diff mbox

[for-2.11,08/27] sparc: replace cpu_sparc_init() with cpu_generic_init()

Message ID 1503050939-227939-9-git-send-email-imammedo@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Igor Mammedov Aug. 18, 2017, 10:08 a.m. UTC
it's just a wrapper, drop it and use cpu_generic_init() directly

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
CC: Fabien Chouteau <chouteau@adacore.com>
CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Artyom Tarasenko <atar4qemu@gmail.com>
---
 target/sparc/cpu.h   | 3 +--
 hw/sparc/leon3.c     | 2 +-
 hw/sparc/sun4m.c     | 2 +-
 hw/sparc64/sparc64.c | 2 +-
 target/sparc/cpu.c   | 5 -----
 5 files changed, 4 insertions(+), 10 deletions(-)

Comments

Philippe Mathieu-Daudé Aug. 18, 2017, 7:57 p.m. UTC | #1
I succeed booting a SPARC image once applying 1 to 8 (this commit),
so not being able to boot the image previously is probably due to patch 
order, which mean current order is not bisect-able.

On 08/18/2017 07:08 AM, Igor Mammedov wrote:
> it's just a wrapper, drop it and use cpu_generic_init() directly
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> CC: Fabien Chouteau <chouteau@adacore.com>
> CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> CC: Artyom Tarasenko <atar4qemu@gmail.com>
> ---
>   target/sparc/cpu.h   | 3 +--
>   hw/sparc/leon3.c     | 2 +-
>   hw/sparc/sun4m.c     | 2 +-
>   hw/sparc64/sparc64.c | 2 +-
>   target/sparc/cpu.c   | 5 -----
>   5 files changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
> index 0e41916..b45cfb4 100644
> --- a/target/sparc/cpu.h
> +++ b/target/sparc/cpu.h
> @@ -579,7 +579,6 @@ void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t) QEMU_NORETURN;
>   
>   #ifndef NO_CPU_IO_DEFS
>   /* cpu_init.c */
> -SPARCCPU *cpu_sparc_init(const char *cpu_model);
>   void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu);
>   void sparc_cpu_list(FILE *f, fprintf_function cpu_fprintf);
>   /* mmu_helper.c */
> @@ -656,7 +655,7 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr,
>   int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
>   
>   #ifndef NO_CPU_IO_DEFS
> -#define cpu_init(cpu_model) CPU(cpu_sparc_init(cpu_model))
> +#define cpu_init(cpu_model) cpu_generic_init(TYPE_SPARC_CPU, cpu_model)
>   #endif
>   
>   #define cpu_signal_handler cpu_sparc_signal_handler
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index d5ff188..56512ec 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -126,7 +126,7 @@ static void leon3_generic_hw_init(MachineState *machine)
>           cpu_model = "LEON3";
>       }
>   
> -    cpu = cpu_sparc_init(cpu_model);
> +    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
>       if (cpu == NULL) {
>           fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
>           exit(1);
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 89dd8a9..cf47dca 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -797,7 +797,7 @@ static void cpu_devinit(const char *cpu_model, unsigned int id,
>       SPARCCPU *cpu;
>       CPUSPARCState *env;
>   
> -    cpu = cpu_sparc_init(cpu_model);
> +    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
>       if (cpu == NULL) {
>           fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
>           exit(1);
> diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c
> index 4e4fdab..ecf38a4 100644
> --- a/hw/sparc64/sparc64.c
> +++ b/hw/sparc64/sparc64.c
> @@ -353,7 +353,7 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_model,
>       if (cpu_model == NULL) {
>           cpu_model = default_cpu_model;
>       }
> -    cpu = cpu_sparc_init(cpu_model);
> +    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
>       if (cpu == NULL) {
>           fprintf(stderr, "Unable to find Sparc CPU definition\n");
>           exit(1);
> diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
> index fd01cbf..2917021 100644
> --- a/target/sparc/cpu.c
> +++ b/target/sparc/cpu.c
> @@ -110,11 +110,6 @@ static void sparc_cpu_parse_features(const char *typename, char *features,
>       cpu_legacy_parse_featurestr(typename, features, errp);
>   }
>   
> -SPARCCPU *cpu_sparc_init(const char *cpu_model)
> -{
> -    return SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
> -}
> -
>   void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu)
>   {
>   #if !defined(TARGET_SPARC64)
>
Igor Mammedov Aug. 21, 2017, 11:11 a.m. UTC | #2
On Fri, 18 Aug 2017 16:57:20 -0300
Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:

> I succeed booting a SPARC image once applying 1 to 8 (this commit),
> so not being able to boot the image previously is probably due to patch 
> order, which mean current order is not bisect-able.

I repeated patch by patch (1-8) build/test steps and it works for me
(i.e. compiles and both sparc/sparc64 target machines start as expected)

Could you re-check with clean build and if failure still persist
pin-point exact cause?
Philippe Mathieu-Daudé Aug. 24, 2017, 2:49 a.m. UTC | #3
On 08/18/2017 07:08 AM, Igor Mammedov wrote:
> it's just a wrapper, drop it and use cpu_generic_init() directly
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
> CC: Fabien Chouteau <chouteau@adacore.com>
> CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> CC: Artyom Tarasenko <atar4qemu@gmail.com>
> ---
>   target/sparc/cpu.h   | 3 +--
>   hw/sparc/leon3.c     | 2 +-
>   hw/sparc/sun4m.c     | 2 +-
>   hw/sparc64/sparc64.c | 2 +-
>   target/sparc/cpu.c   | 5 -----
>   5 files changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
> index 0e41916..b45cfb4 100644
> --- a/target/sparc/cpu.h
> +++ b/target/sparc/cpu.h
> @@ -579,7 +579,6 @@ void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t) QEMU_NORETURN;
>   
>   #ifndef NO_CPU_IO_DEFS
>   /* cpu_init.c */
> -SPARCCPU *cpu_sparc_init(const char *cpu_model);
>   void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu);
>   void sparc_cpu_list(FILE *f, fprintf_function cpu_fprintf);
>   /* mmu_helper.c */
> @@ -656,7 +655,7 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr,
>   int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
>   
>   #ifndef NO_CPU_IO_DEFS
> -#define cpu_init(cpu_model) CPU(cpu_sparc_init(cpu_model))
> +#define cpu_init(cpu_model) cpu_generic_init(TYPE_SPARC_CPU, cpu_model)
>   #endif
>   
>   #define cpu_signal_handler cpu_sparc_signal_handler
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index d5ff188..56512ec 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -126,7 +126,7 @@ static void leon3_generic_hw_init(MachineState *machine)
>           cpu_model = "LEON3";
>       }
>   
> -    cpu = cpu_sparc_init(cpu_model);
> +    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
>       if (cpu == NULL) {
>           fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
>           exit(1);
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 89dd8a9..cf47dca 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -797,7 +797,7 @@ static void cpu_devinit(const char *cpu_model, unsigned int id,
>       SPARCCPU *cpu;
>       CPUSPARCState *env;
>   
> -    cpu = cpu_sparc_init(cpu_model);
> +    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
>       if (cpu == NULL) {
>           fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
>           exit(1);
> diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c
> index 4e4fdab..ecf38a4 100644
> --- a/hw/sparc64/sparc64.c
> +++ b/hw/sparc64/sparc64.c
> @@ -353,7 +353,7 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_model,
>       if (cpu_model == NULL) {
>           cpu_model = default_cpu_model;
>       }
> -    cpu = cpu_sparc_init(cpu_model);
> +    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
>       if (cpu == NULL) {
>           fprintf(stderr, "Unable to find Sparc CPU definition\n");
>           exit(1);
> diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
> index fd01cbf..2917021 100644
> --- a/target/sparc/cpu.c
> +++ b/target/sparc/cpu.c
> @@ -110,11 +110,6 @@ static void sparc_cpu_parse_features(const char *typename, char *features,
>       cpu_legacy_parse_featurestr(typename, features, errp);
>   }
>   
> -SPARCCPU *cpu_sparc_init(const char *cpu_model)
> -{
> -    return SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
> -}
> -
>   void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu)
>   {
>   #if !defined(TARGET_SPARC64)
>
Philippe Mathieu-Daudé Aug. 24, 2017, 2:51 a.m. UTC | #4
On 08/21/2017 08:11 AM, Igor Mammedov wrote:
> Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> 
>> I succeed booting a SPARC image once applying 1 to 8 (this commit),
>> so not being able to boot the image previously is probably due to patch
>> order, which mean current order is not bisect-able.
> 
> I repeated patch by patch (1-8) build/test steps and it works for me
> (i.e. compiles and both sparc/sparc64 target machines start as expected)
> 
> Could you re-check with clean build and if failure still persist
> pin-point exact cause?

Sorry Igor, I guess it was some issue on my side (dirty working space 
probably).

Regards,

Phil.
diff mbox

Patch

diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index 0e41916..b45cfb4 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -579,7 +579,6 @@  void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t) QEMU_NORETURN;
 
 #ifndef NO_CPU_IO_DEFS
 /* cpu_init.c */
-SPARCCPU *cpu_sparc_init(const char *cpu_model);
 void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu);
 void sparc_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 /* mmu_helper.c */
@@ -656,7 +655,7 @@  hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr,
 int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
 
 #ifndef NO_CPU_IO_DEFS
-#define cpu_init(cpu_model) CPU(cpu_sparc_init(cpu_model))
+#define cpu_init(cpu_model) cpu_generic_init(TYPE_SPARC_CPU, cpu_model)
 #endif
 
 #define cpu_signal_handler cpu_sparc_signal_handler
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index d5ff188..56512ec 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -126,7 +126,7 @@  static void leon3_generic_hw_init(MachineState *machine)
         cpu_model = "LEON3";
     }
 
-    cpu = cpu_sparc_init(cpu_model);
+    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
     if (cpu == NULL) {
         fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
         exit(1);
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 89dd8a9..cf47dca 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -797,7 +797,7 @@  static void cpu_devinit(const char *cpu_model, unsigned int id,
     SPARCCPU *cpu;
     CPUSPARCState *env;
 
-    cpu = cpu_sparc_init(cpu_model);
+    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
     if (cpu == NULL) {
         fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
         exit(1);
diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c
index 4e4fdab..ecf38a4 100644
--- a/hw/sparc64/sparc64.c
+++ b/hw/sparc64/sparc64.c
@@ -353,7 +353,7 @@  SPARCCPU *sparc64_cpu_devinit(const char *cpu_model,
     if (cpu_model == NULL) {
         cpu_model = default_cpu_model;
     }
-    cpu = cpu_sparc_init(cpu_model);
+    cpu = SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
     if (cpu == NULL) {
         fprintf(stderr, "Unable to find Sparc CPU definition\n");
         exit(1);
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index fd01cbf..2917021 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -110,11 +110,6 @@  static void sparc_cpu_parse_features(const char *typename, char *features,
     cpu_legacy_parse_featurestr(typename, features, errp);
 }
 
-SPARCCPU *cpu_sparc_init(const char *cpu_model)
-{
-    return SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model));
-}
-
 void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu)
 {
 #if !defined(TARGET_SPARC64)