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=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 158A4C04EB8 for ; Mon, 10 Dec 2018 10:14:15 +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 D814D20870 for ; Mon, 10 Dec 2018 10:14:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Snl86CQ0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D814D20870 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:References: Message-ID:Subject: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=8TePkSIVTGmTuOvzhnPP4jMFjx3M7IdofItaVV151a8=; b=Snl86CQ0IA8TXu WGW+h/n5+F7i0+uVAc47Z1rjpkyKBGdZVixoEF/bnHnxgNDMdWVXuJII6f2hMhCh77/GSuAW5mqiF nOWEeuWNL2EhadOCzTLycqn1OdLB0DsY4vanQKaMQmDTJ4Hkvcc18QeFvIiPLVIFp3bK1Jwo9suLN m7yFLOLr6Up/XF3C+/18M1X8kKnc0MHu3bxMQKyOrTsLPJ3n78yEMZaxOv6B1FYbNClTJdf9Zw0Jo tq+IaHtRVWxh7UX8CwaVmUrWsqpK2bwddKYoxtBYTuRueLr5zB546GTJb54m5xWOGh6/9H9TyYq0e bTbUg74BNTokDpQ+t8Wg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWIZp-0005ha-1y; Mon, 10 Dec 2018 10:14:13 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWIZl-0005gk-Ns for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 10:14:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4E2311596; Mon, 10 Dec 2018 02:13:59 -0800 (PST) Received: from localhost (e113682-lin.copenhagen.arm.com [10.32.144.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB9493F6A8; Mon, 10 Dec 2018 02:13:58 -0800 (PST) Date: Mon, 10 Dec 2018 11:13:57 +0100 From: Christoffer Dall To: Marc Zyngier Subject: Re: [PATCH v3 3/8] arm64: KVM: Install stage-2 translation before enabling traps Message-ID: <20181210101357.GI30263@e113682-lin.lund.arm.com> References: <20181206173126.139877-1-marc.zyngier@arm.com> <20181206173126.139877-4-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181206173126.139877-4-marc.zyngier@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_021409_782441_37EE1B20 X-CRM114-Status: GOOD ( 19.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , kvm@vger.kernel.org, Suzuki K Poulose , Catalin Marinas , Will Deacon , James Morse , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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 On Thu, Dec 06, 2018 at 05:31:21PM +0000, Marc Zyngier wrote: > It is a bit odd that we only install stage-2 translation after having > cleared HCR_EL2.TGE, which means that there is a window during which > AT requests could fail as stage-2 is not configured yet. > > Let's move stage-2 configuration before we clear TGE, making the > guest entry sequence clearer: we first configure all the guest stuff, > then only switch to the guest translation regime. > > While we're at it, do the same thing for !VHE. It doesn't hurt, > and keeps things symmetric. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/switch.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c > index 7cc175c88a37..a8fa61c68c32 100644 > --- a/arch/arm64/kvm/hyp/switch.c > +++ b/arch/arm64/kvm/hyp/switch.c > @@ -499,8 +499,8 @@ int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) > > sysreg_save_host_state_vhe(host_ctxt); > > - __activate_traps(vcpu); > __activate_vm(vcpu->kvm); > + __activate_traps(vcpu); > > sysreg_restore_guest_state_vhe(guest_ctxt); > __debug_switch_to_guest(vcpu); > @@ -545,8 +545,8 @@ int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu) > > __sysreg_save_state_nvhe(host_ctxt); > > - __activate_traps(vcpu); > __activate_vm(kern_hyp_va(vcpu->kvm)); > + __activate_traps(vcpu); > > __hyp_vgic_restore_state(vcpu); > __timer_enable_traps(vcpu); > -- > 2.19.2 > Acked-by: Christoffer Dall _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel