[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/31] util/cacheflush: Fix error generated by clang
From: |
Paolo Bonzini |
Subject: |
[PULL 05/31] util/cacheflush: Fix error generated by clang |
Date: |
Sat, 23 Jan 2021 09:31:02 -0500 |
From: Gan Qixin <ganqixin@huawei.com>
When compiling qemu-fuzz-i386 on aarch64 host, clang reported the following
error:
../util/cacheflush.c:38:44: error: value size does not match register size
specified by the constraint and modifier [-Werror,-Wasm-operand-widths]
asm volatile("mrs\t%0, ctr_el0" : "=r"(save_ctr_el0));
^
../util/cacheflush.c:38:24: note: use constraint modifier "w"
asm volatile("mrs\t%0, ctr_el0" : "=r"(save_ctr_el0));
^~
%w0
Modify the type of save_ctr_el0 to uint64_t to fix it.
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Gan Qixin <ganqixin@huawei.com>
Message-Id: <20210115075656.717957-1-ganqixin@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
util/cacheflush.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/cacheflush.c b/util/cacheflush.c
index 6a20723902..933355b0c9 100644
--- a/util/cacheflush.c
+++ b/util/cacheflush.c
@@ -32,7 +32,7 @@ void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t
len)
* We want to save the whole contents of CTR_EL0, so that we
* have more than the linesize, but also IDC and DIC.
*/
-static unsigned int save_ctr_el0;
+static uint64_t save_ctr_el0;
static void __attribute__((constructor)) init_ctr_el0(void)
{
asm volatile("mrs\t%0, ctr_el0" : "=r"(save_ctr_el0));
@@ -46,9 +46,9 @@ void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t
len)
{
const unsigned CTR_IDC = 1u << 28;
const unsigned CTR_DIC = 1u << 29;
- const unsigned int ctr_el0 = save_ctr_el0;
- const uintptr_t icache_lsize = 4 << extract32(ctr_el0, 0, 4);
- const uintptr_t dcache_lsize = 4 << extract32(ctr_el0, 16, 4);
+ const uint64_t ctr_el0 = save_ctr_el0;
+ const uintptr_t icache_lsize = 4 << extract64(ctr_el0, 0, 4);
+ const uintptr_t dcache_lsize = 4 << extract64(ctr_el0, 16, 4);
uintptr_t p;
/*
--
2.26.2
- [PULL 00/31] Misc patches for 2020-01-21, Paolo Bonzini, 2021/01/23
- [PULL 01/31] runstate: cleanup reboot and panic actions, Paolo Bonzini, 2021/01/23
- [PULL 02/31] configure: MinGW respect --bindir argument, Paolo Bonzini, 2021/01/23
- [PULL 08/31] build-sys: remove unused LIBS, Paolo Bonzini, 2021/01/23
- [PULL 13/31] nsis: adjust for new MinGW paths, Paolo Bonzini, 2021/01/23
- [PULL 05/31] util/cacheflush: Fix error generated by clang,
Paolo Bonzini <=
- [PULL 14/31] meson: convert wixl detection to Meson, Paolo Bonzini, 2021/01/23
- [PULL 03/31] x86/cpu: Use max host physical address if -cpu max option is applied, Paolo Bonzini, 2021/01/23
- [PULL 07/31] ide: atapi: check logical block address and read size (CVE-2020-29443), Paolo Bonzini, 2021/01/23
- [PULL 10/31] build-sys: add libvhost-user missing dependencies, Paolo Bonzini, 2021/01/23
- [PULL 04/31] build-system: clean up TCG/TCI configury, Paolo Bonzini, 2021/01/23
- [PULL 06/31] softmmu/physmem: Silence GCC 10 maybe-uninitialized error, Paolo Bonzini, 2021/01/23
- [PULL 12/31] meson: Declare have_virtfs_proxy_helper in main meson.build, Paolo Bonzini, 2021/01/23
- [PULL 15/31] meson: Summarize information related to directories first, Paolo Bonzini, 2021/01/23
- [PULL 16/31] meson: Display host binaries information altogether, Paolo Bonzini, 2021/01/23
- [PULL 17/31] meson: Summarize overall features altogether, Paolo Bonzini, 2021/01/23