From patchwork Sat Nov 23 15:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 845114 Delivered-To: patch@linaro.org Received: by 2002:a5d:688e:0:b0:382:43a8:7b94 with SMTP id h14csp352891wru; Sat, 23 Nov 2024 07:08:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU71L936Tqb7mpzm6QsTcGx0ZtfdUG8H8ziSDmAij7yyUdckKlcCHPvgoN+tfqgWa3hehop+w==@linaro.org X-Google-Smtp-Source: AGHT+IHlJPXcZTQ6eduaUW6Pw7nL5CbUcoClq95UreJ9m5wuCRDd+EkhwIG1o6YGefdZAicZkHot X-Received: by 2002:a05:620a:2493:b0:7b1:43e2:712e with SMTP id af79cd13be357-7b5144ad15emr811479085a.17.1732374495481; Sat, 23 Nov 2024 07:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732374495; cv=none; d=google.com; s=arc-20240605; b=dqX3ppPd4juzcw4osr0f+cRZp6WV0Se+vsNvy2Y6kXGx+iABVRWYJw6WKm+6bO38RF nfuVAJkYd5zClLdLgHffMV1VrGxK90f29dGvfyOvcUkFRWz1SPM7PvZofNiMNVKW3+9j 91Q66gHazXbDsod48y3h3yRzgq7chr05LTMCo9/sZrKVITUG0/uBhElC7R1Fmq/noU5J PfJACh+N30ptuUmjAcnbGRwXMXjfQVpQSI1dt+Fi5efae7vZqC4v41gWbStiA/kRK3Fs zL6y+b2N7vOB3su1Gs8bLT3qLHrsl5NPlkR8XCEIIh4sSjwWqukPwf55xEv6RPD3/GIL oB9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3+soXgIGzU1qx/4reP56HeUhKrWsVcJ3S0viKluo4FI=; fh=Z5cQS2SDpzotHfcDUrj0/G4dYdihu+anMiGjmeCrPQU=; b=LdOZp4PqbgJdy6u9KPNMhBAax6zuYuM7+YpQ4B2ft9GMoQLrgKdkUQ8mZrjA4t2guY 5lIc0ezuR50N8BKWkLY+7C8OYJqWKg9006z3ZgoH47claGb1G7i52D1SO3xPenKqK/MJ hUfCHJRZB+aOHDJK8WwrnsWY8tlcxQLtEbM52ZWpOY9a1Z3Ks/CfNZeTQ0Cl1CtGW3qu Wh5UZS92x4UKosanv9qre9gmogcu/cEmS/dZh5IDoKE7MOx1yxuIHnq4XjFMuxhoMBXV 0DKXFjsZcbfMffYY6KyV7vCmbvCPWke/XXJbbfAeR6Wjmb8CINzwmjFhwEuiYjrDe987 WfWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LnjDoSuk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-85b118a7320si1478419241.174.2024.11.23.07.08.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Nov 2024 07:08:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LnjDoSuk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tErj8-00024R-QZ; Sat, 23 Nov 2024 10:07:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tErj6-000244-TH for qemu-devel@nongnu.org; Sat, 23 Nov 2024 10:07:13 -0500 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tErj5-0004q1-9Q for qemu-devel@nongnu.org; Sat, 23 Nov 2024 10:07:12 -0500 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-295d27f9fc9so2411515fac.0 for ; Sat, 23 Nov 2024 07:07:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732374430; x=1732979230; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3+soXgIGzU1qx/4reP56HeUhKrWsVcJ3S0viKluo4FI=; b=LnjDoSukwJc5iaaDwxp++G8QEerDLJVQ6BpG1+3pqrbyfnqixPkGreH3mraC+pO74K CAaXPY6+wlAs86BKDfsUU+xqjnEjYVISHjXeVwyvfdZ3Vkv6OHqLwLtYbV6iP4rgC6Wv uQ74m6Bmd14Q+LotquJQytXIYM4u6Hz6wr2b0UBmbucfQlDYiEGEHck6NUnpaEL214YO Xjg90WdS0jx+bonnGdWOiFMJ0oZZ4mcY7tiLjOAIPUZl1w97jNLc2EbTtL3jH+OVLEH+ oVi1rXxGHEPXglwAbZwm5kLhqT4AlgRrQ7/aAhXld5Ub7HsTzPBeeZEthQb4UzFjWdml TDJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732374430; x=1732979230; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3+soXgIGzU1qx/4reP56HeUhKrWsVcJ3S0viKluo4FI=; b=eXSWcPCMKxqKHLRQnJ2wU6apS/bsfLCSBESbvP8PurEQzJO6TjZhE/Wf9M2RcRBkKd SbsbqzeoaSLP5bDAOJeYRp2VZIoqDXz60sZLWpq2yUPC8xUX4SVWeg6fj1EME68WUHvA dPDxiSXZzbMuOV1UTS58QYnWMGbJFGRdlkI0YaEfpR9NuxyK0J5F/Cc6Wosy+UpyyJPW 8O0Lmd2WlTNyvTDUDMhMdCJ/OjOnlkBGmrP6HngDDcKdM3Z38okGVlF/tUH7OGXVzbhx 1n2E777PFGX2PxIZhFsqSExmEg0GR2rtzJskszbWDbfa8LH0+QKTwczJBr4tXhqTOjtt 2tdw== X-Gm-Message-State: AOJu0Yyesry7hidJO0NsefolUXxUHqpkaYE1mkzXiLYSDJmakM3TrJPk gU/X70raCPjuDmnU7FCWi7EqrmmJC2cteay4lLvCOrnfzud1EEJYU9FWbhJ+7LL9O3JgZsLjWOA iAHY= X-Gm-Gg: ASbGncsIHeT+n11mrgzebsCEthoKL6b8k8G9Aq3E15E31SbSVxeEpYPi9mVWfFLe2SY 2w584KdHSG0HQtLxPeZSm41i7ruPr77iSKuFHJtKoCcSjpnfvtiKnk0vBnZvg3w1MaLyJ6DVvmJ 8bD46QxJQsIxarv+dsObZPcnXKzhITC5wcGmETn+SFj7tx7xLwJy0zumi04GGsHc5rZyhUX1zA8 3ZfaR+QzJPgEUpQvOv5q07Hoz0j/6UMcQlYg7pY6h0eXrgeGY8CeaB5MQ== X-Received: by 2002:a05:6870:2188:b0:297:949:4406 with SMTP id 586e51a60fabf-29720ede21bmr6827393fac.31.1732374430178; Sat, 23 Nov 2024 07:07:10 -0800 (PST) Received: from stoup.. ([187.210.107.185]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2971d82291fsm1396390fac.33.2024.11.23.07.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Nov 2024 07:07:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?J=2E_Neusch=C3=A4fer?= Subject: [PULL 1/2] linux-user: Print tid not pid with strace Date: Sat, 23 Nov 2024 09:07:05 -0600 Message-ID: <20241123150706.19740-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241123150706.19740-1-richard.henderson@linaro.org> References: <20241123150706.19740-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::34; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: J. Neuschäfer This aligns with strace, and is very useful when tracing multi-threaded programs. The result is the same in single-threaded programs. Signed-off-by: J. Neuschäfer Message-Id: 20241024-strace-v1-1-56c4161431cd@gmx.net [rth: Use TaskState.ts_tid via get_task_state()] Signed-off-by: Richard Henderson --- linux-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index b70eadc19e..f68c5cdc44 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -4401,7 +4401,7 @@ print_syscall(CPUArchState *cpu_env, int num, if (!f) { return; } - fprintf(f, "%d ", getpid()); + fprintf(f, "%d ", get_task_state(env_cpu(cpu_env))->ts_tid); for (i = 0; i < nsyscalls; i++) { if (scnames[i].nr == num) { From patchwork Sat Nov 23 15:07:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 845115 Delivered-To: patch@linaro.org Received: by 2002:a5d:688e:0:b0:382:43a8:7b94 with SMTP id h14csp352896wru; Sat, 23 Nov 2024 07:08:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUwuIVQ79AkfK+CcimtEIyizLQ8VNXsjlEpk6SFEymgi43VzeIh3GpY3DD/vOprCUymeoCOQg==@linaro.org X-Google-Smtp-Source: AGHT+IGRks5HS29uvuY26aaiW5LANoUg1Y8JxuhBFfIE/S96Ct62ljWh4ZVyiazba+mRx2e4CcA0 X-Received: by 2002:a05:622a:94:b0:462:fc9b:985d with SMTP id d75a77b69052e-4653d63d3camr104279951cf.51.1732374495720; Sat, 23 Nov 2024 07:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732374495; cv=none; d=google.com; s=arc-20240605; b=JIs2CDofGs2cpIyIBzX8k+xJerm8v2P1QH74nnAKZbH9opiZ3U6Ed7t9KlB2VzLhgh cv8wity8mek4wr2B57stjLLnbyGQxj0HSHP4veKpFBUNkK+gWWLf6A3KQpZcfOb6Io9c J/XsLmgBxj1W/slFxxMOx/iyH8Tf3gE/LeBhkL04FpQUp73Ubl9+2dF2OLtTNlwY4dzZ dWS560za13rHoASZ8fEi442k0fLh77DvHsjd6/JHv4uEJT+/Q2fE7hKc3yooVnRa2S25 xCVCjChxMJhL0OtabfVf1qupOHZ8LZJoczcQRNDvup5DBRlASR3iYDSJ4dMoGCBjaO7I 4l2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rlzoEerYr1QXo4i48LqayXX7/GK/4llQjkrQzRbzFKU=; fh=4RqdLMIrR7qTEUmnmFFI+83EHhKCrT2Fs4rC7TcdDhw=; b=VCULMbSy8YyCH7Ny7QBUIK8eWPqc3hhMQ0iPB80dnKlbZL/6Tb89QdSE7u2ya/nPK/ 8ysq9gCwabqeW2XPNKisO3Fa6Kg1zTt/Ldk35YxwPmhPRXTNgcPCPPGmGBjqWYzwe/Je Kf1rGS7GAB1ZC2sOSwwlTm0TrOsWOZ+/ONxM/ZSpBOK1A9VebwG2pxjJ3QOLOfX90P51 63wri6QVScsEWPUTZGQoVfXDLBXCjCMjNAQ51Wf3wCYYE/Nlm9OXS0Grxmj3kkBFlvSd CaS8gPXSvWHxCM1VidjZw4peipY2DcsolBEpwh9cFRp0jPuCepW5m15qanZhM/dLPsGx PEdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FW9wThUN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-514fb256c98si519438e0c.244.2024.11.23.07.08.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Nov 2024 07:08:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FW9wThUN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tErjB-00025J-Q2; Sat, 23 Nov 2024 10:07:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tErj9-00024W-8v for qemu-devel@nongnu.org; Sat, 23 Nov 2024 10:07:15 -0500 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tErj7-0004qK-NE for qemu-devel@nongnu.org; Sat, 23 Nov 2024 10:07:15 -0500 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-296b0d23303so1570203fac.2 for ; Sat, 23 Nov 2024 07:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732374432; x=1732979232; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rlzoEerYr1QXo4i48LqayXX7/GK/4llQjkrQzRbzFKU=; b=FW9wThUNKfWRM/P/v5TXjxI/ZtRjnH+DIkmRAPDJyNTBRPqpFZUIbFwDeg1AZ+w5A5 O1IXHvr6t2v9ItY/VdjI7gaWYddY+D1wNQNHwAaDoZhkP5mrFmhyfxzWlAwyKPHwbcws MY0HRbzCOWiiRU/mip+oJosfAmD/0p9fqqVoR6eJL25rX+4zg4RGC+Ac+UE+1ktFPxYC tDOLK7WDjjp3aifKZTL6fWxmVfNp8Hn79hx1yO+zRz9y1bRR9efOIwgqfw4W6rdjI0id pvb+HcxX71rQcLvyMZWTF/ExU/WKgsgGSPje+bB+LOnXmUvrJGo48jr3jFc7eU/bdRVs 506Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732374432; x=1732979232; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rlzoEerYr1QXo4i48LqayXX7/GK/4llQjkrQzRbzFKU=; b=GuPEAe3GlKUal+Xtp1u0KfveiT/UztDqgdZ7+BwluWIXL1qUGFMiMZwud5f5w79zyi XXoK5ItGsAaPlli+qgDnw4D54yFKhGYd7DNsFnT10Kz+PVaIxjxtlsQxjdF0VV/Fr1Bd l9iMhC3Am/2RmSPOqyclgmj0Elu04O/E1z20HBBQxhjM47yBxIDTC/IxCLQSV6vwzX3o L1W2gRpgtwm3d6sIEHjv3fZuEXLxa4XcTEjqV4CceRP6hZEu1n0xGQBBYHPdSpxZTgZU 0nfsdXnXVKDbCR91Sjiw2hGXZkRCHFqSzUosu8hcjLLa0+CAUptnmnmUsbQ0bJte1Cl9 WGjA== X-Gm-Message-State: AOJu0YwDdn0+turd89czXQM0m5g7m32ac79GH8hSEiHU6tphxz5cEhvz z6mgkT8yE2E3WIaYeQUaFFo/oM148aO5IccDOIDHMEHn2n4XtGRv+9qOMxSuPfd72yuc/tn3Zxp ECeY= X-Gm-Gg: ASbGncufflolQg40ntrGd5N6+tSKt0dtK6dCP7DY13TvSLc5R/CiaPyYDWMK4dCmSAx LVsPq41fw1/9mPUl5b8mGRu8EVM8yxjJisfsri5ogrDoFjkgXtrw6mu/fC/ssTbkyvi2cWOhdSP 7jQNy0D7Aenz2W8+rwIN9yHQhM+wHsCebqEtqbgcN29tcCjkxg/2RzHjE8qbUzNN0LibzI1p5hk pIGXxYk97p+f7rFK1qgx2Khzmuia47UQaACC0nkmNOPfHNXDEqDZBqxLQ== X-Received: by 2002:a05:6870:5a9b:b0:297:2643:fa25 with SMTP id 586e51a60fabf-2972644cd34mr4901809fac.26.1732374432021; Sat, 23 Nov 2024 07:07:12 -0800 (PST) Received: from stoup.. ([187.210.107.185]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2971d82291fsm1396390fac.33.2024.11.23.07.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Nov 2024 07:07:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , qemu-stable@nongnu.org Subject: [PULL 2/2] linux-user: Fix strace output for s390x mmap() Date: Sat, 23 Nov 2024 09:07:06 -0600 Message-ID: <20241123150706.19740-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241123150706.19740-1-richard.henderson@linaro.org> References: <20241123150706.19740-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::34; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich print_mmap() assumes that mmap() receives arguments via memory if mmap2() is present. s390x (as opposed to s390) does not fit this pattern: it does not have mmap2(), but mmap() still receives arguments via memory. Fix by sharing the detection logic between syscall.c and strace.c. Cc: qemu-stable@nongnu.org Fixes: d971040c2d16 ("linux-user: Fix strace output for old_mmap") Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-ID: <20241120212717.246186-1-iii@linux.ibm.com> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 7 +++++++ linux-user/strace.c | 2 +- linux-user/syscall.c | 5 +---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 0e08dfae3e..faad9147c9 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2766,4 +2766,11 @@ struct target_open_how_ver0 { #define RESOLVE_NO_SYMLINKS 0x04 #endif +#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \ + (defined(TARGET_ARM) && defined(TARGET_ABI32)) || \ + defined(TARGET_M68K) || defined(TARGET_MICROBLAZE) || \ + defined(TARGET_S390X) +#define TARGET_ARCH_WANT_SYS_OLD_MMAP +#endif + #endif diff --git a/linux-user/strace.c b/linux-user/strace.c index f68c5cdc44..3b744ccd4a 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3971,7 +3971,7 @@ print_mmap(CPUArchState *cpu_env, const struct syscallname *name, { return print_mmap_both(cpu_env, name, arg0, arg1, arg2, arg3, arg4, arg5, -#if defined(TARGET_NR_mmap2) +#ifdef TARGET_ARCH_WANT_SYS_OLD_MMAP true #else false diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0279f23576..1ce4c79784 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10588,10 +10588,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, return ret; #ifdef TARGET_NR_mmap case TARGET_NR_mmap: -#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \ - (defined(TARGET_ARM) && defined(TARGET_ABI32)) || \ - defined(TARGET_M68K) || defined(TARGET_MICROBLAZE) \ - || defined(TARGET_S390X) +#ifdef TARGET_ARCH_WANT_SYS_OLD_MMAP { abi_ulong *v; abi_ulong v1, v2, v3, v4, v5, v6;