From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073AbcGAQhz (ORCPT ); Fri, 1 Jul 2016 12:37:55 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:36449 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbcGAQhx (ORCPT ); Fri, 1 Jul 2016 12:37:53 -0400 Subject: Re: [PATCH v1 06/11] KVM: x86: use hardware-compatible format for APIC ID register To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <20160630205429.16480-1-rkrcmar@redhat.com> <20160630205429.16480-7-rkrcmar@redhat.com> <733b706a-f30f-3854-5fc7-402d6b5fd79a@redhat.com> <20160701131119.GC27840@potion> <217814b5-d637-07f8-48cd-777ad498c54f@redhat.com> <20160701145407.GC2301@potion> <0547afff-bb34-53dc-c753-3601a9fb7022@redhat.com> <20160701155349.GB5965@potion> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Lan, Tianyu" , Igor Mammedov , Jan Kiszka , Peter Xu From: Paolo Bonzini Message-ID: <2d235797-366b-ab58-0bf3-532852978465@redhat.com> Date: Fri, 1 Jul 2016 18:37:43 +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: <20160701155349.GB5965@potion> 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 01/07/2016 17:53, Radim Krčmář wrote: >> >> enable_xapic() >> >> id = apic_id() >> >> set_apic_id(id+1) // ? >> >> enable_x2apic() >> >> id == apic_id() & 0xff >> >> disable_apic() >> >> enable_xapic() >> >> id == apic_id() >> >> > > > > Yes, plus checking that it "moves" appropriately between low and high bits. > > x2APIC cannot use MMIO interface, so apic_id() already does the best we > can ... if KVM is shifting wrong somwhere, then the id should differ. Yeah, fair enough. Paolo