From patchwork Thu Mar 15 10:28:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 131760 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp922395ljb; Thu, 15 Mar 2018 03:28:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELuIlF3+N+u/6zbZ8YJ3mRgRswudFXFFaeGDMSplddWgMPoC8zDnP69IbjiZrI9zfGdVnGEE X-Received: by 2002:a17:902:7290:: with SMTP id d16-v6mr7454551pll.31.1521109717521; Thu, 15 Mar 2018 03:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521109717; cv=none; d=google.com; s=arc-20160816; b=Ob6oIMxckVWQtIWZAqDN6SPFeCxsO4StyLbB2Btia/pLiuCU17eYXuDCVKZ+8Cnkzh uPTrUVw5jbSg9Z8nFPDlzyql31gJDLhcQ2jZHWus+KNp26r2KH5Xe4DV1T0fm/py9Jsi 4Oyk3rrokAeKQYnLKjG3VRsojUOLQRmlrBZKFTEoZVnkc27JedvypylizIyaTPNcWy4h M5fupMJw/Z3HAOb20E5MW8FBrRR4ZpkqbYvY+Trg8WXhOJn8By29cRMTrCtFns5sucUm hhNgm9mf+9Y1ipQH/FVgUlmH3XsZGg86QcOaVfdBDVJX+BNWsAXSwc8o/htfx271WLO5 XuIg== 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=sOKhOr7EfZky7fhnaeyeeHe3UCO+XS8ZzG+t6nO1xxo=; b=yPbXIkp5V2BtHC8C/4FMTbt+ata9/P0wgivddDbHW+zXJ+jZCN/vYj9UEnVQfE/d0r YFxZmzQ4bEdqQlRRn15AnHUGwWifsuWq9TgcqDOxVkWgdGw3ctYvZcWwEM6YyKlh79Sb bmMagh3Jp93UBM49zqZXAG680gXmKy11HIe3SrBo/pKGdCLbCfOS7Hh9H11lew3Lqaei 4TJXmsiOPuOqUnlbmA5Vd+g4t9834BOwCnhfSKMgqEQubG4im5q30q7JBj2LnCPsVYnd MUSPj3wTCCXoCBLQFJc2YvKPe33rxJpkiGs7m8OyHWW//e+54mwDkuHoCFznmrWuHu4v QSlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dV5gVDxq; 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 r65si3665473pfe.295.2018.03.15.03.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 03:28:37 -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=dV5gVDxq; 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 1AF2E20956078; Thu, 15 Mar 2018 03:22:12 -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:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 3097820956066 for ; Thu, 15 Mar 2018 03:22:09 -0700 (PDT) Received: by mail-wm0-x244.google.com with SMTP id i194so9389983wmg.1 for ; Thu, 15 Mar 2018 03:28:33 -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=s0sCbvNX4aghtPVU3Ni5QVFW5SF6g07RsulreUUCe7Q=; b=dV5gVDxqOIT2cf0yRIHqu0yjNnKmQHyJ0De/cXSg/aEGMi024AjXPwyMtTTvhSkJe1 A/73hQF2b3aDIjzgsQdtS9ch0Xuelx273jFZJdAGuYEB80VCgcKU3DuEaPSynFRkRWpF QHGeiE+YdYRy9qmxxBhw51795qByjn/GNQTiQ= 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=s0sCbvNX4aghtPVU3Ni5QVFW5SF6g07RsulreUUCe7Q=; b=XpZcrigM5DBEJUoPNGsJse//7piQ4e2Gt3SkSD+hfqCv/HMbLRk4s/lm3j7i5YAy1G MoKl8S4wUkm4/T8bP5KmoS+N2yQnsaGr149cdCPrZ2N0KBJQl0PYHlpgYd+utlmKW44d Z4KZDr9MUWv+KrDfA8npY4u8QNtmnQWxqCh3ZAIkOwlLeUYcAv4CIHylFeBI9pGxCAsH hJzAmiQJ9iwkLdMB6D1xXCZOkqzab6eXv96qqWdgg41eAn7qDhv7PWceJH8iW9xBvumH WWfACqmhXq3Y5WstSsyFGEDH9W27NvOKOxCMl7aNtodzkQ2PVI7CqsESdepx6+5CSZ+J dBXA== X-Gm-Message-State: AElRT7FF4gI6/fQv9v3clmSV8sFF1nGEG/JnWBWrgFdMhPba3Z/4h4tv vhX4PSlW+IeJCZ+DFB4tSFyKfNEgcM8= X-Received: by 10.28.238.2 with SMTP id m2mr2379473wmh.135.1521109711727; Thu, 15 Mar 2018 03:28:31 -0700 (PDT) Received: from localhost.localdomain ([105.142.191.63]) by smtp.gmail.com with ESMTPSA id s86sm589475wma.23.2018.03.15.03.28.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 03:28:30 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Thu, 15 Mar 2018 10:28:26 +0000 Message-Id: <20180315102826.10517-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 Subject: [edk2] [PATCH] ArmPkg/TimerDxe: remove workaround for KVM timer handling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.zyngier@arm.com, heyi.guo@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. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/TimerDxe/TimerDxe.c | 1 - ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c | 10 ---------- 2 files changed, 11 deletions(-) -- 2.15.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Acked-by: Marc Zyngier Reviewed-by: Leif Lindholm Acked-by: Laszlo Ersek 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); }