From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH] x86/p2m-ept: Don't unmap the EPT pagetable while it is still in use Date: Thu, 2 Jul 2015 11:07:30 +0100 Message-ID: <55950D62.8030300@eu.citrix.com> References: <1435684155-11807-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435684155-11807-1-git-send-email-andrew.cooper3@citrix.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: Andrew Cooper , Xen-devel Cc: Kevin Tian , Eddie Dong , Jun Nakajima , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 06/30/2015 06:09 PM, Andrew Cooper wrote: > The call to iommu_pte_flush() between the two hunks uses &ept_entry->epte > which is a pointer into the mapped page. > > It is eventually passed to `clflush` instruction which will suffer a pagefault > if the virtual mapping has fallen out of the TLB. > > (XEN) ----[ Xen-4.5.0-xs102594-d x86_64 debug=y Not tainted ]---- > (XEN) CPU: 7 > (XEN) RIP: e008:[] cacheline_flush+0x4/0x9 > > (XEN) Xen call trace: > (XEN) [] cacheline_flush+0x4/0x9 > (XEN) [] __iommu_flush_cache+0x4a/0x6a > (XEN) [] iommu_pte_flush+0x2b/0xd5 > (XEN) [] ept_set_entry+0x4bc/0x61f > (XEN) [] p2m_set_entry+0xd1/0x112 > (XEN) [] clear_mmio_p2m_entry+0x1a0/0x200 > (XEN) [] unmap_mmio_regions+0x49/0x73 > (XEN) [] do_domctl+0x15bd/0x1edb > (XEN) [] syscall_enter+0xeb/0x145 > (XEN) > (XEN) Pagetable walk from ffff820040004ae0: > (XEN) L4[0x104] = 00000008668a5063 ffffffffffffffff > (XEN) L3[0x001] = 00000008668a3063 ffffffffffffffff > (XEN) L2[0x000] = 000000086689c063 ffffffffffffffff > (XEN) L1[0x004] = 000000056f078063 000000000007f678 > (XEN) > (XEN) **************************************** > (XEN) Panic on CPU 7: > (XEN) FATAL PAGE FAULT > (XEN) [error_code=0000] > (XEN) Faulting linear address: ffff820040004ae0 > (XEN) **************************************** > > Signed-off-by: Andrew Cooper > CC: Jan Beulich > CC: George Dunlap > CC: Jun Nakajima > CC: Eddie Dong > CC: Kevin Tian Reviewed-by: George Dunlap -George