From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938845AbcJSQdY (ORCPT ); Wed, 19 Oct 2016 12:33:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51280 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbcJSOLB (ORCPT ); Wed, 19 Oct 2016 10:11:01 -0400 Subject: Re: [PATCH] x86/smp: Add irq_enter/exit() in smp_reschedule_interrupt() To: Wanpeng Li References: <1476409733-5133-1-git-send-email-wanpeng.li@hotmail.com> <20161016133911.GI3142@twins.programming.kicks-ass.net> <20161017082250.GX3568@worktop.programming.kicks-ass.net> <938757058.3991379.1476698922290.JavaMail.zimbra@redhat.com> Cc: Peter Zijlstra , "linux-kernel@vger.kernel.org" , Wanpeng Li , Ingo Molnar , Mike Galbraith , Thomas Gleixner From: Paolo Bonzini Message-ID: <2d1e0bd3-5e5b-4a06-9005-327cc6364050@redhat.com> Date: Wed, 19 Oct 2016 16:10:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 19 Oct 2016 14:11:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/10/2016 16:01, Wanpeng Li wrote: > 2016-10-18 8:01 GMT+08:00 Wanpeng Li : >> 2016-10-17 18:08 GMT+08:00 Paolo Bonzini : >> [...] >>>>> 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. > > [...] > >> >> If -cpu host,-x2apic we should go through mmio when writes xapic EOI. > > Any ideas? :) Make apic_set_eoi_write return the old pointer? Paolo