* [PATCH] Makes softmmu compile with clang at HEAD
@ 2020-03-18 6:20 Shu-Chun Weng
2020-03-30 20:58 ` Shu-Chun Weng
2020-03-30 21:55 ` Alex Bennée
0 siblings, 2 replies; 3+ messages in thread
From: Shu-Chun Weng @ 2020-03-18 6:20 UTC (permalink / raw)
To: Richard Henderson, Paolo Bonzini; +Cc: qemu-devel, Shu-Chun Weng
With clang at HEAD, linking fails with "undefined symbol:
qemu_build_not_reached". It's because `store_helper` and
`helper_ret_stb_mmu` are mutually recursive and clang inlined latter
inside the former, making `store_helper` a recursive function and no
longer fully inlineable preventing constant propogation.
Signed-off-by: Shu-Chun Weng <scw@google.com>
---
accel/tcg/cputlb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index e3b5750c3b..a7c812ed72 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -2050,6 +2050,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
store_memop(haddr, val, op);
}
+__attribute__((noinline))
void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val,
TCGMemOpIdx oi, uintptr_t retaddr)
{
--
2.25.1.481.gfbce0eb801-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Makes softmmu compile with clang at HEAD
2020-03-18 6:20 [PATCH] Makes softmmu compile with clang at HEAD Shu-Chun Weng
@ 2020-03-30 20:58 ` Shu-Chun Weng
2020-03-30 21:55 ` Alex Bennée
1 sibling, 0 replies; 3+ messages in thread
From: Shu-Chun Weng @ 2020-03-30 20:58 UTC (permalink / raw)
To: Richard Henderson, Paolo Bonzini; +Cc: qemu-devel
[-- Attachment #1.1: Type: text/plain, Size: 1013 bytes --]
Ping.
On Tue, Mar 17, 2020 at 11:21 PM Shu-Chun Weng <scw@google.com> wrote:
> With clang at HEAD, linking fails with "undefined symbol:
> qemu_build_not_reached". It's because `store_helper` and
> `helper_ret_stb_mmu` are mutually recursive and clang inlined latter
> inside the former, making `store_helper` a recursive function and no
> longer fully inlineable preventing constant propogation.
>
> Signed-off-by: Shu-Chun Weng <scw@google.com>
> ---
> accel/tcg/cputlb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index e3b5750c3b..a7c812ed72 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -2050,6 +2050,7 @@ store_helper(CPUArchState *env, target_ulong addr,
> uint64_t val,
> store_memop(haddr, val, op);
> }
>
> +__attribute__((noinline))
> void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val,
> TCGMemOpIdx oi, uintptr_t retaddr)
> {
> --
> 2.25.1.481.gfbce0eb801-goog
>
>
[-- Attachment #1.2: Type: text/html, Size: 1459 bytes --]
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3844 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Makes softmmu compile with clang at HEAD
2020-03-18 6:20 [PATCH] Makes softmmu compile with clang at HEAD Shu-Chun Weng
2020-03-30 20:58 ` Shu-Chun Weng
@ 2020-03-30 21:55 ` Alex Bennée
1 sibling, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2020-03-30 21:55 UTC (permalink / raw)
To: Shu-Chun Weng; +Cc: Paolo Bonzini, Richard Henderson, qemu-devel
Shu-Chun Weng <scw@google.com> writes:
> With clang at HEAD, linking fails with "undefined symbol:
> qemu_build_not_reached". It's because `store_helper` and
> `helper_ret_stb_mmu` are mutually recursive and clang inlined latter
> inside the former, making `store_helper` a recursive function and no
> longer fully inlineable preventing constant propogation.
>
> Signed-off-by: Shu-Chun Weng <scw@google.com>
> ---
> accel/tcg/cputlb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index e3b5750c3b..a7c812ed72 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -2050,6 +2050,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
> store_memop(haddr, val, op);
> }
>
> +__attribute__((noinline))
> void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val,
> TCGMemOpIdx oi, uintptr_t retaddr)
Hmm I wonder if the correct fix is for store_helper to callL
store_memop(addr + i, val8, MO_UB);
direct in the fallback case - although the page crossing may be tricky
to get right. Perhaps we should out of line all the unaligned stuff?
--
Alex Bennée
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-30 21:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 6:20 [PATCH] Makes softmmu compile with clang at HEAD Shu-Chun Weng
2020-03-30 20:58 ` Shu-Chun Weng
2020-03-30 21:55 ` Alex Bennée
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.