From patchwork Wed Sep 29 13:05:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 514840 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:4087:0:0:0:0 with SMTP id m7csp17982jam; Wed, 29 Sep 2021 06:19:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVoQavVVaVqY4ke9s/22fkDmYtc4yw1D7ILVDAyU/ZBAsdE6YZp4mZj7FGzLPHWKV/cT0k X-Received: by 2002:adf:e44c:: with SMTP id t12mr6892198wrm.49.1632921590356; Wed, 29 Sep 2021 06:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632921590; cv=none; d=google.com; s=arc-20160816; b=cyxG4TS07dnlUicpaTYaVP655nQ4hUqyF3Vke7E/6aRpFJZ9fagfqlSKt+SUG3yVM8 +seI6+sdQPPljXNUFmyssVxGjsAfMWVKjBmjwwjkKl9ieIthbwbPsXuhpzrbnS5K0iN0 Hb5Xi4Xdlzv3Y0hvXDz8fzdEsNkU5zfzkwjh2fGjWBTD87lX53YelCk65zhbozvMLvzV 0tS/QVvGNkFffWps/AVvkmYSOq9oVk5OT+GxrBBIUvmXctB2XomiOtxh4kZpiwgx8MJU 640tDbQiugfQ4K69mKIvkJAiFdM7ioEmongnmA3Aci7V91qiOVlHlFZIqqTbErPMIO2W h74A== 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=7zszFeWHoddqJiQjxDacbGdC0FlOhNlodUAD1GXKctw=; b=wDtJGOGazmXmI+jIL2tuk1YYbPFkvgnMjzJpxVBGqYDsbqbeE6y/fVffqnuixhl2ZD 338NNzFVWX8Bs6y9+DVGqZG2yZwNgWb8Nlu1qraJJFIJ45QzYMsWC82dT1HZufVl53Ux SqCA1z7Ls5Lkvvgn9rCPbDIo/MNPsbTVRoPSbgEBrs3Y6YrDQQU7SWexvRsAPoHGqFrc YPXUcadKfv+sIAJHJgQi1lhuXXZapNlBMaMR/w69zvInGrQ6EgbRCvXbtzs1GWKu7Nn/ HULu0GX7stBV0KPpDgBtV94DSWne8Kb4iOz0E1Mbu/8OtcVUD3EVM//jTSJACR4ghkc4 UvlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ubKz+tGh; 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 i29si1477250wmb.145.2021.09.29.06.19.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Sep 2021 06:19: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=ubKz+tGh; 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]:60650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVZUz-0001Ae-9d for patch@linaro.org; Wed, 29 Sep 2021 09:19:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVZIH-0007MJ-Ss for qemu-devel@nongnu.org; Wed, 29 Sep 2021 09:06:42 -0400 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]:43663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVZID-0006Lt-8l for qemu-devel@nongnu.org; Wed, 29 Sep 2021 09:06:41 -0400 Received: by mail-oi1-x234.google.com with SMTP id q16so2764689oiw.10 for ; Wed, 29 Sep 2021 06:06:36 -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=7zszFeWHoddqJiQjxDacbGdC0FlOhNlodUAD1GXKctw=; b=ubKz+tGh0AlMI2BYp96swNidwDBdZ1rscbambE9t9NVmhJu0btAq1qR1DYjh1lQN+Q XMoEqmt6o7RzY4ecTzBXKUVRBMeuHA9zaz4geCV72WDARcIJjtuULArQgzBcfGG7L/XJ VRQye4wQRqvREC8eR17MDMjSZeUujqOe9ptMKuNM+2NA0/x68uRirNVSRF+5Qlg7d+r7 aLMRNemr6rSuN4gyO3GhTkecu+eJSCaHl+6zkcwF8hgb4aXBhJJGsGhfgqtjxzBleuUa HpnkU6pHa4gQ+ylFI9NJ50S/C+PBCDlXjTI9yiOTB4AAvCA6yVCobqvlz2xCi0Izr2zd GDXw== 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=7zszFeWHoddqJiQjxDacbGdC0FlOhNlodUAD1GXKctw=; b=x78VaHtJXCQm55dchtS3x7rFyewpXhVtcqJf/loVouNVhZqqqZrwxOu6wO11Q34OK9 9zx/KozoenfdyYnllyMau7F9T4gPWc/2Q2KYLWGs3T/Fel2aQGlVqnIitxqMXg0JlUi0 S5oo/poUIUsY7uTSNA902L9k2KVN6s9A950ZGnx51G4xRbsZLYDuuxxjsixx2xhe6ZVt vgRedJJPjMXOR8SfNDP2vWqF11lan/er6FZPzptMh2C3ihB06sq9XskK9+frIIl97Cj0 5oh3qq+/rBJGj/W1wtuGowem275+cQ/rP7ZsvUKQx/W2LoScnDrjVD6cr/6TysfXIJiF V2oQ== X-Gm-Message-State: AOAM532+x0vOSoOl7rnWp17S5zM1KsMrfDGLR1VZl3MZ4kW5b77SXe7u S1Uoj9/aU3oDEisxFUS2uYlblsgsfsyseQ== X-Received: by 2002:a54:4810:: with SMTP id j16mr8009994oij.103.1632920796235; Wed, 29 Sep 2021 06:06:36 -0700 (PDT) Received: from localhost.localdomain ([172.58.171.248]) by smtp.gmail.com with ESMTPSA id w1sm442823ote.41.2021.09.29.06.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 06:06:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 18/26] linux-user/ppc: Simplify encode_trampoline Date: Wed, 29 Sep 2021 09:05:45 -0400 Message-Id: <20210929130553.121567-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210929130553.121567-1-richard.henderson@linaro.org> References: <20210929130553.121567-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.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, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= 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 Reviewed-by: Philippe Mathieu-Daudé 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 e4d0dfa3bf..77f37b9f01 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -309,10 +309,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,