qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 16/22] intel_iommu: replay pasid binds after context cache


From: Peter Xu
Subject: Re: [PATCH v1 16/22] intel_iommu: replay pasid binds after context cache invalidation
Date: Tue, 24 Mar 2020 14:07:55 -0400

On Sun, Mar 22, 2020 at 05:36:13AM -0700, Liu Yi L wrote:
> This patch replays guest pasid bindings after context cache
> invalidation. This is a behavior to ensure safety. Actually,
> programmer should issue pasid cache invalidation with proper
> granularity after issuing a context cache invalidation.
> 
> Cc: Kevin Tian <address@hidden>
> Cc: Jacob Pan <address@hidden>
> Cc: Peter Xu <address@hidden>
> Cc: Yi Sun <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Cc: Richard Henderson <address@hidden>
> Cc: Eduardo Habkost <address@hidden>
> Signed-off-by: Liu Yi L <address@hidden>
> ---
>  hw/i386/intel_iommu.c          | 68 
> ++++++++++++++++++++++++++++++++++++++++++
>  hw/i386/intel_iommu_internal.h |  6 +++-
>  hw/i386/trace-events           |  1 +
>  3 files changed, 74 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index 8ec638f..1e0ccde 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -68,6 +68,10 @@ static void vtd_address_space_refresh_all(IntelIOMMUState 
> *s);
>  static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n);
>  
>  static void vtd_pasid_cache_reset(IntelIOMMUState *s);
> +static void vtd_replay_guest_pasid_bindings(IntelIOMMUState *s,
> +                                           uint16_t *did, bool is_dsi);
> +static void vtd_pasid_cache_devsi(IntelIOMMUState *s,
> +                                  VTDBus *vtd_bus, uint16_t devfn);
>  
>  static void vtd_panic_require_caching_mode(void)
>  {
> @@ -1865,6 +1869,8 @@ static void 
> vtd_context_global_invalidate(IntelIOMMUState *s)
>       * VT-d emulation codes.
>       */
>      vtd_iommu_replay_all(s);
> +
> +    vtd_replay_guest_pasid_bindings(s, NULL, false);

I think the only uncertain thing is whether you still want to rework
the vtd_replay_guest_pasid_bindings() interface.  It'll depend on the
future discussion of previous patches.  Besides that this patch looks
good to me.

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]