Commit graph

72888 commits

Author SHA1 Message Date
Xin Li
6042b45f56 Merge "Merge Android 12" 2021-10-07 23:50:14 +00:00
Wei Wang
1132977223 Merge changes from topic "sysbg_aosp"
* changes:
  task_profiles: add ServicePerformance to legacy device policy
  libutils: use system_background for low prio tasks in framework
2021-10-07 17:54:40 +00:00
David Anderson
af09c15049 Merge "adds LO_FLAGS_AUTOCLEAR for loop device of zram backing device" 2021-10-07 15:49:18 +00:00
Akilesh Kailash
fb964a1fbe snapuserd: Refactor buffer allocation code
Since there is no change in the buffer allocation
code with respect to snapshots in user-space, refactor
it so that we have a common code base.

Bug: 193863397
Test: Build
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I3a7b3d319f6d1532b1bb63af9884b64e1346bb50
2021-10-07 07:18:45 +00:00
Akilesh Kailash
228f6a099c snapuserd: Implement snapshot merge
Implement snapshot merge in the daemon. Following
are the important changes:

1: Spin up merge thread which does merging in user-space.
2: For ordered ops (COPY and XOR), read-ahead thread is used.
3: Read-ahead thread will read a fixed set of COW ops and cache
them in memory. Furthermore data is saved in scratch space buffer
in COW device.
4: No change in scratch space buffer - default 2MB buffer is allocated.
5: Merge thread and Read-ahead thread will work in lock step for merging
ordered ops.
6: Once the ordered ops are merged, REPLACE and XOR operations are
merged.
7: If there is a crash during merge, COW header tracks the number of
operations merged. No change in this code path.
8: Merge thread requires Base device for merging as opposed to using
the source device. Hence, while initializng the merge threads,
libsnapshot will have to pass the "Base" device to the daemon. This
is the same "Base" device which is passed to dm-snapshot during
snapshot creation.

Patch does not handle any communication with dm-user yet.

Bug: 193863397
Bug: 193863280
Bug: 193862712
Test: snapuserd_test on CF
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I14aab6eaa07ac68f2a3a23516ed9ba6567a35734
2021-10-07 07:09:28 +00:00
Akilesh Kailash
46e15bd18b snapuserd: Move dm-snapshot-merge related code
Move all the snapuserd files related to dm-snapshot/dm-snapshot-merge
to a seperate directory. We will have a logical seperation
to maintain user-space merge code.

No code changes other than moving files around.

Bug: 193863397
Test: Build
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ide0d824bb19f9d870ec32699d0a37de0e5d6ce81
2021-10-07 07:08:45 +00:00
Steven Moreland
2e1e76b8ff Merge "Revert "strerror: incl enum name"" 2021-10-07 00:25:39 +00:00
Steven Moreland
dde8fefced Revert "strerror: incl enum name"
Revert "strerror: incl enum name"

Revert submission 1833622-usable-strerror

Reason for revert: b/202330586
Bug: 202330586
Reverted Changes:
I4d8f617a0:Track strerror(3) change.
I8ea86220c:strerror: incl enum name
I407bd9f4d:strerror: incl enum name

Change-Id: I293ac322160c6a82ff7004a3de085cafbd514458
2021-10-07 00:19:18 +00:00
Xin Li
513ca33168 Merge Android 12
Bug: 202323961
Merged-In: I6c3beb288ae8733ef65723d8ae5bc820a65f17c2
Change-Id: I1f1c2bf1a8e11d4cb590a0df4695caa3e16d4ba5
2021-10-06 22:55:12 +00:00
Wei Wang
c53d794ca8 task_profiles: add ServicePerformance to legacy device policy
Since we are adding SCHED_SP_SYSTEM into framework, the policy is needed
on older releases as well.

