Merge tag 'android-13.0.0_r52' into int/13/fp3
Android 13.0.0 Release 52 (TQ3A.230605.012)
* tag 'android-13.0.0_r52':
syscall01: use 32bit syscalls if available
BACKPORT: clock_gettime04: set threshold based on the clock resolution
added ltp_1 sysfs at Test case 9 before starting echo to this sysfs
Add support for qvm hypervisor
Delete test/temp file for lftest
UPSTREAM: Skip oversleep checks in timer tests under VM
Enhanced detection of KVM
UPSTREAM: tst_is_virt(): Allow checking for any hypervisor
Change-Id: I136e4340a587fbbc7cfaaa3f13c09f90d4c8f260
diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
index fc3ad1b..8c282f2 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
@@ -168,6 +168,7 @@
# Test that notify_on_release can be changed
test9()
{
+ create_subgroup "$start_path/ltp_1"
local notify=$(ROD cat "$start_path/ltp_1/notify_on_release")
local value
diff --git a/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c b/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
index a8d2c5b..c279da7 100644
--- a/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
+++ b/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
@@ -35,7 +35,7 @@
};
static gettime_t ptr_vdso_gettime, ptr_vdso_gettime64;
-static long long delta = 5;
+static long long delta, precise_delta, coarse_delta;
static inline int do_vdso_gettime(gettime_t vdso, clockid_t clk_id, void *ts)
{
@@ -92,9 +92,18 @@
static void setup(void)
{
+ struct timespec res;
+
+ clock_getres(CLOCK_REALTIME, &res);
+ precise_delta = 5 + res.tv_nsec / 1000000;
+
+ clock_getres(CLOCK_REALTIME_COARSE, &res);
+ coarse_delta = 5 + res.tv_nsec / 1000000;
+
if (tst_is_virt(VIRT_ANY)) {
tst_res(TINFO, "Running in a virtual machine, multiply the delta by 10.");
- delta *= 10;
+ precise_delta *= 10;
+ coarse_delta *= 10;
}
find_clock_gettime_vdso(&ptr_vdso_gettime, &ptr_vdso_gettime64);
@@ -108,6 +117,11 @@
int count = 10000, ret;
unsigned int j;
+ if (clks[i] == CLOCK_REALTIME_COARSE || clks[i] == CLOCK_MONOTONIC_COARSE)
+ delta = coarse_delta;
+ else
+ delta = precise_delta;
+
do {
for (j = 0; j < ARRAY_SIZE(variants); j++) {
/* Refresh time in start */
diff --git a/testcases/kernel/syscalls/syscall/syscall01.c b/testcases/kernel/syscalls/syscall/syscall01.c
index 167e6ee..76e7932 100644
--- a/testcases/kernel/syscalls/syscall/syscall01.c
+++ b/testcases/kernel/syscalls/syscall/syscall01.c
@@ -37,7 +37,11 @@
uid_t u1, u2;
u1 = getuid();
+#ifdef SYS_getuid32
+ u2 = syscall(SYS_getuid32);
+#else
u2 = syscall(SYS_getuid);
+#endif
if (u1 == u2) {
tst_res(TPASS, "getuid() == syscall(SYS_getuid)");
@@ -52,7 +56,11 @@
gid_t g1, g2;
g1 = getgid();
+#ifdef SYS_getgid32
+ g2 = syscall(SYS_getgid32);
+#else
g2 = syscall(SYS_getgid);
+#endif
if (g1 == g2) {
tst_res(TPASS, "getgid() == syscall(SYS_getgid)");