Commit Graph

71897 Commits

Author SHA1 Message Date
Alexander Potapenko 0e28aeb786 Revert "Revert "init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 and <= 5.4""
This reverts commit 220f604ca5.

Reason for revert: from bug 202436407 it looks like the initial revert wasn't needed.

Change-Id: I81dba47ee4bc55da2d4c5212dfc1b6200719b8be
2021-10-13 15:54:34 +00:00
Wei Wang ecaf9ef70a Merge "libutils: use system_background for low prio tasks in framework" into sc-qpr1-dev 2021-10-08 21:14:04 +00:00
Wei Wang 276ba2c75b 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
Merged-In: I0784820bfec84fd8ef98f2feb2caee084d0a14a2
2021-10-08 21:13:54 +00:00
Chiayu Pei 220f604ca5 Revert "init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 and <= 5.4"
This reverts commit 4edda28b92.

Reason for revert: b/202436407

Change-Id: I4cdbdb756b9fc61bb6f5ff61335fec7d541ec6a2
2021-10-08 04:26:55 +00:00
Wei Wang 7ee4980dc2 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
Merged-In: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c
2021-10-07 17:58:44 +00:00
Alexander Potapenko 4edda28b92 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

Signed-off-by: Alexander Potapenko <glider@google.com>
Merged-In: I794062741688ebea0e4bc500723a966f8f646ee1
Change-Id: Ie8614e67a89cea67bed88427820fefdf110713c9
2021-10-06 18:12:46 +00:00
TreeHugger Robot b0cd5f87e8 Merge "Restrict creation of bootreceiver tracing instance to 64-bit systems." into sc-qpr1-dev 2021-10-06 18:06:20 +00:00
Alexander Potapenko b5f93dfa5d Restrict creation of bootreceiver tracing instance to 64-bit systems.
The main users of this instance are KFENCE and MTE-aided KASAN, which are only supported on arm64.
Skip creation of this tracing instance on 32-bit systems to save ~6Mb memory on low-end devices.

Bug: 195089948
Bug: 194719088
Bug: 194156700
Test: manual on Pixel device
Merged-In: Icaf762715fed7a282b1ad738c10bcb45dc848f4d
Change-Id: I61694ce174fa745ef9fd50ca7464b5a9e1d1e011
2021-10-06 16:13:06 +00:00
Alexander Potapenko e69aea9256 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
Test: manual on a Pixel device
Signed-off-by: Alexander Potapenko <glider@google.com>
Merged-In: Icec640b8a7150b344d9aa3bc0bdbcdae050c7c45
Change-Id: I5af411e39da600e5e0f6703f3a2a4930d509e29d
2021-10-06 16:12:41 +00:00
Stephen Crane 857115b1ef [automerger skipped] storageproxyd: Retry RPMB request on UNIT ATTENTION am: ab2257ee48 -s ours
am skip reason: Merged-In Ib970e779365bb396756c114684c7f6e56a737ab1 with SHA-1 d1a212e0d8 is already in history

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

Change-Id: I665ffb3d37b5fa4c1eeb61b5ddf249f2c754f27a
2021-10-05 19:22:00 +00:00
Stephen Crane 122048f24c [automerger skipped] storageproxyd: Fix inverted conditional in error checking am: 237679cfca -s ours
am skip reason: Merged-In I3b84188aabe58345a83d2fd57bb8103e730cf365 with SHA-1 dcdac24306 is already in history

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

Change-Id: I7b4344764e66de4a2848dec9319c6e3abc89751e
2021-10-05 19:21:59 +00:00
Stephen Crane c898d12eda [automerger skipped] [storageproxyd] Dump binary buffers to log instead of stderr am: 77e2af18be -s ours
am skip reason: Merged-In Iecc0d4680420bb92c94be628789093888a2f1941 with SHA-1 f647221827 is already in history

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

Change-Id: I55e606476410febd80dbad2662f6f75c3521d239
2021-10-05 19:21:59 +00:00
Stephen Crane a2613eace1 [automerger skipped] storageproxyd: Add logging of failed RPMB transactions am: bf6e22a318 -s ours
am skip reason: Merged-In I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa with SHA-1 642d977bc8 is already in history

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

Change-Id: Ifa30cff385ebaf558bde531b0bbc2777f9fbdd4b
2021-10-05 19:21:58 +00:00
Stephen Crane d10e28fc29 [automerger skipped] storageproxyd: Add file handle param to debug buffer print am: 4ee811ee46 -s ours
am skip reason: Merged-In Iade322a21312a676b3599bddafdfc43b599617ea with SHA-1 3bb483b196 is already in history

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

Change-Id: I3e4dc6d20f02fcfcb5118adc7c21caa1fde4df06
2021-10-05 19:21:58 +00:00
Stephen Crane ab2257ee48 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: 194712579
Change-Id: Ib970e779365bb396756c114684c7f6e56a737ab1
Merged-In: Ib970e779365bb396756c114684c7f6e56a737ab1
(cherry picked from commit a9085181afaa80ac8b4cfb82a6762e336b1e2500)
2021-10-05 09:56:43 -07:00
Stephen Crane 237679cfca storageproxyd: Fix inverted conditional in error checking
check_scci_sense (now renamed unexpected_scsi_sense) was supposed to
return false iff the sense data was valid and did not contain an error.
This return value was inverted. Invert the return values and rename the
function to clarify its role.

Test: m storageproxyd
Bug: 195544379
Change-Id: I3b84188aabe58345a83d2fd57bb8103e730cf365
Merged-In: I3b84188aabe58345a83d2fd57bb8103e730cf365
2021-10-05 09:56:34 -07:00
Stephen Crane 77e2af18be [storageproxyd] Dump binary buffers to log instead of stderr
Rewrites the buffer logging to print to the Android log instead of
stderr. The storageproxyd service is started by init and stderr is not
logged anywhere. Because we want to log sense data errors under normal
operation, we need to log to logcat instead of stderr.

Test: Define RPMB_DEBUG, build for qemu-trusty, run, inspect logcat
Bug: 195544379
Change-Id: Iecc0d4680420bb92c94be628789093888a2f1941
Merged-In: Iecc0d4680420bb92c94be628789093888a2f1941
2021-10-05 09:55:10 -07:00
Stephen Crane bf6e22a318 storageproxyd: Add logging of failed RPMB transactions
Adds parsing and logging of SCSI errors from SG_IO calls for RPMB. Does
not alter behavior of the RPMB proxy in response to these errors.

Test: m storageproxyd
Bug: 195544379
Change-Id: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
Merged-In: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
2021-10-05 09:55:03 -07:00
Stephen Crane 4ee811ee46 storageproxyd: Add file handle param to debug buffer print
Adds a file handle parameter to the debug print_buf function to allow
printing to either stdout or stderr.

Test: m storageproxyd
Bug: 195544379
Change-Id: Iade322a21312a676b3599bddafdfc43b599617ea
Merged-In: Iade322a21312a676b3599bddafdfc43b599617ea
(cherry picked from commit 3bb483b196)
2021-10-05 09:54:58 -07:00
Stephen Crane d1a212e0d8 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: 194712579
Change-Id: Ib970e779365bb396756c114684c7f6e56a737ab1
Merged-In: Ib970e779365bb396756c114684c7f6e56a737ab1
(cherry picked from commit a9085181afaa80ac8b4cfb82a6762e336b1e2500)
2021-10-04 18:50:24 +00:00
Stephen Crane dcdac24306 storageproxyd: Fix inverted conditional in error checking
check_scci_sense (now renamed unexpected_scsi_sense) was supposed to
return false iff the sense data was valid and did not contain an error.
This return value was inverted. Invert the return values and rename the
function to clarify its role.

Test: m storageproxyd
Bug: 195544379
Change-Id: I3b84188aabe58345a83d2fd57bb8103e730cf365
Merged-In: I3b84188aabe58345a83d2fd57bb8103e730cf365
2021-09-24 14:35:04 -07:00
Stephen Crane 1d9e35c5bf Merge changes Iecc0d468,I928ddebc,Iade322a2 into sc-qpr1-dev
* changes:
  [storageproxyd] Dump binary buffers to log instead of stderr
  storageproxyd: Add logging of failed RPMB transactions
  storageproxyd: Add file handle param to debug buffer print
2021-09-17 23:17:52 +00:00
Akilesh Kailash d6383199e8 Merge changes I779184f1,I241ee11d into sc-qpr1-dev
* changes:
  libsnapshot: Error handling after QuerySnapshotStatus
  snapuserd: I/O request on sectors not mapping to any COW op
2021-09-17 18:17:51 +00:00
Akilesh Kailash ab12b4e8ff libsnapshot: Error handling after QuerySnapshotStatus
QuerySnapshotStatus will capture the error codes
from dm-snapshot if there are any snapshot related
failure. Handle the error codes and fail the
QuerySnapshotStatus call.

Validate snapshot status in MapSnapshot(). If
the mode is set to Persistent and snapshot status
is in Merging state, then forcefully set the
mode to Merge state.

Bug: 198265278
Test: Full/incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I779184f1998b23edacd6e780acf2676442004340
Merged-In: I779184f1998b23edacd6e780acf2676442004340
2021-09-17 18:16:20 +00:00
Akilesh Kailash f7185915be snapuserd: I/O request on sectors not mapping to any COW op
If there is an I/O request which doesn't map to any
COW Operation in the vector mapping, then that request
is an EOF request and should not be discarded with an
I/O error.

Bug: 198787355
Test: Incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I241ee11d7cf540854aa4a232bc1b18da43d41e05
Merged-In: I241ee11d7cf540854aa4a232bc1b18da43d41e05
2021-09-17 18:14:42 +00:00
Stephen Crane f647221827 [storageproxyd] Dump binary buffers to log instead of stderr
Rewrites the buffer logging to print to the Android log instead of
stderr. The storageproxyd service is started by init and stderr is not
logged anywhere. Because we want to log sense data errors under normal
operation, we need to log to logcat instead of stderr.

Test: Define RPMB_DEBUG, build for qemu-trusty, run, inspect logcat
Bug: 195544379
Change-Id: Iecc0d4680420bb92c94be628789093888a2f1941
Merged-In: Iecc0d4680420bb92c94be628789093888a2f1941
2021-09-15 18:14:18 -07:00
Stephen Crane 642d977bc8 storageproxyd: Add logging of failed RPMB transactions
Adds parsing and logging of SCSI errors from SG_IO calls for RPMB. Does
not alter behavior of the RPMB proxy in response to these errors.

Test: m storageproxyd
Bug: 195544379
Change-Id: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
Merged-In: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
2021-09-15 18:14:18 -07:00
Stephen Crane 3bb483b196 storageproxyd: Add file handle param to debug buffer print
Adds a file handle parameter to the debug print_buf function to allow
printing to either stdout or stderr.

Test: m storageproxyd
Bug: 195544379
Change-Id: Iade322a21312a676b3599bddafdfc43b599617ea
Merged-In: Iade322a21312a676b3599bddafdfc43b599617ea
2021-09-15 18:14:18 -07:00
David Anderson 5932ed07db libsnapshot: Fix new partitions not transitioning in second-stage init.
Bug: 196922070
Test: vts_libsnapshot_test
Merged-In: If8a7afde218fd719e4426dc1dda41f53a4e6544b
Change-Id: If8a7afde218fd719e4426dc1dda41f53a4e6544b
2021-09-15 00:43:20 +00:00
David Anderson 0a6f250242 libsnapshot: Fix missing source partitions when adding a new partition.
When adding a new partition, don't attempt to map a source partition
during boot, because none exists. Instead use the base device.

Bug: 196922070
Test: vts_libsnapshot_test
Change-Id: Ice6015237b0a76a0210819994433e52159376393
Merged-In: Ice6015237b0a76a0210819994433e52159376393
2021-08-25 00:02:39 +00:00
Bart Van Assche d5a663fde4 Reduce the queue depth of loop devices used by the zram driver am: 1a9cad816d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584614

Change-Id: Id0a6c5b0e7c9cb118df02a9be768b3f68dde43a9
2021-08-18 20:04:09 +00:00
Bart Van Assche 1a9cad816d Reduce the queue depth of loop devices used by the zram driver
Make the queue depth of loop devices identical to that of the underlying
storage device. This patch reduces latency by lowering the queue depth.
With this patch applied I see the following:

 # cat /sys/block/loop30/queue/nr_requests
32

Bug: 194450129
Test: Built Android images, installed these and verified that the queue depth of loop devices is 32 instead of 256.
Merged-In: Ifa16084c7df3a54d9559c2388abc4a8392ff88c6
Change-Id: Icc89e1f88d2f0ade2805999afef556b15b7ff8eb
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-18 11:00:31 -07:00
TreeHugger Robot b155a9a8a1 Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev am: de0cc6cc59
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584613

Change-Id: I1221648f11e6fd2ccae40b1ad5d335c31ff8efa1
2021-08-17 05:52:31 +00:00
TreeHugger Robot 10e14c95bc Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev am: 232ec664b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584612

Change-Id: I687f47d10a8aa8c955aab5e3c630f2c735e82c19
2021-08-17 05:52:19 +00:00
TreeHugger Robot caef6def08 Merge "Rename two local variables" into sc-dev am: d95943088e
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584611

Change-Id: I1a7057d9dd955d425446985cf2ab16955efaa8ce
2021-08-17 05:52:07 +00:00
TreeHugger Robot de0cc6cc59 Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev 2021-08-17 05:38:11 +00:00
TreeHugger Robot 232ec664b1 Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev 2021-08-17 05:38:09 +00:00
TreeHugger Robot d95943088e Merge "Rename two local variables" into sc-dev 2021-08-17 05:38:07 +00:00
TreeHugger Robot ec759fe14d Merge "Handle long responses by keymint IPC." into sc-dev am: a707c28937
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15515450

Change-Id: I87baacb3d5ac3854d648cecea3a615132e0d36db
2021-08-16 20:24:24 +00:00
TreeHugger Robot a707c28937 Merge "Handle long responses by keymint IPC." into sc-dev 2021-08-16 20:07:15 +00:00
Bart Van Assche 9e54a90e54 libdm: Export ExtractBlockDeviceName()
Make this function available to libdm users. A caller outside libdm will
be added by a later patch.

Bug: 194450129
Test: mm libfs_mgr libdm_test
Merged-In: I3e3560f3cdef8978eac644d5b53cf3851209c0c2
Change-Id: Ic05cc84565952662178bb649ec97cad6f76dcf92
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16 11:04:40 -07:00
Bart Van Assche 96b21cc589 libdm: Make ExtractBlockDeviceName() return its result
From https://engdoc.corp.google.com/eng/doc/devguide/cpp/styleguide.md:
"Prefer using return values over output parameters: they improve
readability, and often provide the same or better performance (see the C++
Primer)." Implement this advice for ExtractBlockDeviceName(). This patch
does not change any functionality.

Bug: 194450129
Test: mm libfs_mgr libdm_test
Merged-In: I6363781163eba08e6128507b403200f472f68a59
Change-Id: I7d340b33281ebccded0836cd0b5a293e941f4043
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16 11:04:35 -07:00
Bart Van Assche c554240e64 Rename two local variables
Improve code readability by renaming 'device' into 'loop_device' and
'device_fd' into 'loop_fd'.

Bug: 194894000
Test: Built Android images and installed these on an Android device.
Merged-In: Ia9c2d7a525e727f8706e66631b97fc4678c6a4d9
Change-Id: I3fa0c9ca53277b621bb5b81aca394a3079c6e0a3
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16 11:04:18 -07:00
Max Bires a19f6e3940 Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev am: 98f87ca8a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15481660

Change-Id: Ifdee480b05d57c18f488365c7329b78417eb2774
2021-08-15 18:09:28 +00:00
Max Bires 98f87ca8a7 Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev 2021-08-15 17:55:48 +00:00
Xin Li 78993f1baf [automerger skipped] Merge stage-aosp-sc-ts-dev before making it an upstream am: dc9e8e5084 -s ours
am skip reason: Merged-In I3735e0752a6e502536000bd3102abda30cbd58fe with SHA-1 84b4353790 is already in history

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

Change-Id: If7b98731765d23bafcf1299c4be89eb09e050771
2021-08-13 20:53:29 +00:00
Xin Li dc9e8e5084 Merge stage-aosp-sc-ts-dev before making it an upstream
Bug: 169893837
Merged-In: I3735e0752a6e502536000bd3102abda30cbd58fe
Change-Id: I0e78f7e9c3f27e44d1c04bbd138e840829a3dc84
2021-08-13 18:27:12 +00:00
The Android Open Source Project 65335e200f Merge ab/7633965
Bug: 169893837
Merged-In: I7afea72a15b1a2a7aa676bddd12ea4a2dd896f81
Change-Id: Id30ca5943b34b6fffc1f203667b5a59a79950f67
2021-08-12 22:27:46 +00:00
Eric Biggers 1312688506 Merge "fs_mgr: Look for fstab file in /system/etc" into sc-qpr1-dev 2021-08-12 21:15:37 +00:00
David Anderson d92cd94d81 Merge "fastbootd: Delete all VAB partitions during "flashall"." into sc-qpr1-dev 2021-08-12 18:00:22 +00:00