Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2424382rdg; Mon, 16 Oct 2023 04:18:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQ7OmMG21C7UFmAUmyyuv/AqrZ5GwvX+vvuvKYLP9ZuZbzg8mM04pT36uFLFYwU76IHrF5 X-Received: by 2002:a05:6a00:1781:b0:692:822a:2250 with SMTP id s1-20020a056a00178100b00692822a2250mr35551995pfg.17.1697455118854; Mon, 16 Oct 2023 04:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697455118; cv=none; d=google.com; s=arc-20160816; b=jN1f/ej13AOpL9Q0rvFqRjaOULUb10Nbu8TUHWexFVYiEpHmeFa1bI0mwwxZDf0NzJ eCnks9St5z7W+PKA/dnv6tH9y58OShXpYMbk5dQ/yC1DJeNqiXWK+0d4N8CPw7FkcUtw ZT1C/z3DVpAYzcSO9nrYQW7tn3NIh28uMME142UvBLSmrHdjVRUgTk2iELZKsyIqnKoV ykWc/4ianQPG418dlrAOnmEf1A3O/Z5ELUOryWbYi2Zq4kY3adhiDOFfhXrtEQ/AUyqC Zy25zpH4qdMIbUYxwaifRpwFuUovio2rNI7iIXZR98mmNQyUGJJsnYkgWgmmrm6GsUWB 0rjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cYZPT0kSHMpbU6o+Gjv3y0QqFO0FSp+3oDPiMrpGdm0=; fh=HXDuDGb+DPlNS26c0sFY/7cUqZICuX4wogAVM6tkwDQ=; b=CZal6yHaEmYvPQjw9ZE1o1AR0HMkCduAsmencnM4vfnStrf2ZhOgqmv5I9+00ZwUX7 HctsOMscHYWpchLY5WuG7vZsXEgKLdIvfjZ0izQez1ahNobFPRpACzU9ILNKT9MuKP/3 zNyag/awEkf5kLPcQEMmVlyBR27oY9YkGqn9MZvIZDi25Rr2vsCKYDhE05CR5i9TEpy1 wMMAgiHOKAOzDC9+oYNl6Im8oD+73Xx0B3soPL8GeIqouijbWvKaKcO6eorOrKrqcn1f q9TgD7ih+Gehw3KVv62ZL8DeCK9UrjVXoupdNLPdagvxWBqmocNF0ghExS2OXHuviwIi jPsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=Fe5p6hKc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z190-20020a6333c7000000b005897813624fsi7839517pgz.476.2023.10.16.04.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:18:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=Fe5p6hKc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 84F6B80BBC6F; Mon, 16 Oct 2023 04:18:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233007AbjJPLSa (ORCPT + 99 others); Mon, 16 Oct 2023 07:18:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232693AbjJPLS0 (ORCPT ); Mon, 16 Oct 2023 07:18:26 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE7BDE8 for ; Mon, 16 Oct 2023 04:18:24 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39G6n1Hn020635; Mon, 16 Oct 2023 11:17:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2023-03-30; bh=cYZPT0kSHMpbU6o+Gjv3y0QqFO0FSp+3oDPiMrpGdm0=; b=Fe5p6hKcqIo+LTKxp6y/PDrOScAqipgVDKihlsCkZd+4/OsuJcVWk/mmqAiQZ0CPHV5a jLtyzBZz31iWY+a9DCapN+bKNA+jtJAVAaK2nOH0lcII67mFdyyPQv+GIfyIHBkBGfT9 eCN0jnb3GMmab3XdOjLb0i8ZIt/oRzjD/fIV73oeGUhPUv81oD5rpzv5HLkrrhB+Ht6f RwxQkTf+yNjcqXhEydI0R2ztd55ThLfLCmPUPG/NCrZjARgMZkhFyKjaObszZGAnd3yQ pwUBnp3KLPWNh0YY8sBJ3tNIdNvxSyuNXd5i8IL4a29HzWx8CXb+UHwhI7Sr8oRV6+li MQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tqkhu2ejb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Oct 2023 11:17:54 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39G9MUvh027313; Mon, 16 Oct 2023 11:17:53 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3trg529h23-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Oct 2023 11:17:53 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39GBHqS8040637; Mon, 16 Oct 2023 11:17:52 GMT Received: from mlluis-mac.uk.oracle.com (dhcp-10-175-197-167.vpn.oracle.com [10.175.197.167]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3trg529gvb-1; Mon, 16 Oct 2023 11:17:52 +0000 From: Miguel Luis To: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Jing Zhang , Eric Auger , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Cc: miguel.luis@oracle.com Subject: [PATCH v4 0/3] arm64/kvm: Fine grain _EL2 system registers list that affect nested virtualization Date: Mon, 16 Oct 2023 11:17:39 +0000 Message-Id: <20231016111743.30331-1-miguel.luis@oracle.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-16_04,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=898 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310160099 X-Proofpoint-GUID: 5lxFsOScxNx3QQFg_J_v-MIGfog1Ov3H X-Proofpoint-ORIG-GUID: 5lxFsOScxNx3QQFg_J_v-MIGfog1Ov3H X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 16 Oct 2023 04:18:37 -0700 (PDT) The current HCR_EL2 description defines ranges of system register encodings in which accesses should trap for NV. These ranges include encodings which aren't defined in the reference manual. In order avoid this, let's rather implement a more fine grained approach excluding those undefined. v3 -> v4 patch 2: Add BRBCR_EL2. patch 3: Handle BRBCR_EL2. Add Eric's R-b. Thanks! v3: https://lore.kernel.org/kvmarm/20231011180103.91774-1-miguel.luis@oracle.com/ v2: https://lore.kernel.org/kvmarm/20230925162057.27548-1-miguel.luis@oracle.com/ v1: https://lore.kernel.org/kvmarm/20230913185209.32282-1-miguel.luis@oracle.com/ Miguel Luis (3): arm64: Add missing _EL12 encodings arm64: Add missing _EL2 encodings arm64/kvm: Fine grain _EL2 system registers list that affect nested virtualization arch/arm64/include/asm/sysreg.h | 50 ++++++++++++++++++ arch/arm64/kvm/emulate-nested.c | 89 ++++++++++++++++++++++++++++++--- 2 files changed, 133 insertions(+), 6 deletions(-) -- 2.39.2