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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 D6587C4338F for ; Thu, 12 Aug 2021 08:47:39 +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 993BF60C3F for ; Thu, 12 Aug 2021 08:47:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 993BF60C3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=tWPtL0BJ5SKYccz89AWX9iiaHYqG2bzsicJQea9atNo=; b=3NxjmQAc6Nu1ok 3qF2zjniors5t178ocaByLz0WPmQjf79TvDj4L04I0CeOQzTO3z6VNMxexW9PMOp9YpT6MB8sjqrK xAFcAXsAx98PI3BFtjiaFkiX9kgKLTtT5Bw8LUWln8BLlP7/54HMBoIdjo2ZGT4wkUrKm/coywznI o0VB9cZQisqPbL6NbYZ+EQuZPVPHrJAvTs5+HpHQOF8raJVIwAauU8shVG20pU9K66XalI+Fl13Hl zq2TqfRFdavk4Z/zNMBiWEzYIAQqTHJrKYNLZQ1L2dHmy/bcZLClwPPgJ0oRESbWlbPI+ez2ZhuuG xCGu1ntpd6kXtByZXW+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mE6Lr-009D9a-A7; Thu, 12 Aug 2021 08:46:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mE6Ln-009D8s-PL for linux-arm-kernel@lists.infradead.org; Thu, 12 Aug 2021 08:46:09 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id BDB6960724; Thu, 12 Aug 2021 08:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628757967; bh=bkl8tFQVs/zWYEgsZnhecDk9futAxtTTe8bCKKSsTbM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z2xEWPhGXCC3hYjkoOwVu5NNCZixMYARc4Obyms3/6Sll6y15fu++5hzxXpe19DRx EhYSelrSgMUtSRqyyDWoF8aU53SNNBsMCsz/oE1a4Uuykg/PmfSuwKpWM4U79UjcjE +FBepWdxQ0UofglZOQAgBIFc0zgMNmwtCFs5QKkE1WVMSyRs6H81uDgVkBCE3TMCQT y2qrz0rXzvSbQ/LZ9GLhqbQZvxvyXibIhBqjF+zWrad975+NrHB7Dkuo6l4SolV8BY tYsvlHdHLIUVh0obkeNpkUiMjQxgXhdLk7xcfRf7X1DIiR/ZBnWyhOL0KdnJb9n2dq AxUNUinPIaNCg== Date: Thu, 12 Aug 2021 09:46:01 +0100 From: Will Deacon To: Fuad Tabba Cc: Andrew Jones , kvmarm@lists.cs.columbia.edu, maz@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, pbonzini@redhat.com, qperret@google.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com Subject: Re: [PATCH v3 06/15] KVM: arm64: Restore mdcr_el2 from vcpu Message-ID: <20210812084600.GA5912@willie-the-truck> References: <20210719160346.609914-1-tabba@google.com> <20210719160346.609914-7-tabba@google.com> <20210720145258.axhqog3abdvtpqhw@gator> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20210812_014607_880623_64F2FEDA X-CRM114-Status: GOOD ( 22.45 ) 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 Wed, Jul 21, 2021 at 08:37:21AM +0100, Fuad Tabba wrote: > On Tue, Jul 20, 2021 at 3:53 PM Andrew Jones wrote: > > > > On Mon, Jul 19, 2021 at 05:03:37PM +0100, Fuad Tabba wrote: > > > On deactivating traps, restore the value of mdcr_el2 from the > > > newly created and preserved host value vcpu context, rather than > > > directly reading the hardware register. > > > > > > Up until and including this patch the two values are the same, > > > i.e., the hardware register and the vcpu one. A future patch will > > > be changing the value of mdcr_el2 on activating traps, and this > > > ensures that its value will be restored. > > > > > > No functional change intended. > > > > I'm probably missing something, but I can't convince myself that the host > > will end up with the same mdcr_el2 value after deactivating traps after > > this patch as before. We clearly now restore whatever we had when > > activating traps (presumably whatever we configured at init_el2_state > > time), but is that equivalent to what we had before with the masking and > > ORing that this patch drops? > > You're right. I thought that these were actually being initialized to > the same values, but having a closer look at the code the mdcr values > are not the same as pre-patch. I will fix this. Can you elaborate on the issue here, please? I was just looking at this but aren't you now relying on __init_el2_debug to configure this, which should be fine? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel