[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A2CD04D.7070603@redhat.com>
Date: Mon, 08 Jun 2009 11:48:13 +0300
From: Avi Kivity <avi@...hat.com>
To: Huang Ying <ying.huang@...el.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH -v3] KVM: Add VT-x machine check support
Huang Ying wrote:
> From: Andi Kleen <ak@...ux.intel.com>
>
> VT-x needs an explicit MC vector intercept to handle machine checks in the
> hyper visor.
>
> It also has a special option to catch machine checks that happen
> during VT entry.
>
> Do these interceptions and forward them to the Linux machine check
> handler. Make it always look like user space is interrupted because
> the machine check handler treats kernel/user space differently.
>
> Thanks to Jiang Yunhong for help and testing.
>
>
Noticed an additional problem. See below.
> static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
> {
> struct vcpu_vmx *vmx = to_vmx(vcpu);
> @@ -2616,6 +2640,10 @@ static int handle_exception(struct kvm_v
> vect_info = vmx->idt_vectoring_info;
> intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
>
> + ex_no = intr_info & INTR_INFO_VECTOR_MASK;
> + if (ex_no == MC_VECTOR)
> + return handle_machine_check(vcpu, kvm_run);
> +
>
It isn't sufficient to check the vector number; you also need to check
the interrupt type. See for example is_page_fault() and is_no_device().
I suggest you add an is_machine_check() along similar lines. Later we
can collapse all those functions to use a single helper.
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -382,6 +382,8 @@ struct kvm_vcpu_arch {
> u64 mcg_status;
> u64 mcg_ctl;
> u64 *mce_banks;
> +
> + u32 exit_reason;
> };
>
Please move this into struct vcpu_vmx.
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists