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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 770BCC2BA18 for ; Fri, 3 Apr 2020 10:34:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4A96B20737 for ; Fri, 3 Apr 2020 10:34:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="o+kq9ilT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A96B20737 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tZ66BVxaOxr3lnz39JGR7nZdI1Hzax+xGYWAiWrKZN8=; b=o+kq9ilTbhmH7w Fnjxo5ZqTpw6tTFXmWBQeLOZKsu5sbdPkO5s4f+hI7EYgAY2x+oFAQdQDjXNMk0YJd6fUdsBKB/Qk 2hLMleqVE53aU8jeHOhxcaLO1a+UDD1vVKfvTFJnXfCnuXIQoyOq14G8Ia+krDPhjeQblOOC4NqcN EcuH1Hh/qhY5JsXxAeCD9ikTtZVG7Ej1LKFb90M4/iUv+GqEcCnm9RsbEZDbaXPChh1Gd0nKFcEcN XW3kQlAE5ZcGbS+T7SuA+pCQZU96ULxgdCCDs+OoGORiCcnHbw2dLECFCZqDAYmD4/m+RbMZuHAKl sS++d8UBGyU9DSUTXYuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKJes-000468-Hx; Fri, 03 Apr 2020 10:34:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKJeq-00044B-7x for linux-arm-kernel@lists.infradead.org; Fri, 03 Apr 2020 10:34:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DD81D30E; Fri, 3 Apr 2020 03:34:37 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6CD23F71E; Fri, 3 Apr 2020 03:34:36 -0700 (PDT) Subject: Re: [PATCH 0/2] KVM: arm64: PSCI fixes To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org References: <20200401165816.530281-1-maz@kernel.org> From: Alexandru Elisei Message-ID: <23107386-bbad-6ee1-c1cc-03dd70868905@arm.com> Date: Fri, 3 Apr 2020 11:35:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200401165816.530281-1-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200403_033440_328733_3E92049B X-CRM114-Status: GOOD ( 17.43 ) 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: James Morse , Christoffer Dall , Julien Thierry , Suzuki K Poulose Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 4/1/20 5:58 PM, Marc Zyngier wrote: > Christoffer recently pointed out that we don't narrow the arguments to > SMC32 PSCI functions called by a 64bit guest. This could result in a > guest failing to boot its secondary CPUs if it had junk in the upper > 32bits. Yes, this is silly, but the guest is allowed to do that. Duh. > > Whist I was looking at this, it became apparent that we allow a 32bit > guest to call 64bit functions, which the spec explicitly forbids. Oh > well, another patch. > > This has been lightly tested, but I feel that we could do with a new > set of PSCI corner cases in KVM-unit-tests (hint, nudge... ;-). Good idea. I was already planning to add new PSCI and timer tests, I'm waiting for Paolo to merge the pull request from Drew, which contains some fixes for the current tests. > > Marc Zyngier (2): > KVM: arm64: PSCI: Narrow input registers when using 32bit functions > KVM: arm64: PSCI: Forbid 64bit functions for 32bit guests > > virt/kvm/arm/psci.c | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > I started reviewing the patches and I have a question. I'm probably missing something, but why make the changes to the PSCI code instead of making them in the kvm_hvc_call_handler function? From my understanding of the code, making the changes there would benefit all firmware interface that use SMCCC as the communication protocol, not just PSCI. Thanks, Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel