From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
qemu-devel@nongnu.org
Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-riscv <qemu-riscv@nongnu.org>
Subject: Re: [PATCH v2 07/13] target/riscv: Include missing 'accel/tcg/getpc.h' in csr.c
Date: Thu, 24 Apr 2025 14:01:41 -0700 [thread overview]
Message-ID: <431dce61-4cdb-4bf6-98f8-d2ac714a1ab6@linaro.org> (raw)
In-Reply-To: <ebd88b93-3752-4e18-b5c0-78e3b4a4b8e2@linaro.org>
On 4/24/25 13:13, Philippe Mathieu-Daudé wrote:
> On 24/4/25 12:14, Mark Cave-Ayland wrote:
>> On 24/04/2025 10:46, Philippe Mathieu-Daudé wrote:
>>
>>> "accel/tcg/getpc.h" is pulled in indirectly. Include it
>>> explicitly to avoid when refactoring unrelated headers:
>>>
>>> target/riscv/csr.c:2117:25: error: call to undeclared function 'GETPC' [-Wimplicit-
>>> function-declaration]
>>> 2117 | if ((val & RVC) && (GETPC() & ~3) != 0) {
>>> | ^
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>> target/riscv/csr.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/target/riscv/csr.c b/target/riscv/csr.c
>>> index c52c87faaea..13086438552 100644
>>> --- a/target/riscv/csr.c
>>> +++ b/target/riscv/csr.c
>>> @@ -28,6 +28,7 @@
>>> #include "exec/cputlb.h"
>>> #include "exec/tb-flush.h"
>>> #include "exec/icount.h"
>>> +#include "accel/tcg/getpc.h"
>>> #include "qemu/guest-random.h"
>>> #include "qapi/error.h"
>>> #include <stdbool.h>
>>
>> I'm mildly curious as to why the target needs to include accel/tcg/ getpc.h directly as
>> it's almost a requirement for TCG
>
> Indeed. There is a TODO around, added upon introduction in
> commit f18637cd611 ("RISC-V: Add misa runtime write support"):
>
> 2113 /*
> 2114 * Suppress 'C' if next instruction is not aligned
> 2115 * TODO: this should check next_pc
> 2116 */
> 2117 if ((val & RVC) && (GETPC() & ~3) != 0) {
> 2118 val &= ~RVC;
> 2119 }
Yes, I've sent mail about this bug at least twice.
r~
next prev parent reply other threads:[~2025-04-24 21:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 9:46 [PATCH v2 00/13] include: Remove "exec/exec-all.h" Philippe Mathieu-Daudé
2025-04-24 9:46 ` [PATCH v2 01/13] accel/tcg: Use vaddr for walk_memory_regions callback Philippe Mathieu-Daudé
2025-04-24 9:46 ` [PATCH v2 02/13] accel/tcg: Use vaddr in user/page-protection.h Philippe Mathieu-Daudé
2025-04-24 9:46 ` [PATCH v2 03/13] accel/tcg: Correct list of included headers in tcg-stub.c Philippe Mathieu-Daudé
2025-04-24 10:10 ` Mark Cave-Ayland
2025-04-24 9:46 ` [PATCH v2 04/13] include/exec: Include missing headers in exec-all.h Philippe Mathieu-Daudé
2025-04-24 10:11 ` Mark Cave-Ayland
2025-04-24 9:46 ` [PATCH v2 05/13] include/exec: Move tb_invalidate_phys_range to translation-block.h Philippe Mathieu-Daudé
2025-04-24 9:46 ` [PATCH v2 06/13] accel/tcg: Compile tb-maint.c twice Philippe Mathieu-Daudé
2025-04-24 9:46 ` [PATCH v2 07/13] target/riscv: Include missing 'accel/tcg/getpc.h' in csr.c Philippe Mathieu-Daudé
2025-04-24 9:50 ` Philippe Mathieu-Daudé
2025-04-24 10:14 ` Mark Cave-Ayland
2025-04-24 20:13 ` Philippe Mathieu-Daudé
2025-04-24 21:01 ` Richard Henderson [this message]
2025-04-24 10:23 ` Alistair Francis
2025-04-24 9:46 ` [PATCH v2 08/13] target/hexagon: Include missing 'accel/tcg/getpc.h' Philippe Mathieu-Daudé
2025-04-24 10:15 ` Mark Cave-Ayland
2025-04-24 14:35 ` Brian Cain
2025-04-24 9:46 ` [PATCH v2 09/13] accel/tcg: Include 'accel/tcg/getpc.h' in 'exec/helper-proto' Philippe Mathieu-Daudé
2025-04-24 10:21 ` Mark Cave-Ayland
2025-04-24 11:23 ` Philippe Mathieu-Daudé
2025-04-24 20:09 ` Philippe Mathieu-Daudé
2025-04-24 9:46 ` [PATCH v2 10/13] physmem: Move TCG IOMMU methods around Philippe Mathieu-Daudé
2025-04-24 10:23 ` Mark Cave-Ayland
2025-04-24 9:46 ` [PATCH v2 11/13] physmem: Restrict TCG IOMMU code to TCG accel Philippe Mathieu-Daudé
2025-04-24 10:25 ` Mark Cave-Ayland
2025-04-24 9:46 ` [PATCH v2 12/13] accel/tcg: Extract probe API out of 'exec/exec-all.h' Philippe Mathieu-Daudé
2025-04-24 9:50 ` Philippe Mathieu-Daudé
2025-04-24 10:30 ` Mark Cave-Ayland
2025-04-24 17:21 ` Richard Henderson
2025-04-24 9:46 ` [PATCH v2 13/13] include: Remove 'exec/exec-all.h' Philippe Mathieu-Daudé
2025-04-24 10:32 ` Mark Cave-Ayland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=431dce61-4cdb-4bf6-98f8-d2ac714a1ab6@linaro.org \
--to=richard.henderson@linaro.org \
--cc=mark.caveayland@nutanix.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).