Re: [PATCH v1 2/4] KVM: x86: Introduce MSR read/write emulation helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux