diff options
author | Damien Zammit <damien@zamaudio.com> | 2022-08-23 12:44:03 +0200 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2023-06-24 00:00:10 +1000 |
commit | 3714eb05ff7e09ee8fa5eb3fc76e1250792a1ecb (patch) | |
tree | 395884d437c7a230f14fef4215bde4b1dcfe7722 | |
parent | 2103fd87f3cfc9aebf2d403f5c08248f235889a4 (diff) |
rumpkernel: pci-userspace: Ask for permission to use PCI CONF2 registers
Rationale: QEMU allocates actual io ports in the 0xc000 - 0xcfff
range, therefore we still need to allow rump to access these ports,
in case they are allocated to real pci hardware.
-rw-r--r-- | debian/patches/machirqdev.diff | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/debian/patches/machirqdev.diff b/debian/patches/machirqdev.diff index 2f74ca61..1cde6a36 100644 --- a/debian/patches/machirqdev.diff +++ b/debian/patches/machirqdev.diff @@ -40,7 +40,7 @@ #include "mach_debug_U.h" #include <mach/vm_param.h> #include <mach.h> -@@ -89,6 +89,7 @@ +@@ -89,11 +89,10 @@ static int numdevs =3D -1; static mach_port_t master_host; static mach_port_t master_device; @@ -48,6 +48,25 @@ #define PCI_CFG1_START 0xcf8 #define PCI_CFG1_END 0xcff +-#define PCI_CFG2_START 0xc000 +-#define PCI_CFG2_END 0xcfff + + int + rumpcomp_pci_iospace_init(void) +@@ -105,11 +104,8 @@ rumpcomp_pci_iospace_init(void) + /* 0-0xcf7 */ + if (ioperm(0, PCI_CFG1_START, 1)) + return rumpuser_component_errtrans(errno); +- /* 0xd00-0xbfff */ +- if (ioperm(PCI_CFG1_END+1, PCI_CFG2_START - (PCI_CFG1_END+1), 1)) +- return rumpuser_component_errtrans(errno); +- /* 0xd000-0xffff */ +- if (ioperm(PCI_CFG2_END+1, 0x10000 - (PCI_CFG2_END+1), 1)) ++ /* 0xd00-0xffff */ ++ if (ioperm(PCI_CFG1_END+1, 0x10000 - (PCI_CFG1_END+1), 1)) + return rumpuser_component_errtrans(errno); + + return 0; @@ -131,6 +132,9 @@ if (get_privileged_ports (&master_host, &master_device)) err(1, "get_privileged_ports"); |