From patchwork Sat Dec 10 20:47:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9469489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C8D3607F2 for ; Sat, 10 Dec 2016 20:49:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30576284E5 for ; Sat, 10 Dec 2016 20:49:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25806284E9; Sat, 10 Dec 2016 20:49:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D25CE284E5 for ; Sat, 10 Dec 2016 20:49:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cFoYu-000260-KP; Sat, 10 Dec 2016 20:48:04 +0000 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cFoYL-0001tf-Js for linux-arm-kernel@lists.infradead.org; Sat, 10 Dec 2016 20:47:31 +0000 Received: by mail-lf0-x232.google.com with SMTP id c13so21780685lfg.0 for ; Sat, 10 Dec 2016 12:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5Qvkg09J9MILFgNx/Em7D3aI7I4l3WYgPlk6ixvMjbY=; b=d6ol+m/k9aKrP2yKoZHl6tAVHHolgckC1jkNiQvfhJSWKFei+eYSQHy6yXuA+VcdAn okmIfDFqvjF8fREvE24tu6DEEsDSi20ZwnTy1/gnmXAIVfGDZHhRKobuJRiP14ZL/uDH uwHFY1VNJeaNRg/sm4RcnfWZVclyQ6SRargWI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5Qvkg09J9MILFgNx/Em7D3aI7I4l3WYgPlk6ixvMjbY=; b=c9Qxzq4f+p8NR2PwpbAWiu5EVt1hZAMsnamz+QmmW20ZXOItteWeb4endBHdLMcTO+ V0DfRLdt8/eD6w+8HwbUx5eRL9tcMDwBiwk42gOPGU94fgv7Gl3UP1HL289fS766eITV ylmxvEtWCdZv16jVcxo7mekSWSOix0tKPRRKC/MoZOE0fVt6F4ClqLFm5NouS9m3QgwH 6xDTV+geB8IqW3toynBq8cmAr3iDheQkrV1kSfmNgi0cSNsQ7kmgkDJ0wmj2NsuAQZtK FgCIcfTA0U6L0uLZojSZU0jDdnscOuJIDxGfLFLREMD4VT12S6LrQ1utg1yRaYrWiyyo hHIw== X-Gm-Message-State: AKaTC01WMfVL+HYixm9eIoK9NegvIol0cCa9JQjceoWiGHUqJeLouOV10OPwh+ZYy9UNPCz5 X-Received: by 10.46.13.26 with SMTP id 26mr19441015ljn.53.1481402827454; Sat, 10 Dec 2016 12:47:07 -0800 (PST) Received: from localhost.localdomain (x1-6-50-6a-03-de-ec-c2.cpe.webspeed.dk. [2.108.209.202]) by smtp.gmail.com with ESMTPSA id 29sm7578325lft.43.2016.12.10.12.47.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Dec 2016 12:47:07 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Subject: [RFC PATCH 2/7] KVM: arm/arm64: Move kvm_vgic_flush_hwstate under disabled irq Date: Sat, 10 Dec 2016 21:47:07 +0100 Message-Id: <20161210204712.21830-3-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161210204712.21830-1-christoffer.dall@linaro.org> References: <20161210204712.21830-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161210_124729_903252_1E85E448 X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As we are about to play tricks with the timer to be more lazy in saving and restoring state, we need to move the timer flush function under a disabled irq section and since we hav to flush the vgic state after the timer state, move it as well. Signed-off-by: Christoffer Dall --- arch/arm/kvm/arm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 13e54e8..6591af7 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -627,11 +627,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) */ preempt_disable(); kvm_pmu_flush_hwstate(vcpu); - kvm_timer_flush_hwstate(vcpu); - kvm_vgic_flush_hwstate(vcpu); local_irq_disable(); + kvm_timer_flush_hwstate(vcpu); + kvm_vgic_flush_hwstate(vcpu); + /* * Re-check atomic conditions */