Skip to content

Commit 0757ca0

Browse files
committed
Merge tag 'iommu-fixes-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull iommu fixes from Joerg Roedel: - Intel VT-d fixes: - Remove unused PASID_DISABLED - Fix RCU locking - Fix for the unmap_pages call-back - Rockchip RK3568 address mask fix - AMD IOMMUv2 log message clarification * tag 'iommu-fixes-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/vt-d: Fix unmap_pages support iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock() iommu/rockchip: Fix PAGE_DESC_HI_MASKs for RK3568 iommu/amd: Clarify AMD IOMMUv2 initialization messages iommu/vt-d: Remove unused PASID_DISABLED
2 parents 3498e7f + 86dc40c commit 0757ca0

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

arch/x86/include/asm/fpu/api.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ extern void switch_fpu_return(void);
102102
*/
103103
extern int cpu_has_xfeatures(u64 xfeatures_mask, const char **feature_name);
104104

105-
/*
106-
* Tasks that are not using SVA have mm->pasid set to zero to note that they
107-
* will not have the valid bit set in MSR_IA32_PASID while they are running.
108-
*/
109-
#define PASID_DISABLED 0
110-
111105
/* Trap handling */
112106
extern int fpu__exception_code(struct fpu *fpu, int trap_nr);
113107
extern void fpu_sync_fpstate(struct fpu *fpu);

drivers/iommu/amd/iommu_v2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,10 +929,8 @@ static int __init amd_iommu_v2_init(void)
929929
{
930930
int ret;
931931

932-
pr_info("AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>\n");
933-
934932
if (!amd_iommu_v2_supported()) {
935-
pr_info("AMD IOMMUv2 functionality not available on this system\n");
933+
pr_info("AMD IOMMUv2 functionality not available on this system - This is not a bug.\n");
936934
/*
937935
* Load anyway to provide the symbols to other modules
938936
* which may use AMD IOMMUv2 optionally.
@@ -947,6 +945,8 @@ static int __init amd_iommu_v2_init(void)
947945

948946
amd_iommu_register_ppr_notifier(&ppr_nb);
949947

948+
pr_info("AMD IOMMUv2 loaded and initialized\n");
949+
950950
return 0;
951951

952952
out:

drivers/iommu/intel/cap_audit.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static int cap_audit_static(struct intel_iommu *iommu, enum cap_audit_type type)
144144
{
145145
struct dmar_drhd_unit *d;
146146
struct intel_iommu *i;
147+
int rc = 0;
147148

148149
rcu_read_lock();
149150
if (list_empty(&dmar_drhd_units))
@@ -169,11 +170,11 @@ static int cap_audit_static(struct intel_iommu *iommu, enum cap_audit_type type)
169170
*/
170171
if (intel_cap_smts_sanity() &&
171172
!intel_cap_flts_sanity() && !intel_cap_slts_sanity())
172-
return -EOPNOTSUPP;
173+
rc = -EOPNOTSUPP;
173174

174175
out:
175176
rcu_read_unlock();
176-
return 0;
177+
return rc;
177178
}
178179

179180
int intel_cap_audit(enum cap_audit_type type, struct intel_iommu *iommu)

drivers/iommu/intel/iommu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,13 +1339,11 @@ static struct page *dma_pte_clear_level(struct dmar_domain *domain, int level,
13391339
pte = &pte[pfn_level_offset(pfn, level)];
13401340

13411341
do {
1342-
unsigned long level_pfn;
1342+
unsigned long level_pfn = pfn & level_mask(level);
13431343

13441344
if (!dma_pte_present(pte))
13451345
goto next;
13461346

1347-
level_pfn = pfn & level_mask(level);
1348-
13491347
/* If range covers entire pagetable, free it */
13501348
if (start_pfn <= level_pfn &&
13511349
last_pfn >= level_pfn + level_size(level) - 1) {
@@ -1366,7 +1364,7 @@ static struct page *dma_pte_clear_level(struct dmar_domain *domain, int level,
13661364
freelist);
13671365
}
13681366
next:
1369-
pfn += level_size(level);
1367+
pfn = level_pfn + level_size(level);
13701368
} while (!first_pte_in_page(++pte) && pfn <= last_pfn);
13711369

13721370
if (first_pte)

drivers/iommu/rockchip-iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ static inline phys_addr_t rk_dte_pt_address(u32 dte)
200200
#define DTE_HI_MASK2 GENMASK(7, 4)
201201
#define DTE_HI_SHIFT1 24 /* shift bit 8 to bit 32 */
202202
#define DTE_HI_SHIFT2 32 /* shift bit 4 to bit 36 */
203-
#define PAGE_DESC_HI_MASK1 GENMASK_ULL(39, 36)
204-
#define PAGE_DESC_HI_MASK2 GENMASK_ULL(35, 32)
203+
#define PAGE_DESC_HI_MASK1 GENMASK_ULL(35, 32)
204+
#define PAGE_DESC_HI_MASK2 GENMASK_ULL(39, 36)
205205

206206
static inline phys_addr_t rk_dte_pt_address_v2(u32 dte)
207207
{

0 commit comments

Comments
 (0)