* [PATCH 0/2] hw/sparc/leon3: Minor cleanups
@ 2024-01-30 11:31 Philippe Mathieu-Daudé
2024-01-30 11:31 ` [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-30 11:31 UTC (permalink / raw)
To: qemu-devel
Cc: Artyom Tarasenko, Fabien Chouteau, Frederic Konrad,
Clément Chigot, Mark Cave-Ayland,
Philippe Mathieu-Daudé
Minor cleanups noticed while reviewing Clément series:
https://lore.kernel.org/qemu-devel/20240116130213.172358-1-chigot@adacore.com/
Philippe Mathieu-Daudé (2):
target/sparc: Provide hint about CPUSPARCState::irq_manager member
hw/sparc/leon3: Remove duplicated code
target/sparc/cpu.h | 5 ++---
hw/sparc/leon3.c | 2 --
2 files changed, 2 insertions(+), 5 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member
2024-01-30 11:31 [PATCH 0/2] hw/sparc/leon3: Minor cleanups Philippe Mathieu-Daudé
@ 2024-01-30 11:31 ` Philippe Mathieu-Daudé
2024-01-30 14:22 ` Clément Chigot
2024-01-30 11:31 ` [PATCH 2/2] hw/sparc/leon3: Remove duplicated code Philippe Mathieu-Daudé
2024-02-15 14:59 ` [PATCH 0/2] hw/sparc/leon3: Minor cleanups Philippe Mathieu-Daudé
2 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-30 11:31 UTC (permalink / raw)
To: qemu-devel
Cc: Artyom Tarasenko, Fabien Chouteau, Frederic Konrad,
Clément Chigot, Mark Cave-Ayland,
Philippe Mathieu-Daudé
CPUSPARCState::irq_manager holds a pointer to a QDev,
so declare it as DeviceState instead of void.
Move the comment about Leon3 fields.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/sparc/cpu.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index 12a11ecb26..d02684569a 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -548,10 +548,9 @@ struct CPUArchState {
#endif
sparc_def_t def;
- void *irq_manager;
+ /* Leon3 */
+ DeviceState *irq_manager;
void (*qemu_irq_ack)(CPUSPARCState *env, int intno);
-
- /* Leon3 cache control */
uint32_t cache_control;
};
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] hw/sparc/leon3: Remove duplicated code
2024-01-30 11:31 [PATCH 0/2] hw/sparc/leon3: Minor cleanups Philippe Mathieu-Daudé
2024-01-30 11:31 ` [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member Philippe Mathieu-Daudé
@ 2024-01-30 11:31 ` Philippe Mathieu-Daudé
2024-01-30 14:26 ` Clément Chigot
2024-02-15 14:59 ` [PATCH 0/2] hw/sparc/leon3: Minor cleanups Philippe Mathieu-Daudé
2 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-30 11:31 UTC (permalink / raw)
To: qemu-devel
Cc: Artyom Tarasenko, Fabien Chouteau, Frederic Konrad,
Clément Chigot, Mark Cave-Ayland,
Philippe Mathieu-Daudé
Since commit b04d989054 ("SPARC: Emulation of Leon3") the
main_cpu_reset() handler sets both pc/npc when the CPU is
reset, after the machine is realized. It is pointless to
set it in leon3_generic_hw_init().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/sparc/leon3.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 2dfb742566..1ae9a37583 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -343,8 +343,6 @@ static void leon3_generic_hw_init(MachineState *machine)
bootloader_entry = memory_region_get_ram_ptr(prom);
write_bootloader(env, bootloader_entry, entry);
- env->pc = LEON3_PROM_OFFSET;
- env->npc = LEON3_PROM_OFFSET + 4;
reset_info->entry = LEON3_PROM_OFFSET;
}
}
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member
2024-01-30 11:31 ` [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member Philippe Mathieu-Daudé
@ 2024-01-30 14:22 ` Clément Chigot
0 siblings, 0 replies; 6+ messages in thread
From: Clément Chigot @ 2024-01-30 14:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Artyom Tarasenko, Fabien Chouteau, Frederic Konrad,
Mark Cave-Ayland
On Tue, Jan 30, 2024 at 12:31 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> CPUSPARCState::irq_manager holds a pointer to a QDev,
> so declare it as DeviceState instead of void.
>
> Move the comment about Leon3 fields.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/sparc/cpu.h | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Reviewed-by: Clément Chigot <chigot@adacore.com>
> diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
> index 12a11ecb26..d02684569a 100644
> --- a/target/sparc/cpu.h
> +++ b/target/sparc/cpu.h
> @@ -548,10 +548,9 @@ struct CPUArchState {
> #endif
> sparc_def_t def;
>
> - void *irq_manager;
> + /* Leon3 */
> + DeviceState *irq_manager;
> void (*qemu_irq_ack)(CPUSPARCState *env, int intno);
> -
> - /* Leon3 cache control */
> uint32_t cache_control;
> };
>
> --
> 2.41.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] hw/sparc/leon3: Remove duplicated code
2024-01-30 11:31 ` [PATCH 2/2] hw/sparc/leon3: Remove duplicated code Philippe Mathieu-Daudé
@ 2024-01-30 14:26 ` Clément Chigot
0 siblings, 0 replies; 6+ messages in thread
From: Clément Chigot @ 2024-01-30 14:26 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Artyom Tarasenko, Fabien Chouteau, Frederic Konrad,
Mark Cave-Ayland
On Tue, Jan 30, 2024 at 12:31 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Since commit b04d989054 ("SPARC: Emulation of Leon3") the
> main_cpu_reset() handler sets both pc/npc when the CPU is
> reset, after the machine is realized. It is pointless to
> set it in leon3_generic_hw_init().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/sparc/leon3.c | 2 --
> 1 file changed, 2 deletions(-)
Thanks for those cleanups !
Reviewed-by: Clément Chigot <chigot@adacore.com>
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index 2dfb742566..1ae9a37583 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -343,8 +343,6 @@ static void leon3_generic_hw_init(MachineState *machine)
>
> bootloader_entry = memory_region_get_ram_ptr(prom);
> write_bootloader(env, bootloader_entry, entry);
> - env->pc = LEON3_PROM_OFFSET;
> - env->npc = LEON3_PROM_OFFSET + 4;
> reset_info->entry = LEON3_PROM_OFFSET;
> }
> }
> --
> 2.41.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] hw/sparc/leon3: Minor cleanups
2024-01-30 11:31 [PATCH 0/2] hw/sparc/leon3: Minor cleanups Philippe Mathieu-Daudé
2024-01-30 11:31 ` [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member Philippe Mathieu-Daudé
2024-01-30 11:31 ` [PATCH 2/2] hw/sparc/leon3: Remove duplicated code Philippe Mathieu-Daudé
@ 2024-02-15 14:59 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-15 14:59 UTC (permalink / raw)
To: qemu-devel
Cc: Artyom Tarasenko, Fabien Chouteau, Frederic Konrad,
Clément Chigot, Mark Cave-Ayland
On 30/1/24 12:31, Philippe Mathieu-Daudé wrote:
> Minor cleanups noticed while reviewing Clément series:
> https://lore.kernel.org/qemu-devel/20240116130213.172358-1-chigot@adacore.com/
>
> Philippe Mathieu-Daudé (2):
> target/sparc: Provide hint about CPUSPARCState::irq_manager member
> hw/sparc/leon3: Remove duplicated code
Series queued.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-02-15 15:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30 11:31 [PATCH 0/2] hw/sparc/leon3: Minor cleanups Philippe Mathieu-Daudé
2024-01-30 11:31 ` [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member Philippe Mathieu-Daudé
2024-01-30 14:22 ` Clément Chigot
2024-01-30 11:31 ` [PATCH 2/2] hw/sparc/leon3: Remove duplicated code Philippe Mathieu-Daudé
2024-01-30 14:26 ` Clément Chigot
2024-02-15 14:59 ` [PATCH 0/2] hw/sparc/leon3: Minor cleanups Philippe Mathieu-Daudé
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).