From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 066D7C43461 for ; Mon, 7 Sep 2020 14:21:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 837B921481 for ; Mon, 7 Sep 2020 14:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CZZ//K/H"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ugxc8NXb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 837B921481 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6vma0W+exbYyUYlOQN+Ekol3WmAPDyVjkNhoUQ9dtWY=; b=CZZ//K/Hn4LomQprX6gCUowZt d6ZfTLE2qHHwh1OIPwUuH0PIytpWeWwdqtLLS/o+qS/aPJQTpvy9hOLeL3kZdTvBk391QdF/GszHy MvWUcnH5K1WXaB/1xqN1fk6AnJ83+hWszL4H7XqYONXcO56EOw6o7T3TTlPU7hKgnZYjtKuxyuPg6 Q6ScuyZxpCnH5rBcnlzSkjK6tE7HySOZ5vS1oiL6qr/VbviR7EE6r5vNUZzPQmYvz+aoR4576gOO9 i4VZPId+SjpJ+MDAfkTItVNZb64jsVIpp9PCXC7ESRwpPqv3RFYG2isuE2r8cjLUAZFtCKClFK+eY 2G2HjPBUA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFI0C-0005pb-Gj; Mon, 07 Sep 2020 14:20:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFI0A-0005ov-OV for linux-arm-kernel@lists.infradead.org; Mon, 07 Sep 2020 14:20:11 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB2F221481; Mon, 7 Sep 2020 14:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599488410; bh=xmG2zLYjHHaI4w3YYUB9HtMz6um9lD66REa1f1PLI4U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ugxc8NXbiNGfJcmHzdcDQe/lJrQ6sYJ9aTRD2q/gCicGZxaf6E86SH6xdY1GbVDeq owICP11rDRh+y4U8KEev8nMTkwVWfBNBzS0v8+UEEqmrFTwMPEAMOzR5hdGoUwJvX1 yfxk5MxvNktIg5yFshdmKRhCRKfyGu5jDlhroccM= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFI08-009mcx-3x; Mon, 07 Sep 2020 15:20:08 +0100 Date: Mon, 07 Sep 2020 15:20:07 +0100 Message-ID: <87o8mhlld4.wl-maz@kernel.org> From: Marc Zyngier To: Andrew Scull Subject: Re: [PATCH v3 16/18] KVM: arm64: nVHE: Migrate hyp interface to SMCCC In-Reply-To: <20200903135307.251331-17-ascull@google.com> References: <20200903135307.251331-1-ascull@google.com> <20200903135307.251331-17-ascull@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: ascull@google.com, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, suzuki.poulose@arm.com, julien.thierry.kdev@gmail.com, will@kernel.org, catalin.marinas@arm.com, kernel-team@android.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, dbrazdil@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200907_102010_933687_E33E508D X-CRM114-Status: GOOD ( 26.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, Sudeep Holla , David Brazdil , will@kernel.org, kvmarm@lists.cs.columbia.edu, julien.thierry.kdev@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 03 Sep 2020 14:53:05 +0100, Andrew Scull wrote: > > Rather than passing arbitrary function pointers to run at hyp, define > and equivalent set of SMCCC functions. > > Since the SMCCC functions are strongly tied to the original function > prototypes, it is not expected for the host to ever call an invalid ID > but a warning is raised if this does ever occur. > > As __kvm_vcpu_run is used for every switch between the host and a guest, > it is explicitly singled out to be identified before the other function > IDs to improve the performance of the hot path. > > Signed-off-by: Andrew Scull > Signed-off-by: David Brazdil > --- > arch/arm64/include/asm/kvm_asm.h | 24 ++++++ > arch/arm64/include/asm/kvm_host.h | 25 ++++--- > arch/arm64/kvm/arm.c | 2 +- > arch/arm64/kvm/hyp.S | 24 ++---- > arch/arm64/kvm/hyp/nvhe/hyp-main.c | 113 +++++++++++++++++++++++++---- > 5 files changed, 145 insertions(+), 43 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h > index 4bbde3d3989c..4a73f1349151 100644 > --- a/arch/arm64/include/asm/kvm_asm.h > +++ b/arch/arm64/include/asm/kvm_asm.h > @@ -38,6 +38,30 @@ > > #define __SMCCC_WORKAROUND_1_SMC_SZ 36 > > +#define KVM_HOST_SMCCC_ID(id) \ > + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ > + ARM_SMCCC_SMC_64, \ > + ARM_SMCCC_OWNER_STANDARD_HYP, \ > + (id)) > + > +#define KVM_HOST_SMCCC_FUNC(name) KVM_HOST_SMCCC_ID(__KVM_HOST_SMCCC_FUNC_##name) > + > +#define __KVM_HOST_SMCCC_FUNC___kvm_hyp_init 0 > +#define __KVM_HOST_SMCCC_FUNC___kvm_flush_vm_context 1 > +#define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid_ipa 2 > +#define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid 3 > +#define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_local_vmid 4 > +#define __KVM_HOST_SMCCC_FUNC___kvm_timer_set_cntvoff 5 > +#define __KVM_HOST_SMCCC_FUNC___kvm_vcpu_run 6 > +#define __KVM_HOST_SMCCC_FUNC___kvm_enable_ssbs 7 > +#define __KVM_HOST_SMCCC_FUNC___vgic_v3_get_ich_vtr_el2 8 > +#define __KVM_HOST_SMCCC_FUNC___vgic_v3_read_vmcr 9 > +#define __KVM_HOST_SMCCC_FUNC___vgic_v3_write_vmcr 10 > +#define __KVM_HOST_SMCCC_FUNC___vgic_v3_init_lrs 11 > +#define __KVM_HOST_SMCCC_FUNC___kvm_get_mdcr_el2 12 > +#define __KVM_HOST_SMCCC_FUNC___vgic_v3_save_aprs 13 > +#define __KVM_HOST_SMCCC_FUNC___vgic_v3_restore_aprs 14 Wait. This looks broken. How do you distinguish between these and the stubs? M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel