Skip to content

hw/misc/applesmc: fix GET_KEY_BY_INDEX iteration and populate Apple SMC key set

Matthew Jackson qemu-devel qemu-trivial 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 3 repliesIn review
  2. v3 posting 2/22 patches 1 replySuperseded
  3. v3 posting 1/23 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches0 repliesSuperseded
v12 patches1 replySuperseded

Changes in v4 from the cover letter

- Regenerated against current master. Drop a stray hunk in patch 2/2 that reverted the qdev-properties.h include move (commit 78d45220b4); the include is now left untouched. Reported-by Philippe Mathieu-Daudé. No functional change.
- No other changes from v3.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/misc/applesmc: implement GET_KEY_BY_INDEX, WRITE and TYPE commandshw/misc/applesmc.c+170 -71 reply
2/2hw/misc/applesmc: populate Apple SMC key tablehw/misc/applesmc.c+167 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDaniel Golle
1/2R-b T-b
2/2R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] hw/misc/applesmc: fix GET_KEY_BY_INDEX iteration and populate Apple SMC key set

The applesmc device only answers APPLESMC_READ_CMD at its command port. Modern macOS guests (x86 10.14+, all 15.x) also issue WRITE, TYPE and GET_KEY_BY_INDEX, and enumerate the SMC key space at boot. The unanswered commands and the near-empty key table drive the AppleSMC kext into a kSMCSpuriousData retry storm (~1800 errors/sec, kernel_task ~70% CPU, WindowServer ~509% CPU on macOS 15).

Patch 1 implements the missing commands. Patch 2 populates the key table with a realistic iMac20,1 profile and the canonical #KEY count, so the guest's boot-time enumeration terminates.

v4:
- Regenerated against current master. Drop a stray hunk in patch 2/2 that reverted the qdev-properties.h include move (commit 78d45220b4); the include is now left untouched. Reported-by Philippe Mathieu-Daudé. No functional change.
- No other changes from v3.

v3: https://lore.kernel.org/qemu-devel/[email protected]/
v2: addressed Peter Maydell's style review (loop braces, stl_be_p()).
v1: https://lore.kernel.org/qemu-devel/[email protected]/

Matthew Jackson (2):
hw/misc/applesmc: implement GET_KEY_BY_INDEX, WRITE and TYPE commands hw/misc/applesmc: populate Apple SMC key table

 hw/misc/applesmc.c | 344 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 337 insertions(+), 7 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)