From patchwork Fri Jan 14 15:37:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 531978 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp605350imp; Fri, 14 Jan 2022 07:54:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfMOd5mublc/rJvqZcVFchdnhgjJHUTCnDgfxK+qoMUsZIXuBkaUyrRzH8VMXMSAe114LZ X-Received: by 2002:a25:f211:: with SMTP id i17mr12324492ybe.239.1642175644840; Fri, 14 Jan 2022 07:54:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642175644; cv=none; d=google.com; s=arc-20160816; b=gf8V8dC8qLowWhUnKGN9rYs8PfJ2cX85+N5jA+egzuswd9N8hY43e4GYdcG2vFINsi xTgkhmLgtkNMSNa27w02xtXnNGnociYDwC0GWXxiAFzOAIrFMaQZbQgI/rrgRg2J4bv5 qzAc/Xk8Hcb8EBI+ys/PRzBLKyuOwz1ZEP0GuvsHn858eiGqH0nCivOKWFPjIO+3FhFr QTtLCYThkUd2UDo0gvmzzAtP/CNsP49Iw4n7Qai4blZzZjkuoM3ldDePwNwdpF46nDtq xDxQqR9FuiKlnmyWtzKVqYLLt8WYORR80GYEkO/YRu3ejrRM/ieAQGW3bh0S9L6Wtb9R cobA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=9oAiFDmRNiyFx5akgXGrz8fMLaOCHj0Qubxkn3ACL54=; b=FEY45zeh2cqXxVLfVJoHvj///z+PpWA/TGfRCC0etAkdsLpcdODNNeXsfA7mHMTSug xuZBlYmKljYPcoc5JQAVKyWY4lZk7dAoaRRnePgg6O1NiDpCKCCnXhXoGcQxe413i4gt AGG2RRvzrpvNTT1cYaj1bc231BamYeq93PZTQNCVCTXYDsXEsPz9SNB7ALoztl0RUrmK wJNBUO101QCoOvTYM+gKQvuGzLLOw9YGlZjsm5oZYPZkRvsgdGMHQyWpUGm22WToFeoa Ce3CS3/h72LoSOKC682PLn/zgxUy0t6PEIe1Wp0guAGJP142NYUPgo3GtdfoI7u1i5on sw6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oUH52jyp; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w67si4681531yba.332.2022.01.14.07.54.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 07:54:04 -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=oUH52jyp; 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 Received: from localhost ([::1]:58306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8Otw-00016K-BU for patch@linaro.org; Fri, 14 Jan 2022 10:54:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8Oe2-00087Z-P2 for qemu-devel@nongnu.org; Fri, 14 Jan 2022 10:37:38 -0500 Received: from [2a00:1450:4864:20::42c] (port=46007 helo=mail-wr1-x42c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8Oe0-0000c8-Fo for qemu-devel@nongnu.org; Fri, 14 Jan 2022 10:37:38 -0500 Received: by mail-wr1-x42c.google.com with SMTP id q8so16203933wra.12 for ; Fri, 14 Jan 2022 07:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9oAiFDmRNiyFx5akgXGrz8fMLaOCHj0Qubxkn3ACL54=; b=oUH52jypv1ZTywTRXYBzZXthG7h05bVSWQse2I+ONsHk68CDPDAV4KmveWP7RdNmDN iW+AOLXmgcTvBCTSM7X3xhPV8KAnOUdDi2NBei9Y4yfQj7p0aw+CbaPBgekhMsm6Vu6d CR6BEn+nWW/DYorm1P1HXu8+i1dUc6TPA54zICzM+1XSEvzjLYgmJoktIcgUj2NiBCoE ta3fdf7loBo00LyETyBNX2q91AIJFPl3gMX/r96qhCFZM14m15gpdfFkTYXiHqTi6Kgh Lh+IihBdJY2LBJibjmST5yp4m/ZiuDH8dWixB9AU4ejrT+BXUJ0YclCNxfIQG//Cogsp yCDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9oAiFDmRNiyFx5akgXGrz8fMLaOCHj0Qubxkn3ACL54=; b=EHZZ2xa0QdgYK6pCD5jCNX/muWjsEtJi6hR7SmO6rVJTyKIybCCiYIR13+8SiVHBfv zaJEWVCImuC8GkBS/pXFu67RDyB3QLn8HRr9nkGMOHDDEfGVayCyzpMg++hj9HCRumC3 0zXzLuscT1aaafcT1rgCWq+8M4F69Se5WPnxepmNH79sCJWhZ/HMf/NV4aC5b5c7C/H0 U8wCDIRZkChFkzvVakkHzud3ktDf4X0oJocPda8fOtXpOnrZuQORuO+BCDBBwPsYNNct rNC39TdY1Ck8clT/SVWxr8YrBsHVsWdqEC8YFZypOvn/QFv/T9NTmq+xo8adLb3wX24M KW2A== X-Gm-Message-State: AOAM53018GOa9wy0kd8umdtkVBq806V/81l+EpzKSLL9cZ3T9/ttw5C6 AbiP8BLJszLtGzCLjjUbaFyZuCNqj78z3Q== X-Received: by 2002:a05:6000:2cb:: with SMTP id o11mr3237552wry.187.1642174655246; Fri, 14 Jan 2022 07:37:35 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v13sm6464141wro.90.2022.01.14.07.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 07:37:34 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 1/3] linux-user: Remove unnecessary 'aligned' attribute from TaskState Date: Fri, 14 Jan 2022 15:37:30 +0000 Message-Id: <20220114153732.3767229-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220114153732.3767229-1-peter.maydell@linaro.org> References: <20220114153732.3767229-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The linux-user struct TaskState has an 'aligned(16)' attribute. When the struct was first added in commit 851e67a1b46f in 2003, there was a justification in a comment (still present in the source today): /* NOTE: we force a big alignment so that the stack stored after is aligned too */ because the final field in the struct was "uint8_t stack[0];" But that field was removed in commit 48e15fc2d in 2010 which switched us to allocating the stack and the TaskState separately. Because we allocate the structure with g_new0() rather than as a local variable, the attribute made no difference to the alignment of the structure anyway. Remove the unnecessary attribute, and the corresponding comment. Signed-off-by: Peter Maydell --- linux-user/qemu.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 5c713fa8ab2..bd0559759ae 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -96,10 +96,6 @@ struct emulated_sigtable { target_siginfo_t info; }; -/* - * NOTE: we force a big alignment so that the stack stored after is - * aligned too - */ typedef struct TaskState { pid_t ts_tid; /* tid (or pid) of this task */ #ifdef TARGET_ARM @@ -160,7 +156,7 @@ typedef struct TaskState { /* This thread's sigaltstack, if it has one */ struct target_sigaltstack sigaltstack_used; -} __attribute__((aligned(16))) TaskState; +} TaskState; abi_long do_brk(abi_ulong new_brk); From patchwork Fri Jan 14 15:37:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 531976 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp597031imp; Fri, 14 Jan 2022 07:42:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/b5U0ZZPS7pcW6b+U5VBCIaNrPmpuMBl3UFMbO7/Jn/r1ut5z3GY9SD6TD1l6NfDefWr3 X-Received: by 2002:a25:cb13:: with SMTP id b19mr13948638ybg.497.1642174939213; Fri, 14 Jan 2022 07:42:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642174939; cv=none; d=google.com; s=arc-20160816; b=lHY1qQpmeOY6XtgljVVyBGroTqak7ewLSNXQl5TsJoU+iFCjYqoa6g43wR/7lx4bG9 9CRmMwZ44WrrQzolUFcBRzaAnJmEM8Bhqg6Hvjy3zB4irIHw0m0jniwPosBDEn/Xc4np gnqP/iuUm4IrE6cI8zuvfNL5pRDFAJ8Z8vo9lVM5wEBHKvZ1CxHwpPNsIMManNVyKdDE YkPoex4nAYWtm+C1ZiLDRM8R+A+tCXOb27a/KdSBQjVKTl274kK2kFfop4KcIllHUAay Z/Egz1pq0Ovu4hoHiGuKdQ/iGW4XSFIbk3RryDaJUkrBtXpL1GABPrv8q+PhyHZyXR8h s4pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=J28a/NNVYEjFSLH7bw1vfwdi9VWF2J04rRZYQ11TvGw=; b=WO24L40nCigaD5umaqr+0o8jcW/3BuRCdBPzt+cDJtdcRCGzjEf1z1fvM2ethyc3Gx F62F5fvNeulHhzaOhSivuKJGcsiICGJuFNLY9XoX1ffVcBqPE7PeFMI+IoiLuQvgcMah Xl4Ve/Hb67g3VxquMCUiEFTKJzngJHSAE2rtnGUoAceyboMwTWsgTmlj60kaVHyK7JP9 cbuBOnDothDA+dfKxkVuMApv4AiwpGvzICqK16zocvMnBOwlcXKZ+x3Z3jxQB3XOlt1I 84nq3aAe9bRFQZu2NlEdJj5aZndPofUmQCT1/FVGXLv8+aHYQy0B7uTBhJgIjUHdAylo 55rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EDH06yxH; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c6si5037599ybo.292.2022.01.14.07.42.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 07:42:19 -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=EDH06yxH; 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 Received: from localhost ([::1]:37914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8OiY-0003XD-OG for patch@linaro.org; Fri, 14 Jan 2022 10:42:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8Oe3-00088I-Bc for qemu-devel@nongnu.org; Fri, 14 Jan 2022 10:37:42 -0500 Received: from [2a00:1450:4864:20::329] (port=41781 helo=mail-wm1-x329.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8Oe2-0000cF-19 for qemu-devel@nongnu.org; Fri, 14 Jan 2022 10:37:39 -0500 Received: by mail-wm1-x329.google.com with SMTP id q141-20020a1ca793000000b00347b48dfb53so6451853wme.0 for ; Fri, 14 Jan 2022 07:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J28a/NNVYEjFSLH7bw1vfwdi9VWF2J04rRZYQ11TvGw=; b=EDH06yxH2Jus/t7A1iyNwmW8E4F7XIAxP/Ee8V+VS79LyGRi+7GrSdTrKwn8loi+xL G2VdGhIJyvr7CY958zwEpANfywEp5e0vuxW/ZiAPuN/zpyb0tNyZOfqm9Vl4m7ywuePI NbT0L37Mj3mbprsR/eeB3a95QAPwLL18G7UYYfVP3IHtc2NrNt8Vu3KFH2HWnCUxDIHo CdGj0FazrFiHwcI3u16VVunM9/7rlLbSCU+BxHa5f8tcUVLj7sRca8T6I63EnhSppUoD ErFT+Ss1NGjQE3lD204Ih0CfIkTRgwUEw8wF1lPoQenjqIi+BXwhCW46I5yJvpK/Z8fb 5hBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J28a/NNVYEjFSLH7bw1vfwdi9VWF2J04rRZYQ11TvGw=; b=O7A6W5FhjEYYCyESQ0+2VotOzIrVUc81MfeO6eg7ROBk1wxMzMD719pf7eqJDlzFSC JVP58AZA6jxymoZcgIMpFPaGlgpDDtT/sjJTtnMo5twNxaUOufDikysGEKCgo3J/jHc/ uyA6enQcoB73cpKsvG6C/jNamRHFUzYWW353bU+p34Djo5+PRurEYZlvyMu3bd/jPMfX iDgTg2eB5RtxnIq8zLubvfVxdA3XNh1m/zE5HOSO9NgzHvlslgHiixvXN7WUguwUdC0g cTrL1RAZkQIDjRd2DZikZxsSV151VXCMvuiIdVDuS7I/Ay5TXWnVXj5f2QGezZ6KQGh2 BZhQ== X-Gm-Message-State: AOAM532/kRmbflfB7F0d/+cTAWF6eIYI/JYz+tnjkViZYzkR0CAv4DfM WyLaj+ZQZxa46uXVlWaYDPAQrmcB6XHrrQ== X-Received: by 2002:a7b:c413:: with SMTP id k19mr16264749wmi.25.1642174655929; Fri, 14 Jan 2022 07:37:35 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v13sm6464141wro.90.2022.01.14.07.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 07:37:35 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 2/3] linux-user: Rename user_force_sig tracepoint to match function name Date: Fri, 14 Jan 2022 15:37:31 +0000 Message-Id: <20220114153732.3767229-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220114153732.3767229-1-peter.maydell@linaro.org> References: <20220114153732.3767229-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::329 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In commit c599d4d6d6e9bfdb64 in 2016 we renamed the old force_sig() function to dump_core_and_abort(), but we forgot to rename the associated tracepoint. Rename the tracepoint to to match the function it's called from. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- linux-user/signal.c | 2 +- linux-user/trace-events | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index f813b4f18e4..bfbbeab9ad2 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -734,7 +734,7 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig) struct sigaction act; host_sig = target_to_host_signal(target_sig); - trace_user_force_sig(env, target_sig, host_sig); + trace_user_dump_core_and_abort(env, target_sig, host_sig); gdb_signalled(env, target_sig); /* dump core if supported by target binary format */ diff --git a/linux-user/trace-events b/linux-user/trace-events index e7d2f54e940..f33717f248a 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -9,7 +9,7 @@ user_setup_frame(void *env, uint64_t frame_addr) "env=%p frame_addr=0x%"PRIx64 user_setup_rt_frame(void *env, uint64_t frame_addr) "env=%p frame_addr=0x%"PRIx64 user_do_rt_sigreturn(void *env, uint64_t frame_addr) "env=%p frame_addr=0x%"PRIx64 user_do_sigreturn(void *env, uint64_t frame_addr) "env=%p frame_addr=0x%"PRIx64 -user_force_sig(void *env, int target_sig, int host_sig) "env=%p signal %d (host %d)" +user_dump_core_and_abort(void *env, int target_sig, int host_sig) "env=%p signal %d (host %d)" user_handle_signal(void *env, int target_sig) "env=%p signal %d" user_host_signal(void *env, int host_sig, int target_sig) "env=%p signal %d (target %d)" user_queue_signal(void *env, int target_sig) "env=%p signal %d" From patchwork Fri Jan 14 15:37:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 531980 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp607318imp; Fri, 14 Jan 2022 07:56:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqRUEflFkARIC/YuxfpEu1tBsCgbw2DO94nauNwKJKUN7/wAYMWEbkhIKTLD6jhx2evQRL X-Received: by 2002:a25:5d0a:: with SMTP id r10mr13836511ybb.166.1642175812453; Fri, 14 Jan 2022 07:56:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642175812; cv=none; d=google.com; s=arc-20160816; b=jxiK9drsjs1AB/ODKyQeOlv8kIuo3qxXVnFB2Az3MmL+Qnk+Ae5azkqLlNCi3icD2m xVsdcdWDld7C9Z/cF16KRO2vI9E78FhP6QjHk6OLYgOQQRUFrUgXPBI2fvnfjd5VYuEt HBkqhLb87zBEJETJxMnTqBa+qrBqrGRQLK2Va6UX5iGtWSH7o714N6myyFg8zWrsWocA fzao9YGHsJ/NwhTJHXmvHZBxXjiHeJMcqhPPPZkHzegFNaiDXDGlFgEKVQ7bcxj1Kt2W /IjuGvtbz0OeOxTYCj8D40ct3+/5/WYA6Hj3HSScwNJ/J5OpmKvRixavkR6rAtl79DFu 5gQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=fY4h9Zasl1T6lu5BwFhXAKfI2EvfJnF9sL2oRaoqTGk=; b=ckAoutON2z9GeTJFcT0W4HFIuO2e0TdFFLAIFtVbbe/U94dpn8FIOD/1SPrJtlvSqk ObIosWDrazKa9oBgeD91FqoNJrAgE88nl6/XeJrj7MrV/bKIAXqIhwKI7HBOvz+Qf2ay doBmlnph5ZWfZlrxnTmX4kTI7YxQUSgL5Lh3e8FFqci0A9tjSAHkO2RPBtl1W2BOVswW ojAZEog+J/HZuzMzS20jziVi+vhicB0Iot/OQYbHFnXLFvOzJa2OwRh7ii1en8oPl3JE t6efcKycwxSQlqCRLf6bfAvJhXOelgof2XE1Xtcffz8iFcBpvQIuWzhgEfTZ3QIB3Ntd c1GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cOIG5Uuj; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u18si4922858ybc.786.2022.01.14.07.56.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 07:56:52 -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=cOIG5Uuj; 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 Received: from localhost ([::1]:34542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8Owd-00059A-MY for patch@linaro.org; Fri, 14 Jan 2022 10:56:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8Oe4-00088K-NP for qemu-devel@nongnu.org; Fri, 14 Jan 2022 10:37:43 -0500 Received: from [2a00:1450:4864:20::433] (port=43650 helo=mail-wr1-x433.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8Oe3-0000cX-BU for qemu-devel@nongnu.org; Fri, 14 Jan 2022 10:37:40 -0500 Received: by mail-wr1-x433.google.com with SMTP id o3so16219461wrh.10 for ; Fri, 14 Jan 2022 07:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fY4h9Zasl1T6lu5BwFhXAKfI2EvfJnF9sL2oRaoqTGk=; b=cOIG5UujQAev1mHdAPGLcpBxYivOBceG9Xp9trVyRF86PWz0UwYY0da3XrdcNtZS6T YfFxLdhhKLgVjDYUh+RqlBp7mgexfeXEHVfTgOeF03nSyKdH46pL2ZqpbfVXF/P9CUqR 8OciWjlAArY9bN5iVWs9qjZ8WayhOMw/WM+sf9ya538NKpB4XdCDQMNtC0uy4XTFqRMc IXgSoQOfqwX41uW4XWLfgJrVZj772p1VL8y7MMLMjTYC4l0EvWCeCAMLnA2IVO+frGtf gPob52sRl/ujjFBsTnw1biS6ECnML5oxtYdtSS5hjqe19jEYPmGuxG7e32qKpCLGzeQr 0Y3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fY4h9Zasl1T6lu5BwFhXAKfI2EvfJnF9sL2oRaoqTGk=; b=DASYAMFA4384MGnrICj1rQgB8XOzr7mqowoMBhY5eXUdP1Jt0WB/fDapSw7cRGeVq5 DQ+NKAdtPUsM6hBrcvoUBoSdEKN984ZGeqyRR/Qjg1AcXqLnTP8UCnazsjm4gP1Vy61R /iUo521JhNjLdhMAahEJFBSHDTacXHg5rMw0oy3a3wyNW1XaTSXSFfoWMKNjFfXPrZm/ URcM65PJzvVeFXhAtW8Hv39Fgfxwfqhwt0Q67ywr8JE5F5NbJv7xvjCPUFBHmgZlPBn/ jY7OoDXEWGM+KRuagX/2nC2ZbItk1R0b7G2voFTSZ3t5IqBXRCr+yQz9Ddb/b2DYXRyZ 0iBw== X-Gm-Message-State: AOAM530P+yn6ABXo29F3Ob+54XwKfil6klD4dkDpDGAtKOVX7mSK5Urg qQWPq37iPUjUjzTvv9XkmmyN2ZTsd9NLLw== X-Received: by 2002:a5d:6c6a:: with SMTP id r10mr5118704wrz.489.1642174658177; Fri, 14 Jan 2022 07:37:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v13sm6464141wro.90.2022.01.14.07.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 07:37:36 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 3/3] linux-user: Return void from queue_signal() Date: Fri, 14 Jan 2022 15:37:32 +0000 Message-Id: <20220114153732.3767229-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220114153732.3767229-1-peter.maydell@linaro.org> References: <20220114153732.3767229-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::433 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The linux-user queue_signal() function always returns 1, and none of its callers check the return value. Give it a void return type instead. The return value is a leftover from the old pre-2016 linux-user signal handling code, which really did have a queue of signals and so might return a failure indication if too many signals were queued at once. The current design avoids having to ever have more than one signal queued via queue_signal() at once, so it can never fail. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- linux-user/signal-common.h | 4 ++-- linux-user/signal.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/linux-user/signal-common.h b/linux-user/signal-common.h index 42aa479080b..2113165a758 100644 --- a/linux-user/signal-common.h +++ b/linux-user/signal-common.h @@ -59,8 +59,8 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, void process_pending_signals(CPUArchState *cpu_env); void signal_init(void); -int queue_signal(CPUArchState *env, int sig, int si_type, - target_siginfo_t *info); +void queue_signal(CPUArchState *env, int sig, int si_type, + target_siginfo_t *info); void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info); void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo); int target_to_host_signal(int sig); diff --git a/linux-user/signal.c b/linux-user/signal.c index bfbbeab9ad2..32854bb3752 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -780,8 +780,8 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig) /* queue a signal so that it will be send to the virtual CPU as soon as possible */ -int queue_signal(CPUArchState *env, int sig, int si_type, - target_siginfo_t *info) +void queue_signal(CPUArchState *env, int sig, int si_type, + target_siginfo_t *info) { CPUState *cpu = env_cpu(env); TaskState *ts = cpu->opaque; @@ -794,7 +794,6 @@ int queue_signal(CPUArchState *env, int sig, int si_type, ts->sync_signal.pending = sig; /* signal that a new signal is pending */ qatomic_set(&ts->signal_pending, 1); - return 1; /* indicates that the signal was queued */ }