Re: [PATCH v2 07/11] KVM: x86: add a delayed hardware NMI injection interface

From: Santosh Shukla
Date: Wed Feb 08 2023 - 04:36:33 EST


On 2/1/2023 2:42 AM, Sean Christopherson wrote:
> On Sat, Jan 28, 2023, Sean Christopherson wrote:
>> On Tue, Nov 29, 2022, Maxim Levitsky wrote:
>>> @@ -10015,13 +10022,34 @@ static void process_nmi(struct kvm_vcpu *vcpu)
>>> * Otherwise, allow two (and we'll inject the first one immediately).
>>> */
>>> if (static_call(kvm_x86_get_nmi_mask)(vcpu) || vcpu->arch.nmi_injected)
>>> - limit = 1;
>>> + limit--;
>>> +
>>> + /* Also if there is already a NMI hardware queued to be injected,
>>> + * decrease the limit again
>>> + */
>>
>> /*
>> * Block comment ...
>> */
>>
>>> + if (static_call(kvm_x86_get_hw_nmi_pending)(vcpu))
>>
>> I'd prefer "is_hw_nmi_pending()" over "get", even if it means not pairing with
>> "set". Though I think that's a good thing since they aren't perfect pairs.
>
> Thinking more, I vote for s/hw_nmi/vnmi. "hardware" usually means actual hardware,
> i.e. a pending NMI for the host.

Ah!,. better.

Thanks,
Santosh