From patchwork Tue Sep 22 10:53:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cabaj X-Patchwork-Id: 2309829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hqC553P0cz1xyW for ; Wed, 23 Sep 2026 06:54:17 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1x97VB-0005ng-Ug; Tue, 22 Sep 2026 20:54:09 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1x97V5-0005hW-JQ for kernel-team@lists.ubuntu.com; Tue, 22 Sep 2026 20:54:03 +0000 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 62ED43F28B for ; Tue, 22 Sep 2026 20:54:03 +0000 (UTC) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-939f3426a7cso72747185a.0 for ; Tue, 22 Sep 2026 13:54:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790110442; x=1790715242; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Eft+fsk6V+rMsDZTBggaAQy7G0n/Cf5I+64fHgak+ME=; b=xAz0rGUTPKa2CdDR+tbWoCcsuzy5JtJhjInpl+v1StmKXR/p3viRBRZ1Yx2RBN6CoA uYpnWTMV5d9gXgo/Tvo+RrZB4V5iXJfameDQ0HLu75c95ENQbaI/ITgjc+yenkL88DZf iMZPN/BMXT5OiYGqcQRpjZCsAl6FVV+so53ztEOGhq28OhE0spmB/LbRxaCs3WqS0cbe Zv9SJms15ssj20U0U5U693vp6R/l6zus1VxJA9eIGJuKGIX525hQ1slK1uiFYIeSyUwV CEwnxfKSkk2bqwGqIt1gbSJbeiCotNO56zr4vhQTkWtvP7xK819Cx9BDcZIDv1N5DUN4 8HZg== X-Gm-Message-State: AFuF++nxNAGQ/E1TLEwOzd7/hN6rXYdKZAdcFJGcbEOtjim7R77bije6 R0H445Yd9pYM1Q9kl11KA2Y1V7ZbV+2MVzBu5/0+vFG2il2c9KSiq5K8wT6Jmx3dzXaXlnwGBA+ 7d/lm/ao53oGYBhWS1V11l236+/DEVzoJOA/PM5ysI/R+EpI52PNvWUQpQKgHHgJFNDlw2uSWBO AWDmyQJ+WXqKkwvQ== X-Gm-Gg: AYBFou2WUuzvzHSshUeibNN/oKyUfiUErZG14rsCW3qfELwpgB/kxE5SGlRIXK/4mTr gkdKXEpK1k0dR6ZGKvR1/k8Y6jDO8uL02+2tLiN7wpRLLKaY+ZZmq+70le+jkPNLD+KT5SOOclZ h71g1cOi0HwRGTE56AoC3Fj8DHUSIP4MuJUJxog1pGX18ZJCtXjXxkYzblQTQhBCOlUbcj+cGp4 any3b3Dwj9ZiMwyJ4vrgFZ1oH1Xb/J9pxYfboxXvD4MizqtfXfWWJ/HMVMBj9Az+gVboxbU6mTT ekJyqOGU53QWTiFPAnxV0y/ChUYy4UHVsdmF6+t9uetKOZdlVZwE/lKHfbID50lm8kvpv+7nK1M NN2NdkXNlncnQg/lCTvmPmMpBKfcIiv/AvQseaLV7zgcVAaPPFZHUofIh5JH/t8Yq X-Received: by 2002:a05:620a:27ce:b0:939:365a:49a5 with SMTP id af79cd13be357-93c25115281mr89721685a.27.1790110442157; Tue, 22 Sep 2026 13:54:02 -0700 (PDT) X-Received: by 2002:a05:620a:27ce:b0:939:365a:49a5 with SMTP id af79cd13be357-93c25115281mr89719785a.27.1790110441718; Tue, 22 Sep 2026 13:54:01 -0700 (PDT) Received: from smtp.gmail.com (h69-129-43-220.mdtnwi.broadband.dynamic.tds.net. [69.129.43.220]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93c248a1481sm67988885a.35.2026.09.22.13.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 13:54:01 -0700 (PDT) To: kernel-team@lists.ubuntu.com Subject: [SRU][J:linux-azure][PATCH 1/2] Revert "UBUNTU: SAUCE: clocksource: hyper-v: use the APIC timer if the Hyper-V timer is unreliable on some CPUs" Date: Tue, 22 Sep 2026 15:53:52 -0500 Message-ID: <20260922205354.228673-6-john.cabaj@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260922205354.228673-1-john.cabaj@canonical.com> References: <20260922205354.228673-1-john.cabaj@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: John Cabaj via kernel-team From: John Cabaj Reply-To: John Cabaj Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2167893 This reverts commit cc366f8df62baf66a31ecc9dc3a622bb796e23ac. Signed-off-by: John Cabaj --- arch/x86/kernel/cpu/mshyperv.c | 43 ---------------------------------- 1 file changed, 43 deletions(-) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 77770d3aeb0e8..fb601a6b34c86 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -308,43 +308,6 @@ static void __init hv_smp_prepare_cpus(unsigned int max_cpus) } #endif -/* - * It's been reported that very rarely the raw TSC reading during early boot - * on the CPUs below may be slightly smaller than expected: - * AMD EPYC 7452 32-Core Processor (family: 0x17, model: 0x31, stepping: 0x0) - * AMD EPYC 7763 64-Core Processor (family: 0x19, model: 0x1, stepping: 0x1) - * As a result, the calculated time from the Hyper-V TSC page is smaller than - * expected, meaning that when we use the time of the Hyper-V TSC page to - * program the Hyper-V timer, the timer may fire immediately and cause a - * timer interrupt storm during early boot: during Linux's early boot, - * Linux stays in periodic timer mode (i.e. Linux keeps programming the timer - * in single-shot mode at a frequency of CONFIG_HZ) for a short while before - * it switches the timer to the on-demand tickless mode; in the periodic timer - * mode, Linux timer interrupt handler reprograms the timer before the handler - * finishes, causing a new timer interrupt and hence the handler runs again, - * which causes another timer interrupt and the handler runs over and over - * again, and consequently the vCPU ends up in soft lockup. - * - * It looks like the smaller-than-expected TSC reading only rarely happens - * during early boot, and later the TSC reading becomes normal. While we're - * trying to understand why this happens, let's hide the Hyper-V timer - * capability in favor of the local APIC timer, which doesn't rely on TSC, - * and hence does not suffer from the rare timer interrupt storm. - */ -static bool tsc_is_unreliable(void) -{ - if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) - return false; - - if (boot_cpu_data.x86 == 0x17 && boot_cpu_data.x86_model == 0x31) - return true; - - if (boot_cpu_data.x86 == 0x19 && boot_cpu_data.x86_model == 0x1) - return true; - - return false; -} - static void __init ms_hyperv_init_platform(void) { int hv_max_functions_eax; @@ -371,12 +334,6 @@ static void __init ms_hyperv_init_platform(void) ms_hyperv.features, ms_hyperv.priv_high, ms_hyperv.hints, ms_hyperv.misc_features); - if ((ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE) && - tsc_is_unreliable()) { - ms_hyperv.features &= ~HV_MSR_SYNTIMER_AVAILABLE; - pr_info("Hyper-V: HV timer won't be used due to unstable TSC\n"); - } - ms_hyperv.max_vp_index = cpuid_eax(HYPERV_CPUID_IMPLEMENT_LIMITS); ms_hyperv.max_lp_index = cpuid_ebx(HYPERV_CPUID_IMPLEMENT_LIMITS);