From patchwork Tue Feb 23 14:07:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Imbrenda X-Patchwork-Id: 12100379 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=-11.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 42393C433E9 for ; Tue, 23 Feb 2021 14:08:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13FA964E4B for ; Tue, 23 Feb 2021 14:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbhBWOIu (ORCPT ); Tue, 23 Feb 2021 09:08:50 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45176 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230165AbhBWOIr (ORCPT ); Tue, 23 Feb 2021 09:08:47 -0500 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 11NE4804036949; Tue, 23 Feb 2021 09:08:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=ySQiB4YasbBPzqhTJdzSqSt993KdrOQGK0tllJJ677Y=; b=b4gm3v7q+xxQjPPmOYEsfU0sdAhJr6Ol+nwYOOLtvfo3hxxmmn+CfW7qmG8V0BAIOsJD 5S/c3flhU/guaXmj6MypMjL2kUESUXCkOpui0xaNUs5TQ1EXhN5MTzU7fPP5nOWzjqhn g9/yYisdhy7GXfDHZNWy0zrvXDEP07JbqueC6fdbAD/YAFEtExG8mSBkkThJkeEpQLUJ sWQTqjE2CQ5jV+8x11TaPPeH5muz8CPrLCqejSKdsxomuVw/QlUQ12VAS5gjeTsgjtiC a+g770okmrr1V3jCPvTDpAgqTj5+7hoAaFQPtIJ+hT+uDbk2+diRafbPEIsJ2mup2V/R ng== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 36vkfuaay7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Feb 2021 09:08:06 -0500 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 11NE4J73037532; Tue, 23 Feb 2021 09:08:06 -0500 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 36vkfuaaww-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Feb 2021 09:08:06 -0500 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11NE7xrd002394; Tue, 23 Feb 2021 14:08:03 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04fra.de.ibm.com with ESMTP id 36tt289d68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Feb 2021 14:08:03 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11NE80Qx28705044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Feb 2021 14:08:00 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 969BFA4083; Tue, 23 Feb 2021 14:08:00 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 384BCA4082; Tue, 23 Feb 2021 14:08:00 +0000 (GMT) Received: from ibm-vm.ibmuc.com (unknown [9.145.5.213]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 23 Feb 2021 14:08:00 +0000 (GMT) From: Claudio Imbrenda To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, david@redhat.com, thuth@redhat.com, frankja@linux.ibm.com, cohuck@redhat.com, pmorel@linux.ibm.com Subject: [kvm-unit-tests PATCH v2 0/5] s390: Add support for large pages Date: Tue, 23 Feb 2021 15:07:54 +0100 Message-Id: <20210223140759.255670-1-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-02-23_07:2021-02-23,2021-02-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=999 phishscore=0 spamscore=0 impostorscore=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102230119 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Introduce support for large (1M) and huge (2G) pages. Add a simple testcase for EDAT1 and EDAT2. v1->v2 * split patch 2 -> new patch 2 and new patch 3 * patch 2: fixes pgtable.h, also fixes wrong usage of REGION_TABLE_LENGTH instead of SEGMENT_TABLE_LENGTH * patch 3: introduces new macros and functions for large pages * patch 4: remove erroneous double call to pte_alloc in get_pte * patch 4: added comment in mmu.c to bridge the s390x architecural names with the Linux ones used in the kvm-unit-tests * patch 5: added and fixed lots of comments to explain what's going on * patch 5: set FC for region 3 after writing the canary, like for segments * patch 5: use uintptr_t instead of intptr_t for set_prefix * patch 5: introduce new macro PGD_PAGE_SHIFT instead of using magic value 41 * patch 5: use VIRT(0) instead of mem to make it more clear what we are doing, even though VIRT(0) expands to mem Claudio Imbrenda (5): libcflat: add SZ_1M and SZ_2G s390x: lib: fix pgtable.h s390x: lib: improve pgtable.h s390x: mmu: add support for large pages s390x: edat test s390x/Makefile | 1 + lib/s390x/asm/pgtable.h | 40 +++++- lib/libcflat.h | 2 + lib/s390x/mmu.h | 73 +++++++++- lib/s390x/mmu.c | 260 ++++++++++++++++++++++++++++++++---- s390x/edat.c | 285 ++++++++++++++++++++++++++++++++++++++++ s390x/unittests.cfg | 3 + 7 files changed, 633 insertions(+), 31 deletions(-) create mode 100644 s390x/edat.c