From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 0/4] Swapping Date: Tue, 16 Oct 2007 09:37:49 +0200 Message-ID: <47146A4D.9010401@qumranet.com> References: <47102823.2000600@qumranet.com> <4713ACF8.6010809@codemonkey.ws> <4713AF9C.8000609@qumranet.com> <4713B97F.7090403@codemonkey.ws> <4713BCA4.3080103@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Izik Eidus Return-path: In-Reply-To: <4713BCA4.3080103-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Izik Eidus wrote: > Anthony Liguori wrote: > >> Izik Eidus wrote: >> >>> Anthony Liguori wrote: >>> >>>> I've been playing around with these patches. If I do an >>>> madvise(MADV_DONTNEED) in userspace, when I close the VM, I get the >>>> following bug. My knowledge of the mm is limited but since >>>> madvise(MADV_DONTNEED) effectively does a zap_page_range() I wonder >>>> if we're lacking the necessary callback to also remove any potential >>>> GPA covered by that range from shadow page cache. >>>> >>>> Regards, >>>> >>>> Anthony Liguori >>>> >>> it probably beacuse the changes of the first patch, ( that make all >>> present shadow pages rmapped ) >>> Anthony can you please check what happn if you run latest kvm with >>> the patch (of the rmap) and without the patch? >>> >> It looks like it's my patch for doing an in kernel mmap() to support >> older userspaces. I'll figure out what the problem is. >> >> But at any rate, would madvise() be able to evict the current contents >> of something in the shadow page cache or will the guest not pick up >> the new memory until the old gets evicted from the shadow page cache? >> > if i understand you right, then madvise() wont harm us, beacuse we > protect all our shadow memory by removing the writable bit from it. > therefor the guest cant change anything without we know it. > The host userspace can, though, and we need to protect the kernel from that. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/