From: "Jan Beulich" Subject: Re: [Patch 2/4] x86/hpet: Sanitise HPET ACPI table and warn about multiple tables Date: Mon, 07 Oct 2013 15:26:07 +0100 Message-ID: <5252E09F02000078000F9492@nat28.tlf.novell.com> References: <1381152381-19744-1-git-send-email-andrew.cooper3@citrix.com> <1381152381-19744-3-git-send-email-andrew.cooper3@citrix.com> <5252D71202000078000F9445@nat28.tlf.novell.com> <5252BD3E.9090202@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VTBlF-0001Ab-RF for xen-devel@lists.xenproject.org; Mon, 07 Oct 2013 14:26:14 +0000 In-Reply-To: <5252BD3E.9090202@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 07.10.13 at 15:55, Andrew Cooper wrote: > On 07/10/13 14:45, Jan Beulich wrote: >>>>> On 07.10.13 at 15:26, Andrew Cooper wrote: >>> --- a/xen/arch/x86/acpi/boot.c >>> +++ b/xen/arch/x86/acpi/boot.c >>> @@ -276,6 +276,21 @@ static int __init acpi_parse_hpet(struct >>> acpi_table_header *table) >>> return -1; >>> } >>> >>> + if ( !hpet_tbl->address.address || !(hpet_tbl->address.address + 1) ) >>> + { >>> + printk(KERN_WARNING PREFIX "Bad HPET address %#lx\n", >>> + hpet_tbl->address.address); >>> + return -1; >>> + } >> Did you really encounter a system where this would trigger? >> >>> + >>> + /* >>> + * Hopefully someone might implement multiple HPET support in Xen. >>> + * Until then, warn the user if multiple HPET tables are found. >>> + */ >>> + if ( hpet_address ) >>> + printk(KERN_WARNING PREFIX >>> + "Xen only supports one HPET - Using latest table\n"); >>> + >> You perhaps miunderstood how multiple HPETs would be surfaced >> by firmware: Not via multiple HPET tables, but via objects in the >> ACPI object namespace. With that, a similar question to the above >> arises: Have you seen a system where multiple HPET tables get >> surfaced? > > We had a system which had two HPET tables. A BIOS update fixed the > issue, but the fact remains that in the case of multiple HPET tables, we > blindly go with the latest table. Interesting. > Perhaps the message could change to "Multiple tables found (BIOS BUG?). > Using information from latest" ? Something along those lines. In any case this would raise the question whether going with the first, last, or any intermediate table would be the safest route then. I'd be inclined to use the first in that case rather than the last. Jan