From nobody Thu May 2 00:50:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1563283360; cv=none; d=zoho.com; s=zohoarc; b=CTjkfry4LnepTuY0QEKE17/Fz6WvK2ikN6M352c93toqGYSwG2OcXHcAlrhuI8tFw1KXZgfq8kE6syiEYyletFDVyENGMBBNfQ1LQMeoC0iGXuaS3WZ0sgWJoH2hdgWeLqQKjN9IecJ+gtQ4pEMfZXiMLZcz0y6vPtk9HD+bFvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563283360; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=FUwTbArXya4NP605CFDoTn1obmSd6XEwM7i6ZPFrVLQ=; b=FIQs8RyZUhX9bfXhrYdhmDHQJJHEyQ9BsEAuSFoVZD8Yy2/NxBy3Wl6oro/auSyBKT32mRr1cOZaQ+5sL+r96jB2G39QNseCMVFJo+CbewLB1w9wvscJgNd8aTwnawJHzV+q+5FZN/awpNzcSLi+D/6dnRONRMXXcFiGh9qBTzg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563283360888472.7304131411772; Tue, 16 Jul 2019 06:22:40 -0700 (PDT) Received: from localhost ([::1]:49082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnNPj-0003fh-Cb for importer@patchew.org; Tue, 16 Jul 2019 09:22:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59229) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnMfj-00078H-Ps for qemu-devel@nongnu.org; Tue, 16 Jul 2019 08:35:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnMfh-0007em-Mt for qemu-devel@nongnu.org; Tue, 16 Jul 2019 08:35:07 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:28584 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnMfg-0007V2-Vq for qemu-devel@nongnu.org; Tue, 16 Jul 2019 08:35:05 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6GCX1IR015526 for ; Tue, 16 Jul 2019 08:34:56 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tsdhrbck6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Jul 2019 08:34:56 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Jul 2019 13:34:55 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 16 Jul 2019 13:34:53 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6GCYpxR60293302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Jul 2019 12:34:51 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7488D42041; Tue, 16 Jul 2019 12:34:51 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 360A542042; Tue, 16 Jul 2019 12:34:51 +0000 (GMT) Received: from white.boeblingen.de.ibm.com (unknown [9.152.96.205]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 16 Jul 2019 12:34:51 +0000 (GMT) From: Ilya Leoshkevich To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, rth@twiddle.net, david@redhat.com, cohuck@redhat.com Date: Tue, 16 Jul 2019 14:34:46 +0200 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19071612-4275-0000-0000-0000034D6EBB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19071612-4276-0000-0000-0000385D80A6 Message-Id: <20190716123446.24039-1-iii@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-16_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=895 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907160155 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 X-Mailman-Approved-At: Tue, 16 Jul 2019 09:22:23 -0400 Subject: [Qemu-devel] [PATCH] s390: support EDAT-2 in mmu_translate_region X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: borntraeger@de.ibm.com, Ilya Leoshkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" When debugging s390 linux kernel with qemu kvm gdbstub, dumping memory contents at addresses in range 0x80000000-0x100000000 results in an error or all zeroes being returned. The problem appears to be that linux puts 2G page at that location, which qemu currently does not know about. Check FC bit of Region-Third-Table Entry in mmu_translate_region, just like it's already done for FC bit of Segment-Table Entry in mmu_translate_segment. Signed-off-by: Ilya Leoshkevich Acked-by: Christian Borntraeger --- target/s390x/cpu.h | 1 + target/s390x/mmu_helper.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index a606547b4d..947553386f 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -548,6 +548,7 @@ QEMU_BUILD_BUG_ON(sizeof(SysIB) !=3D 4096); #define ASCE_TABLE_LENGTH 0x03 /* region table length = */ =20 #define REGION_ENTRY_ORIGIN (~0xfffULL) /* region/segment table origin = */ +#define REGION_ENTRY_FC 0x400 /* region format control = */ #define REGION_ENTRY_RO 0x200 /* region/segment protection bit= */ #define REGION_ENTRY_TF 0xc0 /* region/segment table offset = */ #define REGION_ENTRY_INV 0x20 /* invalid region table entry = */ diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 6e9c4d6151..76cf920cd2 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -242,6 +242,14 @@ static int mmu_translate_region(CPUS390XState *env, ta= rget_ulong vaddr, return -1; } =20 + if (level =3D=3D ASCE_TYPE_REGION3 + && (new_entry & REGION_ENTRY_FC) && (env->cregs[0] & CR0_EDAT)) { + /* Decode EDAT-2 region frame absolute address (2GB page) */ + *raddr =3D (new_entry & 0xffffffff80000000ULL) | (vaddr & 0x7fffff= ff); + PTE_DPRINTF("%s: REG=3D0x%" PRIx64 "\n", __func__, new_entry); + return 0; + } + if (level =3D=3D ASCE_TYPE_SEGMENT) { return mmu_translate_segment(env, vaddr, asc, new_entry, raddr, fl= ags, rw, exc); --=20 2.21.0