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 88FF3C54E49 for ; Thu, 29 Feb 2024 17:37:33 +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=h+p+ll/IEZn7Pw+eS7ngAUjQ0lyCnnTqq6Knocj8hL8=; b=z3ekssUkzpJVEl R7oDUxBSY6d9xvSAymMzOXnFq7Y6Lntc/TV94gz4wRygAo6ns0Y/Gyr1lL114gr3roO+2zUUrc2n2 6iy/Qh3k3VmeMPMUE/JsPGImwpCyxe0Iz+NTSDg7Y3FxffhTGuUQQKj8edM6NHYjMOA3JmaY72FYt wMDIs7Khyx01ct5p6s60DWhwGpxS6/HOTZutpW0QSP2F0J2ULJgYEP0TP+5++zpu+6gRCWl0oJubO FrnctZpdcmvPjSYyrSdUm/1E4xWuNlKWFD+D3NorxgYu7pITmlrcLTu+2sMaJBsM3qF2Qf1DJt7d0 sNluK2pU3QLV5NOSXWWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfkLU-0000000EW5q-46Ll; Thu, 29 Feb 2024 17:37:24 +0000 Received: from out-174.mta1.migadu.com ([2001:41d0:203:375::ae]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfkLQ-0000000EW1l-4BzY for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 17:37:22 +0000 Date: Thu, 29 Feb 2024 17:37:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1709228233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AbLYhSrmn+ej2BrFv+AeMp59GzhSQXfGc9DLMJUhPk0=; b=kcMjHD4ZeSb61CCIwcSGVG+8a8CH6NIC5/pnWWKM5dRUmDK1kbFvbghC4Gga9ISSd/oQFt UaLBT3coRruqVXcIFDnIwgjm2CZagHNp5/nXagw9cA48jtGd7yFYEHrR/CIy8IW2Sc0yMZ UokemPfV9HMnYyEpdRp18b5X4/ofRWA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu , James Clark , Anshuman Khandual Subject: Re: [PATCH] KVM: arm64: Fix TRFCR_EL1/PMSCR_EL1 access in hVHE mode Message-ID: References: <20240229145417.3606279-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240229145417.3606279-1-maz@kernel.org> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_093721_346290_75EC0127 X-CRM114-Status: GOOD ( 14.41 ) 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 Hey, On Thu, Feb 29, 2024 at 02:54:17PM +0000, Marc Zyngier wrote: > When running in hVHE mode, EL1 accesses are performed with the EL12 > accessor, as we run with HCR_EL2.E2H=1. > > Unfortunately, both PMSCR_EL1 and TRFCR_EL1 are used with the > EL1 accessor, meaning that we actually affect the EL2 state. Duh. > > Switch to using the {read,write}_sysreg_el1() helpers that will do > the right thing in all circumstances. I was wondering if there was a way to surface these screw-ups at compile time, but there's nothing elegant that comes to mind. Guess we need to be very careful reviewing "nVHE" changes going forward. > Note that the 'Fixes:' tag doesn't represent the point where the bug > was introduced (there is no such point), but the first practical point > where the hVHE feature is usable. > > Cc: James Clark > Cc: Anshuman Khandual > Fixes: 38cba55008e5 ("KVM: arm64: Force HCR_E2H in guest context when ARM64_KVM_HVHE is set") > Signed-off-by: Marc Zyngier Reviewed-by: Oliver Upton -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel