[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/8] spapr: nested: use bitwise NOT operator for flags check
From: |
Nicholas Piggin |
Subject: |
[PULL 1/8] spapr: nested: use bitwise NOT operator for flags check |
Date: |
Sun, 31 Mar 2024 17:33:38 +1000 |
From: Harsh Prateek Bora <harshpb@linux.ibm.com>
Check for flag bit in H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE need to use
bitwise NOT operator to ensure no other flag bits are set.
Resolves: Coverity CID 1540008
Resolves: Coverity CID 1540009
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/spapr_nested.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_nested.c b/hw/ppc/spapr_nested.c
index 936659b4c0..c02785756c 100644
--- a/hw/ppc/spapr_nested.c
+++ b/hw/ppc/spapr_nested.c
@@ -1511,7 +1511,7 @@ static target_ulong h_guest_getset_state(PowerPCCPU *cpu,
if (flags & H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE) {
gsr.flags |= GUEST_STATE_REQUEST_GUEST_WIDE;
}
- if (flags & !H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE) {
+ if (flags & ~H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE) {
return H_PARAMETER; /* flag not supported yet */
}
--
2.43.0
- [PULL 0/8] ppc-for-9.0-3 queue, Nicholas Piggin, 2024/03/31
- [PULL 1/8] spapr: nested: use bitwise NOT operator for flags check,
Nicholas Piggin <=
- [PULL 2/8] hw/ppc/spapr: Include missing 'sysemu/tcg.h' header, Nicholas Piggin, 2024/03/31
- [PULL 3/8] target/ppc/mmu-radix64: Use correct string format in walk_tree(), Nicholas Piggin, 2024/03/31
- [PULL 4/8] target/ppc: Restore [H]DEXCR to 64-bits, Nicholas Piggin, 2024/03/31
- [PULL 5/8] target/ppc: Fix GDB register indexing on secondary CPUs, Nicholas Piggin, 2024/03/31
- [PULL 6/8] target/ppc: Do not clear MSR[ME] on MCE interrupts to supervisor, Nicholas Piggin, 2024/03/31
- [PULL 7/8] tests/avocado: Fix ppc_hv_tests.py xorriso dependency guard, Nicholas Piggin, 2024/03/31
- [PULL 8/8] tests/avocado: ppc_hv_tests.py set alpine time before setup-alpine, Nicholas Piggin, 2024/03/31