qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 07/23] target/loongarch: Cast address to 64bit before DMW_64_V


From: Jiaxun Yang
Subject: [PATCH v2 07/23] target/loongarch: Cast address to 64bit before DMW_64_VSEG shift
Date: Thu, 26 Dec 2024 21:19:38 +0000

Avoid compiler warning on 32bit. This code path won't be taken anyway.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 target/loongarch/cpu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/cpu_helper.c b/target/loongarch/cpu_helper.c
index 
580362ac3e9ffbe6c8523cf57902dcda018ceed5..b8da136eb0554ba661a15e3069ee0d6bae61af86
 100644
--- a/target/loongarch/cpu_helper.c
+++ b/target/loongarch/cpu_helper.c
@@ -196,7 +196,7 @@ int get_physical_address(CPULoongArchState *env, hwaddr 
*physical,
 
     plv = kernel_mode | (user_mode << R_CSR_DMW_PLV3_SHIFT);
     if (is_la64(env)) {
-        base_v = address >> R_CSR_DMW_64_VSEG_SHIFT;
+        base_v = (uint64_t)address >> R_CSR_DMW_64_VSEG_SHIFT;
     } else {
         base_v = address >> R_CSR_DMW_32_VSEG_SHIFT;
     }

-- 
2.43.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]