From: Oliver Upton <oliver.upton@linux.dev>
To: kvmarm@lists.linux.dev
Cc: kvm@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Oliver Upton <oliver.upton@linux.dev>
Subject: [PATCH 1/3] KVM: arm64: Add a predicate for testing if SMCCC filter is configured
Date: Wed, 4 Oct 2023 23:49:45 +0000 [thread overview]
Message-ID: <20231004234947.207507-2-oliver.upton@linux.dev> (raw)
In-Reply-To: <20231004234947.207507-1-oliver.upton@linux.dev>
Eventually we can drop the VM flag, move around the existing
implementation for now.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
arch/arm64/kvm/hypercalls.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c
index 7fb4df0456de..35e023322cdb 100644
--- a/arch/arm64/kvm/hypercalls.c
+++ b/arch/arm64/kvm/hypercalls.c
@@ -158,6 +158,11 @@ static void init_smccc_filter(struct kvm *kvm)
}
+static bool kvm_smccc_filter_configured(struct kvm *kvm)
+{
+ return test_bit(KVM_ARCH_FLAT_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags);
+}
+
static int kvm_smccc_set_filter(struct kvm *kvm, struct kvm_smccc_filter __user *uaddr)
{
const void *zero_page = page_to_virt(ZERO_PAGE(0));
@@ -201,7 +206,7 @@ static u8 kvm_smccc_filter_get_action(struct kvm *kvm, u32 func_id)
unsigned long idx = func_id;
void *val;
- if (!test_bit(KVM_ARCH_FLAG_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags))
+ if (!kvm_smccc_filter_configured(kvm))
return KVM_SMCCC_FILTER_HANDLE;
/*
--
2.42.0.609.gbb76f46606-goog
next prev parent reply other threads:[~2023-10-04 23:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 23:49 [PATCH 0/3] KVM: arm64: Cleanups for managing SMCCC filter maple tree Oliver Upton
2023-10-04 23:49 ` Oliver Upton [this message]
2023-10-04 23:49 ` [PATCH 2/3] KVM: arm64: Only insert reserved ranges when SMCCC filter is used Oliver Upton
2023-10-04 23:49 ` [PATCH 3/3] KVM: arm64: Use mtree_empty() to determine if SMCCC filter configured Oliver Upton
2023-10-05 7:24 ` [PATCH 0/3] KVM: arm64: Cleanups for managing SMCCC filter maple tree Marc Zyngier
2023-10-05 20:55 ` Oliver Upton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231004234947.207507-2-oliver.upton@linux.dev \
--to=oliver.upton@linux.dev \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.