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

[Xen-devel] [PATCH] x86: eliminate pv_post_outb_hook



Use amd_acpi_c1e_quirk and amd_check_disable_c1e instead.

Requested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/arch/x86/cpu/amd.c         |  6 +-----
 xen/arch/x86/pv/emul-priv-op.c | 11 +++++------
 xen/include/asm-x86/io.h       |  2 --
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index e1fc88bdcf..c790416f8d 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -630,12 +630,8 @@ static void init_amd(struct cpuinfo_x86 *c)
        {
        case 0xf ... 0x17:
                disable_c1e(NULL);
-               if (acpi_smi_cmd && (acpi_enable_value | acpi_disable_value)) {
-#ifdef CONFIG_PV
-                       pv_post_outb_hook = amd_check_disable_c1e;
-#endif
+               if (acpi_smi_cmd && (acpi_enable_value | acpi_disable_value))
                        amd_acpi_c1e_quirk = true;
-               }
                break;
        }
 
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index f73ea4a163..83441b68b3 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -26,6 +26,7 @@
 #include <xen/spinlock.h>
 #include <xen/trace.h>
 
+#include <asm/amd.h>
 #include <asm/apic.h>
 #include <asm/debugreg.h>
 #include <asm/hpet.h>
@@ -59,8 +60,6 @@ struct priv_op_ctxt {
 void host_to_guest_gpr_switch(struct cpu_user_regs *);
 unsigned long guest_to_host_gpr_switch(unsigned long);
 
-void (*pv_post_outb_hook)(unsigned int port, u8 value);
-
 typedef void io_emul_stub_t(struct cpu_user_regs *);
 
 static io_emul_stub_t *io_emul_stub_setup(struct priv_op_ctxt *ctxt, u8 opcode,
@@ -351,8 +350,8 @@ static void guest_io_write(unsigned int port, unsigned int 
bytes,
         {
         case 1:
             outb((uint8_t)data, port);
-            if ( pv_post_outb_hook )
-                pv_post_outb_hook(port, (uint8_t)data);
+            if ( amd_acpi_c1e_quirk )
+                amd_check_disable_c1e(port, (uint8_t)data);
             break;
         case 2:
             outw((uint16_t)data, port);
@@ -432,8 +431,8 @@ static int write_io(unsigned int port, unsigned int bytes,
             io_emul_stub_setup(poc, ctxt->opcode, port, bytes);
 
         io_emul(ctxt->regs);
-        if ( (bytes == 1) && pv_post_outb_hook )
-            pv_post_outb_hook(port, val);
+        if ( (bytes == 1) && amd_acpi_c1e_quirk )
+            amd_check_disable_c1e(port, val);
         return X86EMUL_DONE;
     }
 
diff --git a/xen/include/asm-x86/io.h b/xen/include/asm-x86/io.h
index 4d2064ed04..8708b79b99 100644
--- a/xen/include/asm-x86/io.h
+++ b/xen/include/asm-x86/io.h
@@ -48,8 +48,6 @@ __OUT(b,"b",char)
 __OUT(w,"w",short)
 __OUT(l,,int)
 
-extern void (*pv_post_outb_hook)(unsigned int port, u8 value);
-
 /* Function pointer used to handle platform specific I/O port emulation. */
 #define IOEMUL_QUIRK_STUB_BYTES 10
 extern bool (*ioemul_handle_quirk)(
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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