Skip to content

Commit 07c181c

Browse files
committed
passthrough/vtd: Drop the "workaround_bios_bug" logic entirely
It turns out that this code was previously dead. c/s dcf4179 " x86/mmcfg/drhd: Move acpi_mmcfg_init() call before calling acpi_parse_dmar()" resulted in PCI segment 0 now having been initialised enough for acpi_parse_one_drhd() to not take the /* Skip checking if segment is not accessible yet. */ path unconditionally. However, some systems have DMAR tables which list devices which are disabled by user choice (in particular, Dell PowerEdge R740 with I/O AT DMA disabled), and turning off all IOMMU functionality in this case is entirely unhelpful behaviour. Leave the warning which identifies the problematic devices, but drop the remaining logic. This leaves the system in better overall state, and working in the same way that it did in previous releases. Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Igor Druzhinin <igor.druzhinin@citrix.com> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: George Dunlap <george.dunlap@citrix.com> Release-acked-by: Juergen Gross <jgross@suse.com> (cherry picked from commit 74dadb8)
1 parent 1cc70a5 commit 07c181c

File tree

4 files changed

+4
-38
lines changed

4 files changed

+4
-38
lines changed

docs/misc/xen-command-line.pandoc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,8 +1173,7 @@ detection of systems known to misbehave upon accesses to that port.
11731173
### iommu
11741174
= List of [ <bool>, verbose, debug, force, required,
11751175
sharept, intremap, intpost,
1176-
snoop, qinval, igfx, workaround_bios_bug,
1177-
amd-iommu-perdev-intremap,
1176+
snoop, qinval, igfx, amd-iommu-perdev-intremap,
11781177
dom0-{passthrough,strict} ]
11791178

11801179
All sub-options are boolean in nature.
@@ -1259,10 +1258,6 @@ The following options are specific to Intel VT-d hardware:
12591258
similar to Linux's `intel_iommu=igfx_off` option. If specifying `no-igfx`
12601259
fixes anything, please report the problem.
12611260

1262-
* The `workaround_bios_bug` boolean is disabled by default. It can be used
1263-
to ignore errors when parsing the ACPI tables, and finding a listed PCI
1264-
device which doesn't appear to exist in the system.
1265-
12661261
The following options are specific to AMD-Vi hardware:
12671262

12681263
* The `amd-iommu-perdev-intremap` boolean controls whether the interrupt

xen/drivers/passthrough/iommu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ bool_t __initdata iommu_enable = 1;
3030
bool_t __read_mostly iommu_enabled;
3131
bool_t __read_mostly force_iommu;
3232
bool_t __read_mostly iommu_verbose;
33-
bool_t __read_mostly iommu_workaround_bios_bug;
3433
bool_t __read_mostly iommu_igfx = 1;
3534
bool_t __read_mostly iommu_snoop = 1;
3635
bool_t __read_mostly iommu_qinval = 1;
@@ -74,8 +73,6 @@ static int __init parse_iommu_param(const char *s)
7473
else if ( (val = parse_boolean("force", s, ss)) >= 0 ||
7574
(val = parse_boolean("required", s, ss)) >= 0 )
7675
force_iommu = val;
77-
else if ( (val = parse_boolean("workaround_bios_bug", s, ss)) >= 0 )
78-
iommu_workaround_bios_bug = val;
7976
else if ( (val = parse_boolean("igfx", s, ss)) >= 0 )
8077
iommu_igfx = val;
8178
else if ( (val = parse_boolean("verbose", s, ss)) >= 0 )

xen/drivers/passthrough/vtd/dmar.c

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
514514
else
515515
{
516516
u8 b, d, f;
517-
unsigned int i = 0, invalid_cnt = 0;
517+
unsigned int i = 0;
518518
union {
519519
const void *raw;
520520
const struct acpi_dmar_device_scope *scope;
@@ -536,37 +536,12 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
536536
f = PCI_FUNC(dmaru->scope.devices[i]);
537537

538538
if ( !pci_device_detect(drhd->segment, b, d, f) )
539-
{
540539
printk(XENLOG_WARNING VTDPREFIX
541540
" Non-existent device (%04x:%02x:%02x.%u) in this DRHD's scope!\n",
542541
drhd->segment, b, d, f);
543-
invalid_cnt++;
544-
}
545542
}
546543

547-
if ( invalid_cnt )
548-
{
549-
if ( iommu_workaround_bios_bug &&
550-
invalid_cnt == dmaru->scope.devices_cnt )
551-
{
552-
printk(XENLOG_WARNING VTDPREFIX
553-
" Workaround BIOS bug: ignoring DRHD (no devices in its scope are PCI discoverable)\n");
554-
555-
scope_devices_free(&dmaru->scope);
556-
iommu_free(dmaru);
557-
xfree(dmaru);
558-
}
559-
else
560-
{
561-
printk(XENLOG_WARNING VTDPREFIX
562-
" DRHD is invalid (some devices in its scope are not PCI discoverable)\n");
563-
printk(XENLOG_WARNING VTDPREFIX
564-
" Try \"iommu=force\" or \"iommu=workaround_bios_bug\" if you really want VT-d\n");
565-
ret = -EINVAL;
566-
}
567-
}
568-
else
569-
acpi_register_drhd_unit(dmaru);
544+
acpi_register_drhd_unit(dmaru);
570545
}
571546

572547
out:

xen/include/xen/iommu.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y)
5353
}
5454

5555
extern bool_t iommu_enable, iommu_enabled;
56-
extern bool_t force_iommu, iommu_verbose;
57-
extern bool_t iommu_workaround_bios_bug, iommu_igfx;
56+
extern bool_t force_iommu, iommu_verbose, iommu_igfx;
5857
extern bool_t iommu_snoop, iommu_qinval, iommu_intremap, iommu_intpost;
5958
extern bool_t iommu_hap_pt_share;
6059
extern bool_t iommu_debug;

0 commit comments

Comments
 (0)