From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.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 5E0CF3F39ED for ; Fri, 29 May 2026 15:07:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780067276; cv=none; b=lBCmy/mUlJ7SGPpDwetornLB3hKshpMTrxWYEbuR3MrhoTHhbuZboqu3PQci3f6E24Sggjm/LFaQh2+hcLpEcwZNQOWE+uiHo06Gp1Z7E8LrMwgOtAgymSaTwlHkfgQxpDIFKZVpeFr3S3Jd+qZ41jrUyIB80gOZjvlb0BTN1zU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780067276; c=relaxed/simple; bh=kqQGoMW+oi+5ZrWtSd7Fuu/ZnSkBt2VrapqrWKwhgpU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=BQWv2pFBJSQFC3LrApDrWxWbdXeTfnR/Tq+z5vR3UPD01nvXUWxyF6trN5B1PuahBfmwnkU5U5l+5kHJEUHZ6zDUehR1Gq/hSmERzS8+QA5X4KbNv3ohp/nfgvfJ0ULLKNMr8Vgt3LXwt92TsAH0WsLImsaXMWrt7XlxJpEgM5c= 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=MTT5H/Bt; arc=none smtp.client-ip=209.85.214.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="MTT5H/Bt" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2bf30576aa3so2304545ad.3 for ; Fri, 29 May 2026 08:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780067275; x=1780672075; 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=yp4siaZu6zeBY6Dr4EV8ib3+ttfMwXywWsfu9IVNNX0=; b=MTT5H/BtD+VFkskx8pg2WGgy9tBTjt0xmG/mVmPDB5HDINY7uY0sh2YZNENGAKQaR6 elA/yMLkf2gW7nm74tCnIZl/En4kVC2BQOGAYlLncL2OPfugNssLQUwOa95Y0cNqti18 WMRa456+c7TmN85m7rGc5xmh4JFhRhJ426yVCFdTch7M9da28PCWHiuH9UzxRKDrkwQr dL502CMO93fxnVQJcEgZxTeTAS1wz4baF8XdQv5+DDp6x1TW9neghY8z66Tsdfqwd3W0 VaWBdPLbcWuThwCZOJg5/t6JrLXn1WoM/2I1k5x8ckYKO38eIPFlcMx4f+w9YG+CS6Od zRcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780067275; x=1780672075; 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=yp4siaZu6zeBY6Dr4EV8ib3+ttfMwXywWsfu9IVNNX0=; b=WhaPBpUA1R+AgukgyWBhNUo+dy/rpHw9gXBW/9h59MbL00VsxVRBno3XYqFahSRZK0 UXWkIXhjKi+KmmJ80BjULhjhLVrs+/w0z60snh7JOlGoh7gLllJ2MPZNdquYzc3bi9d9 oXbAkWIRLOosSoNoz2nEO8l96gcYZCvOLwUROtY+oY48ItfA+FAbR8XDhLNaZ/nUzlmK ONhA8yUASnX6/CBgtGmIKBLFUe61DZk0f55LGgfYvitY0GOoeQkNqlVBiTPHnsOiHFyh jVJPlpKxsWlN47Pv9jKBcqQzX7oFrH20cvGmGZO+6p5jGueNNaffpCkPmheLORmmIAWB uBWA== X-Forwarded-Encrypted: i=1; AFNElJ8J3TBoOXocH/NnDIhHqU6bfPX4M6F6KNcwgKS4PLzKseaAoD8jvqcAlaLThI+xg2SJfUA3YJQ1GtcIlxc=@vger.kernel.org X-Gm-Message-State: AOJu0Ywv04iI0Z1rqLI2Wtk14ginlqSoYNJ9PEB4a8D4giKSnHS9bW3d nBeWyP2xHYV4cljPQqltTmMij2CfxYO85umqMfQreuh5WrHESrdKY6+p5yohbNvT9zI9gx666UG Khi/IyQ== X-Received: from plgv8.prod.google.com ([2002:a17:902:e8c8:b0:2bf:2f05:e721]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2450:b0:2ba:6ca2:be0 with SMTP id d9443c01a7336-2bf36798a4emr3028165ad.4.1780067274515; Fri, 29 May 2026 08:07:54 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 29 May 2026 08:07:52 -0700 In-Reply-To: <20260529144435.704127-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: <20260529144435.704127-1-seanjc@google.com> X-Mailer: git-send-email 2.54.0.823.g6e5bcc1fc9-goog Message-ID: <20260529150753.714296-1-seanjc@google.com> Subject: [PATCH v4 31/47] x86/vmware: NOP-ify save/restore hooks when using VMware's sched_clock From: Sean Christopherson To: Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Kiryl Shutsemau , 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: "H . Peter Anvin" , Rick Edgecombe , Vitaly Kuznetsov , Broadcom internal kernel review list , Boris Ostrovsky , Stephen Boyd , 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, David Woodhouse , Tom Lendacky , Nikunj A Dadhania , David Woodhouse , Michael Kelley , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" NOP-ify the sched_clock save/restore hooks when using VMware's version of sched_clock. This will allow extending paravirt_set_sched_clock() to set the save/restore hooks, without having to simultaneously change the behavior of VMware guests. Note, it's not at all obvious that it's safe/correct for VMware guests to do nothing on suspend/resume, but that's a pre-existing problem. Leave it for a VMware expert to sort out. Signed-off-by: Sean Christopherson --- arch/x86/kernel/cpu/vmware.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 2d0624c66799..051ef89029a7 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -347,8 +347,11 @@ static void __init vmware_paravirt_ops_setup(void) vmware_cyc2ns_setup(); - if (vmw_sched_clock) + if (vmw_sched_clock) { paravirt_set_sched_clock(vmware_sched_clock); + x86_platform.save_sched_clock_state = x86_init_noop; + x86_platform.restore_sched_clock_state = x86_init_noop; + } if (vmware_is_stealclock_available()) { has_steal_clock = true; -- 2.54.0.823.g6e5bcc1fc9-goog