[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 March 17, 2016 3:38pm, Tian, Kevin <kevin.tian@xxxxxxxxx> wrote:
> > From: Xu, Quan
> > Sent: Thursday, March 17, 2016 2:55 PM
> >
> > 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.
> 
> sorry that I'm unclear what is the criteria of defining high level and low 
> level
> functions in two patches. Could you elaborate? Once I thought you may mean
> common code and vendor specific code, however...
> 

In this patch set, it is adjusting top level functions of the call tree first, 
and working my way down to leaf ones.
I tried to define that top level is mainly about MMU, and the low level is 
mainly about IOMMU. Mixed things are in
Consideration of compiling and simplification. For high level of these call 
trees, IMO it is a reasonable attempt at splitting things.


> >  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 +-
> 
> Above you have general passthrough/iommu.c though most of others are
> vendor specific.
> 


 .e.g, as the 'struct iommu_ops' is common structure for arm/amd/intel.


> Then in PATCH [1/2], you have:
> 
> xen/arch/x86/acpi/power.c             | 14 +++++++++++++-
>  xen/arch/x86/mm.c                     | 13 ++++++++-----
>  xen/arch/x86/mm/p2m-ept.c             | 10 +++++++++-
>  xen/arch/x86/mm/p2m-pt.c              | 12 ++++++++++--
>  xen/common/grant_table.c              |  5 +++--
>  xen/common/memory.c                   |  5 +++--
>  xen/drivers/passthrough/iommu.c       | 16 +++++++++++-----
>  xen/drivers/passthrough/vtd/x86/vtd.c |  7 +++++--
>  xen/drivers/passthrough/x86/iommu.c   |  6 +++++-
>  xen/include/xen/iommu.h               |  6 +++---
> 
> They are also mixed.
> 

It is in Consideration of compiling and simplification. 
 e.g. for this call tree,  ...--iommu_suspend()--device_power_down()--...
 device_power_down() is in -xen/arch/x86/acpi/power.c
 iommu_suspend() is in -xen/drivers/passthrough/iommu.c

when I tried to return error code from iommu_suspend(), which is with 'void' 
annotation.
I need change it from 'void' to 'int', then it is unavoidable to mix things.

Any good idea? To be honest, I am very tired to at splitting things like this 
:).


Quan

_______________________________________________
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®.