Bug: 201428466
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I0784820bfec84fd8ef98f2feb2caee084d0a14a2
2021-10-06 15:08:42 -07:00
Wei Wang
c39d60d114 libutils: use system_background for low prio tasks in framework
Bug: 201428466
Test: Build and boot check system_server's sched group
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c
2021-10-06 13:04:22 -07:00
Elliott Hughes
3afebabf1b Merge "strerror: incl enum name" am: 79de514910
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1835931

Change-Id: I6c3beb288ae8733ef65723d8ae5bc820a65f17c2
2021-10-06 19:53:46 +00:00
Elliott Hughes
79de514910 Merge "strerror: incl enum name" 2021-10-06 19:35:51 +00:00
Armelle Laine
49a4ab3f00 Merge "storageproxyd: Retry RPMB request on UNIT ATTENTION" am: a3359bb3c9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1835315

Change-Id: I1423581f610810f45db172c853134a953dc576d0
2021-10-04 17:43:35 +00:00
Armelle Laine
a3359bb3c9 Merge "storageproxyd: Retry RPMB request on UNIT ATTENTION" 2021-10-04 17:32:51 +00:00
Treehugger Robot
30b3cb13c1 Merge "init: introduce ro.kernel.version property" am: 939353e1e3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1840075

Change-Id: I0f2dd754e0deb081550b86497bca58888dc53fa0
2021-10-01 18:24:39 +00:00
Treehugger Robot
3ed9cb0e13 Merge "init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 and <= 5.4" am: 5294c3da33
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1839019

Change-Id: I9518b09129541848420e48f7377f139438813345
2021-10-01 18:24:37 +00:00
Treehugger Robot
939353e1e3 Merge "init: introduce ro.kernel.version property" 2021-10-01 18:14:34 +00:00
Treehugger Robot
5294c3da33 Merge "init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 and <= 5.4" 2021-10-01 18:14:34 +00:00
Alexander Potapenko
1e966fa9f1 init: introduce ro.kernel.version property
This property will hold the major.minor part of the kernel version (e.g. "5.4"), allowing init scripts to act depending on that version, enabling and disabling certain features.

Bug: 194156700
Change-Id: Icec640b8a7150b344d9aa3bc0bdbcdae050c7c45
Test: manual on a Pixel device
Signed-off-by: Alexander Potapenko <glider@google.com>
2021-10-01 16:06:02 +00:00
Mohammad Islam
204d8c8787 [automerger skipped] Merge "libbinder: split out PackageManagerNative aidl" am: 570451bbfe -s ours
am skip reason: Merged-In Ieca32fc3c970f2b720d76071651e85459d082f02 with SHA-1 abacb514f9 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1827235

Change-Id: I1ebafba171f690264b2c2aac296ebcdb8b5a4b08
2021-10-01 13:01:56 +00:00
Mohammad Islam
570451bbfe Merge "libbinder: split out PackageManagerNative aidl" 2021-10-01 12:52:23 +00:00
Treehugger Robot
69a9fb4922 Merge "Define ro.vendor.api_level" am: 0a671e24f5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1839954

Change-Id: Ic9f2dced1b547ec2f83c5fd8c791193781473961
2021-10-01 03:32:50 +00:00
Treehugger Robot
0a671e24f5 Merge "Define ro.vendor.api_level" 2021-10-01 02:46:09 +00:00
Akilesh Kailash
f7e8b809ed Merge "Revert "snapuserd: Handle real time signal 36"" am: ba097d2cd2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1840354

Change-Id: Ia19a8a44b23f63fffe25020df3d74b94ec6664a6
2021-09-30 17:06:43 +00:00
Akilesh Kailash
ba097d2cd2 Merge "Revert "snapuserd: Handle real time signal 36"" 2021-09-30 16:52:10 +00:00
Akilesh Kailash
fec60563c4 Revert "snapuserd: Handle real time signal 36"
This reverts commit 8d3b31fe68.

Reason for revert: With https://r.android.com/1840754, bionic will handle the real time signal for statically linked binaries.

