[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02257a58-393b-4687-803a-e9b3d6bcb786@zytor.com>
Date: Thu, 31 Jul 2025 10:19:48 -0700
From: Xin Li <xin@...or.com>
To: Chao Gao <chao.gao@...el.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org, pbonzini@...hat.com,
seanjc@...gle.com, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com
Subject: Re: [PATCH v1 2/4] KVM: x86: Introduce MSR read/write emulation
helpers
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.
Powered by blists - more mailing lists