From patchwork Tue Nov 24 17:35:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 57265 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2238144lbb; Tue, 24 Nov 2015 09:38:09 -0800 (PST) X-Received: by 10.66.102.101 with SMTP id fn5mr44608399pab.66.1448386689006; Tue, 24 Nov 2015 09:38:09 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ih4si27646057pad.179.2015.11.24.09.38.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2015 09:38:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1HWJ-0005UH-Qb; Tue, 24 Nov 2015 17:36:47 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1HVG-0004wT-6C for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2015 17:35:43 +0000 Received: by wmuu63 with SMTP id u63so106541365wmu.0 for ; Tue, 24 Nov 2015 09:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c9eX14DnegJsEDcMngRo62NKOcjhylHrZpInYoMjBvk=; b=w98xQJH1cUCD0oUJUGvHXbnZOQy8LW2+enjQnszPmHLEqo5YlA8hE0S8MUUhqLkZrz ynTLXkJUFnk+XoojZIQzrnKcn3GZtk3vhlGSiIrYOn8cnW9cjEh+WZxeH/ehGr8zNglF t/riDv5X9i47B/AOuEPTSQJPrBd2S1/l4Bv+ukfUXttBFJk6XTUxsjHQP0idwCJCoUOB wJgBA7r+9kd15h3BySVFN0zZaXLuVQNn84WLH2LkR1jijrvvto6hrD1RHcV05MUoKTY1 wf9U6lZ7zSopTvKIBHBq5yZRuN3GV4XdrI3uKV/BP1oggtTGV2vPAgEwvmosO2X68XRA sZ7A== 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=c9eX14DnegJsEDcMngRo62NKOcjhylHrZpInYoMjBvk=; b=XvfH342zr+sGd2zqyAQGDr6iy80BvpXzwAbLhNeWk+jQRhnScLhXSZDf4cksw3Bvu6 7kcB73A8UUWpLAT6t2UFXPMiR/RxnT+bcDuc5wRrq+YkDU3g7f807kAl4P7xFh6Fns/1 bislCZEvlJo5gURqHprNxkb5JlHTVgpmlxY7oZe+7SEy8bPC+bM3Jrd+6MXDNcbAVxPe EchyYAexEdYNOTTBHwjWclajk0cUvHXwp2o+C9bDy2zr6cofBYOLwzjWUIwRpJ9rmtNh HNDmGZNZlAexMAOu3FqJfn44ncNJmhyilXpH/SDCHSOdmdIrhzUESpM0DLyfAvH0VLqj KE9Q== X-Gm-Message-State: ALoCoQm5iAjQil0wq41UC9K1iA0Srb4urqy8D5x0Fqjcg4JXYYoRNJaUHeMFNib177ZYMZInTNlS X-Received: by 10.28.99.214 with SMTP id x205mr23367475wmb.20.1448386520901; Tue, 24 Nov 2015 09:35:20 -0800 (PST) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id jo6sm19283805wjb.48.2015.11.24.09.35.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Nov 2015 09:35:20 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini Subject: [PULL 4/8] KVM: arm/arm64: Fix preemptible timer active state crazyness Date: Tue, 24 Nov 2015 18:35:32 +0100 Message-Id: <1448386536-30118-5-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1448386536-30118-1-git-send-email-christoffer.dall@linaro.org> References: <1448386536-30118-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151124_093542_461074_CE4B3763 X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: Christoffer Dall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org We were setting the physical active state on the GIC distributor in a preemptible section, which could cause us to set the active state on different physical CPU from the one we were actually going to run on, hacoc ensues. Since we are no longer descheduling/scheduling soft timers in the flush/sync timer functions, simply moving the timer flush into a non-preemptible section. Reviewed-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kvm/arm.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.1.2.330.g565301e.dirty _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index eab83b2..e06fd29 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -564,17 +564,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) vcpu_sleep(vcpu); /* - * Disarming the background timer must be done in a - * preemptible context, as this call may sleep. - */ - kvm_timer_flush_hwstate(vcpu); - - /* * Preparing the interrupts to be injected also * involves poking the GIC, which must be done in a * non-preemptible context. */ preempt_disable(); + kvm_timer_flush_hwstate(vcpu); kvm_vgic_flush_hwstate(vcpu); local_irq_disable();