From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [Patch 2/4] x86/hpet: Sanitise HPET ACPI table and warn about multiple tables Date: Mon, 7 Oct 2013 14:26:19 +0100 Message-ID: <1381152381-19744-3-git-send-email-andrew.cooper3@citrix.com> References: <1381152381-19744-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1381152381-19744-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich --- xen/arch/x86/acpi/boot.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c index 0e1d570..1f6cbe6 100644 --- 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; + } + + /* + * 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"); + hpet_address = hpet_tbl->address.address; hpet_blockid = hpet_tbl->sequence; printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", -- 1.7.10.4