From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 615983EC2F7 for ; Fri, 8 May 2026 13:30:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247007; cv=none; b=XU/WXSoBBSrFNI6nFGdC2DZwuUgswMP42M6WmfR3+nVFbxyxSClqDwAva79BGaQzWk80Qdl4M5A9xoVJZ+WEeKCuTuZFvrodDFtZ8TXZsMmzBQDM0XMyTZVt9B0QTx9tFNvFj3KQx7KPMYkQb+Cw0VihgN9houLnyw0R7QeAi58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247007; c=relaxed/simple; bh=uyYkZ5uqUZQ+QGMgAdLm/kZa+B81Ng0dm9JLLvnXZ0g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hG2xrom2m6UbzK0fgf627de3/s7fq5+ZiO7d1MolFJkoyPPWRBl5wnxPdlCP7ftzvzrSxywzJc0uAFDM6WyZmaM6YTdSKa5BRKsg3g/YY0H0g5ch4YemGWTVF0txQ4NOs6NC5puwPEYWKJaw8XPszaWJWzYxgWQbP4h8FR7sjYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jZavdyP6; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jZavdyP6" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4896c22fcbaso18947055e9.0 for ; Fri, 08 May 2026 06:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778246995; x=1778851795; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LPdLG9b6+gVEWmXelKlZLFtYDXWsxPjiNSMY1dN9Jug=; b=jZavdyP6rLtwp+HCjOZQ6c0k7N6B27cXTvq+13K+jf21kGPacAwk2E7Eo129AjpvYD VAtfYQzHsJ6byV0xaaW9GRSBsiB0SFo6g+IBihkaSFX/8rJvHvLacq3Gy8rjnDxKKevA UvEli35coR4C2Y1DJgnJiFB79kPCXpkfrglBtHxj+Y2kRI7xOHtMjZwgZSGDiOlXYOhb 8SKjXTKdDtrBOG0KYMAknT9ttkXPSiv1hvW4yEUHsxyx0k7iRViYBJqUD7gRTIDWrp3z QLHqnLVhQ6Gn4tWTHzSCYsYEVYaDIdOExqFE/ca105e2plQyXbN2MdOVRC4shmA95cOC 0Rvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778246995; x=1778851795; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LPdLG9b6+gVEWmXelKlZLFtYDXWsxPjiNSMY1dN9Jug=; b=bEpnhUZZGxbZ8uN4ha9R9D0f1c9N1epJxlQjPY03/t1GshBEq9PZ64f3lVK49snOrL t+gSxm/H0Zr3xgDHQ28BYHKqg1ITxb7NXVFUp2K5Gh1d4cHRB9ZKHxf82DQAor36wF+C /2ZapeVvPEb/CwpRYefuqEK7vR85fg95f30Hp1UODUHWPkgFoz6JJF89EqupmFBbBvIy DVtx+wjYRe7gznhmehyedOQbfIdInLVAhV8487n+Fbdf/N49j+ay6C1Ke9ShbzL9uVG5 dCTjN4q2vVNj1f+moDtSShKtGKJmTtQfuYXAbL6rVRvocBq3lyhOeW2UTZPljQ5QE1lJ cS+Q== X-Forwarded-Encrypted: i=1; AFNElJ95Aem40eVmiopZPMBC2Q41wOXWOQoM6rZrR5e4fZqlqraFOQg+ILg4GZxAwOxkbEBUZUk4EPkZtt5LnjA=@vger.kernel.org X-Gm-Message-State: AOJu0YzH3oJumPNJ2AeqKv7HTIg3x6QcS2Iz/gOJG9RYNoo7IxsfIfSB fr1qmiMzqu3FISKstdKGmvbiJpIJbcoGqOL0d6KXG7RwcGS/zRJeQfg98zfsdSV6nVs= X-Gm-Gg: Acq92OHqWsyLRu+EvvqnLSc9BKcNrKbV7vbUNhoDEe/atKMeXmwzvfQrQCs4cf+zGVM Xw1V3fzJl4ti7+vqobKftzSNtjUiYGffF4tYx+vRFYs7sAfJVW4imR2ZIGNPty60jEpcg3/F8Fv bM8SsY/VWEmOHvSW0iK6pv7yaDGP5fre7aFrWuucPpmHfmXJbZhXMuFZwtEWRuGf8IfUxw0yP4s TlXAZ/GUlg2dwvCCJwa3pqyOfohHgdPL5v68++9TODBroukv2vBUAupB52euz46uWtcA68AsKI/ nSR69J5tiWl62a9WDautmKGcHIgSO3bAsjlNQHRmDT6WnqmRL8OGj/555+chQsQgCEiJChyzd/T vt92yUUmxILtjyLZRz9DgFWRPaA0cAuxYcEuQC1Se7QUstWL/J23uu06iiJX1tTBDmIE9MCpydP tlCneGwpK+fmh8HsHGF348tflQb5Fh X-Received: by 2002:a05:6000:1848:b0:454:86d:b4d2 with SMTP id ffacd0b85a97d-454086db4famr6132859f8f.8.1778246994990; Fri, 08 May 2026 06:29:54 -0700 (PDT) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-454916df968sm4345986f8f.25.2026.05.08.06.29.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 May 2026 06:29:54 -0700 (PDT) Message-ID: Date: Fri, 8 May 2026 14:29:53 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 5/6] perf test: Add inject ASLR test To: Ian Rogers Cc: adrian.hunter@intel.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, acme@kernel.org, gmx@google.com, namhyung@kernel.org References: <20260506004546.3140141-1-irogers@google.com> <20260508082726.2795191-1-irogers@google.com> <20260508082726.2795191-6-irogers@google.com> Content-Language: en-US From: James Clark In-Reply-To: <20260508082726.2795191-6-irogers@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 08/05/2026 9:27 am, Ian Rogers wrote: > Add a new shell test `inject_aslr.sh` to verify the `perf inject --aslr` > feature. The test covers: > - Basic address remapping for user space samples. > - Pipe mode coverage for `perf record` piped into `perf inject --aslr`. > - Callchain address remapping. > - Consistency of `perf report` output before and after injection. > - Pipe mode report consistency. > - Dropping of samples that leak ASLR info (physical addresses). > - Kernel address remapping (utilizing a dedicated kernel-intensive VFS dd workload > to guarantee continuous timer interrupts sampling flow inside kernel privilege states). > - Kernel report consistency with address normalization. > > The test suite is hardened with global 'set -o pipefail' assertions to catch > pipeline failures, stream-consuming awk processors to handle SIGPIPE signals, > and a dedicated pipe output scenario validating raw 'perf inject -o -' stdout > streams. > > Assisted-by: Gemini-CLI:Google Gemini 3 > Signed-off-by: Ian Rogers > --- > v6: Refactor kernel-space sampling test cases to utilize a dedicated > system-call intensive VFS dd workload (kprog) instead of purely > userspace-bound tight loops, guaranteeing high-density kernel > privilege state sampling streams and eliminating intermittent > execution flakiness dropouts. > Hi Ian, V5 passed on X86, but now I get this test failing about 50% of the time with output like: Test user register stripping User registers stripping test [Failed - report parsing differs] Showing first 20 lines of diff: --- /tmp/perf-test-aslr.ssH9urcfri/report_regs1.clean 2026-05-08 14:14:02.127298207 +0100 +++ /tmp/perf-test-aslr.ssH9urcfri/report_regs2.clean 2026-05-08 14:14:02.129298219 +0100 @@ -30,8 +30,8 @@ 0.02% perf ld-linux-x86-64.so.2 [.] mmap64 0.02% perf-noploop [kernel.kallsyms] [k] kmem_cache_free 0.02% perf-noploop [kernel.kallsyms] [k] nohz_balancer_kick - 0.02% perf-noploop [kernel.kallsyms] [k] pvclock_gtod_notify 0.02% perf-noploop [kernel.kallsyms] [k] try_to_wake_up + 0.02% perf-noploop [kvm] [k] pvclock_gtod_notify 0.02% perf-noploop libc.so.6 [.] __cxa_finalize 0.04% perf ld-linux-x86-64.so.2 [.] strcmp 0.05% perf libLLVM-15.so.1 [.] llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) ---- end ---- or: Test user register stripping User registers stripping test [Failed - report parsing differs] Showing first 20 lines of diff: --- /tmp/perf-test-aslr.NoDUUXtHyh/report_regs1.clean 2026-05-08 14:05:31.109246491 +0100 +++ /tmp/perf-test-aslr.NoDUUXtHyh/report_regs2.clean 2026-05-08 14:05:31.111246503 +0100 @@ -2,8 +2,8 @@ 0.01% perf [kernel.kallsyms] [k] find_mergeable_anon_vma 0.01% perf [kernel.kallsyms] [k] finish_fault 0.01% perf [kernel.kallsyms] [k] pte_offset_map_rw_nolock + 0.02% perf [amdgpu] [k] amdgpu_device_rreg 0.02% perf [kernel.kallsyms] [k] __alloc_frozen_pages_noprof - 0.02% perf [kernel.kallsyms] [k] amdgpu_device_rreg 0.02% perf [kernel.kallsyms] [k] __build_id_parse.isra.0 0.02% perf [kernel.kallsyms] [k] filemap_get_entry 0.02% perf [kernel.kallsyms] [k] filemap_map_pages ---- end ---- And on Arm I get a hang/infinite loop every time in "Test kernel ASLR remapping". Looks like it could be related to the changes in V6 as I didn't see it on V5: #0 __read_once_size (size=4, res=0xffffe56c64a0, p=0xaaaaeaedbab8) at linux/tools/include/linux/compiler.h:180 #1 atomic_read (v=0xaaaaeaedbab8) at linux/tools/include/asm-generic/atomic-gcc.h:26 #2 0x0000aaaaaf65cd6c in refcount_read (r=0xaaaaeaedbab8) at linux/tools/include/linux/refcount.h:70 #3 0x0000aaaaaf65d9dc in check_invariants (maps=0xaaaae7e3b480) at util/maps.c:114 #4 0x0000aaaaaf65eef8 in maps__insert (maps=0xaaaae7e3b480, map=0xaaaaec2ccf10) at util/maps.c:536 #5 0x0000aaaaaf62a028 in maps__split_kallsyms (kmaps=0xaaaae7e3b480, dso=0xaaaae7e3f910, delta=1879048192, initial_map=0xaaaae7e3fab0) at util/symbol.c:986 #6 0x0000aaaaaf62b550 in __dso__load_kallsyms (dso=0xaaaae7e3f910, filename=0xaaaae7e55200 "/proc/kallsyms", map=0xaaaae7e3fab0, no_kcore=false) at util/symbol.c:1530 #7 0x0000aaaaaf62b5bc in dso__load_kallsyms (dso=0xaaaae7e3f910, filename=0xaaaae7e55200 "/proc/kallsyms", map=0xaaaae7e3fab0) at util/symbol.c:1536 #8 0x0000aaaaaf62cbc0 in dso__load_kernel_sym (dso=0xaaaae7e3f910, map=0xaaaae7e3fab0) at util/symbol.c:2125 #9 0x0000aaaaaf62bc5c in dso__load (dso=0xaaaae7e3f910, map=0xaaaae7e3fab0) at util/symbol.c:1721 #10 0x0000aaaaaf65b98c in map__load (map=0xaaaae7e3fab0) at util/map.c:351 #11 0x0000aaaaaf5e43cc in thread__find_map (thread=0xaaaae7e443b0, cpumode=1 '\001', addr=18446603336494207932, al=0xffffe56c8c28) at util/event.c:744 #12 0x0000aaaaaf5e4810 in machine__resolve (machine=0xaaaae7e3bee0, al=0xffffe56c8c28, sample=0xffffe56c8df0) at util/event.c:818 #13 0x0000aaaaaf41d850 in process_sample_event (tool=0xffffe56c93d0, event=0xffffb1091ec8, sample=0xffffe56c8df0, evsel=0xaaaae7e3b580, machine=0xaaaae7e3bee0) at builtin-script.c:2686 #14 0x0000aaaaaf6668f4 in evlist__deliver_sample (evlist=0xaaaae7e3c550, tool=0xffffe56c93d0, event=0xffffb1091ec8, sample=0xffffe56c8df0, evsel=0xaaaae7e3b580, machine=0xaaaae7e3bee0) at util/session.c:1335 #15 0x0000aaaaaf667000 in machines__deliver_event (machines=0xaaaae7e3bee0, evlist=0xaaaae7e3c550, event=0xffffb1091ec8, sample=0xffffe56c8df0, tool=0xffffe56c93d0, file_offset=3784, file_path=0xaaaae7e3b540 "/tmp/perf-test-aslr.J1XB8pvpFy/perf.data2.kernel.FA0Uvd") at util/session.c:1502 #16 0x0000aaaaaf667538 in perf_session__deliver_event (session=0xaaaae7e3bca0, event=0xffffb1091ec8, tool=0xffffe56c93d0, file_offset=3784, file_path=0xaaaae7e3b540 "/tmp/perf-test-aslr.J1XB8pvpFy/perf.data2.kernel.FA0Uvd") at util/session.c:1593 #17 0x0000aaaaaf662bbc in ordered_events__deliver_event (oe=0xaaaae7e3c460, event=0xaaaae7e44740) at util/session.c:134 #18 0x0000aaaaaf672c98 in do_flush (oe=0xaaaae7e3c460, show_progress=true) at util/ordered-events.c:245 #19 0x0000aaaaaf673048 in __ordered_events__flush (oe=0xaaaae7e3c460, how=OE_FLUSH__FINAL, timestamp=0) at util/ordered-events.c:324 #20 0x0000aaaaaf673154 in ordered_events__flush (oe=0xaaaae7e3c460, how=OE_FLUSH__FINAL) at util/ordered-events.c:342 #21 0x0000aaaaaf669e54 in __perf_session__process_events (session=0xaaaae7e3bca0) at util/session.c:2508 #22 0x0000aaaaaf66a790 in perf_session__process_events (session=0xaaaae7e3bca0) at util/session.c:2675 #23 0x0000aaaaaf41f59c in __cmd_script (script=0xffffe56c93d0) at builtin-script.c:3241 #24 0x0000aaaaaf4242b0 in cmd_script (argc=0, argv=0xffffe56cb370) at builtin-script.c:4586 #25 0x0000aaaaaf4a03f8 in run_builtin (p=0xaaaaafa14e60 , argc=3, argv=0xffffe56cb370) at perf.c:348 #26 0x0000aaaaaf4a066c in handle_internal_command (argc=3, argv=0xffffe56cb370) at perf.c:398 #27 0x0000aaaaaf4a0824 in run_argv (argcp=0xffffe56cb1ac, argv=0xffffe56cb1a0) at perf.c:442 #28 0x0000aaaaaf4a0b4c in main (argc=3, argv=0xffffe56cb370) at perf.c:549