Re: Direct mapping of devices that need cache coherent memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9 November 2014 11:43, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> wrote:
> On 7 November 2014 20:13, Christoffer Dall <christoffer.dall@xxxxxxxxxx> wrote:
>> Hi Magnus,
>>
>> I think the check in is_mmio_pfn() should be modified if it is common to
>> have coherent memory which is marked as reserved to Linux.  However, I'm
>> not entirely sure which other solutions would work with all other
>> architectures in KVM using this check.
>>
>> I'm cc'ing Paolo and Ard here (Ard recently looked into this area as
>> well), but it may be worth trying to summarize the problem a little more
>> consicely and ask the question at a braoder scope, for example on
>> kvm@xxxxxxxxxxxxxxx.
>>
>
> What is ultimately biting us here (and the fact that I had to add
> !is_zero_pfn() to kvm_is_mmio_pfn() was already a strong hint) is that
> kvm_is_mmio_pfn() is the wrong test to perform against a pfn to decide
> how it should be mapped.
>
> kvm_is_mmio_pfn() is used on the other archs to distinguish 'special'
> pfns from the page frames that take part in ordinary demand paging by
> the host kernel, and that can be reassigned once the refcount drops to
> zero. kvm_is_mmio_pfn() == true is a necessary but not sufficient
> condition to decide that pfn points to device memory.
>
> I think the proper way to deal with this would be to rename
> kvm_is_mmio_pfn() to kvm_is_reserved_pfn() and drop the is_zero_pfn()
> test from it, effectively reverting my change for all archs except
> ARM. Then, we implement a kvm_is_mmio_pfn() that lives up to its name,
> and only returns false for regions that are in fact MMIO and not

I meant 'returns true', of course.

> reserved RAM.
>

-- 
Ard.
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm




[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux