Commit graph

90482 commits

Author SHA1 Message Date
Elliott Hughes
a4e852d032 Stop explicitly adding bionic subdirectories to the include path.
Change-Id: I9961fa6ac957d8613f93fa33731da797f9ba8615
2024-11-14 18:14:26 +00:00
Akilesh Kailash
71ebf1a20d Merge "Revert "Move snapuserd_test to presubmit-large group"" into main 2024-11-13 20:44:51 +00:00
Priyanka Advani (xWF)
1b5a7addd9 Revert "Move snapuserd_test to presubmit-large group"
This reverts commit ac810ad718.

Reason for revert: Droidmonitor created revert due to b/378924658. Will be verifying ABTD before submission.

Change-Id: Icb08a969ba13d863832a90d224f96fe60af9de4b
2024-11-13 20:12:45 +00:00
Treehugger Robot
846b34f7f4 Merge "Move snapuserd_test to presubmit-large group" into main 2024-11-13 17:48:32 +00:00
Treehugger Robot
00503ef565 Merge "Set input thread priority to RT - try 4" into main 2024-11-13 16:30:27 +00:00
Elliott Hughes
3c63d0af34 Merge "Stop explicitly adding bionic subdirectories to the include path." into main 2024-11-13 13:17:10 +00:00
David Drysdale
014c710c27 Merge changes from topic "keymint-v3" into main
* changes:
  Declare previous version when using frozen HALs
  Set the proper FEATURE_HARDWARE_KEYSTORE version
2024-11-13 06:50:42 +00:00
Akilesh Kailash
ac810ad718 Move snapuserd_test to presubmit-large group
Bug: 338329603
Test: Build
Change-Id: I20d722a797093e40eb653a418a1963acf8c4292b
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-11-13 04:34:34 +00:00
Siarhei Vishniakou
9ad453ffae Set input thread priority to RT - try 4
This reverts commit 52da71d47b.

Reason for revert: camera was using its own stale copy of libprocessgroup, and now has revved up its version that includes the new parsing code. So this time the json file update should work OK.

Original description:

To improve input latency, set the critical input threads to RT priority.
This will use RT priority on AOSP devices by default. OEMs can still
choose to customize what "input policy" means for their device, which
may not necessarily mean RT.

For example, on device with multiple small / big cores, input task
affinity could be changed to prioritize big cores + higher CPU frequency
/ voltage, but still keep the standard / default input thread priority.

Note: there is an open issue where the thread priority is not remaining constant. See b/378761104.

Bug: 330719044
Bug: 378761104
Flag: com.android.input.flags.enable_input_policy_profile
Test: took perfetto trace and checked the priority on InputDispatcher
and InputReader threads.

Change-Id: I449be0eeeac989222f5deefa62615478bd65b968
2024-11-13 00:56:06 +00:00
Florian Mayer
574ae66ee6 Merge "Remove mitchp from OWNERS file" into main 2024-11-12 20:51:20 +00:00
Florian Mayer
4be70e7db3 Remove mitchp from OWNERS file
Change-Id: Ifb0e1598f3908fcc2206a2b51611b996f8b48cb8
2024-11-12 20:46:08 +00:00
Florian Mayer
a7da00f4f0 Merge "Test stack buffer size calculation." into main 2024-11-12 18:51:39 +00:00
Elliott Hughes
945dd526ed Stop explicitly adding bionic subdirectories to the include path.
Change-Id: I24776f1008ca5f030cd8c94147d9630519ef6a24
2024-11-12 15:25:09 +00:00
Treehugger Robot
7adba5989c Merge "Add BOARD_GENFS_LABELS_VERSION" into main 2024-11-12 01:42:47 +00:00
Jooyung Han
92d1597718 Merge "Revert^2 "Deprecating libvendorsupport_llndk_headers"" into main 2024-11-12 01:35:41 +00:00
Florian Mayer
6facd1bfd3 Test stack buffer size calculation.
Bug: 378140560
Change-Id: Idca03cac925bc0d8bd574817391c4eaca11f2bff
2024-11-11 14:03:00 -08:00
David Drysdale
5969d69248 Declare previous version when using frozen HALs
The KeyMint HAL has been updated to v4, but frozen builds (e.g. 25Q1)
remain on the previous version.  The core AIDL version is handled
automatically, but we also have a package manager flag whose value
is (100 * HAL-version).  Use `RELEASE_AIDL_USE_UNFROZEN` to switch
between `required` configs for that.

Test: TreeHugger
Bug: 377808462
Bug: 378026324
Change-Id: Id042bee2a81e8563e1029ea7bb43452715e3edee
2024-11-11 19:17:20 +00:00
Karuna Wadhera
e8ff8b494a Set the proper FEATURE_HARDWARE_KEYSTORE version
The binary implements V3 of the KeyMint HAL, so the feature version
should match.

Bug: 369375199
Bug: 378384123
Test: treehugger
Change-Id: Ib26ac73cf6593d9a50f7a019129c6e5e237ae2cd
2024-11-11 18:06:30 +00:00
Dennis Shen
b842f642d9 Merge "Start aconfigd_system processes in init.rc" into main 2024-11-11 14:33:09 +00:00
Treehugger Robot
fa528cccf6 Merge "init: Avoid extra string copies when finding devices by using const refs" into main 2024-11-11 02:05:44 +00:00
Jooyung Han
dbb080d9bf Revert^2 "Deprecating libvendorsupport_llndk_headers"
ab8f9717f1

Change-Id: Ie981692be554942df762a4c9be7c250b0b202f31
2024-11-09 02:41:13 +00:00
Douglas Anderson
46afe22f9d init: Avoid extra string copies when finding devices by using const refs
Now that FindPlatformDevice() isn't modifying the path argument, and
is just passing it on to FindSubsystemDevice(), take this argument by
const reference. That should avoid an unnecessary string copy.

Bug: 316324155
Test: Compile
Change-Id: I1d92a322d0c311ee46a117dd9d650896ec02520f
2024-11-08 15:48:35 -08:00
Priyanka Advani (xWF)
244a63066b Merge "Revert "Deprecating libvendorsupport_llndk_headers"" into main 2024-11-08 19:05:16 +00:00
Ted Bauer
3c700588c7 Start aconfigd_system processes in init.rc
aconfigd_system is replacing aconfigd. Which one executes is toggled
by RO flag enable_system_aconfigd_rust, introduced in https://android-review.googlesource.com/q/topic:%22switch-to-aconfigd-system%22.

Bug: 378079539
Test: m
Change-Id: I6a04c38e9ef22da2b230046ddace73d6f7e39652
2024-11-08 17:45:16 +00:00
Priyanka Advani (xWF)
ab8f9717f1 Revert "Deprecating libvendorsupport_llndk_headers"
Revert submission 3334193-no-llndk-versioning

Reason for revert: Droidmonitor created revert  due to b/378038995. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3334193-no-llndk-versioning

Change-Id: Id8d85be1930bef68f94cee66a0fe29278de48d64
2024-11-08 17:37:26 +00:00
Inseob Kim
76afb4a2c2 Add BOARD_GENFS_LABELS_VERSION
If it's 202504 or later, /sys/class/udc will be labeled as sysfs_udc. If
it's not set, /sys/class/udc will stay at the label sysfs. This is to
support GRF vendors older than 202504.

202404 or old vendors can choose either way. If they want to customize
permissions to /sys/class/udc, they can turn off
BOARD_GENFS_LABELS_VERSION and assign their own label to /sys/class/udc
/sys/class/udc with vendor sepolicy.

202504 or newer vendors must set BOARD_GENFS_LABELS_VERSION to a version
greater than or equal to 202504.

For now there's only one node /sys/class/udc, but more labels can be
added until 202504 freeze.

Bug: 361985697
Test: boot with and without BOARD_GENFS_LABELS_VERSION
Change-Id: I1a28109119368f1475628be85dd8d990c824922e
2024-11-08 16:41:45 +09:00
Treehugger Robot
2a5bef2e98 Merge "Deprecating libvendorsupport_llndk_headers" into main 2024-11-08 06:29:05 +00:00
Hung Nguyen
fb954abea6 Merge "Increase zram size percentage limit" into main 2024-11-08 05:09:37 +00:00
Hung Nguyen
ce6f7330ad Increase zram size percentage limit
To allow experimenting with zram size larger than device memory size.

Bug: 368286978
Test: atest CtsFsMgrTestCases

Change-Id: I47a4a4e6af39571d13e4622d110c92936008127e
2024-11-07 15:16:17 -08:00
Treehugger Robot
308bcbea8e Merge "Increase the test timeout" into main 2024-11-07 23:07:11 +00:00
Akilesh Kailash
e5a2af34b3 Increase the test timeout
Bug: 338329603
Test: Build success
Change-Id: I97008dbe112d87ef2f4bff5605beb41cc4b1fac7
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-11-07 13:43:13 -08:00
Treehugger Robot
c43fd51571 Merge "init: Look for partition only on a boot device if using boot_part_uuid" into main 2024-11-07 16:59:48 +00:00
Doug Anderson
f3e994b439 Merge changes If824cb70,I025d9d68,Ic5a57a89,If5d63f39,I1adb1906 into main
* changes:
  init: Add the ability to find the boot device by partition UUID
  init: Move the stripping of "/devices" and "/devices/platform/" to a helper
  init: Break FindPlatformDevice() into a helper function
  init: Factor GetBlockDeviceInfo() out of GetBlockDeviceSymlinks()
  init: Use ConsumePrefix() instead of open coding in GetBlockDeviceSymlinks()
2024-11-07 15:28:10 +00:00
T.J. Mercier
574da62341 Merge "Revert "Set input thread priority to RT - try 3"" into main 2024-11-06 21:50:40 +00:00
Liana Kazanova
52da71d47b Revert "Set input thread priority to RT - try 3"
This reverts commit a2bd0e6b5d.

Reason for revert:DroidMonitor: Potential culprit for http://b/377739155 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I4c2b686aaf291db819d37711d4427d0094ca2295
2024-11-06 21:42:29 +00:00
Douglas Anderson
eb3d280f1e init: Look for partition only on a boot device if using boot_part_uuid
The current code waits for boot partitions to show up by waiting to
see a uevent with the right partition name. However, nothing in the
waiting code validates that the partition that showed up is actually
on the boot device. That means that the current code can be confused
if there is another block device in the system (possibly connected via
USB) that has a partition name matching one of the system ones.

It can be noted that the problem is specifically just that the
"waiting" part returns too early. Later parts of the system,
specifically the parts of the system that create the
"/dev/block/by-name" symlinks, do properly look at the list of "boot
devices". This means that the problem we're fixing is that later code,
which assumes that the boot partitions have already initialized, can
fail to find an initialized partition.

To make it concrete, imagine that you have two block devices in your
system: the builtin emmc and an external USB disk. Let's say you're
booting over USB and "boot_devices" properly lists only USB. Both the
"emmc" and "USB" block devices are properly formatted Android disks
and have the full slew of partitions. At boot time, you can see:
1. We get to the point where we need to wait for the "boot" source
   (USB) to show up.
2. We see the eMMC show up.
3. The eMMC has all the needed partitions, so we consider our wait
   done. ...but eMMC isn't in the list of "boot devices" so we don't
   create the "/dev/block/by-name" symlinks.
4. Later code assumes that the "/dev/block/by-name" symlinks are
   already setup and fails.
5. The device fails to boot.

Fix it so that the wait makes sure that the partitions are on the boot
device.

Unfortunately, it appears that in some cases products (especially
emulators) aren't setting the "boot devices" and/or are not making
sure all boot partitions are on the same device. Limit the fix to only
devices using the new "boot_part_uuid" to make sure we don't break old
code.

