Skip to content

Commit

Permalink
Intel DMAR: remove the 'dev' member
Browse files Browse the repository at this point in the history
It duplicates iommu.dev, and was forgotten when struct iommu was split
out from dmar.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	AMD dvanced Micro Devices (AMD)
MFC after:	1 week
  • Loading branch information
kostikbel committed May 31, 2024
1 parent 1eb7099 commit 164fdee
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion sys/x86/iommu/intel_dmar.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ struct dmar_msi_data {

struct dmar_unit {
struct iommu_unit iommu;
device_t dev;
uint16_t segment;
uint64_t base;

Expand Down
1 change: 0 additions & 1 deletion sys/x86/iommu/intel_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ dmar_attach(device_t dev)
int i, error;

unit = device_get_softc(dev);
unit->dev = dev;
unit->iommu.unit = device_get_unit(dev);
unit->iommu.dev = dev;
dmaru = dmar_find_by_index(unit->iommu.unit);
Expand Down
4 changes: 2 additions & 2 deletions sys/x86/iommu/intel_intrmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ dmar_ir_program_irte(struct dmar_unit *unit, u_int idx, uint64_t low,
high = DMAR_IRTE2_SVT_RID | DMAR_IRTE2_SQ_RID |
DMAR_IRTE2_SID_RID(rid);
if (bootverbose) {
device_printf(unit->dev,
device_printf(unit->iommu.dev,
"programming irte[%d] rid %#x high %#jx low %#jx\n",
idx, rid, (uintmax_t)high, (uintmax_t)low);
}
Expand Down Expand Up @@ -335,7 +335,7 @@ dmar_init_irt(struct dmar_unit *unit)
if (!unit->qi_enabled) {
unit->ir_enabled = 0;
if (bootverbose)
device_printf(unit->dev,
device_printf(unit->iommu.dev,
"QI disabled, disabling interrupt remapping\n");
return (0);
}
Expand Down
7 changes: 4 additions & 3 deletions sys/x86/iommu/intel_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ dmar_match_quirks(struct dmar_unit *dmar,
(nb_quirk->rev_no == rev_no ||
nb_quirk->rev_no == QUIRK_NB_ALL_REV)) {
if (bootverbose) {
device_printf(dmar->dev,
device_printf(dmar->iommu.dev,
"NB IOMMU quirk %s\n",
nb_quirk->descr);
}
nb_quirk->quirk(dmar, nb);
}
}
} else {
device_printf(dmar->dev, "cannot find northbridge\n");
device_printf(dmar->iommu.dev,
"cannot find northbridge\n");
}
}
if (cpu_quirks != NULL) {
Expand All @@ -135,7 +136,7 @@ dmar_match_quirks(struct dmar_unit *dmar,
(cpu_quirk->stepping == -1 ||
cpu_quirk->stepping == stepping)) {
if (bootverbose) {
device_printf(dmar->dev,
device_printf(dmar->iommu.dev,
"CPU IOMMU quirk %s\n",
cpu_quirk->descr);
}
Expand Down
2 changes: 1 addition & 1 deletion sys/x86/iommu/intel_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ domain_set_agaw(struct dmar_domain *domain, int mgaw)
return (0);
}
}
device_printf(domain->dmar->dev,
device_printf(domain->dmar->iommu.dev,
"context request mgaw %d: no agaw found, sagaw %x\n",
mgaw, sagaw);
return (EINVAL);
Expand Down

0 comments on commit 164fdee

Please sign in to comment.