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

Re: [Xen-devel] [PATCH 2/2] IOMMU/MMU: Adjust low level functions for VT-d Device-TLB flush error.



On Thu, Mar 17, 2016 at 6:54 AM, Quan Xu <quan.xu@xxxxxxxxx> wrote:
> Current code would be panic(), when VT-d Device-TLB flush timed out.
> the panic() is going to be eliminated, so we must check all kinds of
> error and all the way up the call trees.
>
> Signed-off-by: Quan Xu <quan.xu@xxxxxxxxx>
>
> CC: Jun Nakajima <jun.nakajima@xxxxxxxxx>
> CC: Kevin Tian <kevin.tian@xxxxxxxxx>
> CC: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
> CC: Keir Fraser <keir@xxxxxxx>
> CC: Jan Beulich <jbeulich@xxxxxxxx>
> CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> CC: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> CC: Julien Grall <julien.grall@xxxxxxx>
> CC: Feng Wu <feng.wu@xxxxxxxxx>
> CC: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
> ---
>  xen/arch/x86/mm/p2m-ept.c                     |   2 +-
>  xen/drivers/passthrough/amd/iommu_init.c      |  12 ++-
>  xen/drivers/passthrough/amd/pci_amd_iommu.c   |   2 +-
>  xen/drivers/passthrough/arm/smmu.c            |  10 ++-
>  xen/drivers/passthrough/iommu.c               |  17 ++--
>  xen/drivers/passthrough/vtd/extern.h          |   2 +-
>  xen/drivers/passthrough/vtd/iommu.c           | 120 
> ++++++++++++++++++--------
>  xen/drivers/passthrough/vtd/quirks.c          |  26 +++---
>  xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |   2 +-
>  xen/include/asm-x86/iommu.h                   |   2 +-
>  xen/include/xen/iommu.h                       |   6 +-
>  11 files changed, 133 insertions(+), 68 deletions(-)
>
> diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
> index f9bcce7..fa6c710 100644
> --- a/xen/arch/x86/mm/p2m-ept.c
> +++ b/xen/arch/x86/mm/p2m-ept.c
> @@ -825,7 +825,7 @@ out:
>           need_modify_vtd_table )
>      {
>          if ( iommu_hap_pt_share )
> -            iommu_pte_flush(d, gfn, &ept_entry->epte, order, 
> vtd_pte_present);
> +            rc = iommu_pte_flush(d, gfn, &ept_entry->epte, order, 
> vtd_pte_present);

So this sort changes the meaning of the "rc" check near the end of the
function, when we check whether we want to update altp2m.

As it happens, I *think* it doesn't matter, because you can't have
altp2m and passthrough enabled at the same time, right?

If so, this at least merits a comment above the altp2m check; something like:

"NB that if altp2m is enabled, rc cannot be non-zero here due to
iommu_pte_flush, since you can't have altp2m and pass-through enabled
at the same time."

If you *can* have both altp2m and pass-through, then we need to make
sure that the altp2m gets updated when the hostp2m is updated, even if
the iommu flush fails.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.