From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbcGMIjG (ORCPT ); Wed, 13 Jul 2016 04:39:06 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33289 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbcGMIiw (ORCPT ); Wed, 13 Jul 2016 04:38:52 -0400 Subject: Re: [PATCH v3 12/14] KVM: x86: add a flag to disable KVM x2apic broadcast quirk To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20160712200930.32143-1-rkrcmar@redhat.com> <20160712200930.32143-13-rkrcmar@redhat.com> Cc: "Lan, Tianyu" , Igor Mammedov , Jan Kiszka , Peter Xu , Yang Zhang From: Paolo Bonzini Message-ID: <4b30aa90-24bb-c5d0-18c0-b1fb4a62014f@redhat.com> Date: Wed, 13 Jul 2016 10:38:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160712200930.32143-13-rkrcmar@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/07/2016 22:09, Radim Krčmář wrote: > @@ -619,14 +619,17 @@ static bool kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda) > /* KVM APIC implementation has two quirks > * - dest always begins at 0 while xAPIC MDA has offset 24, > * - IOxAPIC messages have to be delivered (directly) to x2APIC. > + * > + * The broadcast quirk can be disabled with KVM_CAP_X2APIC_API. --verbose version: /* KVM APIC implementation has two quirks - * - dest always begins at 0 while xAPIC MDA has offset 24, - * - IOxAPIC messages have to be delivered (directly) to x2APIC. + * - dest always begins at 0 while xAPIC MDA has offset 24. This is + * just a quirk in the API and is not problematic. * - * The broadcast quirk can be disabled with KVM_CAP_X2APIC_API. + * - in-kernel IOAPIC messages have to be delivered directly to + * x2APIC, because the kernel does not support interrupt remapping. + * In order to support broadcast without interrupt remapping, x2APIC + * rewrites the destination of non-IPI messages (and also of IPIs sent + * from xAPIC-mode LAPICs) from APIC_BROADCAST to X2APIC_BROADCAST. + * + * The broadcast quirk can be disabled with KVM_CAP_X2APIC_API. This is + * important when userspace wants to use x2APIC-format MSIs, because + * APIC_BROADCAST (0xff) is a legal route for "cluster 0, CPUs 0-7". */ Sounds good? Paolo