* [PATCH kvm-unit-tests 0/2] apply some new lib functions
@ 2017-05-22 18:18 Andrew Jones
2017-05-22 18:18 ` [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg Andrew Jones
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Andrew Jones @ 2017-05-22 18:18 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, rkrcmar, lvivier, thuth
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(-)
--
2.9.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg
2017-05-22 18:18 [PATCH kvm-unit-tests 0/2] apply some new lib functions Andrew Jones
@ 2017-05-22 18:18 ` Andrew Jones
2017-05-22 20:05 ` Thomas Huth
2017-05-22 18:18 ` [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf Andrew Jones
2017-05-25 16:36 ` [PATCH kvm-unit-tests 0/2] apply some new lib functions Paolo Bonzini
2 siblings, 1 reply; 6+ messages in thread
From: Andrew Jones @ 2017-05-22 18:18 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, rkrcmar, lvivier, thuth
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
lib/arm/setup.c | 7 ++-----
lib/powerpc/setup.c | 8 ++------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/lib/arm/setup.c b/lib/arm/setup.c
index 689c211d3018..9974b4c131dd 100644
--- a/lib/arm/setup.c
+++ b/lib/arm/setup.c
@@ -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);
}
diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c
index 8d44311cac3b..7157bcb70094 100644
--- a/lib/powerpc/setup.c
+++ b/lib/powerpc/setup.c
@@ -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) */
-
asm volatile ("mtsprg0 %[addr]" ::
[addr] "r" (exception_stack[cpu + 1]));
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf
2017-05-22 18:18 [PATCH kvm-unit-tests 0/2] apply some new lib functions Andrew Jones
2017-05-22 18:18 ` [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg Andrew Jones
@ 2017-05-22 18:18 ` Andrew Jones
2017-05-22 20:09 ` Thomas Huth
2017-05-25 16:36 ` [PATCH kvm-unit-tests 0/2] apply some new lib functions Paolo Bonzini
2 siblings, 1 reply; 6+ messages in thread
From: Andrew Jones @ 2017-05-22 18:18 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, rkrcmar, lvivier, thuth
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
arm/gic.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arm/gic.c b/arm/gic.c
index 82f663218b0b..e27e8a36a9f0 100644
--- a/arm/gic.c
+++ b/arm/gic.c
@@ -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:
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg
2017-05-22 18:18 ` [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg Andrew Jones
@ 2017-05-22 20:05 ` Thomas Huth
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2017-05-22 20:05 UTC (permalink / raw)
To: Andrew Jones, kvm; +Cc: pbonzini, rkrcmar, lvivier
On 22.05.2017 20:18, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
> lib/arm/setup.c | 7 ++-----
> lib/powerpc/setup.c | 8 ++------
> 2 files changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/lib/arm/setup.c b/lib/arm/setup.c
> index 689c211d3018..9974b4c131dd 100644
> --- a/lib/arm/setup.c
> +++ b/lib/arm/setup.c
> @@ -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);
> }
> diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c
> index 8d44311cac3b..7157bcb70094 100644
> --- a/lib/powerpc/setup.c
> +++ b/lib/powerpc/setup.c
> @@ -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) */
> -
> asm volatile ("mtsprg0 %[addr]" ::
> [addr] "r" (exception_stack[cpu + 1]));
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf
2017-05-22 18:18 ` [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf Andrew Jones
@ 2017-05-22 20:09 ` Thomas Huth
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2017-05-22 20:09 UTC (permalink / raw)
To: Andrew Jones, kvm; +Cc: pbonzini, rkrcmar, lvivier
On 22.05.2017 20:18, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
> arm/gic.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arm/gic.c b/arm/gic.c
> index 82f663218b0b..e27e8a36a9f0 100644
> --- a/arm/gic.c
> +++ b/arm/gic.c
> @@ -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:
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kvm-unit-tests 0/2] apply some new lib functions
2017-05-22 18:18 [PATCH kvm-unit-tests 0/2] apply some new lib functions Andrew Jones
2017-05-22 18:18 ` [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg Andrew Jones
2017-05-22 18:18 ` [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf Andrew Jones
@ 2017-05-25 16:36 ` Paolo Bonzini
2 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2017-05-25 16:36 UTC (permalink / raw)
To: Andrew Jones, kvm; +Cc: rkrcmar, lvivier, thuth
On 22/05/2017 20:18, Andrew Jones wrote:
> 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(-)
>
Fixed the small conflict in patch 2 and applied, thanks.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-05-25 16:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 18:18 [PATCH kvm-unit-tests 0/2] apply some new lib functions Andrew Jones
2017-05-22 18:18 ` [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg Andrew Jones
2017-05-22 20:05 ` Thomas Huth
2017-05-22 18:18 ` [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf Andrew Jones
2017-05-22 20:09 ` Thomas Huth
2017-05-25 16:36 ` [PATCH kvm-unit-tests 0/2] apply some new lib functions Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.