lkml.org 
[lkml]   [2019]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH RESEND 2/5] x86/MCE: Handle MCA controls in a per_cpu way
On Mon, Apr 08, 2019 at 06:55:59PM +0000, Ghannam, Yazen wrote:
> We already have the case where some banks are not initialized either
> due to quirks or because they are Read-as-Zero, but we don't try to
> skip creating their files. With this full set (see patch 5), an unused
> bank will return a control value of 0.

So set_bank() is changed to do:

@@ -2088,7 +2097,7 @@ static ssize_t set_bank(struct device *s, struct device_attribute *attr,
if (kstrtou64(buf, 0, &new) < 0)
return -EINVAL;

- if (bank >= mca_cfg.banks)
+ if (bank >= per_cpu(num_banks, s->id))
return -EINVAL;


How would that work if the disabled/not-present bank is in the middle?
The old example: bank3 on CPU5.
> Would that be sufficient to indicate that a bank is not used?

Well, it should not allow for any control bits to be set and it should
have the proper bank number.

> But I do have a couple of thoughts:

> 1) Will missing banks confuse users? As mentioned, we already have the
> case of unused/uninitialized banks today, but we don't skip their file
> creation. a) Will this affect any userspace tools?

I guess it would be easier if we keep creating all files but denote properly
which banks are disabled.

> 2) Is the added complexity for file creation/destruction worth it? As
> mentioned, the file will return 0 for unused/uninitialized banks.

Yeah.

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

\
 
 \ /
  Last update: 2019-04-09 22:35    [W:0.076 / U:4.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site