apply some new lib functions
PATCH 1/2 arm/powerpc: setup: apply assert_msg
In reply to Andrew Jones--- lib/arm/setup.c | 7 ++----- lib/powerpc/setup.c | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-)
lib/arm/setup.c +2 -5
@@ -48,11 +48,8 @@ static void cpu_set(int fdtnode __unused, u64 regval, void *info __unused) {int cpu = nr_cpus++; -if (cpu >=NR_CPUS ) { -printf ("Number cpus exceeds maximum supported (%d).\n" , -NR_CPUS ); -assert (0 ); - } +assert_msg (cpu <NR_CPUS ,"Number cpus exceeds maximum supported (%d)." ,NR_CPUS ); + cpus[cpu] = regval;set_cpu_present (cpu, true); }
lib/powerpc/setup.c +2 -6
@@ -50,15 +50,11 @@ static void cpu_set(int fdtnode, u64 regval, void *info)struct cpu_set_params *params = info;int cpu = nr_cpus++; -if (cpu >=NR_CPUS ) { -printf ("Number cpus exceeds maximum supported (%d).\n" , -NR_CPUS ); -assert (0 ); - } +assert_msg (cpu <NR_CPUS ,"Number cpus exceeds maximum supported (%d)." ,NR_CPUS ); + cpus[cpu] = regval;/* set exception stack address for this CPU (in SPGR0) */ - asmvolatile ("mtsprg0 %[addr]" :: [addr]"r" (exception_stack[cpu +1 ]));
Signature · 1 line
2.9.3
PATCH 2/2 arm/arm64: gic: apply report_prefix_pushf
In reply to Andrew Jones--- arm/gic.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arm/gic.c +1 -3
@@ -297,7 +297,6 @@ static void run_active_clear_test(void)int main (int argc,char **argv) { -char pfx[8 ];int cpu;if (!gic_init ()) {
@@ -305,8 +304,7 @@ int main(int argc, char **argv)return report_summary (); } -snprintf (pfx,sizeof (pfx),"gicv%d" ,gic_version ()); -report_prefix_push (pfx); +report_prefix_pushf ("gicv%d" ,gic_version ());switch (gic_version ()) {case 2 :
Signature · 1 line
2.9.3
cover apply some new lib functions
Peter Feiner has provided us some nice, new lib functions. Let's put them to more use.
Andrew Jones (2):
arm/powerpc: setup: apply assert_msg
arm/arm64: gic: apply report_prefix_pushf
arm/gic.c | 4 +--- lib/arm/setup.c | 7 ++----- lib/powerpc/setup.c | 8 ++------ 3 files changed, 5 insertions(+), 14 deletions(-)
Signature · 1 line
2.9.3
Re: [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg
In reply to Andrew JonesQuoted 35 lines · Andrew Jones
Signed-off-by Andrew Jones <[email protected]>--- lib/arm/setup.c | 7 ++----- lib/powerpc/setup.c | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-)lib/arm/setup.c +2
-5@@ -48,11 +48,8 @@ static void cpu_set(int fdtnode __unused, u64 regval, void *info __unused) {int cpu = nr_cpus++; -if (cpu >=NR_CPUS ) { -printf ("Number cpus exceeds maximum supported (%d).\n" , -NR_CPUS ); -assert (0 ); - } +assert_msg (cpu <NR_CPUS ,"Number cpus exceeds maximum supported (%d)." ,NR_CPUS ); + cpus[cpu] = regval;set_cpu_present (cpu, true); }lib/powerpc/setup.c +0
-3@@ -50,15 +50,11 @@ static void cpu_set(int fdtnode, u64 regval, void *info)struct cpu_set_params *params = info;int cpu = nr_cpus++; -if (cpu >=NR_CPUS ) { -printf ("Number cpus exceeds maximum supported (%d).\n" , -NR_CPUS );
lib/powerpc/setup.c static void cpu_set(int fdtnode, u64 regval, void *info) · line 59
Quoted 10 lines
lib/powerpc/setup.c +2
-3-assert (0 ); - } +assert_msg (cpu <NR_CPUS ,"Number cpus exceeds maximum supported (%d)." ,NR_CPUS ); + cpus[cpu] = regval;/* set exception stack address for this CPU (in SPGR0) */ - asmvolatile ("mtsprg0 %[addr]" :: [addr]"r" (exception_stack[cpu +1 ]));
Re: [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf
In reply to Andrew JonesQuoted 19 lines · Andrew Jones
Signed-off-by Andrew Jones <[email protected]>--- arm/gic.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)arm/gic.c +0
-1@@ -297,7 +297,6 @@ static void run_active_clear_test(void)int main (int argc,char **argv) { -char pfx[8 ];int cpu;if (!gic_init ()) {
arm/gic.c int main(int argc, char **argv) · line 310
Quoted 9 lines
arm/gic.c +1
-2@@ -305,8 +304,7 @@ int main(int argc, char **argv)return report_summary (); } -snprintf (pfx,sizeof (pfx),"gicv%d" ,gic_version ()); -report_prefix_push (pfx); +report_prefix_pushf ("gicv%d" ,gic_version ());switch (gic_version ()) {case 2 :
Paolo Bonzini
maintainerQuoted 12 lines · Andrew Jones
Peter Feiner has provided us some nice, new lib functions. Let's put them to more use.
Andrew Jones (2):
arm/powerpc: setup: applyassert_msg
arm/arm64: gic: applyreport_prefix_pushfarm/gic.c | 4 +--- lib/arm/setup.c | 7 ++----- lib/powerpc/setup.c | 8 ++------ 3 files changed, 5 insertions(+), 14 deletions(-)
Fixed the small conflict in patch 2 and applied, thanks.
Paolo