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 C602DC433EF for ; Tue, 22 Mar 2022 05:50:59 +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=2FQ9Q9VtGY5kAd2iE0sHNf923YfuztbB2vzqslpevcc=; b=cwsjQrgI2cSd0K B+IDv/llRzvXgrp3pHtoYWtHFew95ZY1WbfycLKKbAX+v3Ov7kadz7D32TUdo02SuNPyGCHTR+ewj XBUqHgwW0zQVGb3yDgkkaARdCTBPxCrJ7uy87ImI7KoE5nsTRNP6Bx7HsgclFpRQJMNVc8UT1roLF 4O8Akeb/xnezPcIAbnV6cluu2f3YHcdYOPiUfvuoFOL1/nwh9iJ6/3yUZ46asnNbVi/3tQsaBswlf beSv2drtnNdaSkN97OVGMBF6jX8kH+ggVq5zPI4YDbdf6UN5PSaf4zg2sGuvNF9KMc2wOX1zKzLVq dXwgSNH4InHf6u3O2iaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXOl-00A45w-Rp; Tue, 22 Mar 2022 05:49:40 +0000 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXOh-00A45X-RT for linux-arm-kernel@lists.infradead.org; Tue, 22 Mar 2022 05:49:37 +0000 Received: by mail-il1-x12a.google.com with SMTP id j15so1598907ila.13 for ; Mon, 21 Mar 2022 22:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bWjZMLU+VFCSrR0lmrzXv5X+bH9F7caMUKl8oy21g1s=; b=GNd7/xXpwD7cgS56Oo4ahnoy7Q/tYMIQk8nR9PdKbphhOdpbUdRhugE5U0c0v8mpWy 8ePlQ22UlEluvp5V4IOKUMXV9oWogrhbFplL/M5bGE9qVUyINV5ij+W1Vl7GW5Z1ajXv 2/FZw0j8nTQ4pXXJ+9AzPRVRpMWwWvG/et9yer0dNhBSogswjZT+HBwaNpVn5PsKP7Vw IJk1dHlDRIWSNkpwek/bemefUZkMrugq3DmD2xpMWMXzn+lxOcY9CMWJL+ucofgz8Uxu uZnPsxwJI34uyrVxWyTgkrX4JJ2NXeEQnFShMQpdcgghgxvETg1xaV24K/RTfWSNJ7rf Uk5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bWjZMLU+VFCSrR0lmrzXv5X+bH9F7caMUKl8oy21g1s=; b=fegEL2S607kGs04fla/ixDDkEfAbmURB3yJaNRWw6f1Vf16wtzh5BXrXvPJXWMZzVV ONoy/mhjxZRK+zHMoh5fnsTbLkIe4nBzXD4njB8Tvn9FIMgWyW0Q9Rt+c5WcE0QnFfWy gFUDB4k9LQP77rfsTcnMUsLJccYm/fNEAf6BRIg7bUSCaYEiCnPz+SUEEnuadm/r/Le3 ohhzj8wKALTQ9wGUwVy96WXNWC22I/VLSnQv3aM7b/orEznG7i90FmxW1rr7QWPmhlee G8cKTSNa6+fXDTYAA1p2M3ETKX2Q78GVXOFsR6zfixP4R7gHuUw1nmdkZuTA0eQQzvBl QfQw== X-Gm-Message-State: AOAM533N6hacpN1y74/zm+7E69/LMrVIvAkYF0/pOvrFnf9zfzmIMenD Povmf3cEGbLyJLx7n0vWVm6TCA== X-Google-Smtp-Source: ABdhPJyYsgwXPFau1PVGew3KMrIqlZSvQU08WKe/gwzt6lhUP9tczQJPrl7k58LJ0N+qJV996Ll1pA== X-Received: by 2002:a92:cbc3:0:b0:2c6:78fa:41e9 with SMTP id s3-20020a92cbc3000000b002c678fa41e9mr11457667ilq.112.1647928173864; Mon, 21 Mar 2022 22:49:33 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id k11-20020a926f0b000000b002c2756f7e90sm9842447ilc.17.2022.03.21.22.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 22:49:32 -0700 (PDT) Date: Tue, 22 Mar 2022 05:49:29 +0000 From: Oliver Upton To: Reiji Watanabe Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Marc Zyngier , 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 Message-ID: References: <20220318193831.482349-1-oupton@google.com> <20220318193831.482349-3-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_224935_941439_9585B4E7 X-CRM114-Status: GOOD ( 18.49 ) 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 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]. Thanks! [1] https://lore.kernel.org/kvmarm/20220322013310.1880100-1-oupton@google.com -- Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel