From patchwork Wed Jul 7 14:03:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD7B8C11F67 for ; Wed, 7 Jul 2021 14:08:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9197961C73 for ; Wed, 7 Jul 2021 14:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbhGGOKk (ORCPT ); Wed, 7 Jul 2021 10:10:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:27814 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231865AbhGGOKj (ORCPT ); Wed, 7 Jul 2021 10:10:39 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167E7GLN100562; Wed, 7 Jul 2021 10:07:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=WoZJGI1WH+qGk04nyWXvVnZUJoXFaXJcHp4oU+hLTxc=; b=YrkVOdMQBtM0gvZSNWVG+n98z+QUeFMCOvCcM7vCuGRNSkTLfh8N2fNqNtTGN4YAeMyV fIkqFI+3HWB+FYr/jHd+3X7oHhIGIkWTJph1n1aLf+ZvbiSWlt82AwjJFsAsmfnhzezd fQihQagI7dbQ+YR8VMryewJDYwphmBaigCDMujeSOkPYT7zYCp+U8q4Ba6RJL/XXX2aq 5pL/vAHQ+XFr0Mc7fA+CSCdhK7DDmBErbyj4Swwc54fYHEb9LPs0iyCYBs2hbfyhwO1T RilQh+3NjOs+Hekjv0gWyqTKYi5t0BmrA7nS14mRUQkkd7A5SNOL0mNhEjw1P8FAwuUv Pw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mk52jdbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:07:58 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167E7wJF102622; Wed, 7 Jul 2021 10:07:58 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mk52jc71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:07:46 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E3OXB016890; Wed, 7 Jul 2021 14:03:30 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03ams.nl.ibm.com with ESMTP id 39jfh8ssrf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:30 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E1X7m22413714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:01:33 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC646A404D; Wed, 7 Jul 2021 14:03:27 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 351D0A4040; Wed, 7 Jul 2021 14:03:27 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:27 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 1/8] s390x: snippets: Add gitignore as well as linker script and start assembly Date: Wed, 7 Jul 2021 16:03:11 +0200 Message-Id: <20210707140318.44255-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -k3x8jMX--2vt2CV1vKHGl1Lvoj_zu7C X-Proofpoint-GUID: VlSrsqN8J4fdOoNBKFwSoLbtW--mjOCd X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_08:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 priorityscore=1501 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070084 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Snippets are small guests which can be run under a unit test that implements a simple hypervisor. They can be written in C or assembly. The C code needs a linker script and a start assembly file that jumps to main to work properly. So let's add that as well as a gitignore entry for the new files. Signed-off-by: Janosch Frank Reviewed-by: Thomas Huth --- .gitignore | 1 + s390x/snippets/c/cstart.S | 16 ++++++++++++ s390x/snippets/c/flat.lds | 51 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 s390x/snippets/c/cstart.S create mode 100644 s390x/snippets/c/flat.lds diff --git a/.gitignore b/.gitignore index 8534fb74..b3cf2cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ cscope.* /api/dirty-log /api/dirty-log-perf /s390x/*.bin +/s390x/snippets/*/*.gbin diff --git a/s390x/snippets/c/cstart.S b/s390x/snippets/c/cstart.S new file mode 100644 index 00000000..242568d6 --- /dev/null +++ b/s390x/snippets/c/cstart.S @@ -0,0 +1,16 @@ +#include + +.section .init + .globl start +start: + /* XOR all registers with themselves to clear them fully. */ + .irp i, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + xgr \i,\i + .endr + /* 0x3000 is the stack page for now */ + lghi %r15, 0x4000 - 160 + sam64 + brasl %r14, main + /* For now let's only use cpu 0 in snippets so this will always work. */ + xgr %r0, %r0 + sigp %r2, %r0, SIGP_STOP diff --git a/s390x/snippets/c/flat.lds b/s390x/snippets/c/flat.lds new file mode 100644 index 00000000..ce3bfd69 --- /dev/null +++ b/s390x/snippets/c/flat.lds @@ -0,0 +1,51 @@ +SECTIONS +{ + .lowcore : { + /* + * Initial short psw for disk boot, with 31 bit addressing for + * non z/Arch environment compatibility and the instruction + * address 0x4000 (cstart.S .init). + */ + . = 0; + LONG(0x00080000) + LONG(0x80004000) + /* Restart new PSW for booting via PSW restart. */ + . = 0x1a0; + QUAD(0x0000000180000000) + QUAD(0x0000000000004000) + } + . = 0x4000; + .text : { + *(.init) + *(.text) + *(.text.*) + } + . = ALIGN(64K); + etext = .; + .opd : { *(.opd) } + . = ALIGN(16); + .dynamic : { + dynamic_start = .; + *(.dynamic) + } + .dynsym : { + dynsym_start = .; + *(.dynsym) + } + .rela.dyn : { *(.rela*) } + . = ALIGN(16); + .data : { + *(.data) + *(.data.rel*) + } + . = ALIGN(16); + .rodata : { *(.rodata) *(.rodata.*) } + . = ALIGN(16); + __bss_start = .; + .bss : { *(.bss) } + __bss_end = .; + . = ALIGN(64K); + edata = .; + . += 64K; + . = ALIGN(64K); +} From patchwork Wed Jul 7 14:03:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4DB2C07E9B for ; Wed, 7 Jul 2021 14:03:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA85D61C9D for ; Wed, 7 Jul 2021 14:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231944AbhGGOGP (ORCPT ); Wed, 7 Jul 2021 10:06:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:10540 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231357AbhGGOGO (ORCPT ); Wed, 7 Jul 2021 10:06:14 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167DYD7i092280; Wed, 7 Jul 2021 10:03:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=4QVl43MCG/SpLaVeNLAJrrJyRbVZ2yV6iiZIupc2gAs=; b=qXcCB8zP0CTipCVII8gz47s9cgMZ65VcRPPWV9JHROGvJ6NOJKiF1TaadvHZoXThOZS/ XKd77stVocHySwXFYI55Cb6Kd7xataGQoahdAA1LoRG7Z9FSRbCFhdpZNE5s5KSIGMUg 2BlrGkvQzhNOxuUXygmByR05c0/h6rMJtMLqb1ubAtq+YEQcOY5j6mRoskZ8Z7Mk181I IHy7P617vtyOaVWL7vdrauFYmBjI9bsL3xYT8ZiVwdBnqMoEWVtBpFjuJwcur3ZqExLl cz8MVp0ML82hAbjSj3xOOViifVLvp82qodmv5e7Ak11leXAgQ5EY7RGda9ryjhrpyeCK mw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 39m8xtv8r9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:33 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167DZMa7098632; Wed, 7 Jul 2021 10:03:33 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 39m8xtv8qp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:33 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E2eNS005320; Wed, 7 Jul 2021 14:03:31 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 39jf5h9sn0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:31 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E1aPU28639570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:01:36 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44261A4051; Wed, 7 Jul 2021 14:03:28 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0FE1A4040; Wed, 7 Jul 2021 14:03:27 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:27 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 2/8] s390x: snippets: Add snippet compilation Date: Wed, 7 Jul 2021 16:03:12 +0200 Message-Id: <20210707140318.44255-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: BBiUp3ml5z8RgDrJu7SZ-sefIcRdEJie X-Proofpoint-GUID: yN1f41g7EZ4oLTumzaozXXLdAXe3G1rV X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_06:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 malwarescore=0 phishscore=0 priorityscore=1501 spamscore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070081 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Steffen Eiden This patch provides the necessary make targets to properly compile snippets and link them into their associated host. To define the guest-host definition, we use the make-feature `SECONDEXPANSION` in combination with `Target specific Variable Values`. The variable `snippets` has different values depending on the current target. This enables us to define which snippets (=guests) belong to which hosts. Furthermore, using the second-expansion, we can use `snippets` in the perquisites of the host's `%.elf` rule, which otherwise would be not set. Signed-off-by: Steffen Eiden Acked-by: Thomas Huth Acked-by: Janosch Frank --- s390x/Makefile | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/s390x/Makefile b/s390x/Makefile index 8820e998..ba32f4c2 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -76,11 +76,26 @@ OBJDIRS += lib/s390x asmlib = $(TEST_DIR)/cstart64.o $(TEST_DIR)/cpu.o FLATLIBS = $(libcflat) -%.elf: %.o $(FLATLIBS) $(SRCDIR)/s390x/flat.lds $(asmlib) - $(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) \ - $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$@\" - $(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \ - $(filter %.o, $^) $(FLATLIBS) $(@:.elf=.aux.o) + +SNIPPET_DIR = $(TEST_DIR)/snippets +snippet_asmlib = $(SNIPPET_DIR)/c/cstart.o + +# perquisites (=guests) for the snippet hosts. +# $(TEST_DIR)/.elf: snippets = $(SNIPPET_DIR)//.gbin + +$(SNIPPET_DIR)/asm/%.gbin: $(SNIPPET_DIR)/asm/%.o $(FLATLIBS) + $(OBJCOPY) -O binary $(patsubst %.gbin,%.o,$@) $@ + $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $@ $@ + +$(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_asmlib) $(FLATLIBS) + $(CC) $(LDFLAGS) -o $@ -T $(SNIPPET_DIR)/c/flat.lds $(patsubst %.gbin,%.o,$@) $(snippet_asmlib) $(FLATLIBS) + $(OBJCOPY) -O binary $@ $@ + $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $@ $@ + +.SECONDEXPANSION: +%.elf: $$(snippets) %.o $(FLATLIBS) $(SRCDIR)/s390x/flat.lds $(asmlib) + $(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$@\" + $(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds $(filter %.o, $^) $(FLATLIBS) $(snippets) $(@:.elf=.aux.o) $(RM) $(@:.elf=.aux.o) @chmod a-x $@ @@ -94,7 +109,7 @@ FLATLIBS = $(libcflat) $(GENPROTIMG) --host-key-document $(HOST_KEY_DOCUMENT) --no-verify --image $< -o $@ arch_clean: asm_offsets_clean - $(RM) $(TEST_DIR)/*.{o,elf,bin} $(TEST_DIR)/.*.d lib/s390x/.*.d + $(RM) $(TEST_DIR)/*.{o,elf,bin} $(TEST_DIR)/.*.d $(SNIPPET_DIR)/c/*.{o,gbin} $(SNIPPET_DIR)/c/.*.d lib/s390x/.*.d generated-files = $(asm-offsets) $(tests:.elf=.o) $(asmlib) $(cflatobjs): $(generated-files) From patchwork Wed Jul 7 14:03:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 324E2C11F6A for ; Wed, 7 Jul 2021 14:03:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1050B61C73 for ; Wed, 7 Jul 2021 14:03:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231964AbhGGOGR (ORCPT ); Wed, 7 Jul 2021 10:06:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:28910 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231947AbhGGOGP (ORCPT ); Wed, 7 Jul 2021 10:06:15 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167E3WAH124474; Wed, 7 Jul 2021 10:03:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=7BX5hVaXv0O/ZmiTpN2TU2wtw3Z/cEVCUq781yoy794=; b=FKbZCW2iGnzJZfCy8V2iztoQl4N0QbtjHrx/XKVQimrsH4urftqgH9HCW12IXquagEv9 NFL5uXX9WB+27X231oT0bPFvcnOEaIR9Rpoz8wvzcEIO62A7R8+MsvFLY3q/FTHI8FoM ol8EeLhHh1dDJpL76mQ7sj4pkFWWkSs/ghyimjdfXEgC04wZFYTKHdTv2kpUjqdgHF+v KJWDgGvoSEacRswAcPH+glzjEpoO2P7CS3e22ieb9t23ABRomKzXFA76GXLKbLtHpM8z eA01l53CY5IFa/87VUfhEm71JrdIfiZCZlKk87KEf4uAoQDbeniscTtmMm6S80nx4IFm MQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 39mbkf4df6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:34 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167E3XpY124647; Wed, 7 Jul 2021 10:03:34 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 39mbkf4de0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:34 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E2gPP005808; Wed, 7 Jul 2021 14:03:32 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06fra.de.ibm.com with ESMTP id 39jf5hgycw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:31 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E1bZs16843178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:01:37 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D1120A4053; Wed, 7 Jul 2021 14:03:28 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 58BE5A4040; Wed, 7 Jul 2021 14:03:28 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:28 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 3/8] s390x: mvpg: Add SIE mvpg test Date: Wed, 7 Jul 2021 16:03:13 +0200 Message-Id: <20210707140318.44255-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: VHpoPwYD0WUqZF3oerj9oy7k4n2KITtu X-Proofpoint-ORIG-GUID: 3Au77Z5FC82tb2j_6Oj11BmzlXt4QU60 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_06:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 priorityscore=1501 spamscore=0 malwarescore=0 adultscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070084 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Let's also check the PEI values to make sure our VSIE implementation is correct. Signed-off-by: Janosch Frank Acked-by: Thomas Huth --- s390x/Makefile | 2 + s390x/mvpg-sie.c | 149 ++++++++++++++++++++++++++++++++ s390x/snippets/c/mvpg-snippet.c | 33 +++++++ s390x/unittests.cfg | 3 + 4 files changed, 187 insertions(+) create mode 100644 s390x/mvpg-sie.c create mode 100644 s390x/snippets/c/mvpg-snippet.c diff --git a/s390x/Makefile b/s390x/Makefile index ba32f4c2..07af26d0 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -23,6 +23,7 @@ tests += $(TEST_DIR)/sie.elf tests += $(TEST_DIR)/mvpg.elf tests += $(TEST_DIR)/uv-host.elf tests += $(TEST_DIR)/edat.elf +tests += $(TEST_DIR)/mvpg-sie.elf tests_binary = $(patsubst %.elf,%.bin,$(tests)) ifneq ($(HOST_KEY_DOCUMENT),) @@ -82,6 +83,7 @@ snippet_asmlib = $(SNIPPET_DIR)/c/cstart.o # perquisites (=guests) for the snippet hosts. # $(TEST_DIR)/.elf: snippets = $(SNIPPET_DIR)//.gbin +$(TEST_DIR)/mvpg-sie.elf: snippets = $(SNIPPET_DIR)/c/mvpg-snippet.gbin $(SNIPPET_DIR)/asm/%.gbin: $(SNIPPET_DIR)/asm/%.o $(FLATLIBS) $(OBJCOPY) -O binary $(patsubst %.gbin,%.o,$@) $@ diff --git a/s390x/mvpg-sie.c b/s390x/mvpg-sie.c new file mode 100644 index 00000000..9bcd15a2 --- /dev/null +++ b/s390x/mvpg-sie.c @@ -0,0 +1,149 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static u8 *guest; +static u8 *guest_instr; +static struct vm vm; + +static uint8_t *src; +static uint8_t *dst; +static uint8_t *cmp; + +extern const char _binary_s390x_snippets_c_mvpg_snippet_gbin_start[]; +extern const char _binary_s390x_snippets_c_mvpg_snippet_gbin_end[]; +int binary_size; + +static void sie(struct vm *vm) +{ + /* Reset icptcode so we don't trip over it below */ + vm->sblk->icptcode = 0; + + while (vm->sblk->icptcode == 0) { + sie64a(vm->sblk, &vm->save_area); + assert(vm->sblk->icptcode != ICPT_VALIDITY); + } + vm->save_area.guest.grs[14] = vm->sblk->gg14; + vm->save_area.guest.grs[15] = vm->sblk->gg15; +} + +static void test_mvpg_pei(void) +{ + uint64_t **pei_dst = (uint64_t **)((uintptr_t) vm.sblk + 0xc0); + uint64_t **pei_src = (uint64_t **)((uintptr_t) vm.sblk + 0xc8); + + report_prefix_push("pei"); + + report_prefix_push("src"); + memset(dst, 0, PAGE_SIZE); + protect_page(src, PAGE_ENTRY_I); + sie(&vm); + report(vm.sblk->icptcode == ICPT_PARTEXEC, "Partial execution"); + report((uintptr_t)**pei_src == (uintptr_t)src + PAGE_ENTRY_I, "PEI_SRC correct"); + report((uintptr_t)**pei_dst == (uintptr_t)dst, "PEI_DST correct"); + unprotect_page(src, PAGE_ENTRY_I); + report(!memcmp(cmp, dst, PAGE_SIZE), "Destination intact"); + /* + * We need to execute the diag44 which is used as a blocker + * behind the mvpg. It makes sure we fail the tests above if + * the mvpg wouldn't have intercepted. + */ + sie(&vm); + /* Make sure we intercepted for the diag44 and nothing else */ + assert(vm.sblk->icptcode == ICPT_INST && + vm.sblk->ipa == 0x8300 && vm.sblk->ipb == 0x440000); + report_prefix_pop(); + + /* Clear PEI data for next check */ + report_prefix_push("dst"); + memset((uint64_t *)((uintptr_t) vm.sblk + 0xc0), 0, 16); + memset(dst, 0, PAGE_SIZE); + protect_page(dst, PAGE_ENTRY_I); + sie(&vm); + report(vm.sblk->icptcode == ICPT_PARTEXEC, "Partial execution"); + report((uintptr_t)**pei_src == (uintptr_t)src, "PEI_SRC correct"); + report((uintptr_t)**pei_dst == (uintptr_t)dst + PAGE_ENTRY_I, "PEI_DST correct"); + /* Needed for the memcmp and general cleanup */ + unprotect_page(dst, PAGE_ENTRY_I); + report(!memcmp(cmp, dst, PAGE_SIZE), "Destination intact"); + report_prefix_pop(); + + report_prefix_pop(); +} + +static void test_mvpg(void) +{ + int binary_size = ((uintptr_t)_binary_s390x_snippets_c_mvpg_snippet_gbin_end - + (uintptr_t)_binary_s390x_snippets_c_mvpg_snippet_gbin_start); + + memcpy(guest, _binary_s390x_snippets_c_mvpg_snippet_gbin_start, binary_size); + memset(src, 0x42, PAGE_SIZE); + memset(dst, 0x43, PAGE_SIZE); + sie(&vm); + report(!memcmp(src, dst, PAGE_SIZE) && *dst == 0x42, "Page moved"); +} + +static void setup_guest(void) +{ + setup_vm(); + + /* Allocate 1MB as guest memory */ + guest = alloc_pages(8); + /* The first two pages are the lowcore */ + guest_instr = guest + PAGE_SIZE * 2; + + vm.sblk = alloc_page(); + + vm.sblk->cpuflags = CPUSTAT_ZARCH | CPUSTAT_RUNNING; + vm.sblk->prefix = 0; + /* + * Pageable guest with the same ASCE as the test programm, but + * the guest memory 0x0 is offset to start at the allocated + * guest pages and end after 1MB. + * + * It's not pretty but faster and easier than managing guest ASCEs. + */ + vm.sblk->mso = (u64)guest; + vm.sblk->msl = (u64)guest; + vm.sblk->ihcpu = 0xffff; + + vm.sblk->crycbd = (uint64_t)alloc_page(); + + vm.sblk->gpsw.addr = PAGE_SIZE * 4; + vm.sblk->gpsw.mask = 0x0000000180000000ULL; + vm.sblk->ictl = ICTL_OPEREXC | ICTL_PINT; + /* Enable MVPG interpretation as we want to test KVM and not ourselves */ + vm.sblk->eca = ECA_MVPGI; + + src = guest + PAGE_SIZE * 6; + dst = guest + PAGE_SIZE * 5; + cmp = alloc_page(); + memset(cmp, 0, PAGE_SIZE); +} + +int main(void) +{ + report_prefix_push("mvpg-sie"); + if (!sclp_facilities.has_sief2) { + report_skip("SIEF2 facility unavailable"); + goto done; + } + + setup_guest(); + test_mvpg(); + test_mvpg_pei(); + +done: + report_prefix_pop(); + return report_summary(); + +} diff --git a/s390x/snippets/c/mvpg-snippet.c b/s390x/snippets/c/mvpg-snippet.c new file mode 100644 index 00000000..c1eb5d77 --- /dev/null +++ b/s390x/snippets/c/mvpg-snippet.c @@ -0,0 +1,33 @@ +#include + +static inline void force_exit(void) +{ + asm volatile(" diag 0,0,0x44\n"); +} + +static inline int mvpg(unsigned long r0, void *dest, void *src) +{ + register unsigned long reg0 asm ("0") = r0; + int cc; + + asm volatile(" mvpg %1,%2\n" + " ipm %0\n" + " srl %0,28" + : "=d" (cc) : "a" (dest), "a" (src), "d" (reg0) + : "memory", "cc"); + return cc; +} + +static void test_mvpg_real(void) +{ + mvpg(0, (void *)0x5000, (void *)0x6000); + force_exit(); +} + +__attribute__((section(".text"))) int main(void) +{ + test_mvpg_real(); + test_mvpg_real(); + test_mvpg_real(); + return 0; +} diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index a0ec8864..9e1802fd 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -106,3 +106,6 @@ timeout = 10 [edat] file = edat.elf + +[mvpg-sie] +file = mvpg-sie.elf From patchwork Wed Jul 7 14:03:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 332D0C11F69 for ; Wed, 7 Jul 2021 14:03:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19C6561CA8 for ; Wed, 7 Jul 2021 14:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231956AbhGGOGQ (ORCPT ); Wed, 7 Jul 2021 10:06:16 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:27790 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231357AbhGGOGP (ORCPT ); Wed, 7 Jul 2021 10:06:15 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167DYDOg092216; Wed, 7 Jul 2021 10:03:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=pcZj76eopHwzlFQKbT6KwGM/5CQ2gQww5f5zZVnQXKA=; b=mrTkAbMHsDx5whPdRRaojENs3BVAKpQAZm9Ve6woWrwBvrpB/Kc5gDSqbZAdHUwsjils oyPnRNQXoyWSNTVy5RsJnh7A2eetbbWALia/+Q//zKeg1S7jUAgJyN5jyCYwkBTCVjbO 7cNeb1KHRKleo7B4jiTc5+xXy9pMDvQUt9GWa90MxS9oT8tJd1XASOLwrbRAnJkIL5+0 yaObMa6ql9foFcmhfZLqTSSh+rFw1YZhk04fonvOqnH7eyCLScDBq17HytgGd4sZYzws U/sAG/G8JGwqdLcTBlqFevyR49fMw5qE7WVGAEzxzXrDO6kGbx1gGkxNYzzV2bAf7qvM lw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 39m8xtv8ru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:34 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167DaKbF104111; Wed, 7 Jul 2021 10:03:34 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 39m8xtv8r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:34 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E2sCH016484; Wed, 7 Jul 2021 14:03:32 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 39jfh8ssrg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:32 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E3Tj710945014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:03:29 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FE19A4040; Wed, 7 Jul 2021 14:03:29 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E4A6AA4051; Wed, 7 Jul 2021 14:03:28 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:28 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 4/8] s390x: sie: Add missing includes Date: Wed, 7 Jul 2021 16:03:14 +0200 Message-Id: <20210707140318.44255-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 2bHY2Sd8bMeRcSnWaxKB5UnHX9IgVySA X-Proofpoint-GUID: DMyT6SYcq19L4XCARf6F8LjSn9kypRsX X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_06:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 malwarescore=0 phishscore=0 priorityscore=1501 spamscore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070081 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org arch_def.h is needed for struct psw. stdint.h is needed for the uint*_t types. Signed-off-by: Janosch Frank Reviewed-by: Cornelia Huck Reviewed-by: Thomas Huth --- lib/s390x/sie.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h index db30d616..b4bb78c3 100644 --- a/lib/s390x/sie.h +++ b/lib/s390x/sie.h @@ -2,6 +2,9 @@ #ifndef _S390X_SIE_H_ #define _S390X_SIE_H_ +#include +#include + #define CPUSTAT_STOPPED 0x80000000 #define CPUSTAT_WAIT 0x10000000 #define CPUSTAT_ECALL_PEND 0x08000000 From patchwork Wed Jul 7 14:03:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BC43C11F6B for ; Wed, 7 Jul 2021 14:03:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BCE361CA8 for ; Wed, 7 Jul 2021 14:03:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231972AbhGGOGR (ORCPT ); Wed, 7 Jul 2021 10:06:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50450 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231953AbhGGOGQ (ORCPT ); Wed, 7 Jul 2021 10:06:16 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167DXuYN029266; Wed, 7 Jul 2021 10:03:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=VjWbFmSusGCVD1IlgIZ+7NMx8EG2dNAaY2SG5bD1jWc=; b=mvpFaF0sIjBkqVen1R1LBZ/F/Q07LJEOZ+PivYY9XA4nbfibywI3fCJukjt3XpdtamRD TGidnQORtFWX8d5ti5kKLzPrzwb9VCA6qVwzLTw/+O9zsdxudFoHyVZCOAp6otZfL9m8 6c4AN5FlUNIdg9IVcr2zaGXcqi86lMAJFG4r1drTC3hDCc6fhDbg+fffzcdmtZ58QLSc axpynnAGRgbDzv6nnS/KURwaF1uVaEFFU9xGl9WLfFNAmMytfHaoa8NSCmCuoqCe60Ow lcq51mh6Q/2A5vbrfKuAJUyVDUDonQOctkrk/5WIPABhKAOl/5WCP0zROb6vmeqya8pj oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mn8fq8pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:35 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167DXuE1029215; Wed, 7 Jul 2021 10:03:35 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mn8fq8n8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:35 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E3X3T006276; Wed, 7 Jul 2021 14:03:33 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06fra.de.ibm.com with ESMTP id 39jf5hgycx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:33 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E3U0f35324314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:03:30 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05634A4051; Wed, 7 Jul 2021 14:03:30 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 83298A404D; Wed, 7 Jul 2021 14:03:29 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:29 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 5/8] s390x: sie: Fix sie.h integer types Date: Wed, 7 Jul 2021 16:03:15 +0200 Message-Id: <20210707140318.44255-6-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: uaMg5ZCjMIM3_6JlmL8GDUHXzQlXkrAE X-Proofpoint-GUID: 7uwfEj70pceva-Y7AeM2hJ_X4IXBmbcn X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_06:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070081 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Let's only use the uint*_t types. Signed-off-by: Janosch Frank Reviewed-by: Cornelia Huck Reviewed-by: Thomas Huth --- lib/s390x/sie.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h index b4bb78c3..6ba858a2 100644 --- a/lib/s390x/sie.h +++ b/lib/s390x/sie.h @@ -173,9 +173,9 @@ struct kvm_s390_sie_block { } __attribute__((packed)); struct vm_save_regs { - u64 grs[16]; - u64 fprs[16]; - u32 fpc; + uint64_t grs[16]; + uint64_t fprs[16]; + uint32_t fpc; }; /* We might be able to nestle all of this into the stack frame. But @@ -191,7 +191,7 @@ struct vm { struct kvm_s390_sie_block *sblk; struct vm_save_area save_area; /* Ptr to first guest page */ - u8 *guest_mem; + uint8_t *guest_mem; }; extern void sie_entry(void); From patchwork Wed Jul 7 14:03:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5266C07E9B for ; Wed, 7 Jul 2021 14:03:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A670261C9D for ; Wed, 7 Jul 2021 14:03:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbhGGOGS (ORCPT ); Wed, 7 Jul 2021 10:06:18 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56707 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231958AbhGGOGQ (ORCPT ); Wed, 7 Jul 2021 10:06:16 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167E39Wd150715; Wed, 7 Jul 2021 10:03:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=ShDXJEr9xIVi77IDAHWPJrKMQFO3KTNM7o1pLQpzS7c=; b=Rm95uenZ0ruptdjZILijjtVonUD003yiOpGD/uhjR3H68JairY5SmsrTqwR59VHDzU6a As8BWjA0O5W6UWz9+9T4nw90mJZrMBcsOObVyjU90SkqBPxeMm99oQ7rjL8cpCt3q4B4 8PLHEVm9H1RIu8I1XX2f7PRgmRGfSSiCjX/3Z2CKOyKu93UmWknjJ+scUZxsUFMnXvmX CUZBweSE4uWbXj6ifkFsQuLC08JbcPISwRuIbhE+OZseqSRXdu4lsl6voPJGeoSJI1EN /CrUvlRwf47lNwXKZ817hYhjWGRXOPBRQN1uMNOludVksKwACR2V6FKZv0bb2D83hMHM xQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 39mkpvsp7j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:35 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167E38jn150664; Wed, 7 Jul 2021 10:03:35 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 39mkpvsp6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:35 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E3X6W002909; Wed, 7 Jul 2021 14:03:33 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04fra.de.ibm.com with ESMTP id 39jfh8gy4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:33 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E3UD735324322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:03:30 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 995AFA4051; Wed, 7 Jul 2021 14:03:30 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 234D9A404D; Wed, 7 Jul 2021 14:03:30 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:30 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 6/8] lib: s390x: uv: Add offset comments to uv_query and extend it Date: Wed, 7 Jul 2021 16:03:16 +0200 Message-Id: <20210707140318.44255-7-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 45zCRTTD4bZC2kAAlq8EjXuJx8A4qDwW X-Proofpoint-GUID: 08AgJf6oT2vATl-l798dmn-58Iic923g X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_08:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 impostorscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 priorityscore=1501 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070084 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The struct is getting longer, let's add offset comments so we know where we change things when we add struct members. Signed-off-by: Janosch Frank Reviewed-by: Cornelia Huck --- lib/s390x/asm/uv.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h index dc3e02de..ec10d1c4 100644 --- a/lib/s390x/asm/uv.h +++ b/lib/s390x/asm/uv.h @@ -84,22 +84,23 @@ struct uv_cb_init { } __attribute__((packed)) __attribute__((aligned(8))); struct uv_cb_qui { - struct uv_cb_header header; - u64 reserved08; - u64 inst_calls_list[4]; - u64 reserved30[2]; - u64 uv_base_stor_len; - u64 reserved48; - u64 conf_base_phys_stor_len; - u64 conf_base_virt_stor_len; - u64 conf_virt_var_stor_len; - u64 cpu_stor_len; - u32 reserved70[3]; - u32 max_num_sec_conf; - u64 max_guest_stor_addr; - u8 reserved88[158 - 136]; - u16 max_guest_cpus; - u8 reserveda0[200 - 160]; + struct uv_cb_header header; /* 0x0000 */ + u64 reserved08; /* 0x0008 */ + u64 inst_calls_list[4]; /* 0x0010 */ + u64 reserved30[2]; /* 0x0030 */ + u64 uv_base_stor_len; /* 0x0040 */ + u64 reserved48; /* 0x0048 */ + u64 conf_base_phys_stor_len; /* 0x0050 */ + u64 conf_base_virt_stor_len; /* 0x0058 */ + u64 conf_virt_var_stor_len; /* 0x0060 */ + u64 cpu_stor_len; /* 0x0068 */ + u32 reserved70[3]; /* 0x0070 */ + u32 max_num_sec_conf; /* 0x007c */ + u64 max_guest_stor_addr; /* 0x0080 */ + u8 reserved88[158 - 136]; /* 0x0088 */ + uint16_t max_guest_cpus; /* 0x009e */ + u64 uv_feature_indications; /* 0x00a0 */ + u8 reserveda8[200 - 168]; /* 0x00a8 */ } __attribute__((packed)) __attribute__((aligned(8))); struct uv_cb_cgc { From patchwork Wed Jul 7 14:03:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1471C11F66 for ; Wed, 7 Jul 2021 14:03:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA70061C9D for ; Wed, 7 Jul 2021 14:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231986AbhGGOGW (ORCPT ); Wed, 7 Jul 2021 10:06:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:15980 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231978AbhGGOGW (ORCPT ); Wed, 7 Jul 2021 10:06:22 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167E2tms092899; Wed, 7 Jul 2021 10:03:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=9vJW1xY/yVXNBv5NFffilsez3d1UMJ/XV3ibK0BKCwY=; b=gVfMXVN1W477s0yQ8w3CrtZMmb6Y9zrOyV/RvKHwvxVZd1g06HutiDJKakXRy7HRKIPL ddaP/WVhM+mRXV2/I0kE0LfsYNfxm6D4mQedXV4oBYGhuY1itHd3MPSDwOjKm1rZwqV1 8xRW4r1oiNyXSxq1nxQ+McukXxcsZ+nKljZxNxcb+9bMeAnN+rXFBSgwGM+hBZ3W8Gcu yPetm/cA2UoZ6mC+iN2BZJyNNeHz5IgM7T9xo2dcqcDMmM8t+fcqck/zqNQXBCvfb/Wt r+rMIUMaW+NgkxzbKuarml9wyjo2ZM6w26uWh/hdhZLRSQCHC/jBMyp0JaVKDNVFZnKl gg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mm66gddw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:41 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167E33WW093473; Wed, 7 Jul 2021 10:03:40 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mm66gdan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:40 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E2gPQ005808; Wed, 7 Jul 2021 14:03:34 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06fra.de.ibm.com with ESMTP id 39jf5hgycy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:34 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E3VtK30671140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:03:31 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38B1CA4055; Wed, 7 Jul 2021 14:03:31 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC7E2A404D; Wed, 7 Jul 2021 14:03:30 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:30 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 7/8] lib: s390x: Print if a pgm happened while in SIE Date: Wed, 7 Jul 2021 16:03:17 +0200 Message-Id: <20210707140318.44255-8-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: lzo9eXhdtGlc_JZzh5uXJ2XpDFBIKKHe X-Proofpoint-ORIG-GUID: vT0rIrVXsNpFcNNa9Unvx0iKdpWyIgK2 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_06:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 priorityscore=1501 phishscore=0 clxscore=1015 mlxlogscore=999 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070084 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org For debugging it helps if you know if the PGM happened while being in SIE or not. Signed-off-by: Janosch Frank Reviewed-by: Cornelia Huck --- lib/s390x/interrupt.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c index b627942f..109f2907 100644 --- a/lib/s390x/interrupt.c +++ b/lib/s390x/interrupt.c @@ -141,10 +141,15 @@ static void print_int_regs(struct stack_frame_int *stack) static void print_pgm_info(struct stack_frame_int *stack) { + bool in_sie; + + in_sie = (lc->pgm_old_psw.addr >= (uintptr_t)sie_entry && + lc->pgm_old_psw.addr <= (uintptr_t)sie_exit); + printf("\n"); - printf("Unexpected program interrupt: %d on cpu %d at %#lx, ilen %d\n", - lc->pgm_int_code, stap(), lc->pgm_old_psw.addr, - lc->pgm_int_id); + printf("Unexpected program interrupt %s: %d on cpu %d at %#lx, ilen %d\n", + in_sie ? "in SIE" : "", + lc->pgm_int_code, stap(), lc->pgm_old_psw.addr, lc->pgm_int_id); print_int_regs(stack); dump_stack(); report_summary(); From patchwork Wed Jul 7 14:03:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12362697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8460AC07E9E for ; Wed, 7 Jul 2021 14:03:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B03261C92 for ; Wed, 7 Jul 2021 14:03:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231979AbhGGOGU (ORCPT ); Wed, 7 Jul 2021 10:06:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:3348 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbhGGOGT (ORCPT ); Wed, 7 Jul 2021 10:06:19 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167DXtSO165557; Wed, 7 Jul 2021 10:03:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=LhHNKzf8eC+sDyppNRXNGnKxuTjdSeuQRNVuyJxGYLA=; b=UUYok74q2KO8pkr2kzeutDIxV+2e4BhCNrrxJFEA6RntGGC4QfT9dFX4WydAdpFUqS1Q 8RC7MI4itrFeztxxaVBa1GXResxApbNBlTUboCQHmkfbMSI667gXQzjYWBOSwvfWzWr4 FAqPs4EvicLhKJIBJV8v8zh0Bt+tU63cdhx+7yiPpQIQiY6tBkN13z/mZDdNWww/giYk OeYV95W7X6iWk+NF1NhxOzpDI8Qv8H0ahTJVgCxGMnakyNJ1EzQS/udacpFe7m2J+Hso CW6FuydtDbLUWVIwdqmpzCuTVSifiAgaKmOUYaoaGVi3/+UZLabEQDzJMaOvjgeCZL8r /Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mts0m220-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:39 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 167DYD4k166854; Wed, 7 Jul 2021 10:03:38 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mts0m20e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 10:03:38 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 167E1YY3004282; Wed, 7 Jul 2021 14:03:35 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06ams.nl.ibm.com with ESMTP id 39jf5h9sn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:03:34 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 167E3VSX33554758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jul 2021 14:03:31 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA31EA4055; Wed, 7 Jul 2021 14:03:31 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4BCE2A404D; Wed, 7 Jul 2021 14:03:31 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.29.241]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Jul 2021 14:03:31 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 8/8] lib: s390x: Remove left behing PGM report Date: Wed, 7 Jul 2021 16:03:18 +0200 Message-Id: <20210707140318.44255-9-frankja@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707140318.44255-1-frankja@linux.ibm.com> References: <20210707140318.44255-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: B7_u8As3iXNTnuHLd-88L8fyLLeh47nO X-Proofpoint-GUID: qzbHSJjNx4395mVd9fZjWC6wzi8-me3m X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-07_06:2021-07-06,2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 priorityscore=1501 clxscore=1015 adultscore=0 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070081 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When I added the backtrace support I forgot to remove the PGM report. Signed-off-by: Janosch Frank Reviewed-by: Cornelia Huck --- lib/s390x/interrupt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c index 109f2907..785b7355 100644 --- a/lib/s390x/interrupt.c +++ b/lib/s390x/interrupt.c @@ -162,9 +162,6 @@ void handle_pgm_int(struct stack_frame_int *stack) /* Force sclp_busy to false, otherwise we will loop forever */ sclp_handle_ext(); print_pgm_info(stack); - report_abort("Unexpected program interrupt: %d on cpu %d at %#lx, ilen %d\n", - lc->pgm_int_code, stap(), lc->pgm_old_psw.addr, - lc->pgm_int_id); } pgm_int_expected = false;