All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Cc: Gavin Maltby <Gavin.Maltby@sun.com>, Jan Beulich <jbeulich@novell.com>
Subject: Re: RFC: MCA/MCE concept
Date: Thu, 21 Jun 2007 11:29:25 +0200	[thread overview]
Message-ID: <200706211129.26086.Christoph.Egger@amd.com> (raw)
In-Reply-To: <46712D90.20208@sun.com>

On Thursday 14 June 2007 13:59:12 Gavin Maltby wrote:
> On 06/06/07 10:28, Christoph Egger wrote:
> > On Monday 04 June 2007 18:16:56 Gavin Maltby wrote:
> >> In terms of the form of the error event data, the simplest but also
> >> the dumbest would be a binary structure passed from hypervisor
> >> to dom0:
> >
> > struct mca_error_data_ver1 {
> >  	uint8_t version;	/* structure version */
> >  	uint64_t mc_status;
> >  	uint64_t mc_addr;
> >  	uint64_t mc_misc;
> >  	uint16_t mc_chip;
> >  	uint16_t mc_core;
> >  	uint16_t mc_bank;
> >         uint16_t domid;
> >         uint16_t vcpu_id;
> >  	...
> > };
>
> Since there are multiple MCA detector banks, and more than
> one may have logged a valid error, we need to think about
> communicating all the bank error telemetry.  This should
> also allow for there being varying numbers of MCA banks in
> different proccessor types.  So something like
>
> struct {
> 	uint8_t version;
> 	uint8_t nbanks;
> 	uint16_t flags;
> 	uint16_t domid;
> 	uint16_t vcpud_id; /* if meaningful? */
> 	uint8_t chipid;
> 	uint8_t coreid;
> 	uint64_t mcg_status;
> 	struct {
> 		mc_status;
> 		mc_addr;
> 		mc_misc;
> 	} bank[1];
> };
>
> The bank array is actually sized as per nbanks.
>
> I've added mcg_status and flags.  The latter I'd like to use
> for indicators such as "this error data was artificially injected"
> etc.

Here is my proposal for a real exensible event structure:

#define MCA_TYPE_COMMON  0
#define MCA_TYPE_BANK         1
#define MCA_TYPE_ALLBANKS 2
...

#define MCA_COMMON     \
     size_t size;  /* size of this struct in bytes */
     uint32_t type; /* structure type */
     uint16_t domid;
     uint8_t chipid;
     uint8_t coreid;
     uint64_t mcg_status; /* global status */


The base structure:

struct mca_event {
     MCA_COMMON;
};


The specific structs:

struct mca_event_bank {
   MCA_COMMON;

   uint16_t vcpu_id;
   uint16_t mc_bank;
   uint64_t mc_status;
   uint64_t mc_addr;
   uint64_t mc_misc;
   uint32_t flags;
};

struct mca_event_allbanks {
   MCA_COMMON;

   uint16_t vcpud_id;
   uint8_t nbanks;
   uint32_t flags;
   struct {
 	uint64_t mc_status;
 	uint64_t mc_addr;
 	uint64_t mc_misc;
   } bank[1];
};

And you can have many more structs to support future features.

In the code you allocate the size of the struct you want to use:

     struct mca_event *mca = malloc(sizeof(struct mca_event_bank));
     mca->size = sizeof(struct mca_event_bank);
     mca->type = MCA_TYPE_BANK;

in this example you can cast from mca_event to mca_event_bank
and back whenever you like.
The generic code only needs to know struct mca_event.

Christoph


-- 
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy

  reply	other threads:[~2007-06-21  9:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-29 15:32 RFC: MCA/MCE concept Christoph Egger
2007-05-30  7:19 ` Jan Beulich
2007-05-30  7:45   ` Christoph Egger
2007-05-30  8:49     ` Jan Beulich
2007-05-30  9:10       ` Christoph Egger
2007-05-30  9:59         ` Jan Beulich
2007-05-30 10:12           ` Christoph Egger
2007-05-30 13:50         ` Gavin Maltby
2007-05-30 15:03           ` Petersson, Mats
2007-06-01  8:11             ` Christoph Egger
2007-06-01  8:55               ` Petersson, Mats
2007-06-01  9:28                 ` Christoph Egger
2007-06-01  9:48                   ` Petersson, Mats
2007-06-01 10:57                     ` Gavin Maltby
2007-06-01 11:38                       ` Petersson, Mats
2007-06-04 16:16         ` Gavin Maltby
2007-06-06  9:28           ` Christoph Egger
2007-06-06 10:35             ` Gavin Maltby
2007-06-06 11:57               ` Christoph Egger
2007-06-06 12:25                 ` Gavin Maltby
2007-06-06 13:24                   ` Christoph Egger
2007-06-14 11:59             ` Gavin Maltby
2007-06-21  9:29               ` Christoph Egger [this message]
2007-06-21 10:15                 ` Petersson, Mats

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=200706211129.26086.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=Gavin.Maltby@sun.com \
    --cc=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.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.