From patchwork Tue Apr 17 06:03:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 133508 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp4356290ljb; Mon, 16 Apr 2018 23:03:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/S4DI6VbQ8jlz9VCnGddSK8yRytF39KeagcGFtcMxgt8S08IM2mudVktJEQA5Ifra3pa2C X-Received: by 10.98.8.12 with SMTP id c12mr797926pfd.77.1523945010591; Mon, 16 Apr 2018 23:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523945010; cv=none; d=google.com; s=arc-20160816; b=wDhHGn9s4Z6yX3S++Tt2p4VnO+lG2zciYz4zRxVLdoZHfPrpw36pzSWuXMACfvqtAd hOZXHCLcxRcZD9ytod5JjSEpxE88u8BPzPcl5X/OZCmKkQhQya6GVAtMdbhtYsLwgq8h Sg0rBhsKs4Tn2uO2ZjyxxuDyApOioKPoR18dqAAd66RJC6NDyQ3KX9gBZ1WDqqsaiJC1 kqUcqyvczXbItKkRDmTxsjsHiYGo1CpSR+CmC6Wwk14F9GI5qA86LbNF5fgSclex3rPu 0s1J3Er1K0t1fHPw5S0BVc5vbf9KdQtqbOhBI7YzMjbJG4sUVoa6X/QuIF8oqtKLEYZB 3sew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=iwl9Fj+M0AjHIIt/adcfQj4I1G+9kmkMQHI/QQv/EJw=; b=fUs4FkNmxGdLW9D/GGBWI9LvZwAHKpzEzYUa9DL24lN7Hvqb8oP00Qoc1i2MYwput1 QQh+h+OJDYJ+soJfw3Hfy1a1fPXQKjMRfsC0nKku6r/rxgyYWx6lJFi2w/9YMr5mAl1k 92UXclOu6qKwxmNa2AfJtTtJ/24OkGe9nU/xgXIHlZKa8eJKo87fvnhCTyBb4ciIzrji p/N8dARedwTkZT6wNgaLFjzraAbO6c4b4bL0unJYrzUUQUY/ZW748aMqKh3WSv8naIh3 ubmLgqG5Aqa1k54BwGcpAAlBkVNGx0JJTPoW0/+jRN6vuUbFTNBrQ5w0eWU0g1v08mAN kuEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=U6BVxlJR; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id p17-v6si5739527plo.363.2018.04.16.23.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 23:03:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=U6BVxlJR; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 748BB22590E3A; Mon, 16 Apr 2018 23:03:29 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4504C22590E10 for ; Mon, 16 Apr 2018 23:03:27 -0700 (PDT) Received: by mail-wr0-x242.google.com with SMTP id q6so19836628wrd.6 for ; Mon, 16 Apr 2018 23:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=V6bp5k93mpuX5PU45EgpWPcWzEI1KY+tVscpJGnixLM=; b=U6BVxlJRlUchRejUk2vqCG1CoApjfC0CJkX57d9j3RoD1RfiAJK0ogxNhW54KRr7Oz Vs120V4Ccl/lt9xAolrxqFWgCtGyi2J+4Y1ZGct4w29twbkk1LuO6EJUA0h33dwLiJWR Bluo5kMtRzx+ZRiWkKQrRng8L4QLZK3wmkK/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=V6bp5k93mpuX5PU45EgpWPcWzEI1KY+tVscpJGnixLM=; b=G3Fr6PALZjkXMddl3KGw32b77Ct8GZlWWQO+brFYq+Cf0vjAteryQRjxPwkQ2jr61R R/mUNXxeQSuJ7sdfEr2DOF1SfkA7xtOBf829KHg1PKCcyuTnnBAll2fQYvP1fDKpdKyd 818aZHvyXBR0UNoKktkVZNpqUn8vy6TaVUDZ5WuXRQY8W7LafiB4l0PC2mPEKs8FVq2Y b6OIkeI1D6AboL+JaRVfe3fu2j+O3JDA+IHv6vjIIyMvxMdvBsoHCBDgr/psznMeXsjV 0bCjYiAN1BN0zN/XmRrhDf3pqVIRatC7C7JWFBRtTIPwX5lrRFQ6IYzWicg3A1ZY1t8u Z7eA== X-Gm-Message-State: ALQs6tAT0yin0btRw6obs0VeM9EPJOHnilN3aO8orkKoR6UGEHIpwADm CgNYOOtOZWFIID+bM7Lk5+IaniMzsAM= X-Received: by 10.223.171.86 with SMTP id r22mr509297wrc.228.1523945005324; Mon, 16 Apr 2018 23:03:25 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id h133sm9162224wmf.47.2018.04.16.23.03.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 23:03:24 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 17 Apr 2018 08:03:20 +0200 Message-Id: <20180417060320.29090-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 Subject: [edk2] [PATCH v2] ArmPkg/TimerDxe: remove workaround for KVM timer handling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.zyngier@arm.com, cross-distro@lists.linaro.org, lersek@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" When we first ported EDK2 to KVM/arm, we implemented a workaround for the quirky timer handling on the KVM side. This has been fixed in Linux commit f120cd6533d2 ("KVM: arm/arm64: timer: Allow the timer to control the active state") dated 23 June 2014, which was incorporated into Linux release 4.3. So almost 4 years later, it should be safe to drop this workaround on the EDK2 side. This reverts commit b1a633434ddc. Cc: cross-distro@lists.linaro.org Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Acked-by: Marc Zyngier Reviewed-by: Leif Lindholm Acked-by: Laszlo Ersek --- v2: add acks Note to cross-distro readers: this means guest firmware built with this patch will not work on KVM/ARM hosts using kernel v4.2 or earlier. ArmPkg/Drivers/TimerDxe/TimerDxe.c | 1 - ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c | 10 ---------- 2 files changed, 11 deletions(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Drivers/TimerDxe/TimerDxe.c b/ArmPkg/Drivers/TimerDxe/TimerDxe.c index a3202fa056f3..bd616d2efc73 100644 --- a/ArmPkg/Drivers/TimerDxe/TimerDxe.c +++ b/ArmPkg/Drivers/TimerDxe/TimerDxe.c @@ -337,7 +337,6 @@ TimerInterruptHandler ( // Set next compare value ArmGenericTimerSetCompareVal (CompareValue); - ArmGenericTimerEnableTimer (); ArmInstructionSynchronizationBarrier (); } diff --git a/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c b/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c index 69a4ceb62db6..c941895a3574 100644 --- a/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c +++ b/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c @@ -26,16 +26,6 @@ ArmGenericTimerEnableTimer ( TimerCtrlReg = ArmReadCntvCtl (); TimerCtrlReg |= ARM_ARCH_TIMER_ENABLE; - - // - // When running under KVM, we need to unmask the interrupt on the timer side - // as KVM will mask it when servicing the interrupt at the hypervisor level - // and delivering the virtual timer interrupt to the guest. Otherwise, the - // interrupt will fire again, trapping into the hypervisor again, etc. etc. - // This is scheduled to be fixed on the KVM side, but there is no harm in - // leaving this in once KVM gets fixed. - // - TimerCtrlReg &= ~ARM_ARCH_TIMER_IMASK; ArmWriteCntvCtl (TimerCtrlReg); }