NOTE: this is effectively the same change as a previous one ("init:
Look for super partition only on a boot device") but with the added
fix to only enable the check when using "boot_part_uuid".

Bug: 309244873
Bug: 349144493
Bug: 316324155
Test: Boot isn't confused when two boot devices are present
Change-Id: Iaae453ed661307f485cdf4dde86294105cae9b2d
2024-11-06 13:03:15 -08:00
Douglas Anderson
e9de310061 init: Add the ability to find the boot device by partition UUID
The current mechanism for specifying boot devices on Android systems
involves passing a set of "boot_devices" though command line,
bootconfig, or device tree.

The bootdevices are specified as strings and, in general, need to
match a sysfs path but without the "/sys/devices" or
"/sys/devices/platform" prefix. The sysfs path is generally the path
to the closest parent of the block device that is a "platform" device.

As an example, if the sysfs path of the expected boot device is:
  /sys/devices/platform/soc@0/7c4000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk1

The bootloader would specify it as "soc@0/7c4000.mmc" since:
* We strip off "/sys/devices/platform/"
* As we move up directories, we don't find one whose subsystem is
  "platform" until we get up to
  "/sys/devices/platform/soc@0/7c4000.mmc".

The current mechanism is a bit brittle. Specifically:
* The sysfs path isn't _really_ stable and can change across kernel
  upgrades. For instance, during one kernel upgrade the device tree
  for a product changed so that the root node changed from "soc" to
  "soc@0" and this changed all sysfs paths. In the past device tree
  folks have asserted that we shouldn't rely on dts node names to stay
  consistent, yet those node names are used to construct sysfs paths.
* For some devices, like USB, the path of the closest "platform"
  device tends to be the path of the USB controller. This means that
  if two USB disks are plugged in we can't guarantee which one will be
  identified as the boot device.

Add a new method of finding the boot device by passing the partition
UUID that we loaded the kernel from. Using the partition UUID to
identify the boot device is standard on Linux. You can see this
because when you're not using an initramfs you can use the syntax
"root=PARTUUID=<valid-uuid-id>[/PARTNROFF=n]" to specify the root.
Using the same idea for Android's boot code makes sense.

With this new method for finding the boot device, we can make the code
much more specific about matching sysfs paths. Once we find the sysfs
path for the kernel we can make sure that all of the other boot
partition share the same "scsi" or "mmc" parent instead of going all
the way to the closest platform device. In the above example, this
means that we'd make sure that all boot devices are found under this
sysfs node:
  /sys/devices/platform/soc@0/7c4000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk1
...instead of just making sure they are under:
  /sys/devices/platform/soc@0/7c4000.mmc

There is the question of what we should do if the bootloader passes
_both_ an old style "boot_devices" and also a partition UUID. In this
case, we'll issue a warning and then ignore the old "boot_devices".
Considering it a warning rather than an error could allow switching to
the "boot_part_uuid" method even if an old bootloader is still
hardcoding some old "boot_devices".

NOTE: Using partition UUID won't cause any security problems even
though someone _could_ plug in an external device crafted to have the
same UUID as the normal boot device's kernel partition. We already
have "verity" in the system making sure our filesystems are not
tampered with and this would also protect us from booting a tampered
disk. That means that the worst someone could do in this case would be
to confuse the system and make the device non-bootable. Chromebooks
have been using the partition UUID to find the root filesystems for
years and this has never been a problem.

NOTE: this new method relies on the commit ("init: Add partition_uuid
to Uevent") which in turn relies upstream kernel commit 74f4a8dc0dd8
("block: add partition uuid into uevent as "PARTUUID"").

Bug: 316324155
Test: Use partition UUID to boot

Change-Id: If824cb700ca3696a442a28e6ad02d7c522c3b495
2024-11-06 13:03:15 -08:00
Douglas Anderson
3de05fcff6 init: Move the stripping of "/devices" and "/devices/platform/" to a helper
A future change will want the same stripping when looking for USB boot
devices. Move the stripping down to the helper.

This change is intended to be a no-op and just a reorganization.

Bug: 316324155
Test: See boot devices still found
Change-Id: I025d9d68fedf652055454cbd93e15f480b6056dd
2024-11-06 13:03:15 -08:00
Douglas Anderson
6519e6d67f init: Break FindPlatformDevice() into a helper function
We want to use the logic for FindPlatformDevice() in a future change
to look for devices that have USB parents. Break out a helper
function.

This change is intended to be a no-op and just a reorganization.

Bug: 316324155
Test: See boot devices still found
Change-Id: Ic5a57a89339c43dea1334644be9386637169c61c
2024-11-06 13:03:15 -08:00
Douglas Anderson
9481f97603 init: Factor GetBlockDeviceInfo() out of GetBlockDeviceSymlinks()
Later code will want to use GetBlockDeviceInfo(), so factor it out to
a helper function. This change is intended to be a no-op.

Bug: 316324155
Test: Build & boot
Change-Id: If5d63f39efcd84a07eb8c6fa4f28bda45c4cbe5c
2024-11-06 13:03:14 -08:00
Douglas Anderson
743e8f16a7 init: Use ConsumePrefix() instead of open coding in GetBlockDeviceSymlinks()
In GetBlockDeviceSymlinks() we may need to strip the
"/devices/platform/" or "/devices/" from a string. Use the helper
ConsumePrefix() to do this, which is more convenient and readable.

This change is intended to be a no-op and just a cleanup.

Bug: 316324155
Test: Build and boot
Change-Id: I1adb1906ec37ff8f6f505abc5f26e1e3b157e608
2024-11-06 12:22:48 -08:00
Treehugger Robot
04130ee930 Merge "Set input thread priority to RT - try 3" into main 2024-11-06 18:53:25 +00:00
Siarhei Vishniakou
a2bd0e6b5d Set input thread priority to RT - try 3
This partially reverts commit de6707df0c.

Reason for revert: code change landed, now modifying JSON file only

Original description:

To improve input latency, set the critical input threads to RT priority.
This will use RT priority on AOSP devices by default. OEMs can still
choose to customize what "input policy" means for their device, which
may not necessarily mean RT.

For example, on device with multiple small / big cores, input task
affinity could be changed to prioritize big cores + higher CPU frequency
/ voltage, but still keep the standard / default input thread priority.

With this patch, I'm finding that sometimes, one of the critical input
threads has priority 100 instead of the expected 98. Still looking into
that specific issue, but the issue is already present with the existing
"input policy" code.

Bug: 330719044
Flag: com.android.input.flags.enable_input_policy_profile
Test: took perfetto trace and checked the priority on InputDispatcher
and InputReader threads.

Change-Id: I7d8a941f36ad9e4b75a7a0f4c5d81895256d6919
2024-11-06 16:57:37 +00:00
Doug Anderson
5d5906fb02 Merge changes I819eb60a,I48a52aa0,Iab04742c into main
* changes:
  init: Reorder GetBlockDeviceSymlinks() so FindDmDevice() is first
  init: Add partition_uuid to Uevent
  fs_mgr: Add getter for androidboot.boot_part_uuid
2024-11-06 16:40:33 +00:00
Treehugger Robot
41e9d7d3a2 Merge "snapuserd: typecast cow_op->new_block to uint64_t" into main 2024-11-06 10:15:46 +00:00
Akilesh Kailash
01af5431f7 snapuserd: typecast cow_op->new_block to uint64_t
On 32-bit devices, cow_op->new_block * BLOCK_SZ can overflow.

Bug: 376978542
Test: snapuserd_test on 32-bit device
1: Initiate merge on partition > 4GB.
2: Verify no overflow.

Change-Id: I4efc24891e0b330505ddf59b7db7716f054cf9c4
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-11-05 22:22:12 -08:00
Jooyung Han
06c4e96fd8 Deprecating libvendorsupport_llndk_headers
Versioned LLNDK symbols are guarded with __builtin_available.

Bug: 362658565
Test: m --no-skip-soong-tests
Change-Id: I0fb3bc87b74da62b8a8fba0c5bb6a3373e6a55dc
2024-11-06 13:54:01 +09:00
Douglas Anderson
9f760f8d41 init: Reorder GetBlockDeviceSymlinks() so FindDmDevice() is first
By moving FindDmDevice() it's easier to unify the code with the
IsBootDevice() function. In this case the order doesn't matter since
anything with the uevent path "/devices/virtual/block/dm-" (the only
devices FindDmDevice() looks at) won't match any of the other sections
of the if/then/else test.

Bug: 316324155
Test: Build & boot

Change-Id: I819eb60aa5077f0eb2c2f2783b152e43a52ba8b7
2024-11-05 15:55:26 -08:00
Douglas Anderson
e53e50e3fa init: Add partition_uuid to Uevent
As of commit upstream Linux kernel commit 74f4a8dc0dd8 ("block: add
partition uuid into uevent as "PARTUUID""), it's easy to include the
partition UUID in the Uevent structure. Add it in so that other parts
of the init code can make decisions based on the partition UUID.

If this code is run on older kernels we'll never see the partition
UUID and it will be left blank.

Bug: 316324155
Test: Run w/ a newer kernel and see partition_uuid populated.
Change-Id: I48a52aa006c05023f7f1cc5cc0ab5c1f1ec37455
2024-11-05 15:55:26 -08:00
Douglas Anderson
519d3f8b36 fs_mgr: Add getter for androidboot.boot_part_uuid
In order to make booting from some media types (like USB) more robust,
the bootloader will be extended to support passing the partition UUID
that it loaded the kernel from. It can pass this via kernel
commandline or via bootconfig. Add a way to get this.

Bug: 316324155
Test: Use the getter in a future change

Change-Id: Iab04742c0f2666db18dc48bcaaa2869eba405748
2024-11-05 15:55:25 -08:00