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 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 DC863C433F5 for ; Mon, 21 Mar 2022 14:30:44 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TNaGVqhMNYzwL2T4YGI3tiGwxg5x1W62mNNlbjwTlDs=; b=FeXzKRsvxgAkvr TxNAUIXG2X/Sdc8IroBaqMUdWawbxoF1W6lpTdHlDREDAOmpUfrvJTA+hL/FmM/2xqfe+m1mcqazT CohLVpCtBgqJTld09gZltBR2G6B81Y1jriPSuV2wBoY9vn8xvdJtnAd/UQMlshXUfZtitVgily5gK Sda1R/chkxlV4M19DMCaiCgBlaodZzyH0C/56pzCJJinYzaALvcCXliYcJRMt0/mpI2IZ1KUtpeEj iW1K1At1PSTi7AAduUdhEHQHgvLhAxrZQs74rApyRdxAu2Cn7mvg6zr3H8AHFCkIzW6g9/DSAPNNL y2GnvyouYIU+6uP9AoYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWJ2I-0082iv-7g; Mon, 21 Mar 2022 14:29:30 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWJ2E-0082hU-HJ for linux-arm-kernel@lists.infradead.org; Mon, 21 Mar 2022 14:29:28 +0000 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 52DBE609EE; Mon, 21 Mar 2022 14:29:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA7DFC340F3; Mon, 21 Mar 2022 14:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647872965; bh=9mxvzfFWtwfQLECDMiS80V8FJcePBS2XkbDd8KDSM+k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lnlZmG035UNg/wUBwsfHuA+FG11MDnCCSyE4QbLtZyMbQKsBy0ozovwbulJRIKrzL DJxTRRuh6GKrSdWI9BrPe4UuuXwgNy8cfcq96/dDnVMTHx5Z4m5V58xuhI0si67zqJ d9lXvq7xOV5jz5BokdAEVb08JhJuX8LsquN7J4PrtJAxf6B7JNGENpfO9vYQwW/aJ6 478bbvXq4jx835dFass3aCEQVzDS3k0UNJrBFECBmWJiUashwKEDXR6vzeJhLlvA9O 38TgjuKi1tlgaDbV0L39sKqalluyd91XeG1kpthLF6sX09kLKYF7Hv4UOhxYUsfPr1 LkqtsH6nvp9pA== Date: Mon, 21 Mar 2022 14:29:19 +0000 From: Will Deacon To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Reiji Watanabe , Paolo Bonzini Subject: Re: [PATCH 0/2] KVM: arm64: Fixes for SMC64 SYSTEM_RESET2 calls Message-ID: <20220321142918.GA11145@willie-the-truck> References: <20220318193831.482349-1-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220318193831.482349-1-oupton@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_072926_634939_5B5D745A X-CRM114-Status: GOOD ( 17.74 ) 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: , 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 Fri, Mar 18, 2022 at 07:38:29PM +0000, Oliver Upton wrote: > This series addresses a couple of issues with how KVM exposes SMC64 > calls to its guest. It is currently possible for an AArch32 guest to > discover the SMC64 SYSTEM_RESET2 function (via > PSCI_1_0_FN_PSCI_FEATURES) and even make a call to it. SMCCC does not > allow for 64 bit calls to be made from a 32 bit state. > > Patch 1 cleans up the way we filter SMC64 calls in PSCI. Using a switch > with case statements for each possibly-filtered function is asking for > trouble. Instead, pivot off of the bit that indicates the desired > calling convention. This plugs the PSCI_FEATURES hole for SYSTEM_RESET2. > > Patch 2 adds a check to the PSCI v1.x call handler in KVM, bailing out > early if the guest is not allowed to use a particular function. This > closes the door on calls to 64-bit SYSTEM_RESET2 from AArch32. > > My first crack at this [1] was missing the fix for direct calls to > SYSTEM_RESET2. Taking the patch out of that series and sending > separately. > > Applies on top of today's kvmarm pull, commit: > > 21ea45784275 ("KVM: arm64: fix typos in comments") > > [1]: https://patchwork.kernel.org/project/kvm/patch/20220311174001.605719-3-oupton@google.com/ > > Oliver Upton (2): > KVM: arm64: Generally disallow SMC64 for AArch32 guests > KVM: arm64: Actually prevent SMC64 SYSTEM_RESET2 from AArch32 > > arch/arm64/kvm/psci.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) For both patches: Acked-by: Will Deacon Thanks for fixing this! Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel