[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f874f2c0-2f9f-935b-fc4f-2b70a5b5520a@redhat.com>
Date: Wed, 9 Oct 2019 13:00:23 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Radim Krčmář <rkrcmar@...hat.com>
Cc: Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Reto Buerki <reet@...elabs.ch>,
Liran Alon <liran.alon@...cle.com>
Subject: Re: [PATCH v2 7/8] KVM: x86: Add helpers to test/mark reg
availability and dirtiness
On 30/09/19 11:32, Vitaly Kuznetsov wrote:
>> +static inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu,
>> + enum kvm_reg reg)
>> +{
>> + __set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
>> + __set_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
>> +}
>> +
> Personal preference again, but I would've named this
> "kvm_register_mark_avail_dirty" to indicate what we're actually doing
> (and maybe even shortened 'kvm_register_' to 'kvm_reg_' everywhere as I
> can't see how 'reg' could be misread).
>
I think this is okay, a register can be either not cached, available or
dirty. But dirty means we have to write it back, so it implies
availability.
Paolo
Powered by blists - more mailing lists