|
From: | Richard Henderson |
Subject: | Re: [PATCH 09/11] include/exec: added functions to the stubs in exec-all.h |
Date: | Thu, 13 May 2021 18:44:01 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
On 5/13/21 9:03 AM, Lucas Mateus Martins Araujo e Castro wrote:
tlb_set_page is called by many ppc_hash64_handle_mmu_fault, ppc_radix64_handle_mmu_fault and ppc_hash32_handle_mmu_fault, all of which from what I've seen are only used inside #if defined(CONFIG_SOFTMMU).
tlb_set_page should only be called from one place: ppc_cpu_tlb_fill. The other functions should fill in data, much like get_physical_address.
So what is the best way to deal with these tlb_set_page calls? Should these part of the _handle_mmu_fault functions never be reached or should these functions never be called?
There is some duplication between get_physical_address* and *handle_mmu_fault that should be fixed.
What should be happening is that you have one function (per mmu type) that takes a virtual address and resolves a physical address. This bit of code should be written so that it is usable by both CPUClass.get_phys_page_attrs_debug and TCGCPUOps.tlb_fill. It appears as if ppc_radix64_xlate is the right interface for this.
It appears that real mode handling is duplicated between hash64 and radix64, which could be unified.
You should only call tlb_set_page from TCGCPUOps.tlb_fill, aka ppc_cpu_tlb_fill. TCGCPUOps.tlb_fill is obviously TCG only.
The version you are looking at here is system emulation specific (sysemu, !defined(CONFIG_USER_ONLY)). There is a second version of this function, with the same signature, that is used for user emulation in the helpfully named user_only_helper.c.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |