From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (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 077333E0C7C for ; Fri, 15 May 2026 19:20:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778872849; cv=none; b=n8pTPwh+iaFlIRdcPq+ToMzulBpiyAchZsZcQrhd3/cxrJ7zGvy2XIb4dOyG3IMznFEjkKNkyV87E5edPiDn2bGHu7cz26085NSu9mDb9/zVIT0HOR1RMJ5XGSubnATXljLYAt05TJ3xfF1F+tWrE2rihMiaYAFW4Sf5F8151Os= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778872849; c=relaxed/simple; bh=bIvGpEwSZtu1dFGmRrUgP1xhupYQhI4tOk7weRcJRgU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=GeQBX5sLR9/avZU4jj8rwIRn+jv/RVfaJYRmvsHO+6IA+LxCewwuq+eoSzOHLMU47pYWMzJ0FxQCatyXph6/EEYrBpi8JtG6y/m4GF3TxJ/DCQ5Q8dF5lOOXnybmhUxSfDWmzuDLWeaH0j2XV1x4wfw2xc8Ydw/YST5GNEcJkYc= 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=tQMfOm8L; arc=none smtp.client-ip=209.85.210.202 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="tQMfOm8L" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-82f9429f49cso281928b3a.3 for ; Fri, 15 May 2026 12:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1778872847; x=1779477647; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=eVzC+1NNlxe1k/R0gBkxcy+TPbGnZzPB3ftmmd4+5ik=; b=tQMfOm8LUOPoHNGBjDvA0nt2CkSzXhx9m1zO+XHx3KeB/YBqu4clwgUwjB4OUsbpwq kF8Gt1gSAhVDlG1S6IBx+9b8QB04SqRZK1dskYZFXyGhZY6ZqN1F8RaiQgQ0KuSDqs20 7F+Af8csGSwtxvL0UIEzMOMJjuc/i2nRkvtlE2wWzlwQixm0O/enJrXs3SXZ+fl7qkFm 2oOgPrsQwICoFJna7OkaV4XRUX1DTwI8K6tAITICgYkjI+DJsEqqoPz8r9rQJloPWs1Y Rk6n8UsRT9J18hmvoCIOqcjxq0AbyApvkJ30CXGs/obIbUaqLso4VfH43tHBjEaQVNN6 laCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778872847; x=1779477647; h=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; bh=eVzC+1NNlxe1k/R0gBkxcy+TPbGnZzPB3ftmmd4+5ik=; b=QABLq3Xgq63aMtccXNzWqxRum4Fe6b/2EDPw4ZS9Q64oSZqwDAMrVoaDrQROVfgGkO +GXHr3xMfji7/fWBTRSflKOz+x7gxJShZ110kw8bxl2zVz7bf2JKLfGFIHH6IqknnyX3 L3SBTMPtNr6tQO1/lxz65Ame6o7WpaLvU9ER1obNWI011ltgkHQSpKgI69jrIO/M4LKz B4fCVMcFOiXqG0/LCSPwRv6wvmtNXyaGFSfxOR6mP/mE/VC6SblKxN4sW8H9Ogg76nQy bzKR2K/R/H4kaC9LuF4J+9JECxlXgV9+iDp0uHTo3fTUWfKqYOGKkzGzqfjNCwOJ36e9 gIkw== X-Forwarded-Encrypted: i=1; AFNElJ/x53oPuKwGJhaMJ1Jic8qrEbd706HHYqNsIfhYNF+LJRYB8wUzoYa62UYcc2F5gPN2bvClx02JYVJ8z0s=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/xj2c3JdfMW5b7xE0WzTkdfYhFq2e8muQDpSf/Hk4/qDbjrRZ uz0xVf0FUJcUCuA96r1lr5sesfnxemUPGKnFH8ZKpqy0/Bk+/G6EAgLu5Ip1DkreiDlDOxFfs10 0XpsuUw== X-Received: from pfblu4.prod.google.com ([2002:a05:6a00:7484:b0:83a:58c1:f5e2]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:1404:b0:829:9a7b:db84 with SMTP id d2e1a72fcca58-83f33f30bf8mr5787888b3a.49.1778872846903; Fri, 15 May 2026 12:20:46 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 15 May 2026 12:19:16 -0700 In-Reply-To: <20260515191942.1892718-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: <20260515191942.1892718-1-seanjc@google.com> X-Mailer: git-send-email 2.54.0.563.g4f69b47b94-goog Message-ID: <20260515191942.1892718-16-seanjc@google.com> Subject: [PATCH v3 15/41] x86/xen/time: Nullify x86_platform's sched_clock save/restore hooks From: Sean Christopherson To: Kiryl Shutsemau , Paolo Bonzini , Sean Christopherson , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Ajay Kaher , Alexey Makhalov , Jan Kiszka , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Juergen Gross , Daniel Lezcano , Thomas Gleixner , John Stultz Cc: Rick Edgecombe , Vitaly Kuznetsov , Broadcom internal kernel review list , Boris Ostrovsky , Stephen Boyd , x86@kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Michael Kelley , Tom Lendacky , Nikunj A Dadhania , Thomas Gleixner , David Woodhouse Content-Type: text/plain; charset="UTF-8" Nullify the x86_platform sched_clock save/restore hooks when setting up Xen's PV clock to make it somewhat obvious the hooks aren't used when running as a Xen guest (Xen uses a paravirtualized suspend/resume flow). Signed-off-by: Sean Christopherson --- arch/x86/xen/time.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 3d3165eef821..21d366d01985 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -568,6 +568,12 @@ static void __init xen_init_time_common(void) xen_sched_clock_offset = xen_clocksource_read(); static_call_update(pv_steal_clock, xen_steal_clock); paravirt_set_sched_clock(xen_sched_clock); + /* + * Xen has paravirtualized suspend/resume and so doesn't use the common + * x86 sched_clock save/restore hooks. + */ + x86_platform.save_sched_clock_state = NULL; + x86_platform.restore_sched_clock_state = NULL; tsc_register_calibration_routines(xen_tsc_khz, NULL); x86_platform.get_wallclock = xen_get_wallclock; -- 2.54.0.563.g4f69b47b94-goog