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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 884B3C433EF for ; Thu, 3 Feb 2022 15:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352010AbiBCPxW (ORCPT ); Thu, 3 Feb 2022 10:53:22 -0500 Received: from foss.arm.com ([217.140.110.172]:53908 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352003AbiBCPxV (ORCPT ); Thu, 3 Feb 2022 10:53:21 -0500 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 74D13113E; Thu, 3 Feb 2022 07:53:21 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 950FA3F40C; Thu, 3 Feb 2022 07:53:18 -0800 (PST) Date: Thu, 3 Feb 2022 15:53:27 +0000 From: Alexandru Elisei To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Andre Przywara , Christoffer Dall , Jintack Lim , Haibo Xu , Ganapatrao Kulkarni , Chase Conklin , "Russell King (Oracle)" , James Morse , Suzuki K Poulose , karl.heubaum@oracle.com, mihai.carabas@oracle.com, miguel.luis@oracle.com, kernel-team@android.com Subject: Re: [PATCH v6 17/64] KVM: arm64: nv: Emulate PSTATE.M for a guest hypervisor Message-ID: References: <20220128121912.509006-1-maz@kernel.org> <20220128121912.509006-18-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220128121912.509006-18-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Marc, On Fri, Jan 28, 2022 at 12:18:25PM +0000, Marc Zyngier wrote: > From: Christoffer Dall > > We can no longer blindly copy the VCPU's PSTATE into SPSR_EL2 and return > to the guest and vice versa when taking an exception to the hypervisor, > because we emulate virtual EL2 in EL1 and therefore have to translate > the mode field from EL2 to EL1 and vice versa. > > This requires keeping track of the state we enter the guest, for which > we transiently use a dedicated flag. Looks good to me: Reviewed-by: Alexandru Elisei Thanks, Alex 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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id F00D2C433EF for ; Thu, 3 Feb 2022 15:53:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 567734B0B3; Thu, 3 Feb 2022 10:53:26 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m-HYWmHwQHnR; Thu, 3 Feb 2022 10:53:24 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7C54649F5D; Thu, 3 Feb 2022 10:53:24 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A692C49F2E for ; Thu, 3 Feb 2022 10:53:23 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VuRRfgSZ74dJ for ; Thu, 3 Feb 2022 10:53:22 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 12CC349E29 for ; Thu, 3 Feb 2022 10:53:21 -0500 (EST) 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 74D13113E; Thu, 3 Feb 2022 07:53:21 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 950FA3F40C; Thu, 3 Feb 2022 07:53:18 -0800 (PST) Date: Thu, 3 Feb 2022 15:53:27 +0000 From: Alexandru Elisei To: Marc Zyngier Subject: Re: [PATCH v6 17/64] KVM: arm64: nv: Emulate PSTATE.M for a guest hypervisor Message-ID: References: <20220128121912.509006-1-maz@kernel.org> <20220128121912.509006-18-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220128121912.509006-18-maz@kernel.org> Cc: kernel-team@android.com, kvm@vger.kernel.org, Andre Przywara , Christoffer Dall , Chase Conklin , kvmarm@lists.cs.columbia.edu, mihai.carabas@oracle.com, Ganapatrao Kulkarni , "Russell King \(Oracle\)" , linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Marc, On Fri, Jan 28, 2022 at 12:18:25PM +0000, Marc Zyngier wrote: > From: Christoffer Dall > > We can no longer blindly copy the VCPU's PSTATE into SPSR_EL2 and return > to the guest and vice versa when taking an exception to the hypervisor, > because we emulate virtual EL2 in EL1 and therefore have to translate > the mode field from EL2 to EL1 and vice versa. > > This requires keeping track of the state we enter the guest, for which > we transiently use a dedicated flag. Looks good to me: Reviewed-by: Alexandru Elisei Thanks, Alex _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 B4D78C433F5 for ; Thu, 3 Feb 2022 15:54:53 +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=Of2bVuuQJeaqPBK12lTAcMAWRow0qp4vnULHGXiWZvU=; b=ZCnip6obl8YRlx cE2+utamXSHYl5UWSaxVoeGUdgb/o3JDgKBL5x++Ag5CGs+fkWITdRPc7VSc6faRIMQ7ibC9zf8f8 XigzjSQAEHCfEs+0kswdRf9l7JPISluYergEBO2qvLdmeDtI2W4aZq7dP69JVVC9krhV10O4L8W+s uXhREdJe0+QMzUPdboHn5B16WETmKpW41LtIiFjuMy5nWjVz/5VQ+1HN//RN7j1NOQK1NtdG2V/oM NNlZuyds7wSeMFK9o5rdrQ5I9K0CKjei9NOtffVBlbIfXtykackWirx/k50o+wy8/hpLXwZRbvVFo xkvWr7F0gZR5ltAonCUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFeQK-001u6B-0A; Thu, 03 Feb 2022 15:53:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFeQF-001u5C-4R for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 15:53:24 +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 74D13113E; Thu, 3 Feb 2022 07:53:21 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 950FA3F40C; Thu, 3 Feb 2022 07:53:18 -0800 (PST) Date: Thu, 3 Feb 2022 15:53:27 +0000 From: Alexandru Elisei To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Andre Przywara , Christoffer Dall , Jintack Lim , Haibo Xu , Ganapatrao Kulkarni , Chase Conklin , "Russell King (Oracle)" , James Morse , Suzuki K Poulose , karl.heubaum@oracle.com, mihai.carabas@oracle.com, miguel.luis@oracle.com, kernel-team@android.com Subject: Re: [PATCH v6 17/64] KVM: arm64: nv: Emulate PSTATE.M for a guest hypervisor Message-ID: References: <20220128121912.509006-1-maz@kernel.org> <20220128121912.509006-18-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220128121912.509006-18-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220203_075323_266384_5CB1E4DA X-CRM114-Status: GOOD ( 10.25 ) 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 Hi Marc, On Fri, Jan 28, 2022 at 12:18:25PM +0000, Marc Zyngier wrote: > From: Christoffer Dall > > We can no longer blindly copy the VCPU's PSTATE into SPSR_EL2 and return > to the guest and vice versa when taking an exception to the hypervisor, > because we emulate virtual EL2 in EL1 and therefore have to translate > the mode field from EL2 to EL1 and vice versa. > > This requires keeping track of the state we enter the guest, for which > we transiently use a dedicated flag. Looks good to me: Reviewed-by: Alexandru Elisei Thanks, Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel