[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a301659f-9a85-5112-f5e3-5d043a855c77@intel.com>
Date: Tue, 1 Nov 2022 00:00:10 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: "Joseph, Jithu" <jithu.joseph@...el.com>
CC: <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>, <x86@...nel.org>, <hpa@...or.com>,
<gregkh@...uxfoundation.org>, <ashok.raj@...el.com>,
<tony.luck@...el.com>, <linux-kernel@...r.kernel.org>,
<platform-driver-x86@...r.kernel.org>, <patches@...ts.linux.dev>,
<ravi.v.shankar@...el.com>, <thiago.macieira@...el.com>,
<athenas.jimenez.gonzalez@...el.com>, <markgross@...nel.org>,
<hdegoede@...hat.com>
Subject: Re: [PATCH 04/14] platform/x86/intel/ifs: Remove image loading during
init
Thanks for the psuedo code. I think I understand the reasoning now.
There would be an IFS device array created for each type of test that
exists. Based on the capabilities supported in MSR_INTEGRITY_CAPS the
specific IFS devices would be created to run the tests.
> multiple devices will be created if support for more than one is advertised by MSR_INTEGRITY_CAPS as shown below
>
Well, it would also depend on whether the currently running kernel has
enumerated that test. IIUC, older kernels running on newer hardware
would only create ifs test devices they are aware of.
It would have been great if the above statement would be true as is :)
> static int __init ifs_init(void)
> {
>
> ....
> if (rdmsrl_safe(MSR_INTEGRITY_CAPS, &msrval))
> return -ENODEV;
>
> for (i = 0; i < IFS_NUMTESTS; i++) {
> if (!(msrval & BIT(ifs_devices[i].data.integrity_cap_bit)))
> continue;
>
> ifs_devices[i].misc.groups = ifs_get_groups();
> if (!misc_register(&ifs_devices[i].misc)) {
> ndevices++;
> }
> }
>
> return ndevices ? 0 : -ENODEV;
> }
>
Nit:
The _BIT extension is probably unnecessary. How about?
.data = {
.integrity_cap = MSR_INTEGRITY_CAPS_PERIODIC_BIST,
},
Powered by blists - more mailing lists