Commit Graph

22 Commits

Author SHA1 Message Date
Richard Hughes
029d2895bd Rename fu_udev_device_pread_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
40aaeb384a trivial: Do not use the unset MSR ucode version
This happens in VirtualBox.
2022-06-01 14:30:33 +01:00
Mario Limonciello
cc49eb6503 trivial: msr: align the unencrypted RAM failures to match that of psp plugin 2022-04-12 12:23:16 -05:00
Mario Limonciello
f63a1c7a87 pci_psp/msr: Set obsoletes related to SME and TSME
TSME and SME can technically both be enabled at the same time, but
there is no use in reporting one as enabled and the other disabled.

They share the same attribute, and so if one is enabled, obsolete
it in the other plugin.

Granted; this is a bit of a confusing experience.  You have two attributes
that mean similar but not the same things.  You can technically have SME
and TSME both enabled at the same time, or both disabled at the same time.
2022-04-12 12:23:16 -05:00
Mario Limonciello
0e3e8ff610 trivial: change Intel debug attributes to generic
As other platforms have features with the same attribute, remove
the Intel generic one.
2022-04-12 10:39:02 -05:00
Mario Limonciello
53a49b4ac1 Restore AMD SME check
Starting with linux kernel 5.18 the SME flag will be removed from
/proc/cpuinfo when it's not activated.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=08f253ec3767bcfafc5d32617a92cee57c63968e
2022-02-17 10:08:33 -06:00
Mario Limonciello
783e2e0448 Drop the AMD SME check for security attributes (Fixes: #4176)
This method does not indicate whether the kernel has enabled encryption.
That information is only visible from the kernel log at this time.

Continue to read the MSRs though, because if/when we get a method for the
kernel to export it we may use these as a basis of "support" but not a
indication of it being enabled.

encrypted:
```FuPluginMsr          SME/SEV check MSR: eax 01000f, ebx 016f
FuPluginMsr          PCI_MSR_AMD64_SYSCFG: 0f40000, sme_is_enabled=1
FuPluginMsr          PCI_MSR_AMD64_SEV: 00, sev_is_enabled=0
```

not_encrypted:
```
FuPluginMsr          SME/SEV check MSR: eax 01000f, ebx 016f
FuPluginMsr          PCI_MSR_AMD64_SYSCFG: 0f40000, sme_is_enabled=1
FuPluginMsr          PCI_MSR_AMD64_SEV: 00, sev_is_enabled=0
```
2022-02-04 10:41:47 -06:00
Mario Limonciello
9de6adf41f trivial: msr: add more debugging data for register status 2022-02-01 15:58:39 -06:00
Mario Limonciello
fa8bfc7f4a msr: make tsme security attribute match kernel doc more closely
The kernel documentation for AMD memory encryption includes information
on both SME and SEV, but they are separate attributes. Read the attributes
separately.

Link: https://www.kernel.org/doc/html/v5.16/x86/amd-memory-encryption.html
2022-01-20 06:52:51 -06:00
Richard Hughes
e87fc05ab9 Speed up the daemon startup by ~2% by doing dlsym much less
We were calling g_module_symbol() 2703 times, which is actually more
expensive than you'd think.

It also means the plugins are actually what we tell people they are:
A set of vfuncs that get run. The reality before that they were dlsym'd
functions that get called at pretty random times.
2021-11-09 12:02:07 +00:00
Mario Limonciello
35f62e1c84 trivial: msr: only run if /dev/cpu is present
I'm finding errors in a crostini container that the MSR plugin tries
to run and fails later.  The plugin just shouldn't be passing startup
if /dev/cpu isn't present.
2021-09-16 06:44:11 -05:00
Richard Hughes
f56878ff88 Allow adding GUIDs to each HSI security attr
This indicates the GUID in some way contributed to the result decided.

It also allows us to match the submitted HSI results back to a firmware
stream on the LVFS, which allows us to allow vendors to see a subset of
results for uploaded devices.
2021-09-03 22:03:28 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
dfaae2e837 Move amdgpu safety check into the plugin
There are now multiple plugins using drm_dp_aux_dev interface which
may potentially be combined with an amdgpu. Prevent exercising this
interface with any plugin using DP aux unless a new enough kernel is
installed.
2021-07-04 17:49:36 +01:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Richard Hughes
b333e0045c Split out a shared system context
There is a lot of code in fwupd that just assigns a shared object type to
a FuPlugin, and then for each device on that plugin assigns that same shared
object to each FuDevice.

Rather than proxy several kinds of information stores over two different levels
of abstraction create a 'context' which contains the shared *system* state
between the daemon, the plugins and the daemon.

This will allow us to hold other per-machine state in the future, for instance
the system battery level or AC state.
2021-04-01 21:11:29 +01:00
Richard Hughes
525f71f54b Merge the _udev_device() and _usb_device() vfuncs
There are now two 'backends' of device plug/unplug events, and there is about
to become three. Rather than just adding two more vfuncs for every backend type
define common ones that all providers can use.

Also fix up the existing in-tree plugins to use the new vfunc names and filter
on the correct GType.
2021-02-10 12:04:05 +00:00
Mario Limonciello
75835b4a0b Use FWUPD_COMPILATION define to indicate an in tree build
When this is done, include:
* Including the hash
* Including anything that is not ABI stable in plugins yet

Suggested-by: Simon McVittie <smcv@debian.org>
2021-01-22 14:01:25 -06:00
Richard Hughes
b63cfa90d6 Detect the AMD TSME encryption state for HSI 2021-01-06 16:45:33 +00:00
Richard Hughes
8307bd603e cpu: Directly probe the CPUID data to improve startup speed
This is much more efficient than parsing hundreds of lines of /proc/cpuinfo
and also causes hundreds of thousands less allocations at startup. For systems
with dozens of virtual CPUs the deduplication of device objects was increasing
start up time considerably.

Use the msr plugin to read the microcode version as this is not obtained using
CPUID, as it is instead being provided in an MSR.
2020-08-24 16:37:27 +01:00
Richard Hughes
f779a0cfaa msr: Use the new fu_common_cpuid() functionality 2020-08-24 16:37:27 +01:00
Richard Hughes
9a04ce8f29 msr: Add a new plugin to detect the Intel DCI state 2020-07-16 20:13:06 +01:00