Change-Id: I81f0892f1734c7ecfb604820a8894506df8618b3
2021-09-30 07:24:11 +00:00
Treehugger Robot
a4fde44aa2 Merge "Add OWNERS for VTS module vts_libdm_test" am: 19dc4d413f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1770165

Change-Id: I8a8ebde611cfee21156d3877420a2425251e65c6
2021-09-30 04:01:40 +00:00
Treehugger Robot
19dc4d413f Merge "Add OWNERS for VTS module vts_libdm_test" 2021-09-30 03:46:00 +00:00
Treehugger Robot
2d046219ee Merge changes Ie5e47d84,I3c5c9917,Ife48b163 am: 9f2c62481f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1838534

Change-Id: I91df1e384d10566dc9fb31220681719bbfc240a9
2021-09-29 23:30:23 +00:00
Nikita Ioffe
b9fb80af34 [automerger skipped] Only run RebootTest under root am: 0a0e4793e3 -s ours
am skip reason: Merged-In I3c5c9917d0a787d66272ccf4aefc57e6573841bc with SHA-1 49b3a5c891 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1839957

Change-Id: I0d4006321c9453c005807e4efbf66a2f0b05cdd8
2021-09-29 23:30:20 +00:00
Treehugger Robot
9f2c62481f Merge changes Ie5e47d84,I3c5c9917,Ife48b163
* changes:
  Don't create vendor_init in microdroid
  Only run RebootTest under root
  Add reboot_test
2021-09-29 23:16:37 +00:00
Yiming Pan
47af156ee0 Add OWNERS for VTS module vts_libdm_test
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: Id2911fd62841bf5622607f9deeb50c7cf1413b1b
2021-09-29 14:46:24 -07:00
Akilesh Kailash
e31df2c655 Merge "snapuserd: Handle real time signal 36" am: 7ec205920c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1840414

Change-Id: Id54f17a60f31bdd54757580589ee4474711730f1
2021-09-29 21:11:48 +00:00
Yifan Hong
8268f6ea4a Merge "libsnapshot_fuzzer: allow ENXIO." am: d6fc145473
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1839713

Change-Id: Ibd14c26cf444f44ed9dcb9816aaf6a85afcf2945
2021-09-29 21:11:42 +00:00
Akilesh Kailash
7ec205920c Merge "snapuserd: Handle real time signal 36" 2021-09-29 21:04:41 +00:00
Yifan Hong
d6fc145473 Merge "libsnapshot_fuzzer: allow ENXIO." 2021-09-29 20:58:10 +00:00
Treehugger Robot
b5b5d89e50 Merge "Add VerifyMergeOps to ISnapshotWriter" am: 3ad79c8ff7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1839413

Change-Id: Iedbf10d71ac80e6ab808d6f34e32677d2c6cc8e6
2021-09-29 20:19:33 +00:00
Treehugger Robot
3ad79c8ff7 Merge "Add VerifyMergeOps to ISnapshotWriter" 2021-09-29 20:06:40 +00:00
Max Bires
a1d675c1a8 Merge "Make RemoteProvisioner required for KeyMint cc_bin" am: 9eb326c9c0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1809956

Change-Id: Iee982c0a6eb13c2e3089a9a293a91b4e6e08237f
2021-09-29 19:36:24 +00:00
Max Bires
9eb326c9c0 Merge "Make RemoteProvisioner required for KeyMint cc_bin" 2021-09-29 19:26:40 +00:00
Akilesh Kailash
8d3b31fe68 snapuserd: Handle real time signal 36
Add a signal handler for real time signal 36 which
is primarily used by profilers. Default action is to
terminate the daemon if there is no signal handler. We
don't want daemon to get terminated, hence just capture
the signal and ignore it.

Bug: 201497662
Test: cow_snapuserd_test, pkill -36 snapuserd
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ife5a8bdb7344956076bc4223c19a126b90a00706
2021-09-29 17:35:49 +00:00
Stephen Crane
a9085181af storageproxyd: Retry RPMB request on UNIT ATTENTION
Attempts a retry of the intial write or read when an RPMB command
triggers a UNIT ATTENTION condition. This causes the UA status to be
reset and hopefully result in a successful command. This runs the risk
of retrying a successful write, but we wouldn't have been able to get
the RPMB response after that write anyway due to the UA condition.

