[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FDF42E7.8050902@redhat.com>
Date: Mon, 18 Jun 2012 18:01:59 +0300
From: Avi Kivity <avi@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: x86@...nel.org, kvm@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Marcelo Tosatti <mtosatti@...hat.com>, gleb@...hat.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCHv7 3/8] kvm_para: guest side for eoi avoidance
On 06/18/2012 05:50 PM, Michael S. Tsirkin wrote:
>
>> >
>> > +/* size alignment is implied but just to make it explicit. */
>> > +static DEFINE_PER_CPU(unsigned long, kvm_apic_eoi) __aligned(2) =
>> > + KVM_PV_EOI_DISABLED;
>>
>> You're actually breaking the alignment. ulong has 8 byte alignment
>> sometimes and you can make it cross cache boundary this way.
>
> No, if you look at the definition of __aligned
> you will see that it limits the alignment from below.
> Compiler still applies the natural size alignment.
> You are not the first to get confused. So I wonder: is it better
> to add a comment or simply remove __aligned here.
Both.
>> >
>> > + if (kvm_para_has_feature(KVM_FEATURE_PV_EOI)) {
>> > + __get_cpu_var(kvm_apic_eoi) = 0;
>> > + wrmsrl(MSR_KVM_PV_EOI_EN, __pa(&__get_cpu_var(kvm_apic_eoi)) |
>> > + KVM_MSR_ENABLED);
>>
>> Bad formatting.
>
> I guess temporary will make it prettier.
> unsigned long pa;
> __get_cpu_var(kvm_apic_eoi) = 0;
> pa = __pa(&__get_cpu_var(kvm_apic_eoi)) | KVM_MSR_ENABLED;
> wrmsrl(MSR_KVM_PV_EOI_EN, pa);
That, or
+ wrmsrl(MSR_KVM_PV_EOI_EN,
+ __pa(&__get_cpu_var(kvm_apic_eoi)) | _ENABLED);
You have an argument split over two lines with no helpful indentation to
show this.
>>
>>
>> Please check that the kexec path also disables pveoi.
>
> The chunk in kvm_pv_guest_cpu_reboot does this, doesn't it?
Dunno, does it?
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists