public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Wei Yang <richardw.yang@linux.intel.com>,
	kvm@vger.kernel.org, x86@kernel.org, rkrcmar@redhat.com
Subject: Re: [PATCH 2/3] kvm: x86: use same convention to name apic_clear_vector()
Date: Thu, 6 Jun 2019 15:43:33 +0000	[thread overview]
Message-ID: <20190606154333.id2i5ylqeyewyl3m@master> (raw)
In-Reply-To: <718538a4-4c46-85c7-1388-deabc9dc2514@redhat.com>

On Thu, Jun 06, 2019 at 02:07:39PM +0200, Paolo Bonzini wrote:
>On 01/04/19 04:17, Wei Yang wrote:
>> apic_clear_vector() is the counterpart of kvm_lapic_clear_vector(),
>> while they have different naming convention.
>> 
>> Rename it and move together to arch/x86/kvm/lapic.h. Also fix one typo
>> in comment by hand.
>
>You mean "of kvm_lapic_set_vector()".  Queued all three with only this
>change to the commit log, sorry for the delay.
>

Thanks :-)

>Paolo
>
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>>  arch/x86/kvm/lapic.c | 17 +++++++----------
>>  arch/x86/kvm/lapic.h |  5 +++++
>>  2 files changed, 12 insertions(+), 10 deletions(-)
>> 
>> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
>> index c4533d05c214..d8b3cbba8e29 100644
>> --- a/arch/x86/kvm/lapic.c
>> +++ b/arch/x86/kvm/lapic.c
>> @@ -88,11 +88,6 @@ bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector)
>>  		apic_test_vector(vector, apic->regs + APIC_IRR);
>>  }
>>  
>> -static inline void apic_clear_vector(int vec, void *bitmap)
>> -{
>> -	clear_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
>> -}
>> -
>>  static inline int __apic_test_and_set_vector(int vec, void *bitmap)
>>  {
>>  	return __test_and_set_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
>> @@ -445,12 +440,12 @@ static inline void apic_clear_irr(int vec, struct kvm_lapic *apic)
>>  
>>  	if (unlikely(vcpu->arch.apicv_active)) {
>>  		/* need to update RVI */
>> -		apic_clear_vector(vec, apic->regs + APIC_IRR);
>> +		kvm_lapic_clear_vector(vec, apic->regs + APIC_IRR);
>>  		kvm_x86_ops->hwapic_irr_update(vcpu,
>>  				apic_find_highest_irr(apic));
>>  	} else {
>>  		apic->irr_pending = false;
>> -		apic_clear_vector(vec, apic->regs + APIC_IRR);
>> +		kvm_lapic_clear_vector(vec, apic->regs + APIC_IRR);
>>  		if (apic_search_irr(apic) != -1)
>>  			apic->irr_pending = true;
>>  	}
>> @@ -1053,9 +1048,11 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
>>  
>>  		if (apic_test_vector(vector, apic->regs + APIC_TMR) != !!trig_mode) {
>>  			if (trig_mode)
>> -				kvm_lapic_set_vector(vector, apic->regs + APIC_TMR);
>> +				kvm_lapic_set_vector(vector,
>> +						     apic->regs + APIC_TMR);
>>  			else
>> -				apic_clear_vector(vector, apic->regs + APIC_TMR);
>> +				kvm_lapic_clear_vector(vector,
>> +						       apic->regs + APIC_TMR);
>>  		}
>>  
>>  		if (vcpu->arch.apicv_active)
>> @@ -2278,7 +2275,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu)
>>  
>>  	/*
>>  	 * APIC is created enabled. This will prevent kvm_lapic_set_base from
>> -	 * thinking that APIC satet has changed.
>> +	 * thinking that APIC state has changed.
>>  	 */
>>  	vcpu->arch.apic_base = MSR_IA32_APICBASE_ENABLE;
>>  	static_key_slow_inc(&apic_sw_disabled.key); /* sw disabled at reset */
>> diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
>> index ff6ef9c3d760..339ee029be6e 100644
>> --- a/arch/x86/kvm/lapic.h
>> +++ b/arch/x86/kvm/lapic.h
>> @@ -127,6 +127,11 @@ void kvm_lapic_exit(void);
>>  #define VEC_POS(v) ((v) & (32 - 1))
>>  #define REG_POS(v) (((v) >> 5) << 4)
>>  
>> +static inline void kvm_lapic_clear_vector(int vec, void *bitmap)
>> +{
>> +	clear_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
>> +}
>> +
>>  static inline void kvm_lapic_set_vector(int vec, void *bitmap)
>>  {
>>  	set_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
>> 

-- 
Wei Yang
Help you, Help me

      reply	other threads:[~2019-06-06 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190401021723.5682-1-richardw.yang@linux.intel.com>
2019-06-04  3:11 ` [PATCH 1/3] kvm: x86: check kvm_apic_sw_enabled() is enough Wei Yang
     [not found] ` <20190401021723.5682-2-richardw.yang@linux.intel.com>
2019-06-06 12:07   ` [PATCH 2/3] kvm: x86: use same convention to name apic_clear_vector() Paolo Bonzini
2019-06-06 15:43     ` Wei Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190606154333.id2i5ylqeyewyl3m@master \
    --to=richard.weiyang@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=richardw.yang@linux.intel.com \
    --cc=rkrcmar@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox