From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH RFC v2 0/4] Add mem_access support for PV domains Date: Tue, 8 Jul 2014 12:27:24 -0400 Message-ID: <20140708162724.GB9727@laptop.dumpdata.com> References: <1404787805-4540-1-git-send-email-aravindp@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X4ZBZ-0006Ql-6b for xen-devel@lists.xenproject.org; Tue, 08 Jul 2014 17:28:09 +0000 Content-Disposition: inline In-Reply-To: <1404787805-4540-1-git-send-email-aravindp@cisco.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Aravindh Puthiyaparambil Cc: Keir Fraser , Ian Campbell , Stefano Stabellini , Tim Deegan , Ian Jackson , Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Mon, Jul 07, 2014 at 07:50:01PM -0700, Aravindh Puthiyaparambil wrote: > This patch series adds mem_access support for PV domains. To do this the PV > domain domain has to be run with shadow paging. A p2m implementation for > mem_access has been added to track the access permissions. Since special ring > pages are not created for PV domains, this is done as part of enabling > mem_access.This page is freed when mem_access is disabled or when the domain > is destroyed. > > When mem_access is enabled for a PV domain, shadow paging is turned on and all > the shadows are dropped. In the resulting pagefaults, the entries are created > with the default access permissions. On future pagefaults, if there is a violation, > a mem_event is sent to the mem_access listener who will then resolve it. > > The access permissions for individual pages are stored in the shadow_flags field > in the page_info structure. To get the access permissions for individual pages, > this field is referenced. To set the access permission of individual pages, the new > permission is set in the shadow_flags and the shadow for the gmfn is dropped. On the > resulting fault, the new PTE entry will be created with the new permission. A > new API has been added to set the default access permissions for PV domains. In regards to the new ops - you also would need to add the XSM hooks. I recall that in the past Jan had some questions, but I don't recall exactly what they were - does this patchset address that? Thanks! > > Patches are based on top of commit f9cff088. > > Signed-off-by: Aravindh Puthiyaparambil > Cc: Jan Beulich > Cc: Keir Fraser > Cc: Tim Deegan > Cc: Ian Campbell > Cc: Ian Jackson > Cc: Stefano Stabellini > > x86/mm: Shadow and p2m changes for PV mem_access > x86/mem_access: mem_access and mem_event changes to support PV domains > tools/libxc: Add APIs for PV mem_access > tool/xen-access: Add support for PV domains > > tools/libxc/xc_mem_access.c | 42 ++++++ > tools/libxc/xc_mem_event.c | 23 +++- > tools/libxc/xc_private.h | 9 ++ > tools/libxc/xenctrl.h | 28 +++- > tools/tests/xen-access/xen-access.c | 104 +++++++++------ > xen/arch/x86/domain.c | 12 ++ > xen/arch/x86/mm/Makefile | 2 +- > xen/arch/x86/mm/mem_access.c | 244 ++++++++++++++++++++++++++++++++++- > xen/arch/x86/mm/mem_event.c | 62 +++++++-- > xen/arch/x86/mm/p2m-ma.c | 148 +++++++++++++++++++++ > xen/arch/x86/mm/p2m.c | 52 +++++--- > xen/arch/x86/mm/paging.c | 7 + > xen/arch/x86/mm/shadow/common.c | 75 ++++++++++- > xen/arch/x86/mm/shadow/multi.c | 101 ++++++++++++++- > xen/arch/x86/mm/shadow/private.h | 7 + > xen/arch/x86/srat.c | 1 + > xen/arch/x86/usercopy.c | 12 ++ > xen/common/page_alloc.c | 3 + > xen/drivers/video/vesa.c | 1 + > xen/include/asm-x86/domain.h | 9 ++ > xen/include/asm-x86/mem_access.h | 3 + > xen/include/asm-x86/mm.h | 1 - > xen/include/asm-x86/p2m.h | 17 +++ > xen/include/asm-x86/paging.h | 1 + > xen/include/asm-x86/shadow.h | 15 +++ > xen/include/asm-x86/x86_64/uaccess.h | 7 + > xen/include/public/memory.h | 3 + > 27 files changed, 899 insertions(+), 90 deletions(-) > create mode 100644 xen/arch/x86/mm/p2m-ma.c > > -- > 1.9.1 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel