From nobody Tue Feb 10 04:29:39 2026 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=1588168464; cv=none; d=zohomail.com; s=zohoarc; b=h0RoifMdni+Po9GNPw5CBpbVWX/4GYO0YZhJN8UGarBjuFODwGttoNVTuBgCEAAebQNIHn8b4t88/p5FR8ROYjDwvkA5ruyungjnR84jb/q6DdhoW63+Yi/ZkG4DS3UIyN5X3zHgSQx3C/CopBRc5BjPX4xdcKgnDY9zsiYtf3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588168464; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To; bh=jhX1uwZEJ7HKyPKgZOyqrCA1A/IogczMqwP1IqizOEg=; b=JJZHUys1j6E+TpwEcmftKE+OrkkbMU0VSl+gLiFazqQvpXzhsaslD/JT3v1nzcS5pbi/6kY3UXh2SXnUltowMiqHQ652ctxr4GWj+PbhT1qbTYaiCL89t8I/AUjFhxeF39gYJhrEYcIH+07Mkj884zlolLLHuNHOrurLy2wWviQ= 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 1588168464670394.2675240794583; Wed, 29 Apr 2020 06:54:24 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 5159110C1962; Wed, 29 Apr 2020 13:54:21 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 328A510C1954 for ; Wed, 29 Apr 2020 13:53: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-91-lRuAmGUHPiySDHe-hfO5yw-1; Wed, 29 Apr 2020 09:46:59 -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 3EA1E1009615 for ; Wed, 29 Apr 2020 13:46:58 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.corp.redhat.com (Postfix) with ESMTP id E51ED648D2; Wed, 29 Apr 2020 13:46:55 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) id 24D4D9D9F; Wed, 29 Apr 2020 15:46:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168390; 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: in-reply-to:in-reply-to:references:references; bh=3gqf7sqAN84AZD2SPOEBWjlwOfgVepZODYFWIExJPhc=; b=cDRntSpgpFV4hpgZL4iURRbta4hSaEQqnxqOYYsKvWEo7SnQj/i4wQh7KrllQppPDx0hgD TgMWMMhEXXQVJvNSlegneQ/SBYsSEHNbNa9H5S+LF7922vFFfEF8XoH12PpaH5dIrkWRyA rWyYRP0+k+gZLjdhjxwnPp1UWTmrcrM= X-MC-Unique: lRuAmGUHPiySDHe-hfO5yw-1 From: Gerd Hoffmann To: seabios@seabios.org Date: Wed, 29 Apr 2020 15:46:40 +0200 Message-Id: <20200429134643.2001-7-kraxel@redhat.com> In-Reply-To: <20200429134643.2001-1-kraxel@redhat.com> References: <20200429134643.2001-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: NIEKNIXOWJNWZQLWT2GXXI7FKCFWYN52 X-Message-ID-Hash: NIEKNIXOWJNWZQLWT2GXXI7FKCFWYN52 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 v3 6/9] 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