Avi Kivity wrote:
> Anthony Liguori wrote:
>   
>> This patch allows VMA's that contain no backing page to be used for guest
>> memory.  This is a drop-in replacement for Ben-Ami's first page in his direct
>> mmio series.  Here, we continue to allow mmio pages to be represented in the
>> rmap.
>>
>>   
>>     
>
> I like this very much, as it only affects accessors and not the mmu core 
> itself.
>
> Hollis/Xiantao/Carsten, can you confirm that this approach works for 
> you?  Carsten, I believe you don't have mmio, but at least this 
> shouldn't interfere.
>
>   
>>  
>>  struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn)
>>  {
>> -    return pfn_to_page(gfn_to_pfn(kvm, gfn));
>> +    pfn_t pfn;
>> +
>> +    pfn = gfn_to_pfn(kvm, gfn);
>> +    if (pfn_valid(pfn))
>> +            return pfn_to_page(pfn);
>> +
>> +    return NULL;
>>  }
>>   
>>     
>
> You're returning NULL here, not bad_page.
>   

My thinking was that bad_page indicates that the gfn is invalid.  This 
is a different type of error though.  The problem is that the guest is 
we are trying to kmap() a page that has no struct page associated with 
it.  I'm not sure what the right thing to do here is.

Perhaps we should be replacing consumers of gfn_to_page() with 
copy_to_user() instead?

Regards,

Anthony Liguori



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to