Skip to content

hvf: RDTSCP capability not passed to guests

Host environment

  • Operating system: macOS Monterey 12.3.1
  • OS/kernel version: 21E258
  • Architecture: x86_64
  • QEMU flavor: qemu-system-x86_64
  • QEMU version: 6.2.0, master
  • QEMU command line:
    ./qemu-system-x86_64 -cpu host,+rdtscp -machine q35,accel=hvf -m 512 -cdrom ./alpine-standard-3.15.4-x86.iso

Emulated/Virtualized environment

  • Operating system: Alpine 3.15.4
  • OS/kernel version: 5.15.32-0-virt #1-Alpine SMP
  • Architecture: x86_64

Description of problem

Steps to reproduce

  1. Run: wget https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/x86/alpine-standard-3.15.4-x86.iso ./qemu-system-x86_64 -cpu host,+rdtscp -machine q35,accel=hvf -m 512 -cdrom ./alpine-standard-3.15.4-x86.iso

  2. login as "root"

  3. type

cat /etc/cpuinfo | grep rdtscp

Expected result: cpu flag lines including rdtscp Actual result: empty, with:

warning: host doesn't support requested feature: CPUID.80000001H:EDX.rdtscp [bit 27]

Additional information

This patch apparently resolves the issue according to my tests:

https://lore.kernel.org/qemu-devel/20211101054836.21471-1-dirty@apple.com/

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information