From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [SeaBIOS] [PATCH v2] add acpi pmtimer support Date: Thu, 06 Sep 2012 07:56:09 +0200 Message-ID: <50483AF9.60907@redhat.com> References: <1344922159-22703-1-git-send-email-kraxel@redhat.com> <20120902204243.GC1814@morn.localdomain> <5046E2DC.4080104@redhat.com> <50477245.4030003@CloudSwitch.Com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Kevin O'Connor" , seabios@seabios.org, kvm@vger.kernel.org To: Don Slutz Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32772 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443Ab2IFF45 (ORCPT ); Thu, 6 Sep 2012 01:56:57 -0400 In-Reply-To: <50477245.4030003@CloudSwitch.Com> Sender: kvm-owner@vger.kernel.org List-ID: Hi, >>>> + u32 pmtimer = inl(ioport); >>>> + return (u64)wraps << 24 | pmtimer; >>> BTW, why is this "<< 24", and if it should be that way, shouldn't the >>> pmtimer be "inl(ioport) & 0xffffff" ? >> The pmtimer is defined to be 24 bits wide, so the shift is correct. > This is not true in general. It can be either 24 or 32 bits. What it > is depends on ACPI data (acpi_gbl_FADT->tmr_val_ext). The piix4 emulated by qemu has 24 bits. > However it is > valid to only used 24 bits. And we certainly want to mask the ioport read (as suggested by kevin and done in v3 of the patch) so we only pick up the 24 bits we actually use. thanks Gerd