Test: m storageproxyd
Bug: 200037389
Change-Id: Ib970e779365bb396756c114684c7f6e56a737ab1
2021-09-29 10:28:43 -07:00
Kelvin Zhang
8c77196a74 Add VerifyMergeOps to ISnapshotWriter
It turns out update_engine never gets a ICowReader instance... it only
gets a generic FileDescriptor. So bring this function all the way up to
ISnapshotWriter interface.

Test: th
Change-Id: I7d17b9537f97282c99203b5cc13892e5daa1be4c
2021-09-29 10:04:11 -07:00
Alexander Potapenko
53cd1e95e7 init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 and <= 5.4
The tracing instance takes extra RAM and is not needed on devices running older kernels.
Bug: 194156700
Test: manual on a Pixel device

Change-Id: I794062741688ebea0e4bc500723a966f8f646ee1
Signed-off-by: Alexander Potapenko <glider@google.com>
2021-09-29 15:01:55 +00:00
Jiyong Park
3b3d87de79 Don't create vendor_init in microdroid
vendor_init is a subcontext of init which is responsible for handling
the vendor-defined services and vendor-defined actions. This is mainly
to enforce the Treble architecture in which the vendor components are
provided with a less-privileged context than the system components
because they are less-trusted.

However, in case of microdroid, both the system and the vendor
partitions are from the same entity. As VMs don't have direct access to
any of the underlying hardware, the vendor partition is targeting the
virtual platform, not the real hw platform. There really is no need for
the discrimination.

This CL disables the creation of the vendor_init subcontext when init
runs in microdroid.

Bug: 201363575
Test: atest MicrodroidHostTestCases
Change-Id: Ie5e47d84e9e245565239b4f2159e8182b457699d
2021-09-29 21:35:08 +09:00
Nikita Ioffe
0a0e4793e3 Only run RebootTest under root
This test requires running test services, which causes test to crash
(and still incorrectly be reported as passing) when running on
non-rooted device.

Ignore-AOSP-First: reboot_test is not in AOSP yet
Bug: 190958734
Test: atest CtsInitTestCases
Merged-In: I3c5c9917d0a787d66272ccf4aefc57e6573841bc
Change-Id: I3c5c9917d0a787d66272ccf4aefc57e6573841bc
2021-09-29 21:34:59 +09:00
Nikita Ioffe
86b4324a0a Add reboot_test
This test spawns several services backed by /system/bin/yes executable,
and then stops them either while SIGTERM or SIGKILL.

Ideally we want to unit test more of reboot logic, but that requires a
bigger refactoring.

Test: atest CtsInitTestCases
Bug: 170315126
Bug: 174335499
Merged-In: Ife48b1636c6ca2d0aac73f4eb6f4737343a88e7a
Change-Id: Ife48b1636c6ca2d0aac73f4eb6f4737343a88e7a
2021-09-29 20:09:18 +09:00
Justin Yun
dfbdd93336 Define ro.vendor.api_level
ro.vendor.api_level will have the api_level that the vendor images
are required to implement based on the various api level properties.
ro.board.api_level and ro.board.first_api_level explicitly states
the api level of the vendor images for grf.
If these properties are not provided, it reads the device's launching
api level.
The rest of the properties may show the implemented api level of the
vendor images.

Bug: 200258600
Test: getprop ro.vendor.api_level
Change-Id: Id4131b53d6db00d5bbef3b048384d33c1736d681
2021-09-29 15:37:27 +09:00
Christopher Ferris
bb770d06c4 Merge "Add CHECK to verify assumptions in the code." am: bc6317592a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1839573

Change-Id: If9f8249b98ecd8922c4fdfaa941505f4a78b218c
2021-09-29 04:10:42 +00:00