[B][SRU][PATCH 0/2] Add feature bit RDPRU on AMD
Po-Hsu Lin
po-hsu.lin at canonical.com
Tue Jan 17 05:51:05 UTC 2023
[Impact]
RDPRU, the Read Processor Register instruction of AMD Zen 2 processors
is used to give access to some processor registers that are typically
only accessible when the privilege level is zero.
rdpru test in ubuntu_kvm_unit_tests is to check if the RDPRU instruction
can be intercepted by the Hypervisor. Without this patchset, this test
will fail on our AMD Zen 2 system "riccioli" with:
FAIL: RDPRU raises #UD
[Fix]
* fb64f293 x86/cpufeatures: Add feature bit RDPRU on AMD
* 0cb8410b kvm: svm: Intercept RDPRU
We have these patches in newer releases already, only Bionic 4.15
requires this fix. The first patch needs to be backported with some
context adjustment, the second can be cherry-picked.
[Test]
Test kernel can be found here:
https://people.canonical.com/~phlin/kernel/lp-1968681-rdpru/
With the patched kernel, this rdpru test will pass on the target AMD
Zen 2 system.
$ sudo ./rdpru
BUILD_HEAD=d6421940
timeout -k 1s --foreground 90s /usr/bin/qemu-system-x86_64 --no-reboot \
-nodefaults -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 \
-vnc none -serial stdio -device pci-testdev -machine accel=kvm -kernel \
/tmp/tmp.XOMVxpyNnl -smp 1 -cpu max # -initrd /tmp/tmp.I2TbGXFiaZ
enabling apic
smp: waiting for 0 APs
PASS: RDPRU raises #UD
SUMMARY: 1 tests
PASS rdpru (1 tests)
And the rdpru flag will be available in cpuinfo:
$ grep -o rdpru /proc/cpuinfo
rdpru
[Where problems could occur]
This patchset will add a new feature bit RDPRU for AMD Zen 2. We can
expect to see new issues coming up when using this bit in the future.
Babu Moger (1):
x86/cpufeatures: Add feature bit RDPRU on AMD
Jim Mattson (1):
kvm: svm: Intercept RDPRU
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/svm.h | 1 +
arch/x86/include/uapi/asm/svm.h | 1 +
arch/x86/kvm/svm.c | 8 ++++++++
4 files changed, 11 insertions(+)
--
2.7.4
More information about the kernel-team
mailing list