From 882ef5add87e7dae77f42584a66dbf477332e03d Mon Sep 17 00:00:00 2001 From: Enzo Liao Date: Mon, 6 May 2024 19:58:06 +0800 Subject: [PATCH 1/2] Remove unused apps (RamdumpService and SSRestartDetector) from factory build targets. After ag/26620507, the two apps are built in factory build targets. They don't need them so we should not build them. Bug: 298102808 Design: go/sys-software-logging Test: Manual Flag: NONE N/A Change-Id: Ie442c7a95e7fe764749031281e7740c3a4b5a768 --- ramdump_and_coredump/ramdump_and_coredump.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ramdump_and_coredump/ramdump_and_coredump.mk b/ramdump_and_coredump/ramdump_and_coredump.mk index 24af44e..d7a819f 100644 --- a/ramdump_and_coredump/ramdump_and_coredump.mk +++ b/ramdump_and_coredump/ramdump_and_coredump.mk @@ -5,8 +5,8 @@ PRODUCT_PACKAGES_DEBUG += \ dump_ramdump \ ramdump \ -# When not AOSP targets -ifeq (,$(filter aosp_%, $(TARGET_PRODUCT))) +# When neither AOSP nor factory targets +ifeq (,$(filter aosp_% factory_%, $(TARGET_PRODUCT))) PRODUCT_PACKAGES += SSRestartDetector PRODUCT_PACKAGES_DEBUG += RamdumpUploader endif From 0ea3b6ccd1c7b2b8dd330101f58bd310c56663eb Mon Sep 17 00:00:00 2001 From: feiyuchen Date: Sun, 5 May 2024 23:09:21 +0000 Subject: [PATCH 2/2] Allow edgetpu_tachyon_service to call mlock() Tachyon AIDL service is the new Darwinn runtime v3. It needs mlock capability to support the GenAI effort, allowing file backed large models to be mlocked, satisfying the memory accounting on Android, similar to what we just did for edgetpu_app_service ag/26481028 Bug: 337949682 Test: On-device tested that tachyon service can now lock large memories. Change-Id: I02e4d87adf8a459e88e35f7b965d65b2840adce5 --- edgetpu/sepolicy/edgetpu_tachyon_service.te | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/edgetpu/sepolicy/edgetpu_tachyon_service.te b/edgetpu/sepolicy/edgetpu_tachyon_service.te index 5ead23b..da34353 100644 --- a/edgetpu/sepolicy/edgetpu_tachyon_service.te +++ b/edgetpu/sepolicy/edgetpu_tachyon_service.te @@ -49,3 +49,14 @@ get_prop(edgetpu_tachyon_server, vendor_edgetpu_runtime_prop) get_prop(edgetpu_tachyon_server, vendor_hetero_runtime_prop) # Allow Tachyon service to read EdgeTPU CPU scheduler properties get_prop(edgetpu_tachyon_server, vendor_edgetpu_cpu_scheduler_prop) + +# Allow mlock without size restriction +allow edgetpu_tachyon_server self:capability ipc_lock; + +# Need to effectively read file mapped file when mmap + mlocked. +allow edgetpu_tachyon_server privapp_data_file:file { map read}; + +# For shell level testing of mlock +userdebug_or_eng(` + allow edgetpu_tachyon_server shell_data_file:file { map read}; +')