[PATCH] x86/time: Drop unused parameter from soft_rdtsc()

Andrew Cooper posted 1 patch 1 week, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260115095047.1201825-1-andrew.cooper3@citrix.com
xen/arch/x86/pv/emul-priv-op.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH] x86/time: Drop unused parameter from soft_rdtsc()
Posted by Andrew Cooper 1 week, 3 days ago
Fixes: a6ed4543222a ("x86/time: pv_soft_rdtsc() is PV-only")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index c970e16152f4..bf3c92d9ee29 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -874,8 +874,7 @@ static uint64_t guest_efer(const struct domain *d)
     return val;
 }
 
-static uint64_t soft_rdtsc(
-    const struct vcpu *v, const struct cpu_user_regs *regs)
+static uint64_t soft_rdtsc(const struct vcpu *v)
 {
     s_time_t old, new, now = get_s_time();
     struct domain *d = v->domain;
@@ -934,7 +933,7 @@ static int cf_check read_msr(
         return X86EMUL_OKAY;
 
     case MSR_IA32_TSC:
-        *val = currd->arch.vtsc ? soft_rdtsc(curr, ctxt->regs) : rdtsc();
+        *val = currd->arch.vtsc ? soft_rdtsc(curr) : rdtsc();
         return X86EMUL_OKAY;
 
     case MSR_EFER:
-- 
2.39.5


Re: [PATCH] x86/time: Drop unused parameter from soft_rdtsc()
Posted by Jan Beulich 1 week, 3 days ago
On 15.01.2026 10:50, Andrew Cooper wrote:
> Fixes: a6ed4543222a ("x86/time: pv_soft_rdtsc() is PV-only")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Why Fixes: without you calling out what bug it is that is being fixed (and
that was introduced by said commit)? That's really where I think Amends: is
to be used, but yes, I know you dislike that new tag.

The Misra rule 2.2 (dead code) violation was pre-existing to the named commit.
Plus that rule isn't among the accepted ones, i.e. while we should strive to
not have violations, having ones isn't quite a "bug" (yet).

But yes - I probably could / should have noticed this and done the change
right while moving the function.

Without the tag, or with it changed to Amends:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan