@samitouri / QOSamiQemu / commits / 588db67422

Remove cpu_get_phys_addr_debug() and cpu_get_phys_addr_attrs_debug()

All the callers of cpu_get_phys_addr_debug() and cpu_get_phys_addr_attrs_debug() have now been updated to use cpu_translate_for_debug(), so we can remove them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260430093810.2762539-26-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Peter Maydell committed Apr 30, 2026 at 10:38 UTC 588db67422887db53aad78b3f8e316efbf6cd70e
2 files changed -54
hw/core/cpu-system.c
-20
@@ -87,26 +87,6 @@ bool cpu_translate_for_debug(CPUState *cpu, vaddr addr,
87 }
88 }
89
90 -hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr,
91 - MemTxAttrs *attrs)
92 -{
93 - TranslateForDebugResult result;
94 -
95 - if (!cpu_translate_for_debug(cpu, addr, &result)) {
96 - return -1;
97 - }
98 -
99 - *attrs = result.attrs;
100 - return result.physaddr;
101 -}
102 -
103 -hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr)
104 -{
105 - MemTxAttrs attrs = {};
106 -
107 - return cpu_get_phys_addr_attrs_debug(cpu, addr, &attrs);
108 -}
109 -
90 int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs)
91 {
92 int ret = 0;
include/hw/core/cpu.h
-34
@@ -738,40 +738,6 @@ enum CPUDumpFlags {
738 */
739 void cpu_dump_state(CPUState *cpu, FILE *f, int flags);
740
741 -/**
742 - * cpu_get_phys_addr_attrs_debug:
743 - * @cpu: The CPU to use for the virtual-to-physical translation
744 - * @addr: The virtual address.
745 - * @attrs: Updated on return with the memory transaction attributes to use
746 - * for this access.
747 - *
748 - * Obtains the physical address corresponding to a virtual one, together
749 - * with the corresponding memory transaction attributes to use for the access.
750 - * Use it only for debugging because no protection checks are done.
751 - *
752 - * The address need not be page-aligned; the returned address will
753 - * be the physical address corresponding to that virtual address.
754 - *
755 - * Returns: Corresponding physical page address or -1 if no page found.
756 - */
757 -hwaddr cpu_get_phys_addr_attrs_debug(CPUState *cpu, vaddr addr,
758 - MemTxAttrs *attrs);
759 -
760 -/**
761 - * cpu_get_phys_addr_debug:
762 - * @cpu: The CPU to use for the virtual-to-physical translation
763 - * @addr: The virtual address.
764 - *
765 - * Obtains the physical address corresponding to a virtual one.
766 - * Use it only for debugging because no protection checks are done.
767 - *
768 - * The address need not be page-aligned; the returned address will
769 - * be the physical address corresponding to that virtual address.
770 - *
771 - * Returns: Corresponding physical address, or -1 if no page found.
772 - */
773 -hwaddr cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr);
774 -
741 /**
742 * TranslateForDebugResult: gives result of cpu_translate_for_debug()
743 *