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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D78F3C433EF for ; Tue, 22 Mar 2022 08:48:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbiCVItz (ORCPT ); Tue, 22 Mar 2022 04:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbiCVItx (ORCPT ); Tue, 22 Mar 2022 04:49:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFA056D3A9 for ; Tue, 22 Mar 2022 01:48:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 529F061620 for ; Tue, 22 Mar 2022 08:48:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD3E6C340EC; Tue, 22 Mar 2022 08:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647938904; bh=Uds2yt6H1y65fhPnvGjWXdpR5/JP7jfcOFrj7qPJFcI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H8N/fMRWalNI5m8S8DWvtFYQR414v1HclflHQBJ2eZ7Owv67YZpxoLOpksAW4cqQj xWyd4yVE8YVuf8wMafMuz0Bfbj1WVkIpYe3Zq1DEH/xnW07Yb0l7aKluRRubYMb6tW UCM4J27TlZgN0JX83SM9aFgbMGjNpcZStR2zDEjdCAI79NcET5Sr75x4OReCgZmD/7 qGq2z6udGF3HrDz2iLPavDUtzmQx75NCjxC1b0psRA9q0ne+suVtVYmEyyTo96aqqv PahlcJVVcFY7cHLSrKhSYCFH+g2M43vxkCPsTkgnm96r3ihGz2wuyB6T076vgWCM82 pQQbtEEyGwWjg== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nWaBi-00GDUi-3I; Tue, 22 Mar 2022 08:48:22 +0000 Date: Tue, 22 Mar 2022 08:48:21 +0000 Message-ID: <87cziextii.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: Reiji Watanabe , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, James Morse , Alexandru Elisei , Suzuki K Poulose , Linux ARM , Peter Shier , Ricardo Koller , Paolo Bonzini , Will Deacon Subject: Re: [PATCH 2/2] KVM: arm64: Actually prevent SMC64 SYSTEM_RESET2 from AArch32 In-Reply-To: References: <20220318193831.482349-1-oupton@google.com> <20220318193831.482349-3-oupton@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, reijiw@google.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, pshier@google.com, ricarkol@google.com, pbonzini@redhat.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 22 Mar 2022 05:49:29 +0000, Oliver Upton wrote: > > On Mon, Mar 21, 2022 at 09:41:39PM -0700, Reiji Watanabe wrote: > > On 3/18/22 12:38 PM, Oliver Upton wrote: > > > The SMCCC does not allow the SMC64 calling convention to be used from > > > AArch32. While KVM checks to see if the calling convention is allowed in > > > PSCI_1_0_FN_PSCI_FEATURES, it does not actually prevent calls to > > > unadvertised PSCI v1.0+ functions. > > > > > > Check to see if the requested function is allowed from the guest's > > > execution state. Deny the call if it is not. > > > > > > Fixes: d43583b890e7 ("KVM: arm64: Expose PSCI SYSTEM_RESET2 call to the guest") > > > Cc: Will Deacon > > > Signed-off-by: Oliver Upton > > > > Reviewed-by: Reiji Watanabe > > Appreciated :-) > > > BTW, considering the new kvm_psci_check_allowed_function()implementation > > in the patch-1, it might be better to call kvm_psci_check_allowed_function() > > from kvm_psci_call() instead? Then, we could avoid the similar issue > > next time we support a newer PSCI version. > > Good point. If Marc doesn't bite in the next day or two I'll address > this with a new spin, otherwise I'll do a separate cleanup. Just want to > avoid spamming on this topic since I already replied with yet another > patch [1]. Please do, and I'll queue that for -rc1. Thanks, M. -- Without deviation from the norm, progress is not possible.