From patchwork Thu Jan 3 10:07:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 10747115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 486FD746 for ; Thu, 3 Jan 2019 10:09:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3966B285D2 for ; Thu, 3 Jan 2019 10:09:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D7E3285F2; Thu, 3 Jan 2019 10:09:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C799C285D2 for ; Thu, 3 Jan 2019 10:09:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730726AbfACKJx (ORCPT ); Thu, 3 Jan 2019 05:09:53 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41366 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730122AbfACKJw (ORCPT ); Thu, 3 Jan 2019 05:09:52 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x03A9ILQ037784 for ; Thu, 3 Jan 2019 05:09:51 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2psd3jf68p-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 03 Jan 2019 05:09:50 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Jan 2019 10:09:48 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 3 Jan 2019 10:09:46 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x03A9jBd8913242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Jan 2019 10:09:45 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 80F47A4040; Thu, 3 Jan 2019 10:09:45 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F7F0A4059; Thu, 3 Jan 2019 10:09:45 +0000 (GMT) Received: from s38lp20.lnxne.boe (unknown [9.152.224.63]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 3 Jan 2019 10:09:45 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, david@redhat.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH v4 03/13] s390x: Make tests bootable from disk Date: Thu, 3 Jan 2019 11:07:56 +0100 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20190103100806.9039-1-frankja@linux.ibm.com> References: <20190103100806.9039-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19010310-0012-0000-0000-000002E0D9FE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19010310-0013-0000-0000-00002117993C Message-Id: <20190103100806.9039-4-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-03_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=935 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901030090 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently tests are run with the --kernel option of Qemu, which will load the ELF file and jump to the start address. When booting from disk, we need to specify a start address. This is done by setting the initial short PSW at 0x0. .text was moved to 0x11000 because the bootloader can write from 0x10480 until 0x11000 if it has a lot to write. 0x10480 to 0x10600 was not enough safe space. Signed-off-by: Janosch Frank Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand --- s390x/cstart64.S | 9 ++++++++- s390x/flat.lds | 13 ++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/s390x/cstart64.S b/s390x/cstart64.S index dc7ddd6..d382497 100644 --- a/s390x/cstart64.S +++ b/s390x/cstart64.S @@ -14,9 +14,16 @@ .section .init -/* entry point - for KVM + TCG we directly start in 64 bit mode */ +/* + * Short init between 0x10000 and 0x10480 and then jump to 0x11000. + * 0x10480 - 0x11000 are written to by bootloader. + * + * For KVM and TCG kernel boot we are in 64 bit z/Arch mode. + * When booting from disk the initial short psw is in 31 bit mode. + */ .globl start start: + sam64 # Set addressing mode to 64 bit /* setup stack */ larl %r15, stackptr /* setup initial PSW mask + control registers*/ diff --git a/s390x/flat.lds b/s390x/flat.lds index b6e2172..977af7c 100644 --- a/s390x/flat.lds +++ b/s390x/flat.lds @@ -1,10 +1,21 @@ SECTIONS { + /* + * Initial short psw for disk boot, with 31 bit addressing for + * non z/Arch environment compatibility and the instruction + * address 0x10000 (cstart64.S .init). + */ + .lowcore : { + . = 0; + LONG(0x00080000) + LONG(0x80010000) + } + . = 0x10000; .text : { *(.init) . = 0x480; ipl_args = .; - . = 0x600; + . = 0x1000; *(.text) *(.text.*) }