Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/807798/?format=api
{ "id": 807798, "url": "http://patchwork.ozlabs.org/api/1.2/patches/807798/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20170830174128.32541-3-dann.frazier@canonical.com/", "project": { "id": 15, "url": "http://patchwork.ozlabs.org/api/1.2/projects/15/?format=api", "name": "Ubuntu Kernel", "link_name": "ubuntu-kernel", "list_id": "kernel-team.lists.ubuntu.com", "list_email": "kernel-team@lists.ubuntu.com", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170830174128.32541-3-dann.frazier@canonical.com>", "list_archive_url": null, "date": "2017-08-30T17:41:24", "name": "[2/6,SRU,Zesty] arm64: arch_timer: Enable CNTVCT_EL0 trap if workaround is enabled", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c4d0a779439969f1f216e0ae773ed9facf1f6c0b", "submitter": { "id": 9337, "url": "http://patchwork.ozlabs.org/api/1.2/people/9337/?format=api", "name": "dann frazier", "email": "dann.frazier@canonical.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20170830174128.32541-3-dann.frazier@canonical.com/mbox/", "series": [ { "id": 670, "url": "http://patchwork.ozlabs.org/api/1.2/series/670/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=670", "date": "2017-08-30T17:41:23", "name": "[1/6,SRU,Zesty] Revert \"UBUNTU: SAUCE: arm64: arch_timer: Enable CNTVCT_EL0 trap if workaround is enabled\"", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/670/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807798/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807798/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<kernel-team-bounces@lists.ubuntu.com>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=kernel-team-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)", "Received": [ "from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjCW354CQz9sN5;\n\tThu, 31 Aug 2017 03:42:07 +1000 (AEST)", "from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.76)\n\t(envelope-from <kernel-team-bounces@lists.ubuntu.com>)\n\tid 1dn709-0002lG-2y; Wed, 30 Aug 2017 17:42:05 +0000", "from complete.lackof.org ([198.49.126.79])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.76) (envelope-from <dannf@dannf.org>) id 1dn6zy-0002j1-U7\n\tfor kernel-team@lists.ubuntu.com; Wed, 30 Aug 2017 17:41:55 +0000", "from localhost (c-107-2-141-92.hsd1.co.comcast.net [107.2.141.92])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (Client did not present a certificate)\n\tby complete.lackof.org (Postfix) with ESMTPSA id 3169033E0259\n\tfor <kernel-team@lists.ubuntu.com>;\n\tWed, 30 Aug 2017 11:41:53 -0600 (MDT)" ], "From": "dann frazier <dann.frazier@canonical.com>", "To": "kernel-team@lists.ubuntu.com", "Subject": "[PATCH 2/6][SRU Zesty] arm64: arch_timer: Enable CNTVCT_EL0 trap if\n\tworkaround is enabled", "Date": "Wed, 30 Aug 2017 11:41:24 -0600", "Message-Id": "<20170830174128.32541-3-dann.frazier@canonical.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20170830174128.32541-1-dann.frazier@canonical.com>", "References": "<20170830174128.32541-1-dann.frazier@canonical.com>", "X-Spam-Status": "No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY\n\tautolearn=unavailable version=3.3.2", "X-Spam-Checker-Version": "SpamAssassin 3.3.2 (2011-06-06) on\n\tcomplete.lackof.org", "X-BeenThere": "kernel-team@lists.ubuntu.com", "X-Mailman-Version": "2.1.14", "Precedence": "list", "List-Id": "Kernel team discussions <kernel-team.lists.ubuntu.com>", "List-Unsubscribe": "<https://lists.ubuntu.com/mailman/options/kernel-team>,\n\t<mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe>", "List-Archive": "<https://lists.ubuntu.com/archives/kernel-team>", "List-Post": "<mailto:kernel-team@lists.ubuntu.com>", "List-Help": "<mailto:kernel-team-request@lists.ubuntu.com?subject=help>", "List-Subscribe": "<https://lists.ubuntu.com/mailman/listinfo/kernel-team>,\n\t<mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "kernel-team-bounces@lists.ubuntu.com", "Sender": "kernel-team-bounces@lists.ubuntu.com" }, "content": "From: Marc Zyngier <marc.zyngier@arm.com>\n\nBugLink: https://bugs.launchpad.net/bugs/1713821\n\nUserspace being allowed to use read CNTVCT_EL0 anytime (and not\nonly in the VDSO), we need to enable trapping whenever a cntvct\nworkaround is enabled on a given CPU.\n\nAcked-by: Thomas Gleixner <tglx@linutronix.de>\nSigned-off-by: Marc Zyngier <marc.zyngier@arm.com>\n(cherry picked from commit a86bd139f2ae02f960caeb0c1dd5f871d3e087cd)\nSigned-off-by: dann frazier <dann.frazier@canonical.com>\n---\n drivers/clocksource/arm_arch_timer.c | 45 +++++++++++++++++++++++++-----------\n 1 file changed, 32 insertions(+), 13 deletions(-)", "diff": "diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c\nindex 18a8e5727ce7..c7cad4677aaf 100644\n--- a/drivers/clocksource/arm_arch_timer.c\n+++ b/drivers/clocksource/arm_arch_timer.c\n@@ -74,6 +74,7 @@ static enum arch_timer_ppi_nr arch_timer_uses_ppi = ARCH_TIMER_VIRT_PPI;\n static bool arch_timer_c3stop;\n static bool arch_timer_mem_use_virtual;\n static bool arch_counter_suspend_stop;\n+static bool vdso_default = true;\n \n static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM);\n \n@@ -461,6 +462,17 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa\n \t}\n \n \tstatic_branch_enable(&arch_timer_read_ool_enabled);\n+\n+\t/*\n+\t * Don't use the vdso fastpath if errata require using the\n+\t * out-of-line counter accessor. We may change our mind pretty\n+\t * late in the game (with a per-CPU erratum, for example), so\n+\t * change both the default value and the vdso itself.\n+\t */\n+\tif (wa->read_cntvct_el0) {\n+\t\tclocksource_counter.archdata.vdso_direct = false;\n+\t\tvdso_default = false;\n+\t}\n }\n \n static void arch_timer_check_ool_workaround(enum arch_timer_erratum_match_type type,\n@@ -527,11 +539,19 @@ static void arch_timer_check_ool_workaround(enum arch_timer_erratum_match_type t\n \t__val;\t\t\t\t\t\t\t\t\\\n })\n \n+static bool arch_timer_this_cpu_has_cntvct_wa(void)\n+{\n+\tconst struct arch_timer_erratum_workaround *wa;\n+\n+\twa = __this_cpu_read(timer_unstable_counter_workaround);\n+\treturn wa && wa->read_cntvct_el0;\n+}\n #else\n #define arch_timer_check_ool_workaround(t,a)\t\tdo { } while(0)\n #define erratum_set_next_event_tval_virt(...)\t\t({BUG(); 0;})\n #define erratum_set_next_event_tval_phys(...)\t\t({BUG(); 0;})\n #define erratum_handler(fn, r, ...)\t\t\t({false;})\n+#define arch_timer_this_cpu_has_cntvct_wa()\t\t({false;})\n #endif /* CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND */\n \n static __always_inline irqreturn_t timer_handler(const int access,\n@@ -744,15 +764,23 @@ static void arch_counter_set_user_access(void)\n {\n \tu32 cntkctl = arch_timer_get_cntkctl();\n \n-\t/* Disable user access to the timers and the physical counter */\n+\t/* Disable user access to the timers and both counters */\n \t/* Also disable virtual event stream */\n \tcntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN\n \t\t\t| ARCH_TIMER_USR_VT_ACCESS_EN\n+\t\t | ARCH_TIMER_USR_VCT_ACCESS_EN\n \t\t\t| ARCH_TIMER_VIRT_EVT_EN\n \t\t\t| ARCH_TIMER_USR_PCT_ACCESS_EN);\n \n-\t/* Enable user access to the virtual counter */\n-\tcntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN;\n+\t/*\n+\t * Enable user access to the virtual counter if it doesn't\n+\t * need to be workaround. The vdso may have been already\n+\t * disabled though.\n+\t */\n+\tif (arch_timer_this_cpu_has_cntvct_wa())\n+\t\tpr_info(\"CPU%d: Trapping CNTVCT access\\n\", smp_processor_id());\n+\telse\n+\t\tcntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN;\n \n \tarch_timer_set_cntkctl(cntkctl);\n }\n@@ -873,16 +901,7 @@ static void __init arch_counter_register(unsigned type)\n \t\telse\n \t\t\tarch_timer_read_counter = arch_counter_get_cntpct;\n \n-\t\tclocksource_counter.archdata.vdso_direct = true;\n-\n-#ifdef CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND\n-\t\t/*\n-\t\t * Don't use the vdso fastpath if errata require using\n-\t\t * the out-of-line counter accessor.\n-\t\t */\n-\t\tif (static_branch_unlikely(&arch_timer_read_ool_enabled))\n-\t\t\tclocksource_counter.archdata.vdso_direct = false;\n-#endif\n+\t\tclocksource_counter.archdata.vdso_direct = vdso_default;\n \t} else {\n \t\tarch_timer_read_counter = arch_counter_get_cntvct_mem;\n \t}\n", "prefixes": [ "2/6", "SRU", "Zesty" ] }