Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-10-07 Thread Peter Xu
On Mon, Oct 08, 2018 at 02:06:20PM +0800, Peter Xu wrote: > > > -static int vtd_sync_shadow_page_table(VTDAddressSpace *vtd_as) > > > -{ > > > -return vtd_sync_shadow_page_table_range(vtd_as, NULL, 0, UINT64_MAX); > > > +return vtd_sync_shadow_page_table_range(vtd_as, &ce, 0, UINT64_MAX); >

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-10-07 Thread Peter Xu
On Mon, Oct 01, 2018 at 01:36:50PM +0200, Auger Eric wrote: > Hi Peter, > On 9/13/18 9:55 AM, Peter Xu wrote: > > There are two callers for vtd_sync_shadow_page_table_range(), one > > provided a valid context entry and one not. Move that fetching > > operation into the caller vtd_sync_shadow_page_

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-10-07 Thread Peter Xu
On Mon, Oct 08, 2018 at 11:08:31AM +0800, Jason Wang wrote: [...] > > +static int vtd_sync_shadow_page_table(VTDAddressSpace *vtd_as) > > +{ > > int ret; > > +VTDContextEntry ce; > > +IOMMUNotifier *n; > > -if (ce) { > > -/* If the caller provided context entry, use it *

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-10-07 Thread Jason Wang
On 2018年09月13日 15:55, Peter Xu wrote: There are two callers for vtd_sync_shadow_page_table_range(), one provided a valid context entry and one not. Move that fetching operation into the caller vtd_sync_shadow_page_table() where we need to fetch the context entry. Meanwhile, we should handle

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-10-01 Thread Auger Eric
Hi Peter, On 9/13/18 9:55 AM, Peter Xu wrote: > There are two callers for vtd_sync_shadow_page_table_range(), one > provided a valid context entry and one not. Move that fetching > operation into the caller vtd_sync_shadow_page_table() where we need to > fetch the context entry. > > Meanwhile, we

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-27 Thread Peter Xu
On Thu, Sep 13, 2018 at 03:55:17PM +0800, Peter Xu wrote: > There are two callers for vtd_sync_shadow_page_table_range(), one > provided a valid context entry and one not. Move that fetching > operation into the caller vtd_sync_shadow_page_table() where we need to > fetch the context entry. > > M

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-13 Thread Peter Xu
On Thu, Sep 13, 2018 at 10:16:20AM +0200, Maxime Coquelin wrote: > Hi Peter, > > On 09/13/2018 09:55 AM, Peter Xu wrote: > > There are two callers for vtd_sync_shadow_page_table_range(), one > > provided a valid context entry and one not. Move that fetching > > operation into the caller vtd_sync_

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-13 Thread Maxime Coquelin
Hi Peter, On 09/13/2018 09:55 AM, Peter Xu wrote: There are two callers for vtd_sync_shadow_page_table_range(), one provided a valid context entry and one not. Move that fetching operation into the caller vtd_sync_shadow_page_table() where we need to fetch the context entry. Meanwhile, we shou

[Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-13 Thread Peter Xu
There are two callers for vtd_sync_shadow_page_table_range(), one provided a valid context entry and one not. Move that fetching operation into the caller vtd_sync_shadow_page_table() where we need to fetch the context entry. Meanwhile, we should handle VTD_FR_CONTEXT_ENTRY_P properly when synchr