From patchwork Mon Jul 19 16:03:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12386171 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=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham 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 F3A32C6377A for ; Mon, 19 Jul 2021 16:07:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C23E36113E for ; Mon, 19 Jul 2021 16:07:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C23E36113E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:References: Mime-Version:Message-Id: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=rm54EJjKF3qy5L1OuhOW3kmffz7XOYGns0h9NrGh5/w=; b=E1tSL7Pnk1MsiV5mlVZpV+y1tG dQHxb9hUfdLKn5SIbokn/X3TNNLGAV0343qP2nKFZwhkATDlgxeZt905uBNX0PdTx9ccbD8Rbt3m1 3IE18/IQZt5PqhNS58txtWyk4aUteA7vqQUAfVijYsqI7TSvRS7d0wLTlqqfiCQuVASdnBqlTatk+ QEkGzypVX19SU6hXO55AefGIzOJ+DtLnBJVh9tUYQlD3Ldz+R/WWWu6vez9PjQW1BiB7G3fSmZKq+ TcExZni1NB0IM+JiizH8T+08QxgRePRrljiHS1Bpj+4nS3IcIvay/Sfl4Wa4SfM6HiQJTVrWIxju2 85jR3HlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5VmL-00ALRl-FY; Mon, 19 Jul 2021 16:06:03 +0000 Received: from mail-ed1-x54a.google.com ([2a00:1450:4864:20::54a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5VkH-00AKcf-Fl for linux-arm-kernel@lists.infradead.org; Mon, 19 Jul 2021 16:03:55 +0000 Received: by mail-ed1-x54a.google.com with SMTP id p23-20020aa7cc970000b02903948bc39fd5so9506074edt.13 for ; Mon, 19 Jul 2021 09:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=7wkujqQey68d/8KAgY7QxLbL3Tk3E6zx35InqbFhZk8=; b=cI1pqIS70PpjVvFSr5jOtpULbEY43W4Q5k3H2M3+Pe6zycfUQ8J+47luWmyhdcQtj7 LNxHqrAvDi7k9ZrQ99sbopcAZrp3nHUyLPCcBPNXNHZvx6IO2Sjq+TT+uUNxgcRWX4D0 hrK/zoz2PS3l1iEKbpT8oLy9lelodxEKSRRmt9VX3F0p6thfu4rojU+4Yd/qLgMHp/ez VpGefh79ZC7n9pleIODX29EDlrGxzFeLjbnMF+IlxpHlSfvFqr0ESZ0EtoJF7DVEoOGw ZvzS7Ubj2jPwojVsgNF86jX6jRATNvOjxY9RH1HXtLXAJxT+9Z3pMek+apc2yM7iYbcI +qxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=7wkujqQey68d/8KAgY7QxLbL3Tk3E6zx35InqbFhZk8=; b=OUk6+C/WHtMsP+dPWL/SDz96KdcBpn7sZ/spzUZGQR1dKXYX6B7iBrczo8gl5+lSbI ak/fhdq4vGt2RjgPS2+qwnV7FNR2vNc176rFnz+jTrK5zfw3ZAcNNxuZ5EXdO292CMtR SPFXx2sBeMixN20psx4SW/P80iiV/yfqEwdXNMl8rMYE/dchLszQ6g3mqdAvABCXR8kG FxFuSMamTNRmv6caeu4y95NnK3Tpaoi6hQ5h9VpWu3jkgp03Ercn9Y2lGGuCz9czwEkb v04DuWVZEQUnbRj0GkXoXPvexf8AfL6BEKA89l2ynZpFvhICbCl7fI9RsWJEm+cxj3nv IZeA== X-Gm-Message-State: AOAM530X8MJ5ow6SFYPGv46ac8j1/JemYVyLVByLV2hDiQW2Pyx5vb+x Vzz2mS3MJFYo4pBZYG6GkA7fWK8Zmg== X-Google-Smtp-Source: ABdhPJw45jb2VfQ2x2siX2+8lyhQyXfGajRdkU6yAqPnufGi+Y4rw/053/SjjPHbtJCrsvDdQe7auRMpSw== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a05:6402:2228:: with SMTP id cr8mr35901384edb.309.1626710630758; Mon, 19 Jul 2021 09:03:50 -0700 (PDT) Date: Mon, 19 Jul 2021 17:03:32 +0100 In-Reply-To: <20210719160346.609914-1-tabba@google.com> Message-Id: <20210719160346.609914-2-tabba@google.com> Mime-Version: 1.0 References: <20210719160346.609914-1-tabba@google.com> X-Mailer: git-send-email 2.32.0.402.g57bb445576-goog Subject: [PATCH v3 01/15] KVM: arm64: placeholder to check if VM is protected From: Fuad Tabba To: kvmarm@lists.cs.columbia.edu Cc: maz@kernel.org, will@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, pbonzini@redhat.com, drjones@redhat.com, qperret@google.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, tabba@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210719_090353_637050_6B4D8F5B X-CRM114-Status: UNSURE ( 9.98 ) 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 Add a function to check whether a VM is protected (under pKVM). Since the creation of protected VMs isn't enabled yet, this is a placeholder that always returns false. The intention is for this to become a check for protected VMs in the future (see Will's RFC [*]). No functional change intended. Signed-off-by: Fuad Tabba [*] https://lore.kernel.org/kvmarm/20210603183347.1695-1-will@kernel.org/ Acked-by: Will Deacon --- arch/arm64/include/asm/kvm_host.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 41911585ae0c..347781f99b6a 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -771,6 +771,11 @@ void kvm_arch_free_vm(struct kvm *kvm); int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type); +static inline bool kvm_vm_is_protected(struct kvm *kvm) +{ + return false; +} + int kvm_arm_vcpu_finalize(struct kvm_vcpu *vcpu, int feature); bool kvm_arm_vcpu_is_finalized(struct kvm_vcpu *vcpu);