From nobody Wed Apr 24 13:25:41 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585297894; cv=none; d=zohomail.com; s=zohoarc; b=Mts+x8Th/p4UX5Uz/4SWBjzPP1MNC5YGLhFmPVZnE+LmnVaOLPHq0vcQ2TEi7tTOtuBFE2J2sgDfVVp8bERgT2I4ABDCa/sSKW5KRzyWStEnTt+illfzssGqWIbsayRACqt4goIVd5c5xQJvaU75GLuhC3Wk5UFTjvM2BKcmDjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585297894; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:To; bh=jhX1uwZEJ7HKyPKgZOyqrCA1A/IogczMqwP1IqizOEg=; b=J9xp6tGguS4M2lg9VmrBONy2tjBCQFiSMyUo7H3fefOcURmXavx6j5KRV48ruidUX+eSVzNugj6ynZGZ5o8N07gD4rSIoD8uwBBJy59eyzxieR2YGa4waOt51mLhBU3x1khIGY7TMDI7x44nEge3IhJvJc0ZP2/pnb6iNiHQAmI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1585297894094638.8258795878728; Fri, 27 Mar 2020 01:31:34 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 3F45CB01A23; Fri, 27 Mar 2020 08:31:30 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id C6A60B01A1B for ; Fri, 27 Mar 2020 08:31:11 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-7TTqTXj1O7qN712hHMyZYg-1; Fri, 27 Mar 2020 04:24:14 -0400 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA0E2800D5A for ; Fri, 27 Mar 2020 08:24:13 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.corp.redhat.com (Postfix) with ESMTP id A692396FA5; Fri, 27 Mar 2020 08:24:11 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) id 53D462049E; Fri, 27 Mar 2020 09:24:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585297870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3gqf7sqAN84AZD2SPOEBWjlwOfgVepZODYFWIExJPhc=; b=Em1r1NsYBJ/BBEWJ9CPkOGsnE+kc7JPS6nbJ6+UiyYtTbncsmg+qaLwrYUboUyyEfP1r5Y HLre4sUKDUAXL8J7a79JfA48fRnvC8uoePALrHxevn6yITfJrcOkcITZGEpW6wPdQ6Z4Xh kAkhlf7QXKX8XDJzj7DYidx/GXkkcho= X-MC-Unique: 7TTqTXj1O7qN712hHMyZYg-1 From: Gerd Hoffmann To: seabios@seabios.org Date: Fri, 27 Mar 2020 09:24:10 +0100 Message-Id: <20200327082410.22089-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: UXVOLLCK4KSWKJEIPCJT4DDJF7VZLU7Y X-Message-ID-Hash: UXVOLLCK4KSWKJEIPCJT4DDJF7VZLU7Y X-MailFrom: kraxel@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Gerd Hoffmann X-Mailman-Version: 3.3.1 Precedence: list Subject: [SeaBIOS] [PATCH] acpi: add xsdt support List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" In case a xsdt table is present (and located below 4G) prefer it over rsdt. Signed-off-by: Gerd Hoffmann --- src/std/acpi.h | 11 +++++++++++ src/fw/biostables.c | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/std/acpi.h b/src/std/acpi.h index c01fa7be827c..81c22757f50e 100644 --- a/src/std/acpi.h +++ b/src/std/acpi.h @@ -132,6 +132,17 @@ struct rsdt_descriptor_rev1 /* ACPI tables */ } PACKED; =20 +/* + * ACPI 2.0 eXtended System Description Table (XSDT) + */ +#define XSDT_SIGNATURE 0x54445358 // XSDT +struct xsdt_descriptor_rev2 +{ + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + u64 table_offset_entry[0]; /* Array of pointers to other */ + /* ACPI tables */ +} PACKED; + /* * ACPI 1.0 Firmware ACPI Control Structure (FACS) */ diff --git a/src/fw/biostables.c b/src/fw/biostables.c index fe8626efc05d..0d4fdb9c22e8 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -141,18 +141,38 @@ find_acpi_table(u32 signature) if (!RsdpAddr || RsdpAddr->signature !=3D RSDP_SIGNATURE) return NULL; struct rsdt_descriptor_rev1 *rsdt =3D (void*)RsdpAddr->rsdt_physical_a= ddress; + struct xsdt_descriptor_rev2 *xsdt =3D + RsdpAddr->xsdt_physical_address >=3D 0x100000000 + ? NULL : (void*)(u32)(RsdpAddr->xsdt_physical_address); dprintf(4, "rsdt=3D%p\n", rsdt); - if (!rsdt || rsdt->signature !=3D RSDT_SIGNATURE) - return NULL; - void *end =3D (void*)rsdt + rsdt->length; - int i; - for (i=3D0; (void*)&rsdt->table_offset_entry[i] < end; i++) { - struct acpi_table_header *tbl =3D (void*)rsdt->table_offset_entry[= i]; - if (!tbl || tbl->signature !=3D signature) - continue; - dprintf(4, "table(%x)=3D%p\n", signature, tbl); - return tbl; + dprintf(4, "xsdt=3D%p\n", xsdt); + + if (xsdt && xsdt->signature =3D=3D XSDT_SIGNATURE) { + void *end =3D (void*)xsdt + xsdt->length; + int i; + for (i=3D0; (void*)&xsdt->table_offset_entry[i] < end; i++) { + if (xsdt->table_offset_entry[i] >=3D 0x100000000) + continue; /* above 4G */ + struct acpi_table_header *tbl =3D (void*)(u32)xsdt->table_offs= et_entry[i]; + if (!tbl || tbl->signature !=3D signature) + continue; + dprintf(1, "table(%x)=3D%p (via xsdt)\n", signature, tbl); + return tbl; + } } + + if (rsdt && rsdt->signature =3D=3D RSDT_SIGNATURE) { + void *end =3D (void*)rsdt + rsdt->length; + int i; + for (i=3D0; (void*)&rsdt->table_offset_entry[i] < end; i++) { + struct acpi_table_header *tbl =3D (void*)rsdt->table_offset_en= try[i]; + if (!tbl || tbl->signature !=3D signature) + continue; + dprintf(1, "table(%x)=3D%p (via rsdt)\n", signature, tbl); + return tbl; + } + } + dprintf(4, "no table %x found\n", signature); return NULL; } --=20 2.18.2 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org