* What happens if I use get_user_pages()
@ 2008-07-08 6:46 Arn
2008-07-08 9:47 ` Izik Eidus
2008-07-08 19:41 ` Muli Ben-Yehuda
0 siblings, 2 replies; 5+ messages in thread
From: Arn @ 2008-07-08 6:46 UTC (permalink / raw)
To: kvm
Hi,
If I use the kernel function "get_user_pages()" within a guest kernel
module, will this ensure that the
guests pages are never swapped out by the host ? Will it lock these
pages in memory ?
(Has anyone tried this ? )
Thanks
Arn
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What happens if I use get_user_pages()
2008-07-08 6:46 What happens if I use get_user_pages() Arn
@ 2008-07-08 9:47 ` Izik Eidus
2008-07-08 19:41 ` Muli Ben-Yehuda
1 sibling, 0 replies; 5+ messages in thread
From: Izik Eidus @ 2008-07-08 9:47 UTC (permalink / raw)
To: Arn; +Cc: kvm
ציטוט Arn:
> Hi,
>
> If I use the kernel function "get_user_pages()" within a guest kernel
> module, will this ensure that the
> guests pages are never swapped out by the host ? Will it lock these
> pages in memory ?
>
> (Has anyone tried this ? )
>
> Thanks
> Arn
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
running get_user_pages wont make the pages unswappable by the host (only
by the guest)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What happens if I use get_user_pages()
2008-07-08 6:46 What happens if I use get_user_pages() Arn
2008-07-08 9:47 ` Izik Eidus
@ 2008-07-08 19:41 ` Muli Ben-Yehuda
2008-07-08 21:04 ` Arn
1 sibling, 1 reply; 5+ messages in thread
From: Muli Ben-Yehuda @ 2008-07-08 19:41 UTC (permalink / raw)
To: Arn; +Cc: kvm
On Tue, Jul 08, 2008 at 02:46:12AM -0400, Arn wrote:
> Hi,
>
> If I use the kernel function "get_user_pages()" within a guest
> kernel module, will this ensure that the guests pages are never
> swapped out by the host ? Will it lock these pages in memory ?
>
> (Has anyone tried this ? )
As Izik said, the answer is no. Is this the desirable outcome, or are
you trying to find a way for the guest to force the host to pin pages
in memory? If so, why?
Cheers,
Muli
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What happens if I use get_user_pages()
2008-07-08 19:41 ` Muli Ben-Yehuda
@ 2008-07-08 21:04 ` Arn
2008-07-09 4:40 ` Izik Eidus
0 siblings, 1 reply; 5+ messages in thread
From: Arn @ 2008-07-08 21:04 UTC (permalink / raw)
To: Muli Ben-Yehuda, izik; +Cc: kvm
>> If I use the kernel function "get_user_pages()" within a guest
>> kernel module, will this ensure that the guests pages are never
>> swapped out by the host ? Will it lock these pages in memory ?
>> (Has anyone tried this ? )
>
> As Izik said, the answer is no. Is this the desirable outcome, or are
> you trying to find a way for the guest to force the host to pin pages
> in memory? If so, why?
>
Izik, Muli, thanks,
Actually I don't want the guests pages to be pinned at all. My aim is
to do a timing check from within guest (guest kernel) to see if we can
detect that the host has swapped out any of the guests pages. Without
the guest knowing. Its proving to be more difficult than I had
thought. Probably due to my lack of experience with kvm/linux
internals.
My idea is to get the guest kernel to read byte from each of its pages
(either all or a random set of pages) and do a timing check at each
read. A read from a page that has been swapped out by host should take
much longer than a read done directly from memory.
>From previous emails on this list it seems that if I map a guest's
page into its kernelspace then that page will never be swapped out
(due to shadow pagetables). So now I'm stuck, any advice will be
appreciated.
thanks
Arn
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What happens if I use get_user_pages()
2008-07-08 21:04 ` Arn
@ 2008-07-09 4:40 ` Izik Eidus
0 siblings, 0 replies; 5+ messages in thread
From: Izik Eidus @ 2008-07-09 4:40 UTC (permalink / raw)
To: Arn; +Cc: Muli Ben-Yehuda, kvm
ציטוט Arn:
>>> If I use the kernel function "get_user_pages()" within a guest
>>> kernel module, will this ensure that the guests pages are never
>>> swapped out by the host ? Will it lock these pages in memory ?
>>> (Has anyone tried this ? )
>>>
>> As Izik said, the answer is no. Is this the desirable outcome, or are
>> you trying to find a way for the guest to force the host to pin pages
>> in memory? If so, why?
>>
>>
>
> Izik, Muli, thanks,
>
> Actually I don't want the guests pages to be pinned at all. My aim is
> to do a timing check from within guest (guest kernel) to see if we can
> detect that the host has swapped out any of the guests pages. Without
> the guest knowing. Its proving to be more difficult than I had
> thought. Probably due to my lack of experience with kvm/linux
> internals.
>
> My idea is to get the guest kernel to read byte from each of its pages
> (either all or a random set of pages) and do a timing check at each
> read. A read from a page that has been swapped out by host should take
> much longer than a read done directly from memory.
>
> From previous emails on this list it seems that if I map a guest's
> page into its kernelspace then that page will never be swapped out
> (due to shadow pagetables). So now I'm stuck, any advice will be
> appreciated.
>
pages that will be inside the shadow page tables wont be swappable, you
have to use mmu notifiers patch in order to have reible swapping.
> thanks
> Arn
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-09 4:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08 6:46 What happens if I use get_user_pages() Arn
2008-07-08 9:47 ` Izik Eidus
2008-07-08 19:41 ` Muli Ben-Yehuda
2008-07-08 21:04 ` Arn
2008-07-09 4:40 ` Izik Eidus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox