From patchwork Tue Jul 6 23:49:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 470710 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5474266jao; Tue, 6 Jul 2021 17:10:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX8YYZf4VI83jq3ixEYmGa9j3rVU2fylKbJ3XzI+RDiJTeuXyxRuwhXZcTOqxpvIKoa9om X-Received: by 2002:ab0:5a4c:: with SMTP id m12mr3297966uad.40.1625616650537; Tue, 06 Jul 2021 17:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625616650; cv=none; d=google.com; s=arc-20160816; b=wKym9XFF5Mz1PIOCi9v8mB87iYYqm3VFJyGLqrdZI3yvwXEtyRS7JzWkbeI97JO/Mk gdqPQeaYAy7hl64rbaQbTYhFOjHchHpSgnTIfUKtYRevTagZO27k6Vb4RL1JtxC4sgcr r3E5a+579o6K1743ogyfSH/MXr09ebZMJIFeP/vECzY3mf7NSyxinNU2DvmDFVHYq23k 6/wiMedHh6aMrVxXc11lfS9nx8Xzz9ekRAFM8iOYV9saK6U/HYKHcUEEMcFIbhV/WKcb FwcMrfkBgVgff0NowhA6vv0iPEJSezoUd2MDIzf2oJs1mk7MbRdV/18fP0HWKKfC7y2b iqQQ== 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=EI7h92b1yJotII6nje5EoFkQR471c3va7QkzOD5rBK0=; b=hNGzF8vA5Vx69qjlIF8stjmmq7gRlDqmqw8KDjYnNiduxcc/jJYN4/flfa6gjPfngg +phH9hgdeRJDBkjnaCyHEfouVM5o+b2k/yX5ej0fVr/DQkzD2khcuFCaapY0LC4lY4cF TzaijAhS1iTF6GGquqhJFgc/7QJJ0KcepQEBkGgEiHOnMT6UYtv+0VIwHHxkvh5zXXkQ CCotS71rCSwSv4UdDnUgevLDiDflL64v00DB3MkueYz64NMC4R6sE4CsY/IzSMnEeJDD id5OVoOu71MzAZE1PmaMAqOtQEL7qQ0GKYMOpJk1Kuym07SWIFN1T6sropGYGBV8N/eL ffzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=L+Uw4390; 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=fail (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 b18si1107741uaj.46.2021.07.06.17.10.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Jul 2021 17:10:50 -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=fail header.i=@linaro.org header.s=google header.b=L+Uw4390; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0v9N-0006Qc-SC for patch@linaro.org; Tue, 06 Jul 2021 20:10:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0upM-0001qw-R4 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 19:50:10 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:33570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0up7-0006gV-OB for qemu-devel@nongnu.org; Tue, 06 Jul 2021 19:50:08 -0400 Received: by mail-pl1-x630.google.com with SMTP id f11so78826plg.0 for ; Tue, 06 Jul 2021 16:49:53 -0700 (PDT) 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=EI7h92b1yJotII6nje5EoFkQR471c3va7QkzOD5rBK0=; b=L+Uw4390qrHD/Zlvi8CwiX3Z2Lp1r0PkrWbZWNtSrXyc/gvIDRpsNVznYvLbV/mfl3 ukAXRCNUwgsXv/2FPsV8KBgXciMtwcP0gMailXPLCPR3FTS3Qx+XzXTssV9Z6P+bQPiF HCYWxcTlaPCjaM1kzRVVFWJw8i+eywYR4u1WvYvfFkWz2K2LpyTcLDLr4WP8Jz/xhQO+ yjAB3HMx9IPDROHWl+Z3mga2iAdH62xJp/jTPLIZ7ua/5QtNn2gTSwhJXg9EV81HVB3g wtI/2quUbUo90VLxHap4H5qfIxmDXeVg3aEMf3De0VqTPdMY7dwrGelQm6bSuPey1Krw pk+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EI7h92b1yJotII6nje5EoFkQR471c3va7QkzOD5rBK0=; b=KEHr8NPzMA1Z0b21slzSdMtTJwbOQae+eSgTsbDyPCIszE3wwYvkBH7y/RLTznjdf3 6e5JVoxRPCthRNyr3TapXqzTzRcE0YCSZO4xGLBYOhpihVZ+iDCRGuftME+h/+YDJN0T IJ3xOIAEp8sl3033F5F5Eew7w6AXOWtAb1G/8nJDU4E7lmkO39JwSXtXBDke9gD9H8d+ FoeADuKmfWoTtB4qlANd8yU2v5rwkJ06RSNsPG2ST73i/Fx0eobCXRGboBx587BUXNBx GIRkvEo5Hdf4FCVyMMnpxbYOFL/GKF60YD8S41dzgKFs3Knis5XK0ks0sBm0q9lAostu xRWQ== X-Gm-Message-State: AOAM533yRpiB4UyNgukfa2UrroQubbhsgQ8KH15RbJsEr+v9NNrsIJJY 4SApQs52L3IpDiaX7l/dNJq2gfFibO8phA== X-Received: by 2002:a17:90b:3712:: with SMTP id mg18mr22666440pjb.164.1625615392523; Tue, 06 Jul 2021 16:49:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b3sm18058114pfi.179.2021.07.06.16.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 16:49:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 30/36] target/ppc: Simplify encode_trampoline Date: Tue, 6 Jul 2021 16:49:26 -0700 Message-Id: <20210706234932.356913-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706234932.356913-1-richard.henderson@linaro.org> References: <20210706234932.356913-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The sigret parameter is never 0, and even if it was the encoding of the LI instruction would still work. Reported-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/ppc/signal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c index edfad28a37..70cc27b0f6 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -308,10 +308,8 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame) static void encode_trampoline(int sigret, uint32_t *tramp) { /* Set up the sigreturn trampoline: li r0,sigret; sc. */ - if (sigret) { - __put_user(0x38000000 | sigret, &tramp[0]); - __put_user(0x44000002, &tramp[1]); - } + __put_user(0x38000000 | sigret, &tramp[0]); + __put_user(0x44000002, &tramp[1]); } static void restore_user_regs(CPUPPCState *env,