From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753325AbcGMOxV (ORCPT ); Wed, 13 Jul 2016 10:53:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40987 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062AbcGMOxM (ORCPT ); Wed, 13 Jul 2016 10:53:12 -0400 Date: Wed, 13 Jul 2016 16:52:49 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Lan, Tianyu" , Igor Mammedov , Jan Kiszka , Peter Xu , Yang Zhang Subject: Re: [PATCH v3 12/14] KVM: x86: add a flag to disable KVM x2apic broadcast quirk Message-ID: <20160713145249.GC22438@potion> References: <20160712200930.32143-1-rkrcmar@redhat.com> <20160712200930.32143-13-rkrcmar@redhat.com> <10fcb396-853f-e08b-48d9-c2e69189798d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <10fcb396-853f-e08b-48d9-c2e69189798d@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 13 Jul 2016 14:52:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-07-13 12:15+0200, Paolo Bonzini: > On 12/07/2016 22:09, Radim Krčmář wrote: >> +static bool kvm_apic_map_need_slowpath(struct kvm *kvm, struct kvm_lapic **src, >> + struct kvm_lapic_irq *irq, struct kvm_apic_map *map) >> +{ >> + if (!map) >> + return true; >> + >> + if (kvm->arch.x2apic_broadcast_quirk_disabled) { >> + if ((irq->dest_id == APIC_BROADCAST && >> + map->mode != KVM_APIC_MODE_X2APIC)) >> + return true; >> + if (irq->dest_id == X2APIC_BROADCAST) >> + return true; >> + } else { >> + bool x2apic_ipi = src && *src && apic_x2apic_mode(*src); >> + if (irq->dest_id == (x2apic_ipi ? >> + X2APIC_BROADCAST : APIC_BROADCAST)) >> + return true; >> + } >> + >> + return false; >> +} > > This isn't the only case where you go through the slowpath. What about > renaming to kvm_apic_dest_is_broadcast? Yeah, sorry. I have a patch that adds a check for 0xff in flat lapic mode (can be handled in the fast path) and used the same name even before the check ...