[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
- Re: [PATCH v1 17/22] intel_iommu: do not pass down pasid bind for PASID #0, (continued)
[PATCH v1 11/22] intel_iommu: process PASID cache invalidation, Liu Yi L, 2020/03/22
[PATCH v1 02/22] header file update VFIO/IOMMU vSVA APIs, Liu Yi L, 2020/03/22
[PATCH v1 09/22] vfio/common: check PASID alloc/free availability, Liu Yi L, 2020/03/22
[PATCH v1 16/22] intel_iommu: replay pasid binds after context cache invalidation, Liu Yi L, 2020/03/22
- Re: [PATCH v1 16/22] intel_iommu: replay pasid binds after context cache invalidation,
Peter Xu <=
[PATCH v1 10/22] intel_iommu: add virtual command capability support, Liu Yi L, 2020/03/22
[PATCH v1 15/22] intel_iommu: replay guest pasid bindings to host, Liu Yi L, 2020/03/22
[PATCH v1 12/22] intel_iommu: add PASID cache management infrastructure, Liu Yi L, 2020/03/22