From patchwork Tue Nov 24 15:43:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 57259 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2169218lbb; Tue, 24 Nov 2015 07:45:55 -0800 (PST) X-Received: by 10.66.160.194 with SMTP id xm2mr43409120pab.68.1448379954838; Tue, 24 Nov 2015 07:45:54 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 69si27364957pfc.197.2015.11.24.07.45.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2015 07:45:54 -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 1a1FlK-0001Kj-MX; Tue, 24 Nov 2015 15:44:10 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1FlH-0001Gi-5H for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2015 15:44:07 +0000 Received: by wmec201 with SMTP id c201so32374343wme.1 for ; Tue, 24 Nov 2015 07:43:45 -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=xmBWToUx6FSGkKWpmjOaiTH9hmgn2Am79XJQuzCxsOc=; b=Xd5lY/sHEukoLr+QtLrJ3jp3KDUCWIy9u+dDXBn2ee6hQoTE5Uq0qvMfBdcEBkXDaW SIEPTO/j0fW9TNATnDAeVi3DxAFTjiFpWwWijMGRhFm5nSxEk8FtAM7YaNei2xDDM9DD n3mKeUbZ1UpDeEkces/veU/JFNskINWUbvDS6FOx0yQHTDr3yd8Io5GuF5PNpVl6t4ka wiZKiUZSyEKf8GmREgdRPYC3cqIRvzfv+cZKaWw8MtJ5Fo4YX4VFoe40sSbBcf3eFiO/ hKBZneZKfesr5bWpGXrT7zG1yNTXzdkD1onT/6cwBjyaE1lHqK2AJf1RqFHAmZ4luM/C p9Bw== 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=xmBWToUx6FSGkKWpmjOaiTH9hmgn2Am79XJQuzCxsOc=; b=huVd4WJDVGhHa1vCv5jvv6V6L9OoFhnT/Lyt3Rwx8CoPLA0uvGANT3GQxXTIonDic5 +WBv2eX5663GhuaCViSjWGAzty0ZYffqwrisjA+fDNIkVSSQU/j1DfL+BBPTliDsbFIP Nse0TgptoKWFcnkkFf/+8pdb77y3e6+5WcWWGWr7VY2hoqWyoQGhevOLFTHCx7ehcit8 CIBcC0kRI/mSUlRPliJrXYmXFJ6XAvdNvPezUuVn4CtRwyRsnLqHm1CFh1vyAJsTMy0g Z7ZDaxbUsrDPRkK+Ew3AdZ6/EB9kvyMaKKKVZQrMUlqxV+7CySQPyKZWxuua9D19CWTC eDXQ== X-Gm-Message-State: ALoCoQmml9HTyUETzuEfB4Czf/HFcl4tUdnoaTOIfItn5rrRSNYA7gU/YgJAB9G+wsZDZrsxdVDb X-Received: by 10.28.26.78 with SMTP id a75mr25642013wma.13.1448379825052; Tue, 24 Nov 2015 07:43:45 -0800 (PST) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id t64sm18816464wmf.23.2015.11.24.07.43.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Nov 2015 07:43:44 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] KVM: arm/arm64: Fix preemptible timer active state crazyness Date: Tue, 24 Nov 2015 16:43:58 +0100 Message-Id: <1448379840-17516-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1448379840-17516-1-git-send-email-christoffer.dall@linaro.org> References: <1448379840-17516-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_074407_363175_AF434B78 X-CRM114-Status: GOOD ( 12.12 ) 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:232 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: Marc Zyngier , Andre Przywara , Christoffer Dall , kvm@vger.kernel.org, Eric Auger 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. 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();