Skip to contentSkip to conversation

MCE/EDAC Status/Updating?

DISCUSSION Elliott Mitchell 3 participants 8 messages Feb 15, 2019 – Feb 22, 2019

lore
Share & tools
lore
#0 lore raw

The MCE/EDAC support code appears to be in rather poor shape.

The AMD code mentions Family 10h, which might have been available 10 years ago. They've likely been findable used with difficulty more recently, but no hardware made in the past 5 years matches this profile.

The Intel code has had some more recent minor updates. Intel may have managed to keep their hardware supporting the interface used by Xen, and so the driver /may/ function on current Intel hardware.

Looks like both drivers originated with employees of the respective companies (I'm suspecting both were paid for by the corporations).

Given the recent trends in Xen's development I'd tend to suggest going a different direction from the existing code. The existing code was attempting to handle MCE/EDAC errors by emulating them and passing them to the effected domain. Instead of this approach, let Domain 0 handle talking to MCE/EDAC hardware and merely have Xen decode addresses.

If errors/warnings are occuring, you need those reports centralized, which points to handling them in Domain 0. If an uncorrectable error occurs, Domain 0 should choose whether to kill a given VM or panic the entire machine. Either way, Domain 0 really needs to be alerted that hardware is misbehaving and may need to be replaced.

The other part is alerting Domain 0 is *far* more likely to get the correct type of attention. A business owning a Domain U on a random machine, may run a kernel without MCE/EDAC support or could miss the entries in their system log, nor would they necessarily know the correct personel to contact about hardware failing.

The case you would want to pass MCE/EDAC messages would be to a HVM domain where you were testing a new system image. Then you would likely be injecting fake exceptions instead of real ones. At which point we're talking QEMU, rather than Xen.

Signature · 11 lines
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         [email protected]  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 05:23, <[email protected]> wrote:

The MCE/EDAC support code appears to be in rather poor shape.

The AMD code mentions Family 10h, which might have been available 10 years ago. They've likely been findable used with difficulty more recently, but no hardware made in the past 5 years matches this profile.

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

Quoted 14 lines

The Intel code has had some more recent minor updates. Intel may have managed to keep their hardware supporting the interface used by Xen, and so the driver /may/ function on current Intel hardware.

Looks like both drivers originated with employees of the respective companies (I'm suspecting both were paid for by the corporations).

Given the recent trends in Xen's development I'd tend to suggest going a different direction from the existing code. The existing code was attempting to handle MCE/EDAC errors by emulating them and passing them to the effected domain. Instead of this approach, let Domain 0 handle talking to MCE/EDAC hardware and merely have Xen decode addresses.

Quoted 5 lines

If errors/warnings are occuring, you need those reports centralized, which points to handling them in Domain 0. If an uncorrectable error occurs, Domain 0 should choose whether to kill a given VM or panic the entire machine. Either way, Domain 0 really needs to be alerted that hardware is misbehaving and may need to be replaced.

But the point of the virtualization is to allow guests to more or less gracefully recover (at least as far as the theory of it goes), e.g. by killing just a process, rather than getting blindly killed.

As to panic-ing the entire machine - if that's necessary, Dom0 is unlikely to be in the right position. There's way too high a chance for further things to go wrong until the event has even just arrived in Dom0, let alone it having taken a decision.

Quoted 5 lines

The other part is alerting Domain 0 is *far* more likely to get the correct type of attention. A business owning a Domain U on a random machine, may run a kernel without MCE/EDAC support or could miss the entries in their system log, nor would they necessarily know the correct personel to contact about hardware failing.

Alerting Dom0 alongside the affected DomU may indeed be desirable, but mainly for the purpose of logging, only as a last resort for the purpose of killing a guest.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 10 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 05:23, <[email protected]> wrote:

The MCE/EDAC support code appears to be in rather poor shape.

The AMD code mentions Family 10h, which might have been available 10 years ago. They've likely been findable used with difficulty more recently, but no hardware made in the past 5 years matches this profile.

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

In that case sometime between Xen 4.1 and Xen 4.4, the AMD MCE/EDAC code was completely broken and hasn't been fixed.

Quoted 12 lines
Quoted 11 lines

Given the recent trends in Xen's development I'd tend to suggest going a different direction from the existing code. The existing code was attempting to handle MCE/EDAC errors by emulating them and passing them to the effected domain. Instead of this approach, let Domain 0 handle talking to MCE/EDAC hardware and merely have Xen decode addresses.

If errors/warnings are occuring, you need those reports centralized, which points to handling them in Domain 0. If an uncorrectable error occurs, Domain 0 should choose whether to kill a given VM or panic the entire machine. Either way, Domain 0 really needs to be alerted that hardware is misbehaving and may need to be replaced.

Quoted 8 lines

But the point of the virtualization is to allow guests to more or less gracefully recover (at least as far as the theory of it goes), e.g. by killing just a process, rather than getting blindly killed.

As to panic-ing the entire machine - if that's necessary, Dom0 is unlikely to be in the right position. There's way too high a chance for further things to go wrong until the event has even just arrived in Dom0, let alone it having taken a decision.

I'll agree it does make sense to try sending a corrupted memory alert to the effected domain, rather than nuking the entire VM. Alerting the owner of the hardware though should be higher priority as they will then know they need to schedule a downtime and replace the module.

Quoted 9 lines
Quoted 5 lines

The other part is alerting Domain 0 is *far* more likely to get the correct type of attention. A business owning a Domain U on a random machine, may run a kernel without MCE/EDAC support or could miss the entries in their system log, nor would they necessarily know the correct personel to contact about hardware failing.

Alerting Dom0 alongside the affected DomU may indeed be desirable, but mainly for the purpose of logging, only as a last resort for the purpose of killing a guest.

I think alerting Dom0 should be rather higher priority than alerting DomUs. A given DomU may see one correctable memory error per month, which might seem harmless until you find there are a hundred DomUs on that hardware and every one of them is seeing one error per month.

The only real useful place to report correctable errors like that is to Dom0. Meanwhile uncorrectable errors are likely better to send a PV message to the DomU. Let QEMU turn it into something which looks like real hardware if needed. Meanwhile Dom0 may have a more up to date driver for the hardware than Xen.

Signature · 11 lines
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         [email protected]  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw
Quoted 4 lines · Elliott Mitchell
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 05:23, <[email protected]> wrote:

The MCE/EDAC support code appears to be in rather poor shape.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

The AMD code mentions Family 10h, which might have been available 10 years ago. They've likely been findable used with difficulty more recently, but no hardware made in the past 5 years matches this profile.

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

In that case sometime between Xen 4.1 and Xen 4.4, the AMD MCE/EDAC code was completely broken and hasn't been fixed.

I take it you've got a usecase which now doesn't work?

Quoted 38 lines
Quoted 11 lines
Quoted 11 lines

Given the recent trends in Xen's development I'd tend to suggest going a different direction from the existing code. The existing code was attempting to handle MCE/EDAC errors by emulating them and passing them to the effected domain. Instead of this approach, let Domain 0 handle talking to MCE/EDAC hardware and merely have Xen decode addresses.

If errors/warnings are occuring, you need those reports centralized, which points to handling them in Domain 0. If an uncorrectable error occurs, Domain 0 should choose whether to kill a given VM or panic the entire machine. Either way, Domain 0 really needs to be alerted that hardware is misbehaving and may need to be replaced.

Quoted 8 lines

But the point of the virtualization is to allow guests to more or less gracefully recover (at least as far as the theory of it goes), e.g. by killing just a process, rather than getting blindly killed.

As to panic-ing the entire machine - if that's necessary, Dom0 is unlikely to be in the right position. There's way too high a chance for further things to go wrong until the event has even just arrived in Dom0, let alone it having taken a decision.

I'll agree it does make sense to try sending a corrupted memory alert to the effected domain, rather than nuking the entire VM. Alerting the owner of the hardware though should be higher priority as they will then know they need to schedule a downtime and replace the module.

Quoted 8 lines
Quoted 5 lines

The other part is alerting Domain 0 is *far* more likely to get the correct type of attention. A business owning a Domain U on a random machine, may run a kernel without MCE/EDAC support or could miss the entries in their system log, nor would they necessarily know the correct personel to contact about hardware failing.

Alerting Dom0 alongside the affected DomU may indeed be desirable, but mainly for the purpose of logging, only as a last resort for the purpose of killing a guest.

I think alerting Dom0 should be rather higher priority than alerting DomUs. A given DomU may see one correctable memory error per month, which might seem harmless until you find there are a hundred DomUs on that hardware and every one of them is seeing one error per month.

Quoted 5 lines

The only real useful place to report correctable errors like that is to Dom0. Meanwhile uncorrectable errors are likely better to send a PV message to the DomU. Let QEMU turn it into something which looks like real hardware if needed. Meanwhile Dom0 may have a more up to date driver for the hardware than Xen.

I don't think anyone can defend the current state of MCE handling/reporting in Xen, and I would certainly like to see it improved.

However, its not a simple as "let dom0 handle everything".  Dom0 is just a VM, like all other domains.  It cant access the MCE MSR banks, and even if it could, it would have a pcpu vs vcpu problem when trying to interpret the data.

Xen is the entity which needs to handle the #MC, and do first-pass processing.  If we want to give it to dom0 for further processing, it either has to be virtualised in an architectural manner, or passed via a paravirt channel so dom0 definitely knows it is dealing with data in different enumeration spaces.

I expect there are also some non-trivial ACPI interactions here, which are also made complicated by the Xen/dom0 interface-turned-undoucmented-mess.

Another issue we should look into is if we are going to make improvements here, how do we go about ensuring that we don't regress behaviour again.  I have no experience in this area (other than bugfixing the #MC handler until it appears to behave as it did before), but surely there are some ways of testing?

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
In reply to Elliott Mitchell
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 19:20, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 05:23, <[email protected]> wrote:

The MCE/EDAC support code appears to be in rather poor shape.

The AMD code mentions Family 10h, which might have been available 10 years ago. They've likely been findable used with difficulty more recently, but no hardware made in the past 5 years matches this profile.

Quoted 6 lines
Quoted 3 lines

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

In that case sometime between Xen 4.1 and Xen 4.4, the AMD MCE/EDAC code was completely broken and hasn't been fixed.

I can't say I'm surprised, but details of the breakage would still be appreciated.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
Quoted 11 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 19:20, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

In that case sometime between Xen 4.1 and Xen 4.4, the AMD MCE/EDAC code was completely broken and hasn't been fixed.

I can't say I'm surprised, but details of the breakage would still be appreciated.

Originally noticed with Debian: https://bugs.debian.org/810964

Original observer noticed that half the memory controllers were missing from Linux's Domain-0 dmesg with Xen 4.4. EDAC capability flags are missing with Xen 4.4.

I'd been working with a processor Linux was reporting as "cpu family : 16" (ah yes "10h", that funky olde way of refering to things) and noticing Linux's EDAC support failing on kernel start. In which case the EDAC support on AMD processors was completely broken between 4.1 and 4.4 (hadn't realized that processor was just old enough to be interesting).

Signature · 11 lines
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         [email protected]  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#6 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 18.02.19 at 09:42, <[email protected]> wrote:
Quoted 9 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 19:20, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

In that case sometime between Xen 4.1 and Xen 4.4, the AMD MCE/EDAC code was completely broken and hasn't been fixed.

Quoted 8 lines
Quoted 2 lines

I can't say I'm surprised, but details of the breakage would still be appreciated.

Originally noticed with Debian: https://bugs.debian.org/810964

Original observer noticed that half the memory controllers were missing from Linux's Domain-0 dmesg with Xen 4.4. EDAC capability flags are missing with Xen 4.4.

And I had been commenting in this bug. I don't recall technical data ever having emerged on the list here as to what is really going on, and what the root of this perceived regression is.

Quoted 6 lines

I'd been working with a processor Linux was reporting as "cpu family : 16" (ah yes "10h", that funky olde way of refering to things) and noticing Linux's EDAC support failing on kernel start. In which case the EDAC support on AMD processors was completely broken between 4.1 and 4.4 (hadn't realized that processor was just old enough to be interesting).

While there's a relation, I think we need to keep #MC handling and EDAC separate here: The latter lives entirely in Dom0. And as said in the Debian bug, at least back at the time there was no reason to believe the driver would work on Xen other than by accident.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw
Quoted 16 lines · Jan Beulich
Quoted 16 lines
Quoted 1 line
Quoted 1 line · On 18.02.19 at 09:42, <[email protected]> wrote:
Quoted 11 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 19:20, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

In that case sometime between Xen 4.1 and Xen 4.4, the AMD MCE/EDAC code was completely broken and hasn't been fixed.

I can't say I'm surprised, but details of the breakage would still be appreciated.

Originally noticed with Debian: https://bugs.debian.org/810964

Quoted 7 lines
Quoted 3 lines

Original observer noticed that half the memory controllers were missing from Linux's Domain-0 dmesg with Xen 4.4. EDAC capability flags are missing with Xen 4.4.

And I had been commenting in this bug. I don't recall technical data ever having emerged on the list here as to what is really going on, and what the root of this perceived regression is.

I've been having an interesting time trying to figure out where to look to find appropriate information.

I'm thinking Debian's default Xen log level is a little too high. Adding "loglvl=info" doesn't put all that much in Xen's dmesg. I'm suspecting "mce_verbosity=verbose" may be a different story though.

"loglvl=info" gets me "AMD Fam10h machine check reporting enabled", so looks like Xen is successfully getting its MCE support operational.

Taking a closer look at Dom0's dmesg though:

MCE: In-kernel MCE decoding enabled.
EDAC amd64: DRAM ECC enabled.
EDAC amd64: NB MCE bank disabled, set MSR 0x0000017b[4] on node 0 to enable. EDAC amd64: ECC disabled in the BIOS or no ECC capability, module will not load.
Either enable ECC checking or force module loading by setting 'ecc_enable_override'. (Note that use of the override may cause unknown side effects.)

So it seems Linux wants bit 4 of MSR_IA32_MCG_CTL set before it will willingly enable MCE support (I've no idea what this does).

This was done in commit b272353fe98db5bdc73fff3c60a0574835df4c87.

Quoted 7 lines
Quoted 6 lines

I'd been working with a processor Linux was reporting as "cpu family : 16" (ah yes "10h", that funky olde way of refering to things) and noticing Linux's EDAC support failing on kernel start. In which case the EDAC support on AMD processors was completely broken between 4.1 and 4.4 (hadn't realized that processor was just old enough to be interesting).

Quoted 5 lines

While there's a relation, I think we need to keep #MC handling and EDAC separate here: The latter lives entirely in Dom0. And as said in the Debian bug, at least back at the time there was no reason to believe the driver would work on Xen other than by accident.

True, they might have merely been noticed at the same time and in fact be two distinct issues. Having EDAC reporting broken is *very* bad.

I am left though noticing how the state of Xen's EDAC support looks rather odd from how other bits of Xen are evolving. Rather than going more in a direction of para-virtualization, this code looks to be heading more towards true virtualization.

A more PV type approach might be to let Dom0 handle decoding the machine check registers. Then Dom0 asks Xen for what is at physical address X, then potentially turns this into a PV message to the appropriate domain and potentially logs the event. Such an approach could be used to synthesize machine check events for testing VMs. Qemu would then need code to simulate the appropriate register values for a HVM.

Signature · 4 lines
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         [email protected]  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 40 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 18.02.19 at 09:42, <[email protected]> wrote:
Quoted 9 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.02.19 at 19:20, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich

Well, Fam10 is mentioned explicitly, but as per the use of e.g. mcheck_amd_famXX newer ones are supported by this code as well.

In that case sometime between Xen 4.1 and Xen 4.4, the AMD MCE/EDAC code was completely broken and hasn't been fixed.

Quoted 8 lines
Quoted 2 lines

I can't say I'm surprised, but details of the breakage would still be appreciated.

Originally noticed with Debian: https://bugs.debian.org/810964

Original observer noticed that half the memory controllers were missing from Linux's Domain-0 dmesg with Xen 4.4. EDAC capability flags are missing with Xen 4.4.

And I had been commenting in this bug. I don't recall technical data ever having emerged on the list here as to what is really going on, and what the root of this perceived regression is.

Quoted 6 lines

I'd been working with a processor Linux was reporting as "cpu family : 16" (ah yes "10h", that funky olde way of refering to things) and noticing Linux's EDAC support failing on kernel start. In which case the EDAC support on AMD processors was completely broken between 4.1 and 4.4 (hadn't realized that processor was just old enough to be interesting).

While there's a relation, I think we need to keep #MC handling and EDAC separate here: The latter lives entirely in Dom0. And as said in the Debian bug, at least back at the time there was no reason to believe the driver would work on Xen other than by accident.

Jan

Signature · 11 lines
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         [email protected]  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel