From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-ppc@nongnu.org
Subject: Re: [PATCH 1/4] target/ppc: Include missing headers in mmu-hash[32,64].h
Date: Wed, 18 Dec 2024 18:02:57 +0100 [thread overview]
Message-ID: <65ea7da3-cf1d-43c8-be93-075855c66e5d@linaro.org> (raw)
In-Reply-To: <1b2eeff6-e559-449a-b3cf-3d1e0001f56e@linaro.org>
On 18/12/24 17:41, Richard Henderson wrote:
> On 12/18/24 09:51, Philippe Mathieu-Daudé wrote:
>> CPUState* is dereferenced, so we need the structure definition
>> from "cpu.h". PowerPCCPU is declared in "cpu-qom.h". Include
>> them in order to avoid when refactoring:
>>
>> In file included from ../../target/ppc/cpu_init.c:27:
>> target/ppc/mmu-hash32.h:6:23: error: unknown type name 'PowerPCCPU'
>> 6 | bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr,
>> MMUAccessType access_type,
>> | ^
>> target/ppc/mmu-hash32.h:66:15: error: incomplete definition of type
>> 'struct ArchCPU'
>> 66 | return cpu->env.spr[SPR_SDR1] & SDR_32_HTABORG;
>> | ~~~^
>> target/ppc/mmu-hash64.h:173:36: error: unknown type name
>> ‘PowerPCCPU’; did you mean ‘PowerPCCPUAlias’?
>> 173 | static inline void ppc_hash64_init(PowerPCCPU *cpu)
>> | ^~~~~~~~~~
>> | PowerPCCPUAlias
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> target/ppc/mmu-hash32.h | 3 +++
>> target/ppc/mmu-hash64.h | 2 ++
>> 2 files changed, 5 insertions(+)
>>
>> diff --git a/target/ppc/mmu-hash32.h b/target/ppc/mmu-hash32.h
>> index 2838de031c7..abbff206d4e 100644
>> --- a/target/ppc/mmu-hash32.h
>> +++ b/target/ppc/mmu-hash32.h
>> @@ -3,6 +3,9 @@
>> #ifndef CONFIG_USER_ONLY
>> +#include "target/ppc/cpu-qom.h"
>> +#include "cpu.h"
>
> cpu.h handles cpu-qom.h.
> Do we really need both?
"cpu-qom.h" is the one I want. Currently we need "cpu.h" for all the
inlined functions dereferencing ArchCPU, like ppc_hash32_hpt_base(),
but long term it should be avoided in .h because sources become too
specific. Here we want to link the different MMU 32/64 in the same
PPC binary, having 2 different ArchCPU implementations. This patch
is quite old now so I don't remember well, I'll revisit and see if
it is still necessary.
>> +
>> bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType
>> access_type,
>> hwaddr *raddrp, int *psizep, int *protp, int
>> mmu_idx,
>> bool guest_visible);
>> diff --git a/target/ppc/mmu-hash64.h b/target/ppc/mmu-hash64.h
>> index ae8d4b37aed..b32e17c2c58 100644
>> --- a/target/ppc/mmu-hash64.h
>> +++ b/target/ppc/mmu-hash64.h
>> @@ -3,6 +3,8 @@
>> #ifndef CONFIG_USER_ONLY
>> +#include "target/ppc/cpu-qom.h"
>> +
>> #ifdef TARGET_PPC64
>> void dump_slb(PowerPCCPU *cpu);
>> int ppc_store_slb(PowerPCCPU *cpu, target_ulong slot,
>
next prev parent reply other threads:[~2024-12-18 17:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 15:51 [PATCH 0/4] include: Header cleanups around "cpu.h" Philippe Mathieu-Daudé
2024-12-18 15:51 ` [PATCH 1/4] target/ppc: Include missing headers in mmu-hash[32,64].h Philippe Mathieu-Daudé
2024-12-18 16:41 ` Richard Henderson
2024-12-18 17:02 ` Philippe Mathieu-Daudé [this message]
2024-12-18 15:52 ` [PATCH 2/4] tcg/tci: Include missing 'disas/dis-asm.h' header Philippe Mathieu-Daudé
2024-12-18 15:52 ` [PATCH 3/4] exec/ram_addr: Include missing 'exec/hwaddr.h' and 'exec/cpu-common.h' Philippe Mathieu-Daudé
2024-12-18 15:52 ` [PATCH 4/4] exec/cpu-all: Include 'cpu.h' earlier so MMU_USER_IDX is always defined Philippe Mathieu-Daudé
2024-12-18 16:42 ` [PATCH 0/4] include: Header cleanups around "cpu.h" Richard Henderson
2024-12-19 17:18 ` Philippe Mathieu-Daudé
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=65ea7da3-cf1d-43c8-be93-075855c66e5d@linaro.org \
--to=philmd@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.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 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.