From patchwork Wed Dec 5 15:39:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 10714445 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 83C10109C for ; Wed, 5 Dec 2018 15:41:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 756962D64D for ; Wed, 5 Dec 2018 15:41:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 739B92D643; Wed, 5 Dec 2018 15:41:01 +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 129D32D64E for ; Wed, 5 Dec 2018 15:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728254AbeLEPlA (ORCPT ); Wed, 5 Dec 2018 10:41:00 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38274 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728245AbeLEPk7 (ORCPT ); Wed, 5 Dec 2018 10:40:59 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB5FdOGS043543 for ; Wed, 5 Dec 2018 10:40:58 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p6har0shx-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 05 Dec 2018 10:40:57 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Dec 2018 15:40:55 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 5 Dec 2018 15:40:52 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wB5FepEw59703436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Dec 2018 15:40:51 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B2647A4068; Wed, 5 Dec 2018 15:40:51 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82130A4067; Wed, 5 Dec 2018 15:40:51 +0000 (GMT) Received: from s38lp20.lnxne.boe (unknown [9.152.224.44]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 Dec 2018 15:40:51 +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 v2 3/6] s390x: Switch to z/Arch if needed Date: Wed, 5 Dec 2018 16:39:15 +0100 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20181205153918.29480-1-frankja@linux.ibm.com> References: <20181205153918.29480-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18120515-0016-0000-0000-000002327506 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120515-0017-0000-0000-0000328A872C Message-Id: <20181205153918.29480-4-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-05_06:,, 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=786 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812050139 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP LPAR and z/VM start in esam mode depending on the hardware, so we need to switch to z/Arch and set 64 bit addressing. Under Qemu/KVM we already start out with both when being run with the Qemu --kernel argument or we lack 64 bit when booting from disk because of the initial psw specifying 31 bit for z/VM and lpar compatibility. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand --- s390x/cstart64.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/s390x/cstart64.S b/s390x/cstart64.S index d382497..7886f35 100644 --- a/s390x/cstart64.S +++ b/s390x/cstart64.S @@ -20,9 +20,17 @@ * * 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. + * When running under LPAR or z/VM, we might start in 31 bit and esam mode. */ .globl start start: + /* Switch to z/Architecture mode and 64-bit */ + slr %r0, %r0 # Set cpuid to zero + lhi %r1, 2 # mode 2 = esame + sigp %r1, %r0, 0x12 # sigp set arch + bras %r13,0f # Jump over zero area + .fill 16,4,0x0 # Zero area for lmh +0: lmh %r0,%r15,0(%r13) # Clear high-order half of gprs sam64 # Set addressing mode to 64 bit /* setup stack */ larl %r15, stackptr