From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/3 v2] x2APIC interface to local apic Date: Mon, 29 Jun 2009 12:54:03 +0300 Message-ID: <4A488F3B.6060504@redhat.com> References: <1246191331-31085-1-git-send-email-gleb@redhat.com> <1246191331-31085-3-git-send-email-gleb@redhat.com> <4A488C6A.2040703@redhat.com> <20090629095104.GU20289@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:43622 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759204AbZF2Jw2 (ORCPT ); Mon, 29 Jun 2009 05:52:28 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5T9qVId025787 for ; Mon, 29 Jun 2009 05:52:31 -0400 In-Reply-To: <20090629095104.GU20289@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/29/2009 12:51 PM, Gleb Natapov wrote: > On Mon, Jun 29, 2009 at 12:42:02PM +0300, Avi Kivity wrote: > >> On 06/28/2009 03:15 PM, Gleb Natapov wrote: >> >>> This patch implements MSR interface to a local apic as defines by x2APIC >>> Intel specification. >>> >>> @@ -269,7 +275,12 @@ int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest) >>> int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda) >>> { >>> int result = 0; >>> - u8 logical_id; >>> + u32 logical_id; >>> + >>> + if (apic_x2apic_mode(apic)) { >>> + logical_id = apic_get_reg(apic, APIC_LDR); >>> + return logical_id& (uint16_t)mda; >>> + } >>> >>> >> mda is u8, why cast it? >> > Is mda will be zero extended without any cast at all? I suppose it > should. > > Yes. -- error compiling committee.c: too many arguments to function