From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 523FA4D2EF7 for ; Wed, 1 Jul 2026 19:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782934411; cv=none; b=aVvGczkk875SXM7/8b5AmnNHdZy8nuGGTQFD9LNuoB47/P+o+YAiye/KD/oefwoAo2y3DmI2jVqC0033hD47Ahi6X55by3mDQpu5A4U9BWZdlw/ijmdlwkTiaRdEyHeOmTa4CXZg+MC16lvD2gi4RlLecDHkQjapCdaqsBKQZA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782934411; c=relaxed/simple; bh=eWWyL7UaDO+jO5zpybHvT2ywbxk2X6+2Y5u8hqaq4xo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=BIvNJwmwoR5Uy2ClN/zNDAlH6sFM2U9+4ZgYeh9lCgiSdprBTcUO0oeYUSd0fReQ31kYYrw7SrGOXaC+NI2DwWsooCg6m46kVjM2Ep0l3tNjRnwPDblfQXEk+23fwJ5e8HMa7YPaM8RC7NU4ussp+waHoLZuAIjZlMPIUcGKihk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tX3Nf3ES; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tX3Nf3ES" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-37ffaca522dso716949a91.2 for ; Wed, 01 Jul 2026 12:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782934407; x=1783539207; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:reply-to:from:to:cc:subject:date:message-id :reply-to:content-type; bh=BBdglu7Hd/NWIo80QzRStfEHhLuTnQAY4zgBWN5WaBQ=; b=tX3Nf3ES0CGsDO/m7eU49aDvQK/9mnb7NF8+IEiQlJx7nsJyORAtD39WmwqtL3chd6 meNrsW73xdBmGh9IuLuyH2+uypT9l3EmCSFXU6FfHP0FgP2leqkdhY+GGuxzLXCPwVny 89jeFohIIExwnrNZe/zUVjOkdCD7a48UuyiKrEeVT25TvYfayrOa81NiGjjLBn8Sp7yf AbXpBAoL+1n+9Hk1v/ugu81tdt4wqv5rI1jKnJYJDWZdyvIJsZF2KuWzJRlWpbqdBvqd Lma4oivVEZ/dgR4vbGtbOwur/CWvKSuYSZT9DLn6oEM6KWhEvpee8qsHuKFGzYaYf34y j48Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782934407; x=1783539207; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:reply-to:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=BBdglu7Hd/NWIo80QzRStfEHhLuTnQAY4zgBWN5WaBQ=; b=Ba/88C2k7Ht2fKaMwDXcM2upIEHX6iypAvf6Evi88dUWf5AaCI1QFT8/tU1vamJzlU 0z89BQU/aiFztGEnfK+p6VTRcKu4wzej/lNlx882L8hVBsaYZp1Uxc3HOdcNSQ7W6WxT Fo0g7xfVjoiMD7y3ucZwBgrxkYpsr8mPcrp2r4Nt5WJprJMXy2A2jAi48nduRJGZgLF9 /WkhmSVL5HVVuU8bYPqV8Dsw7SrXFxILsoPhBI9DvbPcknHHoUWWP1UqtGbbfXdP4Yl2 XKN32ub12hy+fZ2tmSYDW2mvNafzaKlYEdaWtC75IYI2JspY2tfsaLgwUngKjK1Hf6cL hvrA== X-Forwarded-Encrypted: i=1; AHgh+Rr3LXCIzG4k2YJlJLcNLHM+y6Qm5OhN6czuSOXAFxzI+2veU8O/Jni2uzmY+yxaZVof6XWnENJ55GFhCiM=@vger.kernel.org X-Gm-Message-State: AOJu0YyJl+6IXA7tlATJfcsxBpQAYtY7Jjw0piJ7hCJhba4RnAMDaQ+X 7UlwEArL2ZSQ25n4ao/qZW0LSJHy+DkpGtaC23GlZWAqQaHbv0JCvHpSatJASaQVcoiGLuWuE0v aCjlFRQ== X-Received: from pjbmt23.prod.google.com ([2002:a17:90b:2317:b0:380:79f2:a916]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3a47:b0:37e:2005:6507 with SMTP id 98e67ed59e1d1-380ba84865cmr1899432a91.15.1782934406994; Wed, 01 Jul 2026 12:33:26 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 1 Jul 2026 12:32:11 -0700 In-Reply-To: <20260701193212.749551-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260701193212.749551-1-seanjc@google.com> X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog Message-ID: <20260701193212.749551-51-seanjc@google.com> Subject: [PATCH v5 50/51] x86/paravirt: Move using_native_sched_clock() stub into timer.h From: Sean Christopherson To: Jonathan Corbet , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Kiryl Shutsemau , Rick Edgecombe , Sean Christopherson , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Ajay Kaher , Alexey Makhalov , Jan Kiszka , Andy Lutomirski , Peter Zijlstra , Juergen Gross , Daniel Lezcano , John Stultz Cc: Shuah Khan , "H. Peter Anvin" , Vitaly Kuznetsov , Broadcom internal kernel review list , Boris Ostrovsky , Stephen Boyd , linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, xen-devel@lists.xenproject.org, Tom Lendacky , Nikunj A Dadhania , David Woodhouse , David Woodhouse , Michael Kelley , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Now that timer.h ended up with CONFIG_PARAVIRT #ifdeffery anyways, move the PARAVIRT=n using_native_sched_clock() stub into timer.h as a "free" optimization. No functional change intended. Reviewed-by: David Woodhouse Signed-off-by: Sean Christopherson --- arch/x86/include/asm/timer.h | 6 ++++-- arch/x86/kernel/tsc.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h index ca5c95d48c03..a52388af6055 100644 --- a/arch/x86/include/asm/timer.h +++ b/arch/x86/include/asm/timer.h @@ -11,9 +11,9 @@ extern void recalibrate_cpu_khz(void); extern int no_timer_check; -extern bool using_native_sched_clock(void); - #ifdef CONFIG_PARAVIRT +extern bool using_native_sched_clock(void); + int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable, void (*save)(void), void (*restore)(void)); @@ -23,6 +23,8 @@ static __always_inline void paravirt_set_sched_clock(u64 (*func)(void), { (void)__paravirt_set_sched_clock(func, true, save, restore); } +#else +static inline bool using_native_sched_clock(void) { return true; } #endif /* diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index a146fc7b5e74..564be4faa5a0 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -302,8 +302,6 @@ int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable, } #else u64 sched_clock_noinstr(void) __attribute__((alias("native_sched_clock"))); - -bool using_native_sched_clock(void) { return true; } #endif notrace u64 sched_clock(void) -- 2.55.0.rc0.799.gd6f94ed593-goog