提交 bee615d4 编写于 作者: A Andreas Färber

target-i386: Pass X86CPU to kvm_mce_inject()

Needed for changing cpu_x86_inject_mce() argument to X86CPU.
Signed-off-by: NAndreas Färber <afaerber@suse.de>
[AF: Rebased onto hwaddr]
上级 3993c6bd
...@@ -229,8 +229,9 @@ static int kvm_get_mce_cap_supported(KVMState *s, uint64_t *mce_cap, ...@@ -229,8 +229,9 @@ static int kvm_get_mce_cap_supported(KVMState *s, uint64_t *mce_cap,
return -ENOSYS; return -ENOSYS;
} }
static void kvm_mce_inject(CPUX86State *env, hwaddr paddr, int code) static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code)
{ {
CPUX86State *env = &cpu->env;
uint64_t status = MCI_STATUS_VAL | MCI_STATUS_UC | MCI_STATUS_EN | uint64_t status = MCI_STATUS_VAL | MCI_STATUS_UC | MCI_STATUS_EN |
MCI_STATUS_MISCV | MCI_STATUS_ADDRV | MCI_STATUS_S; MCI_STATUS_MISCV | MCI_STATUS_ADDRV | MCI_STATUS_S;
uint64_t mcg_status = MCG_STATUS_MCIP; uint64_t mcg_status = MCG_STATUS_MCIP;
...@@ -256,6 +257,7 @@ static void hardware_memory_error(void) ...@@ -256,6 +257,7 @@ static void hardware_memory_error(void)
int kvm_arch_on_sigbus_vcpu(CPUX86State *env, int code, void *addr) int kvm_arch_on_sigbus_vcpu(CPUX86State *env, int code, void *addr)
{ {
X86CPU *cpu = x86_env_get_cpu(env);
ram_addr_t ram_addr; ram_addr_t ram_addr;
hwaddr paddr; hwaddr paddr;
...@@ -273,7 +275,7 @@ int kvm_arch_on_sigbus_vcpu(CPUX86State *env, int code, void *addr) ...@@ -273,7 +275,7 @@ int kvm_arch_on_sigbus_vcpu(CPUX86State *env, int code, void *addr)
} }
} }
kvm_hwpoison_page_add(ram_addr); kvm_hwpoison_page_add(ram_addr);
kvm_mce_inject(env, paddr, code); kvm_mce_inject(cpu, paddr, code);
} else { } else {
if (code == BUS_MCEERR_AO) { if (code == BUS_MCEERR_AO) {
return 0; return 0;
...@@ -301,7 +303,7 @@ int kvm_arch_on_sigbus(int code, void *addr) ...@@ -301,7 +303,7 @@ int kvm_arch_on_sigbus(int code, void *addr)
return 0; return 0;
} }
kvm_hwpoison_page_add(ram_addr); kvm_hwpoison_page_add(ram_addr);
kvm_mce_inject(first_cpu, paddr, code); kvm_mce_inject(x86_env_get_cpu(first_cpu), paddr, code);
} else { } else {
if (code == BUS_MCEERR_AO) { if (code == BUS_MCEERR_AO) {
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册