Start the pKVM experiment

Reflect the pKVM experiment status from the property into the misc
partition so the bootloader can apply it next boot. This is only done on
builds that don't have pKVM enabled by default by pkvm_enabler.

Bug: 192819132
Test: set property and observe change in pKVM state at reboot
Change-Id: Ief85fa196f630867d0a0ced7fa4744f0241d41ea
This commit is contained in:
Andrew Scull 2021-11-01 11:24:07 +00:00
parent 8258552f5a
commit 4e18aa73ea
2 changed files with 16 additions and 0 deletions

View file

@ -1072,6 +1072,9 @@ $(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk
PRODUCT_BUILD_PVMFW_IMAGE := true
ifeq ($(TARGET_PKVM_ENABLED),true)
PRODUCT_PACKAGES += pkvm_enabler
else
PRODUCT_COPY_FILES += \
device/google/gs101/pkvm/pkvm_experiment.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/pkvm_experiment.rc
endif
# Enable watchdog timeout loop breaker.

13
pkvm/pkvm_experiment.rc Normal file
View file

@ -0,0 +1,13 @@
service vendor.pkvm_enable /vendor/bin/misc_writer --set-enable-pkvm
disabled
oneshot
service vendor.pkvm_disable /vendor/bin/misc_writer --set-disable-pkvm
disabled
oneshot
on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=true
start vendor.pkvm_enable
on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=false
start vendor.pkvm_disable