On 7/31/2025 9:40 AM, Xin Li wrote:
+
handled = !handle_fastpath_set_x2apic_icr_irqoff(vcpu, data);
break;
case MSR_IA32_TSC_DEADLINE:
- data = kvm_read_edx_eax(vcpu);
+ if (reg == VCPU_EXREG_EDX_EAX)
+ data = kvm_read_edx_eax(vcpu);
+ else
+ data = kvm_register_read(vcpu, reg);
+
Hoist this chunk out of the switch clause to avoid duplication.
I thought about it, but didn't do so because the original code doesn't
read the MSR data from registers when a MSR is not being handled in the
fast path, which saves some cycles in most cases.
I think I can make it an inline function.