[Top][All Lists]

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

Re: [PATCH v3 24/30] target/mips: Move helper_cache() to tcg/sysemu/spec

From: Richard Henderson
Subject: Re: [PATCH v3 24/30] target/mips: Move helper_cache() to tcg/sysemu/special_helper.c
Date: Mon, 19 Apr 2021 13:14:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 4/19/21 12:18 PM, Philippe Mathieu-Daudé wrote:
+#define STUB_HELPER(NAME, ...) \
+    static inline void gen_helper_##NAME(__VA_ARGS__) \
+    { qemu_build_not_reached(); }

Does this really work when optimization is on? I suspect you need additional cleanups before you can use qemu_build_not_reached().

In particular:

 (1) check_cp0_enabled must return a boolean, so that the
     caller can avoid emitting dead code after the
     exception is emitted.

 (2) check_cp0_enabled must be adjusted to Know that
     cp0 access is always forbidden in user-only mode.

Otherwise, I can't see how the compiler can prove that the call to gen_cache_operation, and thus gen_helper_cache, is unreachable.

In the meantime, you can use g_assert_not_reached() in STUB_HELPER. With that changed,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


reply via email to

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