All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Huang Ying <ying.huang@intel.com>
Cc: Avi Kivity <avi@redhat.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Andi Kleen <andi@firstfloor.org>,
	qemu-devel@nongnu.org,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [RFC -v3 1/2] QEMU-KVM: MCE: Add MCE simulation to qemu/tcg
Date: Fri, 08 May 2009 16:08:07 -0500	[thread overview]
Message-ID: <4A049F37.3040603@us.ibm.com> (raw)
In-Reply-To: <1241419677.8815.42.camel@yhuang-dev.sh.intel.com>

Huang Ying wrote:
> - MCE features are initialized when VCPU is intialized according to CPUID.
> - A monitor command "mce" is added to inject a MCE.
> - A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
>
> ---
>  cpu-all.h               |    4 ++
>  cpu-exec.c              |    4 ++
>  monitor.c               |   49 +++++++++++++++++++++++++++++++++
>  target-i386/cpu.h       |   22 +++++++++++++++
>  target-i386/helper.c    |   70 ++++++++++++++++++++++++++++++++++++++++++++++++
>  target-i386/op_helper.c |   34 +++++++++++++++++++++++
>  6 files changed, 183 insertions(+)
>
> --- a/target-i386/cpu.h
> +++ b/target-i386/cpu.h
> @@ -202,6 +202,7 @@
>  #define CR4_DE_MASK   (1 << 3)
>  #define CR4_PSE_MASK  (1 << 4)
>  #define CR4_PAE_MASK  (1 << 5)
> +#define CR4_MCE_MASK  (1 << 6)
>  #define CR4_PGE_MASK  (1 << 7)
>  #define CR4_PCE_MASK  (1 << 8)
>  #define CR4_OSFXSR_SHIFT 9
> @@ -248,6 +249,17 @@
>  #define PG_ERROR_RSVD_MASK 0x08
>  #define PG_ERROR_I_D_MASK  0x10
>  
> +#define MCE_CAP_DEF	0x100
> +#define MCE_BANKS_DEF	4
> +
> +#define MCG_CTL_P	(1UL<<8)
> +
> +#define MCG_STATUS_MCIP	(1UL<<2)
> +
> +#define MCI_STATUS_VAL	(1UL<<63)
> +#define MCI_STATUS_OVER	(1UL<<62)
> +#define MCI_STATUS_UC	(1UL<<61)
> +
>  #define MSR_IA32_TSC                    0x10
>  #define MSR_IA32_APICBASE               0x1b
>  #define MSR_IA32_APICBASE_BSP           (1<<8)
> @@ -288,6 +300,11 @@
>  
>  #define MSR_MTRRdefType			0x2ff
>  
> +#define MSR_MC0_CTL			0x400
> +#define MSR_MC0_STATUS			0x401
> +#define MSR_MC0_ADDR			0x402
> +#define MSR_MC0_MISC			0x403
> +
>  #define MSR_EFER                        0xc0000080
>  
>  #define MSR_EFER_SCE   (1 << 0)
> @@ -674,6 +691,11 @@ typedef struct CPUX86State {
>         user */
>      struct APICState *apic_state;
>      uint32_t mp_state;
> +
> +    uint64 mcg_cap;
> +    uint64 mcg_status;
> +    uint64 mcg_ctl;
> +    uint64 *mce_banks;
>  } CPUX86State;
>
>   

Doesn't this need to be added to the savevm/loadvm state?

-- 
Regards,

Anthony Liguori


WARNING: multiple messages have this Message-ID (diff)
From: Anthony Liguori <aliguori@us.ibm.com>
To: Huang Ying <ying.huang@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Andi Kleen <andi@firstfloor.org>, Avi Kivity <avi@redhat.com>,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [RFC -v3 1/2] QEMU-KVM: MCE: Add MCE simulation to qemu/tcg
Date: Fri, 08 May 2009 16:08:07 -0500	[thread overview]
Message-ID: <4A049F37.3040603@us.ibm.com> (raw)
In-Reply-To: <1241419677.8815.42.camel@yhuang-dev.sh.intel.com>

Huang Ying wrote:
> - MCE features are initialized when VCPU is intialized according to CPUID.
> - A monitor command "mce" is added to inject a MCE.
> - A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
>
> ---
>  cpu-all.h               |    4 ++
>  cpu-exec.c              |    4 ++
>  monitor.c               |   49 +++++++++++++++++++++++++++++++++
>  target-i386/cpu.h       |   22 +++++++++++++++
>  target-i386/helper.c    |   70 ++++++++++++++++++++++++++++++++++++++++++++++++
>  target-i386/op_helper.c |   34 +++++++++++++++++++++++
>  6 files changed, 183 insertions(+)
>
> --- a/target-i386/cpu.h
> +++ b/target-i386/cpu.h
> @@ -202,6 +202,7 @@
>  #define CR4_DE_MASK   (1 << 3)
>  #define CR4_PSE_MASK  (1 << 4)
>  #define CR4_PAE_MASK  (1 << 5)
> +#define CR4_MCE_MASK  (1 << 6)
>  #define CR4_PGE_MASK  (1 << 7)
>  #define CR4_PCE_MASK  (1 << 8)
>  #define CR4_OSFXSR_SHIFT 9
> @@ -248,6 +249,17 @@
>  #define PG_ERROR_RSVD_MASK 0x08
>  #define PG_ERROR_I_D_MASK  0x10
>  
> +#define MCE_CAP_DEF	0x100
> +#define MCE_BANKS_DEF	4
> +
> +#define MCG_CTL_P	(1UL<<8)
> +
> +#define MCG_STATUS_MCIP	(1UL<<2)
> +
> +#define MCI_STATUS_VAL	(1UL<<63)
> +#define MCI_STATUS_OVER	(1UL<<62)
> +#define MCI_STATUS_UC	(1UL<<61)
> +
>  #define MSR_IA32_TSC                    0x10
>  #define MSR_IA32_APICBASE               0x1b
>  #define MSR_IA32_APICBASE_BSP           (1<<8)
> @@ -288,6 +300,11 @@
>  
>  #define MSR_MTRRdefType			0x2ff
>  
> +#define MSR_MC0_CTL			0x400
> +#define MSR_MC0_STATUS			0x401
> +#define MSR_MC0_ADDR			0x402
> +#define MSR_MC0_MISC			0x403
> +
>  #define MSR_EFER                        0xc0000080
>  
>  #define MSR_EFER_SCE   (1 << 0)
> @@ -674,6 +691,11 @@ typedef struct CPUX86State {
>         user */
>      struct APICState *apic_state;
>      uint32_t mp_state;
> +
> +    uint64 mcg_cap;
> +    uint64 mcg_status;
> +    uint64 mcg_ctl;
> +    uint64 *mce_banks;
>  } CPUX86State;
>
>   

Doesn't this need to be added to the savevm/loadvm state?

-- 
Regards,

Anthony Liguori

  reply	other threads:[~2009-05-08 21:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04  6:47 [RFC -v3 1/2] QEMU-KVM: MCE: Add MCE simulation to qemu/tcg Huang Ying
2009-05-04  6:47 ` [Qemu-devel] " Huang Ying
2009-05-08 21:08 ` Anthony Liguori [this message]
2009-05-08 21:08   ` [Qemu-devel] " Anthony Liguori
2009-05-11  1:48   ` Huang Ying
2009-05-11  1:48     ` [Qemu-devel] " Huang Ying

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A049F37.3040603@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.