From patchwork Fri Aug 26 14:18:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62344ECAAD4 for ; Fri, 26 Aug 2022 14:58:14 +0000 (UTC) Received: from localhost ([::1]:56164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRamj-0004EZ-Ak for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:58:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAn-0000cW-Ky for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:02 -0400 Received: from mout.gmx.net ([212.227.15.15]:57413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00054w-7g for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523534; bh=R2gm0lQxTGcnMIZvJ34PSjuclc+ywl/oXY2R8rzIr+k=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=M209SJRyQMiwuhwwhwkqHJspvAPSdNEOsmXGInFH7zwclZqVpvBx+eWzDZ500t62o vECVv5XBxhezvCr+nPJjvvkBjkR1jzfHXSgfBQy71WLzDJRpG4Pxw1VTN8vapGWTQ8 U3+8S/Rd9gMZPHim8W93tf+I1EGM9KUPNFXy9pbE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MQv8n-1opPkf12Dn-00O0BB; Fri, 26 Aug 2022 16:18:54 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 01/13] linux-user: Add missing signals in strace output Date: Fri, 26 Aug 2022 16:18:41 +0200 Message-Id: <20220826141853.419564-2-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:uaicq9/Q9QOb+faWero1wg99rm8R4Hcdn7SvHEavuv26ibUrlX8 TRofYHdyBEGdlu4varVFsV0ZnnLizBA55f+952Vmuav3MB6rzZZBbLXjOkleUPKCMb5f+Gk ZzWha3KFXnvLqFkULa1lmdevGAGQw2A66pQqsxn9A3O7p82w9p1uFM+YqgyScMpFXIKCoqv V0UYZk7zKjb6FOnwVsbTQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:zVgjOc/oPbM=:0juuHsrDb4InimZ763aQYh 5H+r4kfLGe2JYsjPYurdthHLSOl0VbgtuU83SPFlQAeCwEl54RdT0gxVsQg+HE5BZJ5R2UZly sm47HcFBm8bZLyvhajNNi+TdeGG1rQuXI0LuRL/R23uNhM+x8Vv2+4DPNvfGl1mJncAUIjTqb xnj5eor28XVF06KskUSf1imcu5lmIKIpnfQuxeaIb5vazoLrOBxTczu+r8TQMF2Led/PTw2X2 Ffb2qSTXPhtrcSCzvmDGmlvgV7ES7SlQhZmhA9MTyV/hTZ0FPlmJP7SpqMsKxp5W0q592MyXr 6rrvoTFdaOzSJ+mHO+NfXVLq/gdT+kqC2XvLHdSpSLrp1rXFwjED9zbd6a8F93JVkUdLgXpxh 4GOcy8GqOV/oSJT+IVxqUC2qdou1AaxaXnsb2Cg6d2GuayCRyuAyGcdKe0hasnwHNThbTxZjI euM+svTa+MX9UKeG1afzzOTo5NZZPaDg5amM7TCLKCZnqZho1gQ6Cpv3xG5huZW7hL/utJetg qxbRerFrIlchW6ehQ097HnIKkBFrQgAM6YQJpHLZgvKv/jhHkmHEaHb9fNnn4gdUGpIwOwHec sAfIl8uoag1AoTeF92R5I+5rf3roIG7luueqaEP+vtW3/GbEB4A2SPflcxyUolgpbJCX2YWfm LPImLxqaPNdFLKAFbhTD+Set878NPr/9YgL9vzPIZ/mKxy4SplCklfliurh3VnJeECxSRSTz7 3aNKeKRCiCOlJLHJ5RmRJdZtU72VVq2Mz9uao3bZUE33OkA4LtMtsy7gib1QOTrS09VifPqE3 2eNQNj/cOFCg00wKQqvoUKE7xLxX1IW5hO/P+ZHuahCSVEr0K/jUHHSAGdk3B3lSH0R9tHyV9 Osc8xw824BDm92w2t3xk5QtMEBw5TTGirqDJSxhrQIp6iQmPgORRWbXcVImgW+p27Zd1j/Qyh mDVvzUmAxUn49HZ++wMtM5UJBFd1t75K9zENh64uxScQ95aaP17nk5V2EGHmqpFBBrco5t/82 BhGK8KW69xG1D7PvCSi0+H7H84Djh7htljps0npMH0wYkVfjFaQEhl/zAyDQiTqwVb4+zEWKm R1WGrSzHQcmzQBV3dVuw5Euwjq08lihjeri4s8XJk30Mr8JYXOhIIgIhw== Received-SPF: pass client-ip=212.227.15.15; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UPPERCASE_50_75=0.008 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Some of the guest signal numbers are currently not converted to their representative names in the strace output, e.g. SIGVTALRM. This patch introduces a smart way to generate and keep in sync the host-to-guest and guest-to-host signal conversion tables for usage in the qemu signal and strace code. This ensures that any signals will now show up in both tables. There is no functional change in this patch - with the exception that yet missing signal names now show up in the strace code too. Signed-off-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/signal-common.h | 46 ++++++++++++++++++++++++++++++++++++++ linux-user/signal.c | 37 +++--------------------------- linux-user/strace.c | 31 +++++++++---------------- 3 files changed, 60 insertions(+), 54 deletions(-) -- 2.37.1 diff --git a/linux-user/signal-common.h b/linux-user/signal-common.h index 6a7e4a93fc..c2549bcd3e 100644 --- a/linux-user/signal-common.h +++ b/linux-user/signal-common.h @@ -118,4 +118,50 @@ static inline void finish_sigsuspend_mask(int ret) } } +#ifdef SIGSTKFLT +#define MAKE_SIG_ENTRY_SIGSTKFLT MAKE_SIG_ENTRY(SIGSTKFLT) +#else +#define MAKE_SIG_ENTRY_SIGSTKFLT +#endif + +#ifdef SIGIOT +#define MAKE_SIG_ENTRY_SIGIOT MAKE_SIG_ENTRY(SIGIOT) +#else +#define MAKE_SIG_ENTRY_SIGIOT +#endif + +#define MAKE_SIGNAL_LIST \ + MAKE_SIG_ENTRY(SIGHUP) \ + MAKE_SIG_ENTRY(SIGINT) \ + MAKE_SIG_ENTRY(SIGQUIT) \ + MAKE_SIG_ENTRY(SIGILL) \ + MAKE_SIG_ENTRY(SIGTRAP) \ + MAKE_SIG_ENTRY(SIGABRT) \ + MAKE_SIG_ENTRY(SIGBUS) \ + MAKE_SIG_ENTRY(SIGFPE) \ + MAKE_SIG_ENTRY(SIGKILL) \ + MAKE_SIG_ENTRY(SIGUSR1) \ + MAKE_SIG_ENTRY(SIGSEGV) \ + MAKE_SIG_ENTRY(SIGUSR2) \ + MAKE_SIG_ENTRY(SIGPIPE) \ + MAKE_SIG_ENTRY(SIGALRM) \ + MAKE_SIG_ENTRY(SIGTERM) \ + MAKE_SIG_ENTRY(SIGCHLD) \ + MAKE_SIG_ENTRY(SIGCONT) \ + MAKE_SIG_ENTRY(SIGSTOP) \ + MAKE_SIG_ENTRY(SIGTSTP) \ + MAKE_SIG_ENTRY(SIGTTIN) \ + MAKE_SIG_ENTRY(SIGTTOU) \ + MAKE_SIG_ENTRY(SIGURG) \ + MAKE_SIG_ENTRY(SIGXCPU) \ + MAKE_SIG_ENTRY(SIGXFSZ) \ + MAKE_SIG_ENTRY(SIGVTALRM) \ + MAKE_SIG_ENTRY(SIGPROF) \ + MAKE_SIG_ENTRY(SIGWINCH) \ + MAKE_SIG_ENTRY(SIGIO) \ + MAKE_SIG_ENTRY(SIGPWR) \ + MAKE_SIG_ENTRY(SIGSYS) \ + MAKE_SIG_ENTRY_SIGSTKFLT \ + MAKE_SIG_ENTRY_SIGIOT + #endif diff --git a/linux-user/signal.c b/linux-user/signal.c index 8d29bfaa6b..03b4d5e6ee 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -53,40 +53,9 @@ abi_ulong default_rt_sigreturn; QEMU_BUILD_BUG_ON(__SIGRTMAX + 1 != _NSIG); #endif static uint8_t host_to_target_signal_table[_NSIG] = { - [SIGHUP] = TARGET_SIGHUP, - [SIGINT] = TARGET_SIGINT, - [SIGQUIT] = TARGET_SIGQUIT, - [SIGILL] = TARGET_SIGILL, - [SIGTRAP] = TARGET_SIGTRAP, - [SIGABRT] = TARGET_SIGABRT, -/* [SIGIOT] = TARGET_SIGIOT,*/ - [SIGBUS] = TARGET_SIGBUS, - [SIGFPE] = TARGET_SIGFPE, - [SIGKILL] = TARGET_SIGKILL, - [SIGUSR1] = TARGET_SIGUSR1, - [SIGSEGV] = TARGET_SIGSEGV, - [SIGUSR2] = TARGET_SIGUSR2, - [SIGPIPE] = TARGET_SIGPIPE, - [SIGALRM] = TARGET_SIGALRM, - [SIGTERM] = TARGET_SIGTERM, -#ifdef SIGSTKFLT - [SIGSTKFLT] = TARGET_SIGSTKFLT, -#endif - [SIGCHLD] = TARGET_SIGCHLD, - [SIGCONT] = TARGET_SIGCONT, - [SIGSTOP] = TARGET_SIGSTOP, - [SIGTSTP] = TARGET_SIGTSTP, - [SIGTTIN] = TARGET_SIGTTIN, - [SIGTTOU] = TARGET_SIGTTOU, - [SIGURG] = TARGET_SIGURG, - [SIGXCPU] = TARGET_SIGXCPU, - [SIGXFSZ] = TARGET_SIGXFSZ, - [SIGVTALRM] = TARGET_SIGVTALRM, - [SIGPROF] = TARGET_SIGPROF, - [SIGWINCH] = TARGET_SIGWINCH, - [SIGIO] = TARGET_SIGIO, - [SIGPWR] = TARGET_SIGPWR, - [SIGSYS] = TARGET_SIGSYS, +#define MAKE_SIG_ENTRY(sig) [sig] = TARGET_##sig, + MAKE_SIGNAL_LIST +#undef MAKE_SIG_ENTRY /* next signals stay the same */ }; diff --git a/linux-user/strace.c b/linux-user/strace.c index 7d882526da..a217c1025a 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -17,6 +17,7 @@ #include "qemu.h" #include "user-internals.h" #include "strace.h" +#include "signal-common.h" struct syscallname { int nr; @@ -141,30 +142,20 @@ if( cmd == val ) { \ qemu_log("%d", cmd); } +static const char *target_signal_to_host_signal_table[_NSIG] = { +#define MAKE_SIG_ENTRY(sig) [TARGET_##sig] = #sig, + MAKE_SIGNAL_LIST +#undef MAKE_SIG_ENTRY +}; + static void print_signal(abi_ulong arg, int last) { const char *signal_name = NULL; - switch(arg) { - case TARGET_SIGHUP: signal_name = "SIGHUP"; break; - case TARGET_SIGINT: signal_name = "SIGINT"; break; - case TARGET_SIGQUIT: signal_name = "SIGQUIT"; break; - case TARGET_SIGILL: signal_name = "SIGILL"; break; - case TARGET_SIGABRT: signal_name = "SIGABRT"; break; - case TARGET_SIGFPE: signal_name = "SIGFPE"; break; - case TARGET_SIGKILL: signal_name = "SIGKILL"; break; - case TARGET_SIGSEGV: signal_name = "SIGSEGV"; break; - case TARGET_SIGPIPE: signal_name = "SIGPIPE"; break; - case TARGET_SIGALRM: signal_name = "SIGALRM"; break; - case TARGET_SIGTERM: signal_name = "SIGTERM"; break; - case TARGET_SIGUSR1: signal_name = "SIGUSR1"; break; - case TARGET_SIGUSR2: signal_name = "SIGUSR2"; break; - case TARGET_SIGCHLD: signal_name = "SIGCHLD"; break; - case TARGET_SIGCONT: signal_name = "SIGCONT"; break; - case TARGET_SIGSTOP: signal_name = "SIGSTOP"; break; - case TARGET_SIGTTIN: signal_name = "SIGTTIN"; break; - case TARGET_SIGTTOU: signal_name = "SIGTTOU"; break; - } + + if (arg < _NSIG) + signal_name = target_signal_to_host_signal_table[arg]; + if (signal_name == NULL) { print_raw_param("%ld", arg, last); return; From patchwork Fri Aug 26 14:18:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 111C0ECAAA3 for ; Fri, 26 Aug 2022 15:04:48 +0000 (UTC) Received: from localhost ([::1]:58170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRat6-0004FP-0y for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 11:04:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAq-0000ey-5G for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:04 -0400 Received: from mout.gmx.net ([212.227.15.19]:57737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAm-00054p-PL for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523534; bh=lGtuTq6IJ/giMaYIDVQ+83fjvCGaPohajB0Sqj+QRLE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=kfWB8QyjDjpBaJS5LGWviMKJymPENxpZMm81WrWFqzj8VK2uopi5nxRZdv1wINsfd 6bIoezMiMa1Vo5/BhBHH9QBHhwPC/7/nw+IP/D97ocqMSiN1Ugr7MnXlc4SxPjCJE8 8RY0AVH/0j/+pN33c7zXf9d3Tyhjy84sLELIIOLM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MiaY9-1p6wfZ1Y4V-00ffWP; Fri, 26 Aug 2022 16:18:54 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 02/13] linux-user: Add missing clock_gettime64() syscall strace Date: Fri, 26 Aug 2022 16:18:42 +0200 Message-Id: <20220826141853.419564-3-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:LMMHpx8lJ0pTTnHBT3ZFkWep0qLD6ulu7fY1JmQBdgcDiSe5rWY NeQrTJSgJwBSSssnknNuMtfbcVE8UEfV1bu4BaBQejLCJjkuePhdZMTL6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ih5ldL1hnwfX4IELCdm4jIA3V+dlAtQblxaJQ+seREb0+fo8k REcEt9DqLDwjcmjyp12Sg9Abkj72a3IP0Wyatnrxx0zW/STImN/Or2/GjelOlAZHE0ExT/yIy Lk+44gSqHp3aqMRFhpTYJNwTQ6Q/xmtR+FRqImD66Z+pfxif9hcr0jnJzyk8d//vkwOULVJZo kAWSQMRaCJd5us7HQiW+3r72xYWVzvUlI8GtK0dCutv7ochX7S0/tBJvQ== Received-SPF: pass client-ip=212.227.15.19; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by: Helge Deller --- linux-user/strace.c | 53 ++++++++++++++++++++++++++++++++++++++++++ linux-user/strace.list | 4 ++++ 2 files changed, 57 insertions(+) -- 2.37.1 diff --git a/linux-user/strace.c b/linux-user/strace.c index a217c1025a..27309f1106 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -82,6 +82,7 @@ UNUSED static void print_buf(abi_long addr, abi_long len, int last); UNUSED static void print_raw_param(const char *, abi_long, int); UNUSED static void print_timeval(abi_ulong, int); UNUSED static void print_timespec(abi_ulong, int); +UNUSED static void print_timespec64(abi_ulong, int); UNUSED static void print_timezone(abi_ulong, int); UNUSED static void print_itimerval(abi_ulong, int); UNUSED static void print_number(abi_long, int); @@ -794,6 +795,24 @@ print_syscall_ret_clock_gettime(CPUArchState *cpu_env, const struct syscallname #define print_syscall_ret_clock_getres print_syscall_ret_clock_gettime #endif +#if defined(TARGET_NR_clock_gettime64) +static void +print_syscall_ret_clock_gettime64(CPUArchState *cpu_env, const struct syscallname *name, + abi_long ret, abi_long arg0, abi_long arg1, + abi_long arg2, abi_long arg3, abi_long arg4, + abi_long arg5) +{ + if (!print_syscall_err(ret)) { + qemu_log(TARGET_ABI_FMT_ld, ret); + qemu_log(" ("); + print_timespec64(arg1, 1); + qemu_log(")"); + } + + qemu_log("\n"); +} +#endif + #ifdef TARGET_NR_gettimeofday static void print_syscall_ret_gettimeofday(CPUArchState *cpu_env, const struct syscallname *name, @@ -1651,6 +1670,27 @@ print_timespec(abi_ulong ts_addr, int last) } } +static void +print_timespec64(abi_ulong ts_addr, int last) +{ + if (ts_addr) { + struct target__kernel_timespec *ts; + + ts = lock_user(VERIFY_READ, ts_addr, sizeof(*ts), 1); + if (!ts) { + print_pointer(ts_addr, last); + return; + } + qemu_log("{tv_sec = %lld" + ",tv_nsec = %lld}%s", + (long long)tswap64(ts->tv_sec), (long long)tswap64(ts->tv_nsec), + get_comma(last)); + unlock_user(ts, ts_addr, 0); + } else { + qemu_log("NULL%s", get_comma(last)); + } +} + static void print_timezone(abi_ulong tz_addr, int last) { @@ -2266,6 +2306,19 @@ print_clock_gettime(CPUArchState *cpu_env, const struct syscallname *name, #define print_clock_getres print_clock_gettime #endif +#if defined(TARGET_NR_clock_gettime64) +static void +print_clock_gettime64(CPUArchState *cpu_env, const struct syscallname *name, + abi_long arg0, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + print_syscall_prologue(name); + print_enums(clockids, arg0, 0); + print_pointer(arg1, 1); + print_syscall_epilogue(name); +} +#endif + #ifdef TARGET_NR_clock_settime static void print_clock_settime(CPUArchState *cpu_env, const struct syscallname *name, diff --git a/linux-user/strace.list b/linux-user/strace.list index 72e17b1acf..a78cdf3cdf 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1676,3 +1676,7 @@ #ifdef TARGET_NR_copy_file_range { TARGET_NR_copy_file_range, "copy_file_range", "%s(%d,%p,%d,%p,"TARGET_ABI_FMT_lu",%u)", NULL, NULL }, #endif +#ifdef TARGET_NR_clock_gettime64 +{ TARGET_NR_clock_gettime64, "clock_gettime64" , NULL, print_clock_gettime64, + print_syscall_ret_clock_gettime64 }, +#endif From patchwork Fri Aug 26 14:18:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8718FECAAA3 for ; Fri, 26 Aug 2022 14:31:21 +0000 (UTC) Received: from localhost ([::1]:49440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRaMi-0001Og-M8 for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:31:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAl-0000Zr-Ub for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:18:59 -0400 Received: from mout.gmx.net ([212.227.15.15]:45357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAj-00054q-Ru for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:18:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523534; bh=aJsnrj97Y1sQFl5KVvkfVzLschcSZUtzNhYQejbgZog=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=R8AVgAHEtJrI49GMFwRBMHcXj8X0IdNcVvODU+CNP8fRXxuffl4wSezQdDhcrBs82 LrV61jTM0TbMZ2IbfGIp0w/ZsR//gfz4FDiAVOi/0etlzfevK9XreU+e+j6Mtv6oYr ZYfOWQZV7OhJmt0BMhvDhB90Y6IQov6qQTZYODXU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N79yQ-1pUIHi25GO-017XOo; Fri, 26 Aug 2022 16:18:54 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 03/13] linux-user: Add faccessat2() syscall Date: Fri, 26 Aug 2022 16:18:43 +0200 Message-Id: <20220826141853.419564-4-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:SxsNIlt0oBLPDgPJN4GXHui7fMw0Jsgn5Yejy9ta1tAqFgGBdsg 0uGm1L3edUbdFMgXtzbx+0U7l85qqejR7cQMLtu4F8oTPAv1UGnlw+o14uUfl8j8Ewo1IwZ P1/TErofiCycTfzQaAOwR3ezC1Ssauv7Vw4x9ycFQ0AIHsVR0+49SrcFKrcq9EK6kGZKEyU 84lWoF33iRYHvMmDCNOIQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:uPQpqIAp+mg=:LDRgOHdjFlfMjMORNkwVh9 qitNbPMwRHa2BBQ0bLFjCTGto9tHUdR40VfA6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OwOWfww59eB5jRqHKNE9pMCjmnw== Received-SPF: pass client-ip=212.227.15.15; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add implementation and strace output for faccessat2(). Signed-off-by: Helge Deller --- linux-user/strace.c | 2 +- linux-user/strace.list | 3 +++ linux-user/syscall.c | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) -- 2.37.1 diff --git a/linux-user/strace.c b/linux-user/strace.c index 27309f1106..e8c63aa4c2 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1962,7 +1962,7 @@ print_execv(CPUArchState *cpu_env, const struct syscallname *name, } #endif -#ifdef TARGET_NR_faccessat +#if defined(TARGET_NR_faccessat) || defined(TARGET_NR_faccessat2) static void print_faccessat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, diff --git a/linux-user/strace.list b/linux-user/strace.list index a78cdf3cdf..6e88da7fad 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -177,6 +177,9 @@ #ifdef TARGET_NR_faccessat { TARGET_NR_faccessat, "faccessat" , NULL, print_faccessat, NULL }, #endif +#ifdef TARGET_NR_faccessat2 +{ TARGET_NR_faccessat2, "faccessat2" , NULL, print_faccessat, NULL }, +#endif #ifdef TARGET_NR_fadvise64 { TARGET_NR_fadvise64, "fadvise64" , NULL, NULL, NULL }, #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f409121202..f51c4fbabd 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -399,6 +399,9 @@ _syscall3(int, ioprio_set, int, which, int, who, int, ioprio) #if defined(TARGET_NR_getrandom) && defined(__NR_getrandom) _syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags) #endif +#if defined(TARGET_NR_faccessat2) && defined(__NR_faccessat2) +_syscall4(int, faccessat2, int, dirfd, char *, pathname, int, mode, int, flags) +#endif #if defined(TARGET_NR_kcmp) && defined(__NR_kcmp) _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type, @@ -9098,6 +9101,15 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, unlock_user(p, arg2, 0); return ret; #endif +#if defined(TARGET_NR_faccessat2) && defined(__NR_faccessat2) + case TARGET_NR_faccessat2: + if (!(p = lock_user_string(arg2))) { + return -TARGET_EFAULT; + } + ret = get_errno(faccessat2(arg1, p, arg3, arg4)); + unlock_user(p, arg2, 0); + return ret; +#endif #ifdef TARGET_NR_nice /* not on alpha */ case TARGET_NR_nice: return get_errno(nice(arg1)); From patchwork Fri Aug 26 14:18:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6EACECAAD4 for ; Fri, 26 Aug 2022 14:42:01 +0000 (UTC) Received: from localhost ([::1]:37726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRaX2-0004IR-Rz for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAm-0000aT-5c for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:00 -0400 Received: from mout.gmx.net ([212.227.15.15]:50933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00054s-31 for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:18:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523534; bh=Rm37/UMtMZy/vrc/Mh4Erf/0gMnHLsIB/UJJVZ50obo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=RKG0/9YkJiAgwX1e+L3yEBB8Pw1yQqAPQd1pRmYUljkblLq6cyTLVPIxEHnEixR+B 6vbF6m/wRvQnwVgKjdkkQl7NAcDp184y+n7R5gwWn27KrJxNtjr1qzdfWoMff7cTH/ 3n/n+yRPOQ//Fcku2PlWh9+f9DmblDW2vMyVeGec= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MRTN9-1oormt2daH-00NSDP; Fri, 26 Aug 2022 16:18:54 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 04/13] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls Date: Fri, 26 Aug 2022 16:18:44 +0200 Message-Id: <20220826141853.419564-5-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:lYz7os+2Ot5XYZ0+JTUfz6mfB9umwxXXmb9x1CPh/Wo2Tq/9zUn rr1bTGtJt1DNDZD1+u3XQDh7KB1QM5jKdV0DqRmv0LuohK7dN4/3pGo1MGX3aOL7HiqOCKe nKmaLwtlfjeBERIhRArWG38Su732SnY6Y4ricI+prruPqOfOjazBQChifEsf35GkysmHJ8L oiSEogAp8msK1VDRaQmzg== X-UI-Out-Filterresults: notjunk:1;V03:K0:QYvPT7KFr+Q=:WhogArtIAgrk06tTbSMRbP j1X1FcSv0rLT+W2fNpMmr7l+GO6i0ZLJh1gfRyi3I1Jwon8zgXG/hhzrLmgQc97Rlfj4IJBIG RVHUY6LpVj3VELIjrHjc9qvaFWyIYaHmlzt9lQwToYDKuI+okNBMWo8jkQKaefUfMkgMPecd7 U5LOwk9Y/niKga7ueF++465BobSg7jzRL9F67YYDXZB2DmnEnxCnq1eMTUxnch7C4UfNWZ6Qd XhxOxoLx5OGqWryZtzAeHRZ2y69egunwkoiFU+9vIAlgtlTuISgLPfiv1aDs6b4U0I8sUuAQZ f9YGCpkmUsOb+hLelVBNFkJCfqb7BgI+ICjguqqer+mBZtjCUoqoDZXCfbu2FBoYEXg1m5aH9 7MGuJLgthAvcgkR+sl4JbE9/5ioqqYtxA/nNoAcYpG6BcT8du+wjq4cEnwjqAqhnKtNua8O38 ZxduevNIecTUTQP9I9nRNs0YwMsOmpKNWePzBS/bhNHoKi4cnWfcFzODyOTcvjkHMoqQ8LS67 /NZtaNms2HLAkykDUnNxG57iwMvWxmqI0CluNdIvazSEUmgqB3v9uMXASqkmQX2UhVCjpQ91V K2vzVNjz09YzXYYoGkvadoQNANUg3N1XwYvtv6Szh/BMAHDqZQsqoEUG5P9tVNFSDISTVgitC uycEi6QznalyPeMsuTHsjb+wq6sLsADPSZrQrEfINB7HOnOJoBl0D45iocpXXWpw80E/aJysZ 0Uk0qqSJFHaujfpxG0vKeFnGoCJB0nYJKRcUyhdKVF3iN/lkYL0oKhT5ccIkMmJWppwKmMha6 GGl0WQKAkyRtFhVdd+yNWRPERhF/B7M0dMQhqT0h92SLcfnEbGRstfCenhK/gCS5R9qnDxxNR vCP32ynL+LxfWVExuOvXVp15w3Ez42vFp7PeVFGoSAammn607GzgXIeJPEg4sHNSgVGQH2Mcm xWRdwZZREc+zEKPLRGsQDEnCWfZunglOuOtsBN4yidHxfi7xnc5d6z/TNVp8E8DHp+jrL9xDa 8ebpeurnKIU9DypixCxYb1dp+ek+n1CAndT89aZOxg1UHvxjpCW12FQ6/nWuULTWSnbW0hVz8 l+jlPDI/HHTscnybxS27Q2f+cHK/7U7dEgfPUlCHUDzfKije2oRmeGOLQ== Received-SPF: pass client-ip=212.227.15.15; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" I noticed those were missing when running the glib2.0 testsuite. Add the syscalls including the strace output. Signed-off-by: Helge Deller --- linux-user/strace.c | 28 ++++++++++++++++++++++++++++ linux-user/strace.list | 9 +++++++++ linux-user/syscall.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) -- 2.37.1 diff --git a/linux-user/strace.c b/linux-user/strace.c index e8c63aa4c2..86b2034c81 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3316,6 +3316,34 @@ print_openat(CPUArchState *cpu_env, const struct syscallname *name, } #endif +#ifdef TARGET_NR_pidfd_send_signal +static void +print_pidfd_send_signal(CPUArchState *cpu_env, const struct syscallname *name, + abi_long arg0, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + void *p; + target_siginfo_t uinfo; + + print_syscall_prologue(name); + print_raw_param("%d", arg0, 0); + print_signal(arg1, 0); + + p = lock_user(VERIFY_READ, arg2, sizeof(target_siginfo_t), 1); + if (p) { + get_target_siginfo(&uinfo, p); + print_siginfo(&uinfo); + + unlock_user(p, arg2, 0); + } else { + print_pointer(arg2, 1); + } + + print_raw_param("%u", arg3, 0); + print_syscall_epilogue(name); +} +#endif + #ifdef TARGET_NR_mq_unlink static void print_mq_unlink(CPUArchState *cpu_env, const struct syscallname *name, diff --git a/linux-user/strace.list b/linux-user/strace.list index 6e88da7fad..7a69152db7 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1667,6 +1667,15 @@ #ifdef TARGET_NR_pipe2 { TARGET_NR_pipe2, "pipe2", NULL, NULL, NULL }, #endif +#ifdef TARGET_NR_pidfd_open +{ TARGET_NR_pidfd_open, "pidfd_open", "%s(%d,%u)", NULL, NULL }, +#endif +#ifdef TARGET_NR_pidfd_send_signal +{ TARGET_NR_pidfd_send_signal, "pidfd_send_signal", NULL, print_pidfd_send_signal, NULL }, +#endif +#ifdef TARGET_NR_pidfd_getfd +{ TARGET_NR_pidfd_getfd, "pidfd_getfd", "%s(%d,%d,%u)", NULL, NULL }, +#endif #ifdef TARGET_NR_atomic_cmpxchg_32 { TARGET_NR_atomic_cmpxchg_32, "atomic_cmpxchg_32", NULL, NULL, NULL }, #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f51c4fbabd..a1e6d4ad53 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -346,6 +346,16 @@ _syscall6(int,sys_futex,int *,uaddr,int,op,int,val, _syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val, const struct timespec *,timeout,int *,uaddr2,int,val3) #endif +#if defined(__NR_pidfd_open) +_syscall2(int, pidfd_open, pid_t, pid, unsigned int, flags); +#endif +#if defined(__NR_pidfd_send_signal) +_syscall4(int, pidfd_send_signal, int, pidfd, int, sig, siginfo_t *, info, + unsigned int, flags); +#endif +#if defined(__NR_pidfd_getfd) +_syscall3(int, pidfd_getfd, int, pidfd, int, targetfd, unsigned int, flags); +#endif #define __NR_sys_sched_getaffinity __NR_sched_getaffinity _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len, unsigned long *, user_mask_ptr); @@ -8686,6 +8696,30 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, ret = do_open_by_handle_at(arg1, arg2, arg3); fd_trans_unregister(ret); return ret; +#endif +#if defined(TARGET_NR_pidfd_open) + case TARGET_NR_pidfd_open: + return get_errno(pidfd_open(arg1, arg2)); +#endif +#if defined(TARGET_NR_pidfd_send_signal) + case TARGET_NR_pidfd_send_signal: + { + siginfo_t uinfo; + + p = lock_user(VERIFY_READ, arg3, sizeof(target_siginfo_t), 1); + if (!p) { + return -TARGET_EFAULT; + } + target_to_host_siginfo(&uinfo, p); + unlock_user(p, arg3, 0); + ret = get_errno(pidfd_send_signal(arg1, target_to_host_signal(arg2), + &uinfo, arg4)); + } + return ret; +#endif +#if defined(TARGET_NR_pidfd_getfd) + case TARGET_NR_pidfd_getfd: + return get_errno(pidfd_getfd(arg1, arg2, arg3)); #endif case TARGET_NR_close: fd_trans_unregister(arg1); From patchwork Fri Aug 26 14:18:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABB5FECAAA3 for ; Fri, 26 Aug 2022 14:54:50 +0000 (UTC) Received: from localhost ([::1]:49392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRajR-0006Ev-Pk for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:54:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAn-0000bz-8y for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:01 -0400 Received: from mout.gmx.net ([212.227.15.18]:42225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00054y-7V for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523534; bh=MvuGN0117Kzch7knV2cMwdQNjBkK08lvfNFVOeDg1no=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=b2pReOEXsGMgD7pTmZyTRUwhIwhzkPz+jFO11I5NGK+c4KKVZ+OVuGuFDtR0KjlwO Ofz42ZgPNwBfdELYrOYUAaocGOXp0JcIQZZ7E7FdB6QDBg5oW3SnZEwym3jRYapFbj ad30QMgIzzPlU82nQz5W5j5+QCnkw7vWnDEBgluQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N9dsV-1pWlGF39rJ-015ced; Fri, 26 Aug 2022 16:18:54 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 05/13] linux-user: Log failing executable in EXCP_DUMP() Date: Fri, 26 Aug 2022 16:18:45 +0200 Message-Id: <20220826141853.419564-6-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:yR+WNuaCaV2cmmWNcsyjggo9bfduiGnNXqd2ahH+7y4zUGBCi3B 6+fTft0yGH9gftgGGD7HKnipJp7yHlaM9bVgupvJEEb5SWa+lZSGHl9C0ZbVNHc3Z22iwcN iNtIRpX1aW2YFdhPi20mul/iM31Ave3iBICZF6zxYCfm50RmhuC1edhSFPYbeT7vXBLM6XD fpc8wZidpgtOfwJr8TBLw== X-UI-Out-Filterresults: notjunk:1;V03:K0:SlZhwamysH0=:dcgk6iKfpkbYtCey8NX8vr IzoAORvLbWobOjuC2uDb43J0TV/hwpk0j1PKV+Hg/2hYGzod7NcVo53efTQiV+aRz3w1qwOk4 KomHzLkXTjxdvJHPipXYZ25nCszopAvtco0F70sj141CsqRe8ylzh+onGzPUMRfd1/Cu6GQdg Pddc69WLoZkTXfGw8zSiG2ftvGIZTL7n2D6JSSiSoqjIYy6xsYHScdLt4fNGd6Y0ZMmfxOQQn VnO4z/MR0E+laRRYOutw914HPqJn59gQj1f57Ig7EyE3fAXOxrVX73VPEl6UbubtTvBQChegt 16MC6b3CCGUDgGdwIfxDmDbuJKJmCtjFuokZz1oXAD0hrkcIz5dgNb4BydPqRwLfcDxhouaYW VeXrytw9iZRXYJiI+fuFpmbEWxC43vp2oMHxhzsFKv/Fj1PhB4cvoSSOQRF2uRGiFr8PBzkEQ tzX7M8WdP0HwaO8+fTd7fevEI/vc/ITyEZ3Se5HDgE/EFhzlaPuHCT9uGMYzIIEOgLM5P9esL zSaUvXH/xf8CoeqZPg8r0hEXv4i4bTM5pcqUNXKdw0qdATUcFVECMZS1391AjZrP7ikXmVKAp MaA/fL4OxXr//99F7pL2a6YsBUERpkxvepJec4yuEgkKZb+qpn6s/o1h/ISfuBQzYUxdTrpMS +CHMR83l4ZhS5N9euYNqx3bU9SkTvTQVEfB66zNSajYEsUT99Ag+kGMwV6399cE7PyotyQoD6 uIXzD+x7BjfmleCfsZNP8Fca6yru+jh9URrjUr8Ps9Aabt0Ry/hsz20Xg+TLvcIkBplosamdg 7d0fHmiKr1ERgJWJHos6dGA7cFmr4kRVOH3lMaEi+PmKaFr9y7ue04d+tb/V9jnquxUZJe2DZ tioBYB+wsWG7LYVCfzSOEnarim0ClA9vFFaH9EsvVP64LjqIrpxYkqzvFsyPD5pdPHUnLFnJG Xl2tYmwS8goBRgIfSSTfb/S2zBsJrg1quEHkno0dH/Bzw8R2TyIMtuRMNsEvJ30hNIkdcvooJ IBTs7GxTWUuOZeXZcMaZz6FXWDugGEJx9OJFlMrRo+jVz/krolDVQY6DdU6VgF0BsLK2wxIsm TbbE+K9AWCuwK+33MaQFpxWHNiXB1CrZBNSsliEVklCFJ+WEyc7VFSlOg== Received-SPF: pass client-ip=212.227.15.18; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Enhance the EXCP_DUMP() macro to print out the failing program too. During debugging it's sometimes hard to track down the actual failing program if you are e.g. building a whole debian package. Signed-off-by: Helge Deller --- linux-user/cpu_loop-common.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.37.1 diff --git a/linux-user/cpu_loop-common.h b/linux-user/cpu_loop-common.h index dc0042e4de..36ff5b14f2 100644 --- a/linux-user/cpu_loop-common.h +++ b/linux-user/cpu_loop-common.h @@ -27,9 +27,11 @@ do { \ CPUState *cs = env_cpu(env); \ fprintf(stderr, fmt , ## __VA_ARGS__); \ + fprintf(stderr, "Failing executable: %s\n", exec_path); \ cpu_dump_state(cs, stderr, 0); \ if (qemu_log_separate()) { \ qemu_log(fmt, ## __VA_ARGS__); \ + qemu_log("Failing executable: %s\n", exec_path); \ log_cpu_state(cs, 0); \ } \ } while (0) From patchwork Fri Aug 26 14:18:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956144 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22F0BECAAD4 for ; Fri, 26 Aug 2022 14:51:22 +0000 (UTC) Received: from localhost ([::1]:42954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRag5-0000ar-6Z for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAn-0000c1-AY for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:01 -0400 Received: from mout.gmx.net ([212.227.15.18]:41217) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00054z-7d for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=tsWpoxJDqEFn2aJCQOHCSQoZo/RrIQWl5fmyVXL9kNY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=FW7hkPfe+fIUrbMhM9/zedRvHt2rxLqeh1KPdOxU0CVmyQrb1SijSvxvIsIIN7vsF HvyyeWGeAuTQwK+lupp2DhlBlXYlgbUAgPlAzUof3Cnagck4lIc6j8oTkqpPjRFCE7 EPlCvr6MI3QtK29J+7fv9q2GEYujZc/0onBe2OZI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxDp4-1pKMeU3e9Y-00xbmU; Fri, 26 Aug 2022 16:18:54 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 06/13] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info Date: Fri, 26 Aug 2022 16:18:46 +0200 Message-Id: <20220826141853.419564-7-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:bHp3KDukoq63jdGetbZKUcdtiOwY2gXydhsTV2dUEBgtSS+Gcqy XKxCpeVI6qW4777+U9BV+Bp6BoQqDiqsf0ACqcjYuSjHNCJJrX9fcYH8DQGqPw9kQXs9QJD nT37UFmM5OJDmohojj1Jaz/OFaVE2AevxRfp3u75ibLPBmHbsM4nwS//Ol5n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W9W1sm3OQwEG3PY8Fm9WwQJHSvyT3r3cd8RNaAV3cS uW6NIEXRMSxGGbBBnmG8S5dYO776oBYec23VnJjPyatdAJ14ogjJRkwzkVbBX1IppMRbVk/9A xwDmJKWy6z4CxrRzzIWx6EpRmigNUXGeo2EEe3wspT/4ZxX3BWqmWVz2A== Received-SPF: pass client-ip=212.227.15.18; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Enhance the hppa linux-user cpu_loop() to show more debugging info on hard errors. Signed-off-by: Helge Deller --- linux-user/hppa/cpu_loop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.37.1 diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 64263c3dc4..1ef3b46191 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -147,12 +147,15 @@ void cpu_loop(CPUHPPAState *env) force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR, env->iaoq_f); break; case EXCP_ILL: + EXCP_DUMP(env, "qemu: got CPU exception 0x%x - aborting\n", trapnr); force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->iaoq_f); break; case EXCP_PRIV_OPR: + EXCP_DUMP(env, "qemu: got CPU exception 0x%x - aborting\n", trapnr); force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->iaoq_f); break; case EXCP_PRIV_REG: + EXCP_DUMP(env, "qemu: got CPU exception 0x%x - aborting\n", trapnr); force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVREG, env->iaoq_f); break; case EXCP_OVERFLOW: @@ -171,7 +174,8 @@ void cpu_loop(CPUHPPAState *env) /* just indicate that signals should be handled asap */ break; default: - g_assert_not_reached(); + EXCP_DUMP(env, "qemu: unhandled CPU exception 0x%x - aborting\n", trapnr); + abort(); } process_pending_signals(env); } From patchwork Fri Aug 26 14:18:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956122 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5E7F4ECAAA3 for ; Fri, 26 Aug 2022 14:38:01 +0000 (UTC) Received: from localhost ([::1]:56888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRaTA-0007Vk-Dy for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:38:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAn-0000c0-8f for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:01 -0400 Received: from mout.gmx.net ([212.227.15.18]:51101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-000550-7D for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=iXsvkP3ev12f2ThXbBYeEGC5zXB7ceY2b2oHuAaIKO8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=lWi1Mh1IhpH6lsMzemgmZiNcER2r5r2LI776rPNsqkzmXNOtZdzxh2Q8F7mXIYMsl vZQq+gH9vYFiCkyRfsLDGzIagyPESOyQGkucixuf0xmJ5CywwjjtouYTNjZw969WXC mZnbjm+X93MRDyao3QlHfZhFHIsikSBPrZ9CZRlU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbAh0-1oyS5047Ee-00bYeQ; Fri, 26 Aug 2022 16:18:55 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 07/13] linux-user/hppa: Dump IIR on register dump Date: Fri, 26 Aug 2022 16:18:47 +0200 Message-Id: <20220826141853.419564-8-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:dgIl2OKFHhGxco+FUoNG4lc5rMaqkzz7cBeMXT1Dsnxi8jlpKX9 RJAoitsEl2aTwM/JZvv+vjY05s5wCetjJtlns/mnYDUBwGLGL4gZZM/xHgVFOgvpAO5mca6 zKAlaNRKwcSXexNviLe25L5S7+BksSi8BDekg5axQ3Kz3HOnz2Zl/FBg5WIWxoDOaSkp7lc 1Ht7xCry1y9ZRW+hQsEjA== X-UI-Out-Filterresults: notjunk:1;V03:K0:5gSqPZoIVe0=:/l4vJljeVvr0bY3J7vojFV NieJvSdoutaTI9aEGbOCpWZjz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NC gde/iAKWvCvw2JGmHGXU+E56BEwvmbT9+O7CDBc+Gk6+VIuhWoYOgGMHg== Received-SPF: pass client-ip=212.227.15.18; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Include the IIR register (which holds the opcode of the failing instruction) when dumping the hppa registers. Signed-off-by: Helge Deller --- target/hppa/helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.37.1 diff --git a/target/hppa/helper.c b/target/hppa/helper.c index e2758d8df3..74b8747083 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -85,9 +85,11 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) char psw_c[20]; int i; - qemu_fprintf(f, "IA_F " TARGET_FMT_lx " IA_B " TARGET_FMT_lx "\n", + qemu_fprintf(f, "IA_F " TARGET_FMT_lx " IA_B " TARGET_FMT_lx + " IIR " TREG_FMT_lx "\n", hppa_form_gva_psw(psw, env->iasq_f, env->iaoq_f), - hppa_form_gva_psw(psw, env->iasq_b, env->iaoq_b)); + hppa_form_gva_psw(psw, env->iasq_b, env->iaoq_b), + env->cr[CR_IIR]); psw_c[0] = (psw & PSW_W ? 'W' : '-'); psw_c[1] = (psw & PSW_E ? 'E' : '-'); From patchwork Fri Aug 26 14:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA2FBECAAD4 for ; Fri, 26 Aug 2022 15:06:09 +0000 (UTC) Received: from localhost ([::1]:43246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRauO-0005CA-PL for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 11:06:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAo-0000ee-TR for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:03 -0400 Received: from mout.gmx.net ([212.227.15.15]:56177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-000553-Rc for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=W/3O0t423mJ6phUG7vJJvRCtfA/7EJAlySBMTy/Tz34=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=kOQY1mxv0ShrXUnmuOASKzz7o8Pvr2tMlJ9x5LYSy/Lzode5DcHe5ReCT6htoazru tnxkvoHuyTKIYoFR1Qn1h3vQsx9NXuHOlbgmefXlETDymi1WlsUY2wqW+Ht4HWKblm gpIHSoHc/AsH+OnAkV4wror2PPZnd7LP9IIvuy/U= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M7K3i-1oUrxb0OFQ-007hYE; Fri, 26 Aug 2022 16:18:55 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 08/13] linux-user: Fix strace of chmod() if mode == 0 Date: Fri, 26 Aug 2022 16:18:48 +0200 Message-Id: <20220826141853.419564-9-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:4LofVz4sy4ygbo1u9+BQFa+aZzayDzwcYzsgbB1B5SEZy223uYP yv50/zGcKhLmlemvrQ36ERC1kflGnfafduwkM7uGGkVgjFaN+1REnequFOuWia7wJgTEmhe yoB9+yP7p9TIHeGHzRe8Pudt/NTBaBBvOW2LTf7wwSJhLwgAMNkJ5qHL+I1aUItKTmpToHf UzCbigiSRiXpplYxA1PJw== X-UI-Out-Filterresults: notjunk:1;V03:K0:PGuMhHM2BGw=:DGv59cq7mvDmRCDIAygBL9 6Ond91Jjdc9EgxUZlTazc2UEcHeBCZZ3loPBkHToF8dMKnz6llqOZsvqvSXm+VV4tGh7b0gdb uBXt/NjjxZnFUCZ6Lm6FPLTnqyUOPURl53ajdGx6RZB63KzYpQTyqseFGJNe7qi2+v12ySJo2 HiSChJSlxrP517WvIMzgI/3wr5KlOh1Hr30uk/VrhvCC/J7taCNkxF2nJs+1aTclCZ88NGIgK lzFs+8jhvRt3RKz+jlLwYlzqjN+l78CESqovfhlRnZrcVk6NwUBWczbxwUtc5KTkvLprr6vlR 35k5ZHepqaZrCkUMbhOz3Y0k1LIFwt7qvhiSsn/wnZT3r9djeReRRC5LKhz7gfSnyCtVzAaZ0 Jh5I5FIRI+88w+cOsdSY6pahrWOSD1+aK7OwSNy1tOj1/1/UYnSia16/emiYUxmzVT4Om017w k/fJHIopww4GHWKexlBDDZEu2f9pQThcinemTczJTWe6NoOISpVNTeL3acdS9jtyW1MDzYEQb ICcWRTwLFRrwCvA7MkNAsIvcm5EQ94+36/bTqoVoxs+HZtrM6793W5TOAUTfDihqgEQ2qOCXf 5/e9FIqi1lH9/80Yu2EsYmY0f1oVqxEG4Qp6lpA5R8QA8MiA8flZbXOzGt3ksFDsci6QtutdU rA4MTTl6iYqbHgexLLmgK2zyMk/CCER11sI3YiowUgoafRoIucpkJqfRAsJtbPXQajme7hDjV AYdmcbS07s6HLYr+Qvuto3PeGwbY/YI3nAPXxr+KxnUpHpYO53f2NG1L/YyXCGVelmfDMYYRc ndoyMNElKiTK//dz0akKQ29WCfwstxy5R7WSMFyRdAdlSDA2VkSAo8RzzSaMHEelkzu1Zpo4H B7815rzt1E2fsclFnPyLJ02r4dfjURJ+6Y+5b8BHP/ZeZDLLWUPsLCUIa63+gPky/huzXImBj hIKyO3C/NQxmFlf/X79ZbUQCnlUZwJm0xKqDSPgW6fQGw5LlettFhBUmRNIM3rLkzhWuuPOGZ p5uCa53RERmbZwudzahcHyO1EVovczcAKgbz3DQfMGzAiITWYL2WEIAKb5tOg8sZvDC2A0q50 j+nKANzfbZPwOBHX0slKk9ZOAxsQCmpnM8E6FkjktRCiDSeOQZqSFbW/w== Received-SPF: pass client-ip=212.227.15.15; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" If the mode parameter of chmod() is zero, this value isn't shown when stracing a program: chmod("filename",) This patch fixes it up to show the zero-value as well: chmod("filename",000) Signed-off-by: Helge Deller --- linux-user/strace.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.37.1 diff --git a/linux-user/strace.c b/linux-user/strace.c index 86b2034c81..d1afa0e12a 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1504,6 +1504,11 @@ print_file_mode(abi_long mode, int last) const char *sep = ""; const struct flags *m; + if (mode == 0) { + qemu_log("000%s", get_comma(last)); + return; + } + for (m = &mode_flags[0]; m->f_string != NULL; m++) { if ((m->f_value & mode) == m->f_value) { qemu_log("%s%s", m->f_string, sep); From patchwork Fri Aug 26 14:18:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956141 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D16D9ECAAD4 for ; Fri, 26 Aug 2022 14:45:42 +0000 (UTC) Received: from localhost ([::1]:37044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRaac-0002Pt-0K for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:45:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAo-0000di-Jh for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:02 -0400 Received: from mout.gmx.net ([212.227.15.19]:46063) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-000557-Hu for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=vqBGlEYh2uc/X0/atrzzZ0k1UEI6QeKa0HJ0LqnmR5s=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=BKLalN52yvqI/W4Gk4yRZA+pJA/Q6erGX6BzZY2SDAdVDAaPtYAT5XKRLZc3tJI6v FH2KKuIwV+n6DNoza/CvyEYi0WkCD95osj8JTjQkf5g5i0fp88zT4oUohDdRNUKEc6 zqKjNgfGSkV+4PK8mAj/c2VIZ3ifz3l3ERDzqVMw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MFKGZ-1ocsqs0v9d-00FiQN; Fri, 26 Aug 2022 16:18:55 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 09/13] linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch Date: Fri, 26 Aug 2022 16:18:49 +0200 Message-Id: <20220826141853.419564-10-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:W2do2XuOj057L8nY8Evl+xJSSDIwIWe0IqMBpd8k5njh2jFt8ie LQBVsJ6f0PO4q3pMtYA0diELpzBHc2VFjZot+rr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Na+qS07gDwny1DOEBEa5RnRvZHugw5iT1yZJbzky6DISwEPbeBybJJHQ3A8rLxhdTVW4j u9oQHOs+fkbXsrWiSDDGLd3IZENmNudiLyZA6KFxL4s+oddUnOHaOo0ApqrhsIPnGY3WKnWwa L77EE3Gbh275/dVzoCpL73/HAMzxq611ULGTN0/PBKQh2dDTT//1KhW5A72dXoS7MEAxTqCqW bmX5Blsxq3oCaS933nr6nDssZoUhSVPl0NWqlKiGykwxzNXe1Y05Tw2Qw== Received-SPF: pass client-ip=212.227.15.19; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On the parisc architecture the stack grows upwards. Move the TASK_UNMAPPED_BASE to high memory area as it's done by the kernel on physical machines. Signed-off-by: Helge Deller --- linux-user/mmap.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.37.1 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 048c4135af..dba6823668 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -251,8 +251,12 @@ static int mmap_frag(abi_ulong real_start, # define TASK_UNMAPPED_BASE (1ul << 38) #endif #else +#ifdef TARGET_HPPA +# define TASK_UNMAPPED_BASE 0xfa000000 +#else # define TASK_UNMAPPED_BASE 0x40000000 #endif +#endif abi_ulong mmap_next_start = TASK_UNMAPPED_BASE; unsigned long last_brk; From patchwork Fri Aug 26 14:18:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60BE3ECAAD4 for ; Fri, 26 Aug 2022 15:00:54 +0000 (UTC) Received: from localhost ([::1]:53892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRapH-0000mf-Co for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 11:00:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAo-0000dh-Ky for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:03 -0400 Received: from mout.gmx.net ([212.227.15.19]:41079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00055E-HI for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=cQG0bVRLs8shoYAP9NI59cNoDF/tjBt9bk6S7Jij3WY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=MRdUFFJZX2iPQRAMgp4j9tjothzmHo+jVZzFgj5ozt6n4e0FsiEQm83PHzfTLaAtX KQea58Pa/aMXeglWNbBWmn3dQqFlIabU54gWF7gs+x31bIFRo+lT0y3eiIkrA6gM6e psA6xzunIYuf+/tIo9/lZJLd9YoYphd4ZnymdHeA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N8XPn-1pVfKg1ZE9-014Wix; Fri, 26 Aug 2022 16:18:55 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 10/13] linux-user: Add strace for clock_nanosleep() Date: Fri, 26 Aug 2022 16:18:50 +0200 Message-Id: <20220826141853.419564-11-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:ouzVJNFAu3lmoEfFKhE09/11mCEVLw7eRJABp3LvR6rYqX48YOG LS02hJaTTl2PL5bXsg8lKh32i1XMoeB2m3rwUONAs2loOagWhR4/bA83W5B5YByIQyI4LV7 45M6mRhXzYqbdlCgQU0K7VYG+wxMLhzSyEEj0eAKkdCmqRHUKJkswlKpR5rPiB0Eg1UZExt ItbPrOJ4v4qr/FJHQuWpg== X-UI-Out-Filterresults: notjunk:1;V03:K0:XEaDVxqVJTg=:qyKlShV2/tl82Rfex3l85Q BKjIhkeIgHl0RUH0xYcM8a4RTlTlQTdbnXodj5vwryeqOWCPWzUovW/7vByouNvvPw5VlqEf+ 3tR85kNaWndbNpVkrwAp8MOH/OsNpJldAxGKtbJSsY0kX14w9m3WXNP6es1M/VprsCF8E9wTg ZotZeb7P9TYcGYKIGex2OUZTPiUm//4CRGaBSiXscZ6WX/jzpg5HKo6dDD5wnujHJ3OLd2yQj L/bFAqiaENWTuEUxdMZpl5hM1kNvr22XYxfFlgNx9pQKcOUzYeP3w+D5+BNdvfTqySypuh4sA LQcU1q1MemWLykQcJK64VHtDbpG/u01iviG/9SAARANiYfP142zjJLJt+K4EnQu9HbI+t7HeG f7Dx6q2Hp8STJOuYGTK0FQ4vweQV0tAf8LuX0bIfyHB6XbpYLHB4hEGPL3NNVddXsZHMVAPTR 2izFGLjvNao6T2DQA1Rtg2KugpYNK9aNyrg5W0NhRKAsCVgJ5rXItQH1CRoUgquyfo/xCgPjd 2420hgMpPhI3xdRzhbtTJq4oYZtrbKA1lroI92D6CnjJqsLY/LX3XxOdC1y5D5fOzZmXTFtlS +p4/tVAib/DJBSIW9Omyw6o91LbU3yt/4Tl+bX6j/I9rVHRU6gysBYRa8p8l6pDIDTOGchQmr vQ3VcUPR2PBPc3uJAlSsdYwV+tTilfPne4R69xCI4bDTmhBpVoOmGoQVi1ewzAT2SQnzxj7NW TJ5L7waJ6PO0pZvVq36U27SlPSOimZSVVrj9ymonv2R7s/LCTK/79NonN963YJ+nkhc5U2LQq AerC2L6GdvarBrzBLOp4KQE6uzJ4RBxKGgJkTNtPjND8T99WjG14Ia5IgZkIp3Q0GvbWu/cWv 7XZ2FM7K+6PbZubGvcPmkOVPSVl2snFTQmvgEXJ924yVIhcXqlgK+pKNK+bk8hPQ88D3qFZfV VoophJFwOWDunkIZck2ci56CfCB5UMiASNdcTsSSp0+OYVDzbpYoAejKK5Q8kFwhNPsjUhzUp /fVn13P6cxZIOKcQyi3JM0HOIliutHinaTec2x41vV6127+cDinf15FsfpEfk2Qy/HIU2yK/4 c6fh6unsbNn7rl7dugrhrc806RfRHd3ShSy6qMJ5RSmPGR4ljjQMlyXEg== Received-SPF: pass client-ip=212.227.15.19; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Helge Deller --- linux-user/strace.c | 15 +++++++++++++++ linux-user/strace.list | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) -- 2.37.1 diff --git a/linux-user/strace.c b/linux-user/strace.c index d1afa0e12a..bac47748bc 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3566,6 +3566,21 @@ print_unshare(CPUArchState *cpu_env, const struct syscallname *name, } #endif +#ifdef TARGET_NR_clock_nanosleep +static void +print_clock_nanosleep(CPUArchState *cpu_env, const struct syscallname *name, + abi_long arg0, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + print_syscall_prologue(name); + print_enums(clockids, arg0, 0); + print_raw_param("%d", arg1, 0); + print_timespec(arg2, 0); + print_timespec(arg3, 1); + print_syscall_epilogue(name); +} +#endif + #ifdef TARGET_NR_utime static void print_utime(CPUArchState *cpu_env, const struct syscallname *name, diff --git a/linux-user/strace.list b/linux-user/strace.list index 7a69152db7..0463415902 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -91,7 +91,8 @@ print_syscall_ret_clock_gettime }, #endif #ifdef TARGET_NR_clock_nanosleep -{ TARGET_NR_clock_nanosleep, "clock_nanosleep" , NULL, NULL, NULL }, +{ TARGET_NR_clock_nanosleep, "clock_nanosleep" , NULL, print_clock_nanosleep, + NULL }, #endif #ifdef TARGET_NR_clock_settime { TARGET_NR_clock_settime, "clock_settime" , NULL, print_clock_settime, NULL }, From patchwork Fri Aug 26 14:18:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93FEBECAAA3 for ; Fri, 26 Aug 2022 14:54:28 +0000 (UTC) Received: from localhost ([::1]:55380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRaj5-0005ZA-JH for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:54:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAo-0000dg-Kp for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:03 -0400 Received: from mout.gmx.net ([212.227.15.18]:43561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00055K-KL for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=2Hc44QhNuDPlyei5sc5czbu6AbH373ie1V6L/xqbjwA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=aSt9K9+Ff1FZNG7tRAUgD/wlIKmCKzxrzjPEkHT3U28I+Nm4t6WmwbpiPtjHqQ+RD GQpl5Zna5cXKqrHMX6ABOhyO1xYtVIOjsE2Z4zFBey+37wnPxK+uwyY9hl1WLKt6yY 64ui9DERHMEvkjSFz8TR7P/G88EVAnHTBZUGIJcc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5G9n-1pSNXW26K5-011Evv; Fri, 26 Aug 2022 16:18:55 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 11/13] linux-user: Show timespec on strace for futex() Date: Fri, 26 Aug 2022 16:18:51 +0200 Message-Id: <20220826141853.419564-12-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:R+qwusMeOSKazhGUbo7iadpTTEgrOEhM7tQyUttLqZ5M66JA1DD ILRc2XApGxSHuqvqaztb5uaEHFoTokNMMTqJJHE8XMUQ2+zlGECmBwiR3cTadoYAcgIY82o NSVLiNReaUTmqTtsvVRBnaQ7rj3UYmalSVq8t+8I2Gyou1GhJ1Q6yV37TO2wvseiyGH6zDd fZ1Hw68Fut0XEz1xki1Kw== X-UI-Out-Filterresults: notjunk:1;V03:K0:7eCaCgPpPhI=:i/XLhxZXqKkCDMOYBqiEKR WbFNtawatSl6mwQ0Yl+R705uQM+7mJYHiS4E317ZmcBMTc7nFEzz8zhV5YHBEYLS5kSDEk+Wu 3KNBcrbVVwvPYjAzvmqKy7ayHIa+fS8AfxTY3ljf/17dzpJzPDK7hFHr1LSumrlCwwHf8tgaT OwWzJmIS3HyspFdrYxOuMMSWJc7/9/Lp7wpuc/b1t/2pNQLm56l1DkKgl9IG9b6Zih8kFkboF W/SZ7skQHnq4re2Dg5PkBbtsAalaifJSPNF/bGCRnycvqosT9KgshbHtupI4Gf8APeDkPYsN3 hdHptRSomZad6ExHBIM3fv0TUGpexpWF1gJ3O35FnBXLjToNKPTWSI2UUjvxxa+2Kl7x9xQwb uPgYg5LWzZ210RaNoUvmCrgZBS3jW/GXs8qRs0seFV2S5hhMh/sZUR7ETbY4YtgLLLaFdUGzP XnQb6ZPx7Cthwch/NcAj/vmPCV+YCyH+oeYEyV9aG/x7kd6Suh0OjbmJd/wBdEprdkYpoyF2R eIBDjoTWamPazYPmZiKiK6RU/I0pOGElFYsBOXiQWDpotp7KuImtVKC/x7m5IXN3sQlFo9X/7 oM/uJ84Kf2T3CsXl+01b+vkurwIK/0xGg9jNLEHIZhB3W2AFIynUORmUn+ecZHkyEWH7TEijr 4kT6GqFdcd0muHYyGQvvVu9vDGOSYo57L9rT/ab5LNoOdkCHFKDJwL/GsZsmOvRHKFUEAtc0u pC4jfuZWIulotGIc7u8MZMDdWdX876XMA6hp/Yv5OKgqZJMCM5HGA47qvMVTmnN0AsRRvoVkP BuiOKZwQB0dmVQ1aONjr8uYL+XWjsbEb40acr7Y624VQEos/exDoo8sBPnP1o5OOFSCJifN1Y 7rSkMQDZ0tY1+FACNV1HRaSEJCGAcRo5VNXTnLhEQhCsp5aJ8GEWQl9T1Blv6CVAm0QnZcmMt tjZaEKwWVRuMnaVyUTRrh2Ws5QACTolH/eWT12gvdJUg/ChjMNQJQ7SwdWvjeteVnlSDyumey gLkXoth0LbMrK4zrqT4Ii9VLjWSqU5RtmLbs7j0cD8MjUSEXfPH+nDtXkridU59WPAO8IMJ2p 9PB8ExMHsZzuU3kjkwWqy8xIFYtOvocYvXpARbvpyyAcjhtIiON4rzeWA== Received-SPF: pass client-ip=212.227.15.18; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Helge Deller --- linux-user/strace.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.37.1 diff --git a/linux-user/strace.c b/linux-user/strace.c index bac47748bc..a90e719681 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3713,11 +3713,19 @@ print_futex(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { +#ifdef FUTEX_CMD_MASK + abi_long op = arg1 & FUTEX_CMD_MASK; +#else + abi_long op = arg1; +#endif print_syscall_prologue(name); print_pointer(arg0, 0); print_futex_op(arg1, 0); print_raw_param(",%d", arg2, 0); - print_pointer(arg3, 0); /* struct timespec */ + if (op == FUTEX_WAIT || op == FUTEX_WAIT_BITSET) + print_timespec(arg3, 0); + else + print_pointer(arg3, 0); /* struct timespec */ print_pointer(arg4, 0); print_raw_param("%d", arg4, 1); print_syscall_epilogue(name); From patchwork Fri Aug 26 14:18:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F254ECAAD4 for ; Fri, 26 Aug 2022 14:51:08 +0000 (UTC) Received: from localhost ([::1]:59640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRafr-0008MD-Ho for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 10:51:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAo-0000eY-Q3 for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:03 -0400 Received: from mout.gmx.net ([212.227.15.18]:56667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00055R-MW for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=lPtKkG9XisVFJUR1ll9RmaJAtOBuQapADhw77JY1SiM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=MgYDuyEJ2ZWhtap8uKPtEJ+jyGXJsy7lZ1iUsEjHcqyFllnb7sgFRuElkm3kiOteD i60pg9XUWmaHSUD+Nvspm7I3ldxMvfyUk3JrElXGAwtGbOopBJTrbMvicqDHdDcmW6 xJgmNkCjtB5etPnJjSnXOZw0AvjIPqIbvff7DzBg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mjj8D-1p86rc2cPL-00lDQ1; Fri, 26 Aug 2022 16:18:55 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 12/13] linux-user: Add close_range() syscall Date: Fri, 26 Aug 2022 16:18:52 +0200 Message-Id: <20220826141853.419564-13-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Jdmq421NWoMoQ952udopVyle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XaQNv8g87T1l3b1TYcGf0r6ZdMbPiri2UqZAEBwQlvkawGMk+F8bwqbiJ5obapRzJw urhisxT5OdIOceL44km1Sp/9phQPLqXgogdmdLATMoa9L0s9vYpW7k78MKf5DD1BFGMRyTuLh 88zxQ7LCyx72QaEeDEiXiwKhtoT3FNqhWNggX/3WlfKofgIBm8PfLOQ4m7vCkRlL23e6B4a0S jrG/vTJJ1b9C5N+CzwiwBKMScsEIkoVDR9rK/A8GFzskWlR1XzAkGi9GrNy9jCLmPbnAPghmU JVi2C87fUOTWwA9Zvz+c0ZQmaW4cwN7ra4IDYDVst0pAI0X4WlFzoaVaA== Received-SPF: pass client-ip=212.227.15.18; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Helge Deller --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) -- 2.37.1 diff --git a/linux-user/strace.list b/linux-user/strace.list index 0463415902..4560a01d88 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -103,6 +103,9 @@ #ifdef TARGET_NR_close { TARGET_NR_close, "close" , "%s(%d)", NULL, NULL }, #endif +#ifdef TARGET_NR_close_range +{ TARGET_NR_close_range, "close_range" , "%s(%d,%d,%d)", NULL, NULL }, +#endif #ifdef TARGET_NR_connect { TARGET_NR_connect, "connect" , "%s(%d,%#x,%d)", NULL, NULL }, #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a1e6d4ad53..0becaad74c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8724,6 +8724,18 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, case TARGET_NR_close: fd_trans_unregister(arg1); return get_errno(close(arg1)); +#ifdef TARGET_NR_close_range + case TARGET_NR_close_range: + { + abi_long fd; + abi_long maxfd = (arg2 == (abi_long)-1) ? target_fd_max : arg2; + + for (fd = arg1; fd <= maxfd; fd++) { + fd_trans_unregister(fd); + } + } + return get_errno(close_range(arg1, arg2, arg3)); +#endif case TARGET_NR_brk: return do_brk(arg1); From patchwork Fri Aug 26 14:18:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12956153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8BFFCECAAD5 for ; Fri, 26 Aug 2022 15:00:01 +0000 (UTC) Received: from localhost ([::1]:59900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRaoS-00089y-Nh for qemu-devel@archiver.kernel.org; Fri, 26 Aug 2022 11:00:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAp-0000ew-LB for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:04 -0400 Received: from mout.gmx.net ([212.227.15.15]:40995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaAk-00055O-Rg for qemu-devel@nongnu.org; Fri, 26 Aug 2022 10:19:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661523535; bh=2qvus0U1Qcq+tymskvFkUyGJqKVQ/WZ7b2//9XLrNAI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=WsnuHA2appTzhaYdcAriiGlAIWw0zWHos8JWiGHYJcPhQNjTLd9rT+KRgZpdo7AnV OrRr3JcNE5ef8ZjIK1oLjV0hGopHNimsOnTquV6GTMxxhnrY3kzsBuVwm0hXZuMDMH R5AchE+J9QtCUcxhlOJGqhBJqhCfFQZiSUZQ7PqY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.171.190]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MLzBj-1ojO8c37c9-00HyZ1; Fri, 26 Aug 2022 16:18:55 +0200 From: Helge Deller To: Laurent Vivier , qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PATCH 13/13] linux-user: Add parameters of getrandom() syscall for strace Date: Fri, 26 Aug 2022 16:18:53 +0200 Message-Id: <20220826141853.419564-14-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826141853.419564-1-deller@gmx.de> References: <20220826141853.419564-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:NFAgJDiUFT2vpvdqUpmPuXRFF0a5lkP2Xbk7TRR60Vg9FIdngVm 4IomLIAy1AsTl0dQGDa0TuilBnzTAKTcEgJf4rC/6PS0Isddz2HuVlvoVnafqKNjcukpfMt fLZWhtp2gHbdTt8VxGwqtdzhq/nmk6ZWyxRbebe1fPW20iH3iBRtuZvP+fTYoWZ+p6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Hk9wgcFHHyL2T5ZGPdiBIG7zVlekn7p18kAs6JsFiJ XaRQmraQeuWkOVcPHhv+ZDXD2z9iLUSW0hOEfCS9STvlkE9WOaUdKIYcpNtCCh4uhsMSgMmUm K32jr52adCbGWMc7wDFZlCbin8H4hbzPIGaosSGoFbRFVCAPlv1+hNFEA== Received-SPF: pass client-ip=212.227.15.15; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Helge Deller --- linux-user/strace.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.37.1 diff --git a/linux-user/strace.list b/linux-user/strace.list index 4560a01d88..da8c1bf34e 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -358,7 +358,7 @@ { TARGET_NR_getpriority, "getpriority", "%s(%#x,%#x)", NULL, NULL }, #endif #ifdef TARGET_NR_getrandom -{ TARGET_NR_getrandom, "getrandom", NULL, NULL, NULL }, +{ TARGET_NR_getrandom, "getrandom", "%s(%p,%u,%d)", NULL, NULL }, #endif #ifdef TARGET_NR_getresgid { TARGET_NR_getresgid, "getresgid" , NULL, NULL, NULL },