From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: [PATCH kvm-unit-tests 6/6] arm/arm64: gic: apply smp_run Date: Thu, 25 May 2017 12:28:49 +0200 Message-ID: <20170525102849.22754-7-drjones@redhat.com> References: <20170525102849.22754-1-drjones@redhat.com> Cc: pbonzini@redhat.com, rkrcmar@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47280 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032709AbdEYK3S (ORCPT ); Thu, 25 May 2017 06:29:18 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61B532EF190 for ; Thu, 25 May 2017 10:29:18 +0000 (UTC) In-Reply-To: <20170525102849.22754-1-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Andrew Jones --- arm/gic.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arm/gic.c b/arm/gic.c index 82f663218b0b..629d6b51f68f 100644 --- a/arm/gic.c +++ b/arm/gic.c @@ -240,6 +240,14 @@ static void ipi_recv(void) wfi(); } +static void ipi_test(void) +{ + if (smp_processor_id() == IPI_SENDER) + ipi_send(); + else + ipi_recv(); +} + static struct gic gicv2 = { .ipi = { .send_self = gicv2_ipi_send_self, @@ -298,7 +306,6 @@ static void run_active_clear_test(void) int main(int argc, char **argv) { char pfx[8]; - int cpu; if (!gic_init()) { printf("No supported gic present, skipping tests...\n"); @@ -323,14 +330,7 @@ int main(int argc, char **argv) if (strcmp(argv[1], "ipi") == 0) { report_prefix_push(argv[1]); nr_cpu_check(2); - - for_each_present_cpu(cpu) { - if (cpu == 0) - continue; - smp_boot_secondary(cpu, - cpu == IPI_SENDER ? ipi_send : ipi_recv); - } - ipi_recv(); + smp_run(ipi_test); } else if (strcmp(argv[1], "active") == 0) { run_active_clear_test(); } else { -- 2.9.4