qemu icon indicating copy to clipboard operation
qemu copied to clipboard

hw/misc: applesmc: use host osk as default on macs

Open t0rr3sp3dr0 opened this issue 4 years ago • 2 comments

When running on a Mac, QEMU is able to get the host OSK and use it as the default value for the AppleSMC device. The OSK query operation doesn't require administrator privileges and can be executed by any user on the system. This patch is based on open-source code from Apple, just like the implementation from VirtualBox.

Apple: https://opensource.apple.com/source/IOKitUser/IOKitUser-647.6.13/pwr_mgt.subproj/IOPMLibPrivate.c https://opensource.apple.com/source/PowerManagement/PowerManagement-637.60.1/pmconfigd/PrivateLib.c

VirtualBox: https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Devices/EFI/DevSmc.cpp#L516

Signed-off-by: Pedro Tôrres [email protected]

t0rr3sp3dr0 avatar Oct 03 '21 16:10 t0rr3sp3dr0

This patch has also been submitted to QEMU: https://patchew.org/QEMU/[email protected]/

It will allow macOS to run on UTM by using the host OSK instead of setting its value manually.

t0rr3sp3dr0 avatar Oct 03 '21 16:10 t0rr3sp3dr0

@t0rr3sp3dr0 Thanks for the pull request. Can you ping me once the conversation with QEMU is resolved? Even if they don't accept the patch, I can still merge it in this branch. But I just want things to be as consistent as possible so if they do accept it, I don't want to diverge on the implementation with QEMU master.

osy avatar Oct 22 '21 22:10 osy