From: Tim Deegan Subject: [PATCH] Add TLB flushing to HAP p2m changes Date: Mon, 20 Oct 2008 15:41:15 +0100 Message-ID: <20081020144115.GN3780@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2hMgfIw2X+zgXrFs" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --2hMgfIw2X+zgXrFs Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Removing an MFN from the p2m requires it to be flushed from the guest's TLBs on HAP, like we do when we're using shadows. Signed-off-by: Tim Deegan --2hMgfIw2X+zgXrFs Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=hap-tlb-flushing diff -r 66221b72bb01 xen/arch/x86/mm/hap/hap.c --- a/xen/arch/x86/mm/hap/hap.c Mon Oct 20 15:16:54 2008 +0100 +++ b/xen/arch/x86/mm/hap/hap.c Mon Oct 20 15:33:07 2008 +0100 @@ -639,9 +639,16 @@ hap_write_p2m_entry(struct vcpu *v, unsi hap_write_p2m_entry(struct vcpu *v, unsigned long gfn, l1_pgentry_t *p, mfn_t table_mfn, l1_pgentry_t new, unsigned int level) { + uint32_t old_flags; + hap_lock(v->domain); + old_flags = l1e_get_flags(*p); safe_write_pte(p, new); + if ( (old_flags & _PAGE_PRESENT) + && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) ) + flush_tlb_mask(v->domain->domain_dirty_cpumask); + #if CONFIG_PAGING_LEVELS == 3 /* install P2M in monitor table for PAE Xen */ if ( level == 3 ) --2hMgfIw2X+zgXrFs Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --2hMgfIw2X+zgXrFs--