Intel DMAR: remove the 'dev' member

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
This commit is contained in:
Konstantin Belousov 2024-05-30 17:05:22 +03:00
parent 1eb7099eac
commit 164fdee111
5 changed files with 7 additions and 8 deletions

View File

@ -123,7 +123,6 @@ struct dmar_msi_data {
struct dmar_unit {
struct iommu_unit iommu;
device_t dev;
uint16_t segment;
uint64_t base;

View File

@ -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);

View File

@ -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);
}
@ -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);
}

View File

@ -108,7 +108,7 @@ 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);
}
@ -116,7 +116,8 @@ dmar_match_quirks(struct dmar_unit *dmar,
}
}
} else {
device_printf(dmar->dev, "cannot find northbridge\n");
device_printf(dmar->iommu.dev,
"cannot find northbridge\n");
}
}
if (cpu_quirks != NULL) {
@ -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);
}

View File

@ -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);