From patchwork Wed Aug 23 05:16:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 716080 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp622582wrp; Tue, 22 Aug 2023 22:18:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAWwe8W9o2/X0agsw+hpuqSK0mVmXQebx4gTvfdQt7FNZ7QsdEbI2jNaP34QlSmLiorma+ X-Received: by 2002:a05:622a:134f:b0:403:996c:9fa7 with SMTP id w15-20020a05622a134f00b00403996c9fa7mr17547196qtk.60.1692767936564; Tue, 22 Aug 2023 22:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692767936; cv=none; d=google.com; s=arc-20160816; b=woTcwNogOOQuuRGfK0bE4wWYzk6uGEC2ogIrL2uUvcqBXLb8t5wpYqgDyoScEQOmKc TPAuh8YsmeRNaCrbbr8mVHSyAobWRVKr9m5RAdzu9980deI/xwRIIMcRRK8nfzFq8sQp OlAMhY36M1o6a1fHcySmLZO/uOXIzh6PNVNFwRikyHlsbJnLa/YfsS69qU98qZUZrdBa TR4JeIqW1UZd0XI3wTwtgGXHbwJsu69eJ7ZM3+ulffIWAsfPgnbzh8vWA3V/GzEji5AX WbCsZyZrNybsFsnQd3Gr06Wqdnmjn1GHjKkSE6nuWfFExoENlJzqK+L0PyUxEDG4vph4 7l9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=MF9qpDyL1+Jx07it/Adc348RqrT40R2QZvOOKU6UpHk=; fh=uta8CuNdWwEUIsmWLQQIuZWY0GOyjYTd4DbN32nR8cE=; b=qqYp657DlJ0oOrFvh2fvgzo2MJMzdzlxq/jOVpqZSm+DB5pNYT2Hotv0J07lirA9Vn 29MNpmRcDd/Hjib6F1rG9c8x70pBMdYkUP7m2tVP4QOKGCIzup3vpPA8qmwJIH4onivk agcyobVESqiCTmojFfDrvhltIU6388TAC8I5xznxn7Qun7yiRJdiJqxevByAB0DPxYYQ mD/X3FkvVT8GUst2KBj42cTnF0ECwmUwsxqMQhc05P/KOWwpcGEYnracnU9THVTz8aCy Q6yu3Yv+cl/wUs2weBvLQ9E7giD/jIl+ep66dwbqKSwvnXTxCoOAqCPSYGHPi7xkt6bn rXxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MfpiO4YK; 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 s18-20020a05622a179200b00403f3141703si6696160qtk.619.2023.08.22.22.18.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 22:18:56 -0700 (PDT) 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=MfpiO4YK; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYgEJ-0004xU-Bm; Wed, 23 Aug 2023 01:16:31 -0400 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 1qYgEG-0004wa-Uu for qemu-devel@nongnu.org; Wed, 23 Aug 2023 01:16:29 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYgEE-0000tF-Md for qemu-devel@nongnu.org; Wed, 23 Aug 2023 01:16:28 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68a56401b9aso1962804b3a.1 for ; Tue, 22 Aug 2023 22:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692767785; x=1693372585; 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=MF9qpDyL1+Jx07it/Adc348RqrT40R2QZvOOKU6UpHk=; b=MfpiO4YKCTuzTwiXQH96DPVy+i7PG0zMdcQjNJuBJ07BfE746EEE81fGnWTl1fDyhB qUCnLojJIw+4QCNWSrX9sFIexkr5JfXOoSgcVEZ+YHZHM+C7/N5+8ff8pacVzZNsxpNy H/qssMS7UQMxcyigs18JHD+c5d9NnHBHzlKAKTPaciLf3gPc5LDqxV2/MTacpv00SfmX nDz1/ogc6gczBsRfXCWHTGp/hDwFFZgsck9cdcehLoabkKBZ+/cP33nM38CHMbnY+ZAQ DzLteF13pUVnXrrAYRVVT98Jno9OgflTtBsN06Yr+hwkLscI6VkI1YB8G6HB8blFrHoa eY6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692767785; x=1693372585; 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=MF9qpDyL1+Jx07it/Adc348RqrT40R2QZvOOKU6UpHk=; b=E5sOw/ZGa6n8xYuqIPaRW7/DhTAzf7dClDDp3nEo7lQhJNtJpdcg7OrDZxXx7vV4ax 0sSoDOM81gh6zlzYykuk3auQkPuWIGevBzEl9x9IvWD3u5E1Cl/itIrLR5ID8if3cZpV 86/r0GlyyvmP4llmcGRGOM11M5PZ1MRkTr7VCSX4xgXMEMsw0ukBOKalVslr3k0sxaV7 n6XOJR7eE+VciFUkEBF0FSePGa45bfyb2cqsmqiC3GJoDZp3701W3m/eNOfqhnGc5hml HKUoWkYxfZ9pjE5fwzEoif3B+xuE9R0tlIThz8bYqSSD5Q4coGlM4A6eBOg0XGCpwdTh 7umQ== X-Gm-Message-State: AOJu0Yw/1rPY7la3fBxnlI/Q/FeB0Bwz/Jsx8yT/W14xW1bIIOvo8Fa3 GjXXDFr5ZWoiUIhfSV0rJCsCW2oBZRK4JhnxnSM= X-Received: by 2002:a05:6a20:9148:b0:118:e70:6f7d with SMTP id x8-20020a056a20914800b001180e706f7dmr11353660pzc.10.1692767785351; Tue, 22 Aug 2023 22:16:25 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:4e3c:f4a4:b92a:b5ab]) by smtp.gmail.com with ESMTPSA id 5-20020a170902c24500b001bf044dc1a6sm9969402plg.39.2023.08.22.22.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 22:16:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v4 07/10] linux-user: Remap SIGPROF when CONFIG_GPROF Date: Tue, 22 Aug 2023 22:16:12 -0700 Message-Id: <20230823051615.1297706-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230823051615.1297706-1-richard.henderson@linaro.org> References: <20230823051615.1297706-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 Protect the host's use of SIGPROF by remapping TARGET_SIGPROF to one of the RT signals. Signed-off-by: Richard Henderson --- linux-user/signal.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 9d16e3c8c5..b8913968cc 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -523,8 +523,15 @@ static void signal_table_init(void) * multiplexed over a single host signal. * Attempts for configure "missing" signals via sigaction will be * silently ignored. + * + * If the host is using gprof, treat SIGPROF the same way. */ - for (hsig = SIGRTMIN; hsig <= SIGRTMAX; hsig++) { + hsig = SIGRTMIN; +#ifdef CONFIG_GPROF + host_to_target_signal_table[SIGPROF] = 0; + host_to_target_signal_table[hsig++] = TARGET_SIGPROF; +#endif + for (; hsig <= SIGRTMAX; hsig++) { tsig = hsig - SIGRTMIN + TARGET_SIGRTMIN; if (tsig <= TARGET_NSIG) { host_to_target_signal_table[hsig] = tsig;