All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Mateus Martins Araujo e Castro <lucas.araujo@eldorado.org.br>
To: Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: luis.pires@eldorado.org.br, fernando.valle@eldorado.org.br,
	matheus.ferst@eldorado.org.br, david@gibson.dropbear.id.au
Subject: Re: [PATCH v3 2/4] target/ppc: divided mmu_helper.c in 2 files
Date: Wed, 14 Jul 2021 14:04:45 -0300	[thread overview]
Message-ID: <d50b10a0-ab7a-6553-2b6e-5731c39401ce@eldorado.org.br> (raw)
In-Reply-To: <592e6dc1-5c06-6d0c-d524-51c9af81a8e8@eldorado.org.br>

[-- Attachment #1: Type: text/plain, Size: 3389 bytes --]


On 14/07/2021 08:23, Lucas Mateus Martins Araujo e Castro wrote:
> On 08/07/2021 15:09, Richard Henderson wrote:
>
>> On 7/8/21 9:49 AM, Lucas Mateus Castro (alqotel) wrote:
>>> +++ b/target/ppc/cpu.h
>>> @@ -1327,6 +1327,26 @@ void store_40x_dbcr0(CPUPPCState *env,
>>> uint32_t val);
>>>   void store_40x_sler(CPUPPCState *env, uint32_t val);
>>>   void store_booke_tcr(CPUPPCState *env, target_ulong val);
>>>   void store_booke_tsr(CPUPPCState *env, target_ulong val);
>>> +typedef struct mmu_ctx_t mmu_ctx_t;
>>> +bool ppc_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType 
>>> access_type,
>>> +                      hwaddr *raddrp, int *psizep, int *protp,
>>> +                      int mmu_idx, bool guest_visible);
>>> +int ppcmas_tlb_check(CPUPPCState *env, ppcmas_tlb_t *tlb,
>>> +                            hwaddr *raddrp, target_ulong address,
>>> +                            uint32_t pid);
>>> +int ppcemb_tlb_check(CPUPPCState *env, ppcemb_tlb_t *tlb,
>>> +                            hwaddr *raddrp,
>>> +                            target_ulong address, uint32_t pid, int
>>> ext,
>>> +                            int i);
>>> +int get_physical_address_wtlb(CPUPPCState *env, mmu_ctx_t *ctx,
>>> +                                     target_ulong eaddr,
>>> +                                     MMUAccessType access_type, int
>>> type,
>>> +                                     int mmu_idx);
>>> +hwaddr booke206_tlb_to_page_size(CPUPPCState *env,
>>> +                                        ppcmas_tlb_t *tlb);
>>> +/* Software driven TLB helpers */
>>> +int ppc6xx_tlb_getnum(CPUPPCState *env, target_ulong eaddr,
>>> +                                    int way, int is_code);
>>
>> Why are any of these going into cpu.h?
>> Surely they are not used outside of target/ppc/.
> At first I divided between internal.h and cpu.h based on what I thought
> really shouldn't be used outside target/ppc, but looking back my logic
> was flawed since all of this was inside mmu_helper.c, so it was only
> visible inside mmu_helper.c, therefore none of it should be used outside
> target/ppc. I'll fix this in the next version.

Actually I spoke too soon, while most of these functions should just be 
moved to internal.h some functions are in cpu.h because they need some 
structures declared in cpu.h, more specifically ppcmas_tlb_t and 
ppcemb_tlb_t.

These functions are: ppcmas_tlb_check, ppcemb_tlb_check and 
booke206_tlb_to_page_size, from what I gather these functions should be 
in mmu_helper.c, but as they're still called in some 
_get_physical_address functions they're in mmu_common.c for now.

So for this patch is it better to leave this functions declaration in 
cpu.h or do something else?

>>
>>
>> r~
>
-- 
Lucas Mateus M. Araujo e Castro
Instituto de Pesquisas ELDORADO 
<https://www.eldorado.org.br/?utm_campaign=assinatura_de_e-mail&utm_medium=email&utm_source=RD+Station>
Departamento Computação Embarcada
Estagiario
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>

[-- Attachment #2: Type: text/html, Size: 5060 bytes --]

  reply	other threads:[~2021-07-14 17:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 16:49 [PATCH v3 0/4] target/ppc: MMU clean up Lucas Mateus Castro (alqotel)
2021-07-08 16:49 ` [PATCH v3 1/4] target/ppc: Don't compile ppc_tlb_invalid_all without TCG Lucas Mateus Castro (alqotel)
2021-07-09  0:44   ` David Gibson
2021-07-08 16:49 ` [PATCH v3 2/4] target/ppc: divided mmu_helper.c in 2 files Lucas Mateus Castro (alqotel)
2021-07-08 18:09   ` Richard Henderson
2021-07-14 11:23     ` Lucas Mateus Martins Araujo e Castro
2021-07-14 17:04       ` Lucas Mateus Martins Araujo e Castro [this message]
2021-07-08 16:49 ` [PATCH v3 3/4] target/ppc: moved ppc_store_sdr1 to mmu_common.c Lucas Mateus Castro (alqotel)
2021-07-08 16:49 ` [PATCH v3 4/4] target/ppc: moved store_40x_sler to helper_regs.c Lucas Mateus Castro (alqotel)

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=d50b10a0-ab7a-6553-2b6e-5731c39401ce@eldorado.org.br \
    --to=lucas.araujo@eldorado.org.br \
    --cc=david@gibson.dropbear.id.au \
    --cc=fernando.valle@eldorado.org.br \
    --cc=luis.pires@eldorado.org.br \
    --cc=matheus.ferst@eldorado.org.br \
    --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.