From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:45038 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406481AbfIYNaY (ORCPT ); Wed, 25 Sep 2019 09:30:24 -0400 Subject: Re: [kvm-unit-tests PATCH v3 6/6] s390x: SMP test References: <20190920080356.1948-1-frankja@linux.ibm.com> <20190920080356.1948-7-frankja@linux.ibm.com> From: Thomas Huth Message-ID: Date: Wed, 25 Sep 2019 15:30:18 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-s390-owner@vger.kernel.org List-ID: To: David Hildenbrand , Janosch Frank , kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org On 25/09/2019 15.27, David Hildenbrand wrote: > On 20.09.19 10:03, Janosch Frank wrote: >> Testing SIGP emulation for the following order codes: >> * start >> * stop >> * restart >> * set prefix >> * store status >> * stop and store status >> * reset >> * initial reset >> * external call >> * emegergency call >> >> restart and set prefix are part of the library and needed to start >> other cpus. >> >> Signed-off-by: Janosch Frank >> --- >> s390x/Makefile | 1 + >> s390x/smp.c | 242 ++++++++++++++++++++++++++++++++++++++++++++ >> s390x/unittests.cfg | 4 + >> 3 files changed, 247 insertions(+) >> create mode 100644 s390x/smp.c >> >> diff --git a/s390x/Makefile b/s390x/Makefile >> index d83dd0b..3744372 100644 >> --- a/s390x/Makefile >> +++ b/s390x/Makefile >> @@ -15,6 +15,7 @@ tests += $(TEST_DIR)/cpumodel.elf >> tests += $(TEST_DIR)/diag288.elf >> tests += $(TEST_DIR)/stsi.elf >> tests += $(TEST_DIR)/skrf.elf >> +tests += $(TEST_DIR)/smp.elf >> tests_binary = $(patsubst %.elf,%.bin,$(tests)) >> >> all: directories test_cases test_cases_binary >> diff --git a/s390x/smp.c b/s390x/smp.c >> new file mode 100644 >> index 0000000..7032494 >> --- /dev/null >> +++ b/s390x/smp.c >> @@ -0,0 +1,242 @@ >> +/* >> + * Tests sigp emulation >> + * >> + * Copyright 2019 IBM Corp. >> + * >> + * Authors: >> + * Janosch Frank >> + * >> + * This code is free software; you can redistribute it and/or modify it >> + * under the terms of the GNU General Public License version 2. >> + */ >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> + >> +static int testflag = 0; >> + >> +static void cpu_loop(void) >> +{ >> + for (;;) {} > > Won't that be optimized out completely? Why? AFAIK this is the standard way to write and endless loop ... how can a compiler optimize that away? Thomas