From owner-freebsd-acpi@FreeBSD.ORG Wed Dec 9 18:46:39 2009 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7763D106566B for ; Wed, 9 Dec 2009 18:46:39 +0000 (UTC) (envelope-from robert.moore@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx1.freebsd.org (Postfix) with ESMTP id 55EFF8FC18 for ; Wed, 9 Dec 2009 18:46:39 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 09 Dec 2009 10:41:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,369,1257148800"; d="scan'208";a="754385457" Received: from orsmsx603.amr.corp.intel.com ([10.22.226.49]) by fmsmga001.fm.intel.com with ESMTP; 09 Dec 2009 10:46:36 -0800 Received: from orsmsx503.amr.corp.intel.com ([10.22.226.47]) by orsmsx603.amr.corp.intel.com ([10.22.226.49]) with mapi; Wed, 9 Dec 2009 10:46:38 -0800 From: "Moore, Robert" To: John Baldwin , "freebsd-acpi@freebsd.org" Date: Wed, 9 Dec 2009 10:46:36 -0800 Thread-Topic: libi386/biosacpi.c - bad RSDP checksum search Thread-Index: Acp4C2mPNjX17T/AQKGMw4//Fsy+IgA9GPZQ Message-ID: <4911F71203A09E4D9981D27F9D83085840DA9AC8@orsmsx503.amr.corp.intel.com> References: <20091208060339.GK98273@pollux.cenkes.org> <200912080749.55710.jhb@freebsd.org> In-Reply-To: <200912080749.55710.jhb@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Andrew Pantyukhin Subject: RE: libi386/biosacpi.c - bad RSDP checksum search X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 18:46:39 -0000 Might be a dumb question, but why is the bootloader looking around for ACPI= tables in the first place? Thanks, Bob >-----Original Message----- >From: owner-freebsd-acpi@freebsd.org [mailto:owner-freebsd- >acpi@freebsd.org] On Behalf Of John Baldwin >Sent: Tuesday, December 08, 2009 4:50 AM >To: freebsd-acpi@freebsd.org >Cc: Andrew Pantyukhin >Subject: Re: libi386/biosacpi.c - bad RSDP checksum search > >On Tuesday 08 December 2009 1:03:40 am Andrew Pantyukhin wrote: >> Our boot loader stops searching memory at the first occurrence of >> "RSD PTR" while there are BIOSes (e.g. some IBM System x) that >> have multiple such strings and the first one does not contain the >> correct checksum. >> >> The acpi-ca code does the right thing and continues the search. >> >> Any ACPI experts interested in fixing this? I'll be ready to >> test. > >Are you sure? It looks like it keeps going if the checksum fails. Note >the >'continue' after the printf() about a bad checksum. > >/* > * Find the RSDP in low memory. See section 5.2.2 of the ACPI spec. > */ >static ACPI_TABLE_RSDP * >biosacpi_find_rsdp(void) >{ > ACPI_TABLE_RSDP *rsdp; > uint16_t *addr; > > /* EBDA is the 1 KB addressed by the 16 bit pointer at 0x40E. */ > addr =3D (uint16_t *)PTOV(0x40E); > if ((rsdp =3D biosacpi_search_rsdp((char *)(*addr << 4), 0x400)) !=3D = NULL) > return (rsdp); > > /* Check the upper memory BIOS space, 0xe0000 - 0xfffff. */ > if ((rsdp =3D biosacpi_search_rsdp((char *)0xe0000, 0x20000)) !=3D NUL= L) > return (rsdp); > > return (NULL); >} > >static ACPI_TABLE_RSDP * >biosacpi_search_rsdp(char *base, int length) >{ > ACPI_TABLE_RSDP *rsdp; > u_int8_t *cp, sum; > int ofs, idx; > > /* search on 16-byte boundaries */ > for (ofs =3D 0; ofs < length; ofs +=3D 16) { > rsdp =3D (ACPI_TABLE_RSDP *)PTOV(base + ofs); > > /* compare signature, validate checksum */ > if (!strncmp(rsdp->Signature, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP))) >{ > cp =3D (u_int8_t *)rsdp; > sum =3D 0; > for (idx =3D 0; idx < RSDP_CHECKSUM_LENGTH; idx++) > sum +=3D *(cp + idx); > if (sum !=3D 0) { > printf("acpi: bad RSDP checksum (%d)\n", sum); > continue; > } > return(rsdp); > } > } > return(NULL); >} > >-- >John Baldwin >_______________________________________________ >freebsd-acpi@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-acpi >To unsubscribe, send any mail to "freebsd-acpi-unsubscribe@freebsd.org"