From: Wanpeng Li <kernellwp@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.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>
Subject: Re: [PATCH] x86/smp: Add irq_enter/exit() in smp_reschedule_interrupt()
Date: Tue, 18 Oct 2016 08:01:11 +0800 [thread overview]
Message-ID: <CANRm+CxjS_wEMLA6i81muQokKCWuba7pv8pua6qCt74nH8Tpjw@mail.gmail.com> (raw)
In-Reply-To: <938757058.3991379.1476698922290.JavaMail.zimbra@redhat.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.
> /*
> * Make previous memory operations globally visible before
> * sending the IPI through x2apic wrmsr. We need a serializing instruction or
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index edbbfc854e39..61cc6a5e3f44 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -319,7 +319,7 @@ static void kvm_guest_apic_eoi_write(u32 reg, u32 val)
> */
> if (__test_and_clear_bit(KVM_PV_EOI_BIT, this_cpu_ptr(&kvm_apic_eoi)))
> return;
> - apic_write(APIC_EOI, APIC_EOI_ACK);
> + native_apic_msr_eoi_write(APIC_EOI, APIC_EOI_ACK);
> }
If -cpu host,-x2apic we should go through mmio when writes xapic EOI.
Regards,
Wanpeng Li
next prev parent reply other threads:[~2016-10-18 0:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 1:48 [PATCH] x86/smp: Add irq_enter/exit() in smp_reschedule_interrupt() 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 [this message]
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
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=CANRm+CxjS_wEMLA6i81muQokKCWuba7pv8pua6qCt74nH8Tpjw@mail.gmail.com \
--to=kernellwp@gmail.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).