Skip to content

Commit

Permalink
CA-392459: Avoid opening /dev/mem when calling biosdevname
Browse files Browse the repository at this point in the history
biosdevname opens /dev/mem to read the $PIR PCI interrupt routing table.
This fails with Secure Boot enabled and causes a warning in the kernel.
log. Since the $PIR PCI interrupt routing table is used for routing PCI
interrupts to ISA IRQs, it is not useful on any modern system so pass
"-x" to biosdevname to avoid this behaviour.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
  • Loading branch information
rosslagerwall committed May 8, 2024
1 parent a93599b commit 4b3a24b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/test_biosdevname.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def test(self):
# check after the fact that we mocked the proper calls
self.assertEqual(popen_mock.call_count, 2)
calls = popen_mock.call_args_list
self.assertEqual(calls[0].args[0], ['/sbin/biosdevname', '--policy', 'physical', '-d'])
self.assertEqual(calls[1].args[0], ['/sbin/biosdevname', '--policy', 'all_ethN', '-d'])
self.assertEqual(calls[0].args[0], ['/sbin/biosdevname', '--policy', 'physical', '-d', '-x'])
self.assertEqual(calls[1].args[0], ['/sbin/biosdevname', '--policy', 'all_ethN', '-d', '-x'])
popen_kwargs = {"stdout": PIPE, "stderr": PIPE, "universal_newlines": True}
self.assertEqual(calls[0].kwargs, popen_kwargs)
self.assertEqual(calls[1].kwargs, popen_kwargs)
Expand Down
2 changes: 1 addition & 1 deletion xcp/net/biosdevname.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __run_all_devices(policy = "physical"):
"""

proc = Popen(["/sbin/biosdevname", "--policy", policy,
"-d"], stdout=PIPE, stderr=PIPE, universal_newlines=True)
"-d", "-x"], stdout=PIPE, stderr=PIPE, universal_newlines=True)

stdout, stderr = proc.communicate()

Expand Down

0 comments on commit 4b3a24b

Please sign in to comment.