From patchwork Thu Jan 3 10:07:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 10747117 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 7D7E8746 for ; Thu, 3 Jan 2019 10:09:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C621285D2 for ; Thu, 3 Jan 2019 10:09:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60AB4285F2; Thu, 3 Jan 2019 10:09:56 +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 0C025285D2 for ; Thu, 3 Jan 2019 10:09:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730732AbfACKJy (ORCPT ); Thu, 3 Jan 2019 05:09:54 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46028 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730724AbfACKJx (ORCPT ); Thu, 3 Jan 2019 05:09:53 -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 x03A9gDH136786 for ; Thu, 3 Jan 2019 05:09:52 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2pscqg07yf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 03 Jan 2019 05:09:52 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Jan 2019 10:09:50 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) 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:47 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x03A9k7O62193766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Jan 2019 10:09:46 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDD05A4059; Thu, 3 Jan 2019 10:09:46 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C387A404D; Thu, 3 Jan 2019 10:09:46 +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:46 +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 04/13] s390x: Switch to z/Arch Date: Thu, 3 Jan 2019 11:07:57 +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-0008-0000-0000-000002A96812 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19010310-0009-0000-0000-000022157F70 Message-Id: <20190103100806.9039-5-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=942 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 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 Reviewed-by: Thomas Huth --- s390x/cstart64.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/s390x/cstart64.S b/s390x/cstart64.S index d382497..6622633 100644 --- a/s390x/cstart64.S +++ b/s390x/cstart64.S @@ -11,6 +11,7 @@ * under the terms of the GNU Library General Public License version 2. */ #include +#include .section .init @@ -20,9 +21,18 @@ * * 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, SIGP_SET_ARCHITECTURE + /* 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 sam64 # Set addressing mode to 64 bit /* setup stack */ larl %r15, stackptr