Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755652AbcCaLXd (ORCPT ); Thu, 31 Mar 2016 07:23:33 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33143 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbcCaLXb (ORCPT ); Thu, 31 Mar 2016 07:23:31 -0400 Subject: Re: [PART1 RFC v3 10/12] svm: Do not expose x2APIC when enable AVIC To: Suravee Suthikulpanit , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1458281388-14452-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1458281388-14452-11-git-send-email-Suravee.Suthikulpanit@amd.com> <20160318205948.GA26119@potion.brq.redhat.com> <56FCA468.8090406@amd.com> Cc: joro@8bytes.org, bp@alien8.de, gleb@kernel.org, alex.williamson@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com From: Paolo Bonzini Message-ID: <56FD08AE.6000201@redhat.com> Date: Thu, 31 Mar 2016 13:23:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56FCA468.8090406@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 920 Lines: 28 On 31/03/2016 06:15, Suravee Suthikulpanit wrote: >>> + vcpu->arch.cpuid_entries[i].ecx &= ~(1 << 21); >> >> and X86_FEATURE_X2APIC (or something with X2APIC in name) for the >> bit. >> >> The code will become so obvious that the comment can be removed. >> :) > > Good point. I can only find example of using (X86_FEATURE_X2APIC % > 32) == 21. You can use bit(X86_FEATURE_X2APIC), it is defined in arch/x86/kvm/x86.h. >> but the MSR interface is going to exit and host-side interrupt >> delivery will probably still work, so I don't see a huge problem >> with it. > > Agree that it will still work. However, in such case, the guest code > would likely default to using x2APIC interface, which will not be > handled by the AVIC hardware, and resulting in no performance > improvement that we are trying to introduce. You would still get some improvement from exit-free interrupt delivery. Paolo