From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752115AbcGAPxz (ORCPT ); Fri, 1 Jul 2016 11:53:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56873 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750702AbcGAPxy (ORCPT ); Fri, 1 Jul 2016 11:53:54 -0400 Date: Fri, 1 Jul 2016 17:53:50 +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 Subject: Re: [PATCH v1 06/11] KVM: x86: use hardware-compatible format for APIC ID register Message-ID: <20160701155349.GB5965@potion> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0547afff-bb34-53dc-c753-3601a9fb7022@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 01 Jul 2016 15:53:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-07-01 17:07+0200, Paolo Bonzini: > On 01/07/2016 16:54, Radim Krčmář wrote: >>> > (Hint: we >>> > want kvm-unit-tests for this). >> :) Something like this? >> >> 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.