x86: eliminate pv_post_outb_hook
PATCH 1/1 x86: eliminate pv_post_outb_hook
Use amd_acpi_c1e_quirk and amd_check_disable_c1e instead.
Requested-by Jan Beulich <[email protected]>
Signed-off-by Wei Liu <[email protected]>
--- 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(-)
xen/arch/x86/cpu/amd.c +1 -5
@@ -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 ; }
xen/arch/x86/pv/emul-priv-op.c +5 -6
@@ -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 ; }
xen/include/asm-x86/io.h +0 -2
@@ -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)(
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines · Wei Liu
Use
amd_acpi_c1e_quirkandamd_check_disable_c1einstead.Requested-by Jan Beulich <[email protected]>Signed-off-by Wei Liu <[email protected]>
Acked-by Andrew Cooper <[email protected]>
Good riddance to unnecessary function pointers, especially in a retpoline world.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel