Skip to contentSkip to conversation

x86/time: Drop unused parameter from soft_rdtsc()

PATCH In review Andrew Cooper 2 participants 2 messages Jan 15

lore
Share & tools
lore
#0 lore raw

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

Fixes a6ed4543222a ("x86/time: pv_soft_rdtsc() is PV-only")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/pv/emul-priv-op.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
xen/arch/x86/pv/emul-priv-op.c +2 -3
index c970e16152f4..bf3c92d9ee29 100644
@@ -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:
Signature · 1 line
2.39.5
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Andrew Cooper
Fixes a6ed4543222a ("x86/time: pv_soft_rdtsc() is PV-only")

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:

Jan