From patchwork Thu Dec 14 10:01:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 13492692 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B28FC4167D for ; Thu, 14 Dec 2023 10:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RcO722A9bwiL/5ozlQI+w75gL5KwHgzmiXRAHYgiHcA=; b=2LvypWzbKV4eNRrB3cY4o4ITTs wMQ80HteUKGcMagzgqimmPUtjdLxCoXYboDyXK6rqso0Y1KsZQ4X7Htuf9b0PQPglaHIrfVZPSIqs udhvz0bIfrimU3cOWsvgnzwa+gKT7E3zQFhuHDTGdEB6B/jcIrVIope9OiLoS3/SO2Q2jO6wJalZq 6ZsQI+M1fKVzCVDwQo6PiJy4MF5j1h/h75yIBLNLrGYM6QakxrT8LJpRD8LBOSsLrqexshCzkbHWf gY3ifRUGc3ViS+WvAn4pwkAJjULSRgqA+XyM77vzimIUwYH0Vhb58QTN+ToqIhMXbtRcKeSgtf+mL xwf4MMXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDiY0-00HOyg-1L; Thu, 14 Dec 2023 10:02:28 +0000 Received: from mail-wr1-x449.google.com ([2a00:1450:4864:20::449]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDiXs-00HOts-1M for linux-arm-kernel@lists.infradead.org; Thu, 14 Dec 2023 10:02:21 +0000 Received: by mail-wr1-x449.google.com with SMTP id ffacd0b85a97d-33340d20b90so6616498f8f.2 for ; Thu, 14 Dec 2023 02:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702548138; x=1703152938; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=hWCr/u0/LEl0Qz/K61SKmSilcDBET0Mpt8ezhmPfdL0=; b=WXyC3F6KPs3knXZaEa++MAatqIkUVrLlttzJWqMh1qbCNOtxnh5gmSnAfdudKsspAg 3GOAbceBGE2w+XD23ZvDEcTvGHs9TdZyKMiAov6gkpeJlFipa2BVmrXzYenz5cz+zTsF jc3bL3oC7hvZQRkvRh4Ff2PrtRe78KfA78wXEC0Zv+pwONlIy+gxjcPinJCLDJMxmmQj cOd5UygvA+s1+deDs0k9iFNbi9GHVMXQAUx1P5AUnQvgmlYtd1sIu6k4QFhZ7OUp1hnM uywFHboQNWGiUDJyTkO9+LVwoKwpJ/SIY6wyh+DHlvXqL5hkxzvwCukWlwaVrV/iHo7t ymgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702548138; x=1703152938; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hWCr/u0/LEl0Qz/K61SKmSilcDBET0Mpt8ezhmPfdL0=; b=tkppTM/y3oIhbXdo13v8qC2WzhlCVZgMe/+bnEbQFwIb33Ya7Mnz1H9hql2GRhg/zE 4XlwgS1WXjM9SZKgGpcfM6R7yFc7r4n6Rcb49eUI7BlHG9gUoFStCsTEti8dvvKNdSty Vcwy7vvX+x+0l/UTo4PrjU6utqvbOc/DDSy/41P7rWvo2NfZmE+ch7mNdpbWRDbL7/3A albJeCHjiAaCBUILERqaDWCKS8wWqRPJHZHS08jYzB+5/UDck7KrfexsU8rTtTdFuww7 j7eZzO1fZMSbBb5xivauTCzCi56uIpAvSuDJDrP1j2ob7rQKhHnWWGaP2NCEVoZ0IVrA bzKw== X-Gm-Message-State: AOJu0Yz8oQ3nG51U17pK/PxU9Uz0GP81sWc5QbCL4ktS4Bah3dHuO2Px Oy7QPiBji03OqO9V5nJEHih/KP2b0Q== X-Google-Smtp-Source: AGHT+IFL2ThU73Trz4Wy9pYB2yLh/2X8/PtTAtN1qdC64iHsHskqYdTX9A2+HSCsuauP2OUpLSO2Us+QPg== X-Received: from fuad.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1613]) (user=tabba job=sendgmr) by 2002:a05:6000:4024:b0:333:43b5:ef39 with SMTP id cp36-20020a056000402400b0033343b5ef39mr50416wrb.10.1702548138483; Thu, 14 Dec 2023 02:02:18 -0800 (PST) Date: Thu, 14 Dec 2023 10:01:48 +0000 In-Reply-To: <20231214100158.2305400-1-tabba@google.com> Mime-Version: 1.0 References: <20231214100158.2305400-1-tabba@google.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20231214100158.2305400-9-tabba@google.com> Subject: [PATCH v3 08/17] KVM: arm64: Add bit masks for HAFGRTR_EL2 From: Fuad Tabba To: kvmarm@lists.linux.dev Cc: maz@kernel.org, oliver.upton@linux.dev, broonie@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, eric.auger@redhat.com, jingzhangos@google.com, joey.gouly@arm.com, tabba@google.com, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231214_020220_460562_4CA6231C X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To support HAFGRTR_EL2 supported in nested virt in the following patch, first add its bitmask definitions based on DDI0601 2023-09. Reviewed-by: Mark Brown Signed-off-by: Fuad Tabba --- arch/arm64/include/asm/kvm_arm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index b85f46a73e21..7de0a7062625 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h @@ -370,6 +370,10 @@ #define __HDFGWTR_EL2_MASK ~__HDFGWTR_EL2_nMASK #define __HDFGWTR_EL2_nMASK GENMASK(62, 60) +#define __HAFGRTR_EL2_RES0 (GENMASK(63, 50) | GENMASK(16, 5)) +#define __HAFGRTR_EL2_MASK (GENMASK(49, 17) | GENMASK(4, 0)) +#define __HAFGRTR_EL2_nMASK 0UL + /* Similar definitions for HCRX_EL2 */ #define __HCRX_EL2_RES0 (GENMASK(63, 16) | GENMASK(13, 12)) #define __HCRX_EL2_MASK (0)