From patchwork Wed Feb 6 10:53:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 157612 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6263334jaa; Wed, 6 Feb 2019 02:54:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IbWatbiCf3hEQfQLdMjficPIoHvg1gWw6z/4zwYzmQbTuJBwlGhx9oY7V+aH4t92kdiV/AS X-Received: by 2002:a25:9ac1:: with SMTP id t1mr7703872ybo.224.1549450445256; Wed, 06 Feb 2019 02:54:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549450445; cv=none; d=google.com; s=arc-20160816; b=Qz4ybmO5y1byhiiQGhkF0w5HfR+1hnxZxsM8D17Lu89UAZJayZHNECcSfZ1/PB03pe hKeJrgdgeLQQn27K3BmgnJAvFdb1SFCsReir+K+ePhvZuT9IXoZcabOMqm7QoUk0c5Ja 1p399T0QVrFrago6TNenqnVQ0XBtWj07h742FTvDrvk8AyVhs3ZM0hTvN5wpZYBoGoyQ Gm3hywYbJNm2KU+183PzKBLNLqnzhozioBEKdszYbzHChGZ1o12Un5I0VQw+AKka7bAj hU38AVuoxrdX2hrhsTK5CoSWMXA0QkKtHRPplRixeYBRadTmRCR7Xxfj7DjPaSOwTvR8 VEYg== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=uUVVSrOIsw7s88Otw6RQtbHLpqZarBDmGu7sNDA6noM=; b=KyIIKSKhlu0q4Z+7eGqlh1dTgYJMPO+FflEWXtldygFrTxhSRU3wiVhh6O1Eb9RqYu KWLZCx8tJf3hYfHbR4cn4qydolh6KVVRnX41w1v+NXVKJJXy1bwgoCvN7PiDGLqUzVFC TrNfLDf63cCSaPnQXNjZUW0tf1JdxbUAXrhtTE54yB2hWlNF+XRTkdv/SjmeaklziNTm C6tuw/y/37M+e7+vD1fGRrlMErL1A0zcxpGG1PhMkJCCXq48vcZhGUQFLdYYyjZFSpY9 xEq5rwnZ/tQEjzmflEyeVgNk1bNUjOrXJH43CspJ85cWpoBDrSW1V+QJN07IuM0YT4W8 w3iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KUuAIJMS; 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 h126si2107913ywd.43.2019.02.06.02.54.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 06 Feb 2019 02:54:05 -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=fail header.i=@linaro.org header.s=google header.b=KUuAIJMS; 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 ([127.0.0.1]:48419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grKqC-0003nZ-RP for patch@linaro.org; Wed, 06 Feb 2019 05:54:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grKpx-0003mL-OY for qemu-devel@nongnu.org; Wed, 06 Feb 2019 05:53:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grKpx-00009E-1u for qemu-devel@nongnu.org; Wed, 06 Feb 2019 05:53:49 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1grKpw-00007I-Rq for qemu-devel@nongnu.org; Wed, 06 Feb 2019 05:53:48 -0500 Received: by mail-wr1-x42f.google.com with SMTP id v16so5134663wrn.11 for ; Wed, 06 Feb 2019 02:53:48 -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; bh=uUVVSrOIsw7s88Otw6RQtbHLpqZarBDmGu7sNDA6noM=; b=KUuAIJMS59olenRG8JiQpXnumR2uVUmvpRsLCKvHMi5NfXJhkdvwp9CtVNTFXjB2WK Z8tgW/I5KDfR+rUHNTBiq5kLe97krMxR6vc0UiVOUBFW5eQ1UycKu+c7Nr4SVpR/My34 BSk5u8KSvNjuLRdXZZmpekyHsqNYnvNgiSmipI8Hg3BgWB3KYptp8eSbOnVVx5KT+Zkv CRgb3VAcApLrCCsZqnXkymUKQwPHORCgLaMSCqBjuuligsMrYSX0U1lpn3IGfmONZSm4 z6OTBsmKHkrnYGmozMaNHKUSvzVydUYg6fO/DDqE8iEWQsJuN2u1fZYlGup41nDW2bFE gQig== 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; bh=uUVVSrOIsw7s88Otw6RQtbHLpqZarBDmGu7sNDA6noM=; b=HA/y1sg4vs4uBnr3lzS+TRffuXwN9s+NjAadSA8YbYdYJlMYnyM+z3JXhtX8D/YsRu FCGcB7+DB0ZqCXYrxkv5FWA2VEXTlm2L29hNYxJVUXGcIIV2Ef+mX3fMrZPajYeEv53+ 7f6/B91eJl9ZGnbcLyyLl5lyQsrjE+F7NSPw4hTFtULyft9TuLuDzbyMMa8OduX4B8BV JkhnwGB0/piOtv5FwAYjZoWEQQuEA9tgGziMvh+J8x36KgD/DytGrBYGzwrVlB5mwro+ pndZb3bQx4mEwEMIZA5zqb4fPEMvG0Fg1doFx9GX0FZCscA89su/pMoMiZ3a2SJXRHWt du4w== X-Gm-Message-State: AHQUAuZtJYO/GfS6wxqFpXkZMloziVXgqYZsNdH4Hxd1PeXTARPx0un9 6YuIOSxvDH/89XhXlnnaiI2kVCfmZkzgfQ== X-Received: by 2002:a5d:4d46:: with SMTP id a6mr7576434wru.28.1549450427246; Wed, 06 Feb 2019 02:53:47 -0800 (PST) Received: from cloudburst.twiddle.net.com ([212.187.182.166]) by smtp.gmail.com with ESMTPSA id v4sm16421568wme.6.2019.02.06.02.53.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 02:53:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 6 Feb 2019 10:53:37 +0000 Message-Id: <20190206105337.11559-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190206105337.11559-1-richard.henderson@linaro.org> References: <20190206105337.11559-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f Subject: [Qemu-devel] [PULL 3/3] target/hppa: fix PSW Q bit behaviour to match hardware X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Sven Schnelle Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle PA-RISC specification says: "Setting the PSW Q-bit, PSW{28}, to 1 with this instruction, if it was not already 1, is an undefined operation." However, at least HP-UX 10.20 sets the Q bit from 0 to 1 with the SSM instruction. Tested this both on HP9000/712 and HP9000/785/C3750, both machines set the Q bit from 0 to 1 without exception. This makes HP-UX 10.20 progress a little bit further. Signed-off-by: Sven Schnelle Message-Id: <20190129191402.29539-1-svens@stackframe.org> [rth: Add a comment to the code as well.] Signed-off-by: Richard Henderson --- target/hppa/op_helper.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.17.2 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 912e8d5be4..6bf478e7b0 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -665,11 +665,15 @@ void HELPER(reset)(CPUHPPAState *env) target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm) { target_ulong psw = env->psw; - /* ??? On second reading this condition simply seems - to be undefined rather than a diagnosed trap. */ - if (nsm & ~psw & PSW_Q) { - hppa_dynamic_excp(env, EXCP_ILL, GETPC()); - } + /* + * Setting the PSW Q bit to 1, if it was not already 1, is an + * undefined operation. + * + * However, HP-UX 10.20 does this with the SSM instruction. + * Tested this on HP9000/712 and HP9000/785/C3750 and both + * machines set the Q bit from 0 to 1 without an exception, + * so let this go without comment. + */ env->psw = (psw & ~PSW_SM) | (nsm & PSW_SM); return psw & PSW_SM; }