From patchwork Wed Feb 5 13:22:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shameer Kolothum X-Patchwork-Id: 13961158 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 C7A0BC02199 for ; Wed, 5 Feb 2025 14:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=c+f85VesU1wqypd/tIYZxAGisoTlq7XWZXMqb5630eQ=; b=fG1vReg/m27p/lWwJ7nWdw9KHd xMWrUz/L9hbINMCBcFbY5zoP9bpOdCn4SzcR/iwPzmfX0JbpYw1YaBzBI5R4Lm2rQVuPhSxESrIU5 dbDfxTZ0Nu0NeyU9+VoNXU7IRgiq8RFiuEKZ193JDG7joJrntprY833TL5Wmy1PbPK1lX7gravdhR PBLyoKYfRU6lDCI5h58Uks/9vzdtKuRJF1oNMQUF6rrBY9SL1miDVF7gApGh+ydY9BKBSD19HcqWl ajllxAuxg4FmTImbK9mnm94v8RmRwoDZpxu9lPydvzKjqFjzpODV0te2Aum1FFCq79N7NzDyTa7mX PVR7IK8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tfgQp-00000003Y1e-1Gco; Wed, 05 Feb 2025 14:31:11 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tffND-00000003O2m-3v6F for linux-arm-kernel@lists.infradead.org; Wed, 05 Feb 2025 13:23:25 +0000 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Yp17w0k0Kz6FBYy; Wed, 5 Feb 2025 21:20:44 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 8511914034E; Wed, 5 Feb 2025 21:23:22 +0800 (CST) Received: from A2303104131.china.huawei.com (10.203.177.241) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 5 Feb 2025 14:23:14 +0100 From: Shameer Kolothum To: , , CC: , , , , , , , , , , , , Subject: [PATCH v6 3/4] KVM: arm64: Report all the KVM/arm64-specific hypercalls Date: Wed, 5 Feb 2025 13:22:21 +0000 Message-ID: <20250205132222.55816-4-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20250205132222.55816-1-shameerali.kolothum.thodi@huawei.com> References: <20250205132222.55816-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.203.177.241] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To frapeml500008.china.huawei.com (7.182.85.71) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_052324_120215_9ED951F2 X-CRM114-Status: UNSURE ( 9.63 ) 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 Currently ARM_SMCCC_VENDOR_HYP_KVM_FEATURES_FUNC_ID returns the bitmap corresponding to KVM_REG_ARM_VENDOR_HYP_BMAP and it only returns _KVM_FEATURES_FUNC_ID and _KVM_PTP_FUNC_ID. Change that to return all the KVM/arm64-specific hypercalls exposed by KVM/arm64 to guest operating systems. Signed-off-by: Shameer Kolothum --- arch/arm64/kvm/hypercalls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c index 27ce4cb44904..5cef2590ffdf 100644 --- a/arch/arm64/kvm/hypercalls.c +++ b/arch/arm64/kvm/hypercalls.c @@ -359,7 +359,11 @@ int kvm_smccc_call_handler(struct kvm_vcpu *vcpu) val[3] = ARM_SMCCC_VENDOR_HYP_UID_KVM_REG_3; break; case ARM_SMCCC_VENDOR_HYP_KVM_FEATURES_FUNC_ID: - val[0] = smccc_feat->vendor_hyp_bmap; + val[0] = GENMASK(ARM_SMCCC_KVM_FUNC_PTP, + ARM_SMCCC_KVM_FUNC_FEATURES); + /* Function numbers 2-63 are reserved for pKVM for now */ + val[2] = GENMASK((ARM_SMCCC_KVM_FUNC_DISCOVER_IMPL_CPUS - 64), + (ARM_SMCCC_KVM_FUNC_DISCOVER_IMPL_VER - 64)); break; case ARM_SMCCC_VENDOR_HYP_KVM_PTP_FUNC_ID: kvm_ptp_get_time(vcpu, val);