[kvm-unit-tests PATCH v1 5/5] s390x: skrf: avoid hardcoded CPU addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the recently introduced smp_cpu_addr_from_idx to discover the
addresses of the CPUs to use in the test, instead of using hardcoded
values. This makes the test more portable.

Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
---
 s390x/skrf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/s390x/skrf.c b/s390x/skrf.c
index ca4efbf1..bd0abba0 100644
--- a/s390x/skrf.c
+++ b/s390x/skrf.c
@@ -164,6 +164,7 @@ static void test_exception_ext_new(void)
 		.mask = extract_psw_mask(),
 		.addr = (unsigned long)ecall_setup
 	};
+	uint16_t cpu1;
 
 	report_prefix_push("exception external new");
 	if (smp_query_num_cpus() < 2) {
@@ -171,14 +172,15 @@ static void test_exception_ext_new(void)
 		report_prefix_pop();
 		return;
 	}
+	cpu1 = smp_cpu_addr_from_idx(1);
 
-	smp_cpu_setup(1, psw);
+	smp_cpu_setup(cpu1, psw);
 	wait_for_flag();
 	set_flag(0);
 
-	sigp(1, SIGP_EXTERNAL_CALL, 0, NULL);
+	sigp(cpu1, SIGP_EXTERNAL_CALL, 0, NULL);
 	wait_for_flag();
-	smp_cpu_stop(1);
+	smp_cpu_stop(cpu1);
 	report_prefix_pop();
 }
 
-- 
2.34.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux