]> xenbits.xensource.com Git - xen.git/commitdiff
x86: allow to suppress port-alias probing
authorJan Beulich <jbeulich@suse.com>
Thu, 16 May 2024 08:02:34 +0000 (10:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 16 May 2024 08:02:34 +0000 (10:02 +0200)
By default there's already no use for this when we run in shim mode.
Plus there may also be a need to suppress the probing in case of issues
with it. Before introducing further port alias probing, introduce a
command line option allowing to bypass it, default it to on when in shim
mode, and gate RTC/CMOS port alias probing on it.

Requested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
docs/misc/xen-command-line.pandoc
xen/arch/x86/include/asm/setup.h
xen/arch/x86/setup.c
xen/arch/x86/time.c

index e760f3266ee9f5d0bd9b25968d64ac4fc64097fd..1dea7431fab6b98fafdaca912d243549348c2c8d 100644 (file)
@@ -2004,6 +2004,17 @@ INVPCID is supported and not disabled via `invpcid=false`.
 This is a mask of C-states which are to be used preferably.  This option is
 applicable only on hardware were certain C-states are exclusive of one another.
 
+### probe-port-aliases (x86)
+> `= <boolean>`
+
+> Default: `true` outside of shim mode, `false` in shim mode
+
+Certain devices accessible by I/O ports may be accessible also through "alias"
+ports (originally a result of incomplete address decoding).  When such devices
+are solely under Xen's control, Xen disallows even Dom0 access to the "primary"
+ports.  When alias probing is active and aliases are detected, "alias" ports
+would then be treated similar to the "primary" ones.
+
 ### psr (Intel)
 > `= List of ( cmt:<boolean> | rmid_max:<integer> | cat:<boolean> | cos_max:<integer> | cdp:<boolean> )`
 
index 1849e60cd661f658c71c17208650619bb92cb0e0..e48b9d01e99f47f1f0da6f41774ee2cd6d0777a6 100644 (file)
@@ -49,6 +49,7 @@ extern unsigned long highmem_start;
 #endif
 
 extern int8_t opt_smt;
+extern int8_t opt_probe_port_aliases;
 
 #ifdef CONFIG_SHADOW_PAGING
 extern bool opt_dom0_shadow;
index f84e1cd79c594faae5c8d94b50dace9a77377272..b50c9c84af6d216569ce04d0ebf77f0d126413b4 100644 (file)
@@ -76,6 +76,9 @@ static bool __initdata opt_invpcid = true;
 boolean_param("invpcid", opt_invpcid);
 bool __read_mostly use_invpcid;
 
+int8_t __initdata opt_probe_port_aliases = -1;
+boolean_param("probe-port-aliases", opt_probe_port_aliases);
+
 /* Only used in asm code and within this source file */
 unsigned long asmlinkage __read_mostly cr4_pv32_mask;
 
@@ -1860,6 +1863,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     /* Low mappings were only needed for some BIOS table parsing. */
     zap_low_mappings();
 
+    if ( opt_probe_port_aliases < 0 )
+        opt_probe_port_aliases = !pv_shim;
+
     init_apic_mappings();
 
     normalise_cpu_order();
index 78ea095e3ed14d5939ae886c3153e8aa930e7fd3..96559712697a11c37bd2e9b5fa3dd16c08ceaea4 100644 (file)
@@ -1252,7 +1252,8 @@ static int __init cf_check probe_cmos_alias(void)
 {
     unsigned int offs;
 
-    if ( acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC )
+    if ( (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) ||
+         !opt_probe_port_aliases )
         return 0;
 
     for ( offs = 2; offs < 8; offs <<= 1 )