[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] drivers/char: support up to 1M BAR0 of xhci



commit 549b042943a57b748ce80070d1174e4ff5b8ef0b
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Dec 14 12:04:26 2022 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Dec 14 12:04:26 2022 +0100

    drivers/char: support up to 1M BAR0 of xhci
    
    AMD's XHCI has BAR0 of 1M (compared to 64K on Intel). Map it as a whole
    (reserving more space in the fixmap). Make fixmap slot conditional on
    CONFIG_XHCI.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/include/asm/fixmap.h | 4 +++-
 xen/drivers/char/xhci-dbc.c       | 6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/fixmap.h 
b/xen/arch/x86/include/asm/fixmap.h
index bc39ffe896..516ec3fa6c 100644
--- a/xen/arch/x86/include/asm/fixmap.h
+++ b/xen/arch/x86/include/asm/fixmap.h
@@ -25,7 +25,7 @@
 #include <asm/msi.h>
 #include <acpi/apei.h>
 
-#define MAX_XHCI_PAGES 16
+#define MAX_XHCI_PAGES 256
 
 /*
  * Here we define all the compile-time 'special' virtual
@@ -45,8 +45,10 @@ enum fixed_addresses {
     FIX_COM_BEGIN,
     FIX_COM_END,
     FIX_EHCI_DBGP,
+#ifdef CONFIG_XHCI
     FIX_XHCI_BEGIN,
     FIX_XHCI_END = FIX_XHCI_BEGIN + MAX_XHCI_PAGES - 1,
+#endif
 #ifdef CONFIG_XEN_GUEST
     FIX_PV_CONSOLE,
     FIX_XEN_SHARED_INFO,
diff --git a/xen/drivers/char/xhci-dbc.c b/xen/drivers/char/xhci-dbc.c
index 86f6df6bef..60b781f872 100644
--- a/xen/drivers/char/xhci-dbc.c
+++ b/xen/drivers/char/xhci-dbc.c
@@ -268,10 +268,12 @@ static void *dbc_sys_map_xhc(uint64_t phys, size_t size)
 {
     size_t i;
 
-    if ( size != MAX_XHCI_PAGES * PAGE_SIZE )
+    if ( size > MAX_XHCI_PAGES * PAGE_SIZE )
         return NULL;
 
-    for ( i = FIX_XHCI_END; i >= FIX_XHCI_BEGIN; i-- )
+    size >>= PAGE_SHIFT;
+
+    for ( i = FIX_XHCI_END; i > FIX_XHCI_END - size; i-- )
     {
         set_fixmap_nocache(i, phys);
         phys += PAGE_SIZE;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.