[PATCH v2 1/1] iommu/vt-d: Fix list_add double add when enabling VMD and scalable mode

2022-02-16 Thread Adrian Huang
From: Adrian Huang When enabling VMD and IOMMU scalable mode, the following kernel panic call trace/kernel log is shown in Eagle Stream platform (Sapphire Rapids CPU) during booting: pci :59:00.5: Adding to iommu group 42 ... vmd :59:00.5: PCI host bridge to bus 1:80 pci 1:80

[PATCH] iommu/vt-d: Fix list_add double add when enabling VMD and scalable mode

2022-02-10 Thread Adrian Huang
From: Adrian Huang When enabling VMD and IOMMU scalable mode, the following kernel panic call trace/kernel log is shown in Eagle Stream platform (Sapphire Rapids CPU) during booting: pci :59:00.5: Adding to iommu group 42 ... vmd :59:00.5: PCI host bridge to bus 1:80 pci 1:80

[RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment

2020-12-09 Thread Adrian Huang
From: Adrian Huang From: Adrian Huang The values of local variables are assigned after local variables are declared, so no need to assign the initial value during the variable declaration. And, no need to assign NULL for the local variable 'ivrs_base' after invoking acpi_put_table(). Signed

[PATCH 1/1] iommu/amd: Remove unnecessary assignment

2020-10-12 Thread Adrian Huang
From: Adrian Huang The values of local variables are assigned after local variables are declared, so no need to assign the initial value during the variable declaration. And, no need to assign NULL for the local variable 'ivrs_base' after invoking acpi_put_table(). Signed-off-by: Adrian Huang

[PATCH 1/1] iommu/amd: Fix the overwritten field in IVMD header

2020-09-26 Thread Adrian Huang
From: Adrian Huang Commit 387caf0b759a ("iommu/amd: Treat per-device exclusion ranges as r/w unity-mapped regions") accidentally overwrites the 'flags' field in IVMD (struct ivmd_header) when the I/O virtualization memory definition is associated with the exclusion range entry.

[PATCH 1/1] iommu/amd: Fix the configuration of GCR3 table root pointer

2020-02-14 Thread Adrian Huang
From: Adrian Huang The SPA of the GCR3 table root pointer[51:31] masks 20 bits. However, this requires 21 bits (Please see the AMD IOMMU specification). This leads to the potential failure when the bit 51 of SPA of the GCR3 table root pointer is 1'. Signed-off-by: Adrian Huang --- drivers

[PATCH 1/1] iommu/amd: Remove the unnecessary assignment

2020-01-22 Thread Adrian Huang
From: Adrian Huang The assignment of the global variable 'iommu_detected' has been moved from amd_iommu_init_dma_ops() to amd_iommu_detect(), so this patch removes the assignment in amd_iommu_init_dma_ops(). Signed-off-by: Adrian Huang --- drivers/iommu/amd_iommu.c | 1 - 1 file changed, 1

[PATCH 0/2] iommu/amd: Optimization and cleanup for unused variables

2020-01-08 Thread Adrian Huang
This series optimizes the register reading by using readq instead of readl and cleans up the unused variables. Adrian Huang (2): iommu/amd: Replace two consecutive readl calls with one readq iommu/amd: Remove unused struct member drivers/iommu/amd_iommu_init.c | 6 +- drivers/iommu

[PATCH 1/2] iommu/amd: Replace two consecutive readl calls with one readq

2020-01-08 Thread Adrian Huang
From: Adrian Huang Optimize the reigster reading by using readq instead of the two consecutive readl calls. Signed-off-by: Adrian Huang --- drivers/iommu/amd_iommu_init.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu

[PATCH 2/2] iommu/amd: Remove unused struct member

2020-01-08 Thread Adrian Huang
From: Adrian Huang Commit c805b428f206 ("iommu/amd: Remove amd_iommu_pd_list") removes the global list for the allocated protection domains. The corresponding member 'list' of the protection_domain struct is not used anymore, so it can be removed. Signed-off-by: Adrian Huang --- dri

[PATCH 1/1] iommu/amd: Fix typos for PPR macros

2019-12-29 Thread Adrian Huang
From: Adrian Huang The bit 13 and bit 14 of the IOMMU control register are PPRLogEn and PPRIntEn. They are related to PPR (Peripheral Page Request) instead of 'PPF'. Fix them accrodingly. Signed-off-by: Adrian Huang --- drivers/iommu/amd_iommu_init.c | 4 ++-- drivers/iommu/amd_iommu_types.h

[PATCH 1/1] iommu/amd: Remove local variables

2019-12-24 Thread Adrian Huang
From: Adrian Huang The usage of the local variables 'range' and 'misc' was removed from commit 226e889b20a9 ("iommu/amd: Remove first/last_device handling") and commit 23c742db2171 ("iommu/amd: Split out PCI related parts of IOMMU initialization"). So, remove them accr

[PATCH 1/1] iommu/amd: Treat per-device exclusion ranges as r/w unity-mapped regions

2019-11-13 Thread Adrian Huang
://lists.linuxfoundation.org/pipermail/iommu/2019-November/040140.html Suggested-by: Joerg Roedel Signed-off-by: Adrian Huang --- drivers/iommu/amd_iommu_init.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index

[PATCH 1/1] iommu/amd: Fix the overwritten exclusion range with multiple IVMDs

2019-11-04 Thread Adrian Huang
rdware. Note that the first IVMD still uses the exclusion range. Signed-off-by: Adrian Huang --- drivers/iommu/amd_iommu_init.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index