[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/23] target/s390x/tcg/mem_helper: Test the right bits in psw_key
From: |
Thomas Huth |
Subject: |
[PULL 04/23] target/s390x/tcg/mem_helper: Test the right bits in psw_key_valid() |
Date: |
Wed, 14 Dec 2022 11:08:52 +0100 |
The PSW key mask is a 16 bit field, and the psw_key variable is
in the range from 0 to 15, so it does not make sense to use
"0x80 >> psw_key" for testing the bits here. We should use 0x8000
instead.
Message-Id: <20221205142043.95185-1-thuth@redhat.com>
Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/tcg/mem_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index 3758b9e688..006b6798a7 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -51,7 +51,7 @@ static inline bool psw_key_valid(CPUS390XState *env, uint8_t
psw_key)
if (env->psw.mask & PSW_MASK_PSTATE) {
/* PSW key has range 0..15, it is valid if the bit is 1 in the PKM */
- return pkm & (0x80 >> psw_key);
+ return pkm & (0x8000 >> psw_key);
}
return true;
}
--
2.31.1
- [PULL 18/23] .gitlab-ci.d/windows.yml: Exclude qTests from 64-bit CI job for now, (continued)
- [PULL 18/23] .gitlab-ci.d/windows.yml: Exclude qTests from 64-bit CI job for now, Thomas Huth, 2022/12/14
- [PULL 21/23] gitlab-ci: Check building ppc64 without TCG, Thomas Huth, 2022/12/14
- [PULL 23/23] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar, Thomas Huth, 2022/12/14
- [PULL 22/23] .gitlab/issue_templates: Move suggestions into comments, Thomas Huth, 2022/12/14
- [PULL 06/23] monitor/misc: Remove superfluous include statements, Thomas Huth, 2022/12/14
- [PULL 14/23] tests/qtest/e1000e-test: De-duplicate constants, Thomas Huth, 2022/12/14
- [PULL 13/23] tests/qtest/libqos/e1000e: Remove "other" interrupts, Thomas Huth, 2022/12/14
- [PULL 09/23] util/qemu-config: Fix "query-command-line-options" to provide the right values, Thomas Huth, 2022/12/14
- [PULL 11/23] MAINTAINERS: Add documentation files to the corresponding sections, Thomas Huth, 2022/12/14
- [PULL 07/23] scripts/make-release: Add a simple help text for the script, Thomas Huth, 2022/12/14
- [PULL 04/23] target/s390x/tcg/mem_helper: Test the right bits in psw_key_valid(),
Thomas Huth <=
- [PULL 19/23] tests/qtest: Enable qtest build on Windows, Thomas Huth, 2022/12/14
- Re: [PULL 00/23] First batch of s390x, qtest, CI and misc patches for 8.0, Peter Maydell, 2022/12/15