From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Wanpeng Li <wanpeng.li@hotmail.com>,
Ingo Molnar <mingo@kernel.org>, Mike Galbraith <efault@gmx.de>,
Thomas Gleixner <tglx@linutronix.de>,
Radim Krcmar <rkrcmar@redhat.com>
Subject: Re: [PATCH] x86/smp: Add irq_enter/exit() in smp_reschedule_interrupt()
Date: Mon, 24 Oct 2016 16:32:19 +0200 [thread overview]
Message-ID: <b2318cab-2c58-b84c-7d77-3fe1d1878e0d@redhat.com> (raw)
In-Reply-To: <CANRm+CzJ=6SsN=NYi==Q5g1C_7a=KwE=+iMGF2aV+DvW7CA48g@mail.gmail.com>
On 19/10/2016 16:30, Wanpeng Li wrote:
> Cc Radim,
> 2016-10-19 22:10 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
>>
>>
>> On 19/10/2016 16:01, Wanpeng Li wrote:
>>> 2016-10-18 8:01 GMT+08:00 Wanpeng Li <kernellwp@gmail.com>:
>>>> 2016-10-17 18:08 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
>>>> [...]
>>>>>>> Something like the below avoids all that. Paravirt will still need fixing.
>>>>>>
>>>>>> kvm_guest_apic_eoi_write
>>>>>> -> native_apic_msr_write
>>>>>
>>>>> kvm_guest_apic_eoi_write can use native_apic_msr_eoi_write too:
>>>>>
>>>>> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
>>>>> index f5aaf6c83222..9769d76a62c4 100644
>>>>> --- a/arch/x86/include/asm/apic.h
>>>>> +++ b/arch/x86/include/asm/apic.h
>>>>> @@ -174,7 +174,7 @@ static inline void disable_local_APIC(void) { }
>>>>> static inline void lapic_update_tsc_freq(void) { }
>>>>> #endif /* !CONFIG_X86_LOCAL_APIC */
>>>>>
>>>>> -#ifdef CONFIG_X86_X2APIC
>>>>> +#if defined CONFIG_X86_X2APIC || defined CONFIG_KVM_GUEST
>>>>
>>>> If CONFIG_X86_X2APIC is undefined and CONFIG_KVM_GUEST is defined,
>>>> there are undefined reference warning for x2apic_mode and check_x2apic
>>>> etc since they are extern variables and just define under
>>>> CONFIG_X86_X2APIC.
>>>
>
> This results in undefined reference warning.
>
>>>
>>>>
>>>> If -cpu host,-x2apic we should go through mmio when writes xapic EOI.
>>>
>>> Any ideas? :)
>>
>> Make apic_set_eoi_write return the old pointer?
>
> Could you elaborate? :)
No, that won't work due to how struct apic works and how
apic_set_eoi_write patches it. One possibility then is to add a
void (*native_eoi_write)(u32 reg, u32 v);
field to struct apic, and make apic_set_eoi_write set
(*drv)->native_eoi_write = (*drv)->eoi_write;
(*drv)->eoi_write = eoi_write;
Then kvm.c can call
apic->native_eoi_write(reg, v);
Thanks,
Paolo
next prev parent reply other threads:[~2016-10-24 14:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 1:48 Wanpeng Li
2016-10-14 12:19 ` [tip:x86/urgent] " tip-bot for Wanpeng Li
2016-10-16 13:39 ` [PATCH] " Peter Zijlstra
2016-10-17 4:19 ` Wanpeng Li
2016-10-17 8:22 ` Peter Zijlstra
2016-10-17 9:45 ` Wanpeng Li
2016-10-17 10:08 ` Paolo Bonzini
2016-10-17 10:23 ` Wanpeng Li
2016-10-18 0:01 ` Wanpeng Li
2016-10-19 14:01 ` Wanpeng Li
2016-10-19 14:10 ` Paolo Bonzini
2016-10-19 14:30 ` Wanpeng Li
2016-10-24 14:32 ` Paolo Bonzini [this message]
2016-10-25 2:52 ` Wanpeng Li
2016-10-17 12:19 ` Wanpeng Li
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=b2318cab-2c58-b84c-7d77-3fe1d1878e0d@redhat.com \
--to=pbonzini@redhat.com \
--cc=efault@gmx.de \
--cc=kernellwp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=wanpeng.li@hotmail.com \
/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
all inboxes | Powered by JetHome®