]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/misc: applesmc: use host osk as default on macs
authorPedro Tôrres <t0rr3sp3dr0@gmail.com>
Mon, 4 Oct 2021 08:46:37 +0000 (10:46 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Oct 2021 11:10:29 +0000 (13:10 +0200)
commit93ddefbc3c909bb6c3b76086f1dfc8ad98dd3725
tree6035dad0048cf37b7a421ebe1ca10ad18432dd5b
parentc0c2d319d6714517cc4e0332edf99f2fccaa9442
hw/misc: applesmc: use host osk as default on macs

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 <t0rr3sp3dr0@gmail.com>
hw/misc/applesmc.c