login
Header Space

 
 

Re: [kvm-devel] mmu notifier #v14

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrea Arcangeli <andrea@...>
Cc: Nick Piggin <npiggin@...>, Chris Wright <chrisw@...>, Jack Steiner <steiner@...>, Peter Zijlstra <a.p.zijlstra@...>, <kvm-devel@...>, Kanoj Sarcar <kanojsarcar@...>, Roland Dreier <rdreier@...>, <linux-kernel@...>, Avi Kivity <avi@...>, Marcelo Tosatti <marcelo@...>, <linux-mm@...>, Robin Holt <holt@...>, <general@...>, Hugh Dickins <hugh@...>, <akpm@...>, Steve Wise <swise@...>, Christoph Lameter <clameter@...>
Date: Saturday, April 26, 2008 - 9:54 pm

Andrea Arcangeli wrote:

Avi can correct me if I'm wrong, but I don't think the consensus of that 
discussion was that we're going to avoid putting mmio pages in the 
rmap.  Practically speaking, replacing:

+	struct page *page = pfn_to_page((*spte & PT64_BASE_ADDR_MASK) >> 
PAGE_SHIFT);
+	get_page(page);


With:

unsigned long pfn = (*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT;
kvm_get_pfn(pfn);

Results in exactly the same code except the later allows mmio pfns in 
the rmap.  So ignoring the whole mmio thing, using accessors that are 
already there and used elsewhere seems like a good idea :-)


I appreciate the desire to minimize changes, but taking a lock on return 
seems to take that to a bit of an extreme.  It seems like a simple thing 
to fix though, no?


I see.  It seems a little strange to me as a KVM guest isn't really tied 
to the current mm.  It seems like the net effect of this is that we are 
now tying a KVM guest to an mm.

For instance, if you create a guest, but didn't assign any memory to it, 
you could transfer the fd to another process and then close the fd 
(without destroying the guest).  The other process then could assign 
memory to it and presumably run the guest.

With your change, as soon as the first process exits, the guest will be 
destroyed.  I'm not sure this behavioral difference really matters but 
it is a behavioral difference.

Regards,

Anthony Liguori


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
mmu notifier #v14, Andrea Arcangeli, (Sat Apr 26, 12:46 pm)
mmu notifier-core v14-&gt;v15 diff for review, Andrea Arcangeli, (Thu May 1, 2:12 pm)
Re: mmu notifier #v14, Anthony Liguori, (Sat Apr 26, 2:59 pm)
Re: mmu notifier #v14, Andrea Arcangeli, (Sat Apr 26, 8:20 pm)
Re: [kvm-devel] mmu notifier #v14, Anthony Liguori, (Sat Apr 26, 9:54 pm)
Re: [kvm-devel] mmu notifier #v14, Andrea Arcangeli, (Sat Apr 26, 11:05 pm)
Re: [kvm-devel] mmu notifier #v14, Marcelo Tosatti, (Mon Apr 28, 10:48 am)
speck-geostationary