Re: [PART2 PATCH v5 09/12] iommu/amd: Enable vAPIC interrupt remapping mode by default

Joerg Roedel
2016-08-09T14:54:32Z

On Mon, Jul 25, 2016 at 04:32:08AM -0500, Suthikulpanit, Suravee wrote:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>
> Introduce struct iommu_dev_data.use_vapic flag, which IOMMU driver
> uses to determine if it should enable vAPIC support, by setting
> the ga_mode bit in the device's interrupt remapping table entry.
>
> Currently, it is enabled for all pass-through device if vAPIC mode
> is enabled.
>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> drivers/iommu/amd_iommu.c | 44 +++++++++++++++++++++++++++++++++--------
> drivers/iommu/amd_iommu_init.c | 12 ++++++++++-
> drivers/iommu/amd_iommu_types.h | 2 +-
> 3 files changed, 48 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index a044ce4..155b4a6 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -105,6 +105,7 @@ struct iommu_dev_data {
> bool pri_tlp; /* PASID TLB required for
> PPR completions */
> u32 errata; /* Bitmap for errata to apply */
> + u32 use_vapic; /* Enable device to use vapic mode */

bool is a better choice here.