Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp993334rdg; Wed, 11 Oct 2023 11:02:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOVjbc0pl90j4dkDWVuySz2PrF2av8Go8+JLYh4qApZt25LwO4ttW5H2HNu7SfXLKEnUpw X-Received: by 2002:a05:6e02:1053:b0:345:d58d:9ae5 with SMTP id p19-20020a056e02105300b00345d58d9ae5mr23226646ilj.7.1697047355980; Wed, 11 Oct 2023 11:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697047355; cv=none; d=google.com; s=arc-20160816; b=vMVo+uznaW3v1j5KLOFqHGNUOSV+ERrTKkwyu0fMMobyMcEe3OdiolCdfbZSwtnYKt D+ZCgmhmopJlqSAUVMkUn2tZXgPsTxmweuju4QTYILT7zE2oS3sRIJaT8jRcBILnOlVd JWTwEk7Tr6J1a+YnwmwzJke99w1619JFEMCdgLbdbINacszr+oJkWD/JQ79ey9PrRFcA ENIqrzS2CQTTHEIfpvhyR92/4KV9qJ2k4IQ7Y+c7TvRXo9b9u0Jm3uYnKegCg5DZttOG uv8vsb33Mzk7aZW3Vg9bUS/RWBi3hEVTiBu8za20yv/0UsKKTUpGGXl/lhE1sOnwQ7po mLkw== 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=LANmNJdueyvQi7c+RbU1YOnVyO963av3fCML/59OnNg=; fh=HXDuDGb+DPlNS26c0sFY/7cUqZICuX4wogAVM6tkwDQ=; b=cPTxPSgsMbdGGDAeLNRYBQZg64P3nVQk9q8XH4dHOOu7Yxm2L4IMk7yqJ3BpguixEu AP5RF1vvYgtkY5K270hDkyfWB9uD6c3juNMOpe/s80gxMiqXmYW7l61sAweqSfcto/S8 2U3NMLYWXjYDYBCJWklaOYd70o2aa5U4Mwyt33DvhHWWFf93cXZGItkVLi2KtMW9BF/M n0RnP4mSkm69sJlPxzxK7Jl31MAaKN7CsAzexr+Pp6roIiyv94Y2t9WCyVdNf7ioC79O AFCflN1LRU5AZvKxQHKuvWsLEJL3VWC0Pw81XtOolbEIM1XGv+mElY0fwZ+L476s6wIA aULA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=O3lSyLLC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cb21-20020a056a02071500b0056533c00e83si348434pgb.413.2023.10.11.11.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 11:02:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=O3lSyLLC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 1499281716A1; Wed, 11 Oct 2023 11:02:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234775AbjJKSCX (ORCPT + 99 others); Wed, 11 Oct 2023 14:02:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232218AbjJKSCV (ORCPT ); Wed, 11 Oct 2023 14:02:21 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E792793 for ; Wed, 11 Oct 2023 11:02:19 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39BHE2Ku020157; Wed, 11 Oct 2023 18:01:42 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=LANmNJdueyvQi7c+RbU1YOnVyO963av3fCML/59OnNg=; b=O3lSyLLCbj4f96Jv4+r7OqeiTyynS/aleT1b1LCzjeLQ+9NT6NjqkqvWj8KEDNr/oLCK yPfokbmH2DDEOHbkeaN2okWNlpNKDs2J/eti1VBwkAQyaCJvxHPlVLlKBVQ9xaNrWWDm ujXo52LdSew/4MCE0EoAz5nZvLP77gYhO1I3vqQnEzpjD7+XMWaWHeHiiTGoaEI27wEV 1EydeADLcnvmW3VW6iE8faOBf9NGMUr+W6VBamQCDWVV5vJETnGTKya+E8/7bHiIadnN a8PONg/o5ZBWsEsdx4UUOkHle1+6SKvd0E3Xm4XQ8az/VCUe2hP3crEZLj+M8DlGW8+1 Dw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tjx43rypq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:01:41 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39BGjwdH002618; Wed, 11 Oct 2023 18:01:41 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tjwsedrkh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:01:40 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39BI1eE0029797; Wed, 11 Oct 2023 18:01:40 GMT Received: from mlluis-mac.uk.oracle.com (dhcp-10-175-192-63.vpn.oracle.com [10.175.192.63]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3tjwsedrg7-1; Wed, 11 Oct 2023 18:01:39 +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 v3 0/3] Fine grain sysregs allowed to trap for nested virtualization Date: Wed, 11 Oct 2023 18:00:59 +0000 Message-Id: <20231011180103.91774-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.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_12,2023-10-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110159 X-Proofpoint-ORIG-GUID: xzf-n6Ewm7oFwSQkaKcFwZ04a9JY1xaN X-Proofpoint-GUID: xzf-n6Ewm7oFwSQkaKcFwZ04a9JY1xaN X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 11:02:32 -0700 (PDT) X-Spam-Level: ** 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. Changes v2 -> v3 patch 1: Fix BRBCR_EL12. (Eric) Add Eric's R-b. Thanks! patch 2: New patch to add missing _EL2 encodings for patch 3. patch 3: Previously patch 2 in v2. Add Fixes tag. (Eric) Merge contiguous ranges and exclude undefined encodings. (Eric) v1 -> v2 patch 1: fix indentation patch 2: improve commit message (Marc) fix indentation (Marc) follow kernel comment format (Marc) describe LRs in ranges (Marc) include AMEVCNTVOFF0_EL2 and AMEVCNTVOFF1_EL2 patch 3: drop. Excluded IMPDEF range is trapped by HCR_EL2.TIDCP 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 | 48 ++++++++++++++++++ arch/arm64/kvm/emulate-nested.c | 88 ++++++++++++++++++++++++++++++--- 2 files changed, 130 insertions(+), 6 deletions(-) -- 2.39.2