From owner-svn-src-all@freebsd.org Wed Jul 11 01:38:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 049601046DD9; Wed, 11 Jul 2018 01:38:11 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE34D75BA8; Wed, 11 Jul 2018 01:38:10 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id 1B27D18BF9; Wed, 11 Jul 2018 01:38:10 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Tue, 10 Jul 2018 18:38:08 -0700 From: Ben Widawsky To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336185 - head/usr.sbin/acpi/acpidump Message-ID: <20180711013808.mflhpmbqysf5ep44@smtp.freebsd.org> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807110137.w6B1b1ne046881@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807110137.w6B1b1ne046881@repo.freebsd.org> User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2018 01:38:11 -0000 Here is sample output from the tool: LPIT: Length=148, Revision=1, Checksum=32, OEMID=INTEL, OEM Table ID=SKL, OEM Revision=0x0, Creator ID=MSFT, Creator Revision=0x5f Type=ACPI_LPIT_TYPE_NATIVE_CSTATE Length=56 UniqueId=0x0000 Flags= EntryTrigger=0x0000000000000060 (?) Residency=30000 Latency=3000 ResidencyCounter=0x0000000000000632 (?) CounterFrequency=TSC Type=ACPI_LPIT_TYPE_NATIVE_CSTATE Length=56 UniqueId=0x0001 Flags= EntryTrigger=0x0000000000000060 (?) Residency=30000 Latency=3000 ResidencyCounter=0x0000000000000632 (?) CounterFrequency=TSC On 18-07-11 01:37:01, Ben Widawsky wrote: > Author: bwidawsk > Date: Wed Jul 11 01:37:01 2018 > New Revision: 336185 > URL: https://svnweb.freebsd.org/changeset/base/336185 > > Log: > acpidump(8): Add ACPI LPIT (Low Power Idle Table) > > The LPIT is the part of the "standardized" way that one can enumerate > various power state information on Intel platforms. > > The documentation for this change can be found here: > http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf > > Reviewed By: jhb > Approved By: jhb > Differential Revision: https://reviews.freebsd.org/D15931 > > Modified: > head/usr.sbin/acpi/acpidump/acpi.c > head/usr.sbin/acpi/acpidump/acpidump.8 > > Modified: head/usr.sbin/acpi/acpidump/acpi.c > ============================================================================== > --- head/usr.sbin/acpi/acpidump/acpi.c Tue Jul 10 23:30:19 2018 (r336184) > +++ head/usr.sbin/acpi/acpidump/acpi.c Wed Jul 11 01:37:01 2018 (r336185) > @@ -68,6 +68,7 @@ static void acpi_handle_hpet(ACPI_TABLE_HEADER *sdp); > static void acpi_handle_mcfg(ACPI_TABLE_HEADER *sdp); > static void acpi_handle_slit(ACPI_TABLE_HEADER *sdp); > static void acpi_handle_wddt(ACPI_TABLE_HEADER *sdp); > +static void acpi_handle_lpit(ACPI_TABLE_HEADER *sdp); > static void acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain, > uint32_t flags); > static void acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp); > @@ -716,6 +717,79 @@ acpi_handle_wddt(ACPI_TABLE_HEADER *sdp) > } > > static void > +acpi_print_native_lpit(ACPI_LPIT_NATIVE *nl) > +{ > + printf("\tEntryTrigger="); > + acpi_print_gas(&nl->EntryTrigger); > + printf("\tResidency=%u\n", nl->Residency); > + printf("\tLatency=%u\n", nl->Latency); > + if (nl->Header.Flags & ACPI_LPIT_NO_COUNTER) > + printf("\tResidencyCounter=Not Present"); > + else { > + printf("\tResidencyCounter="); > + acpi_print_gas(&nl->ResidencyCounter); > + } > + if (nl->CounterFrequency) > + printf("\tCounterFrequency=%ju\n", nl->CounterFrequency); > + else > + printf("\tCounterFrequency=TSC\n"); > +} > + > +static void > +acpi_print_lpit(ACPI_LPIT_HEADER *lpit) > +{ > + if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE) > + printf("\tType=ACPI_LPIT_TYPE_NATIVE_CSTATE\n"); > + else > + warnx("unknown LPIT type %u", lpit->Type); > + > + printf("\tLength=%u\n", lpit->Length); > + printf("\tUniqueId=0x%04x\n", lpit->UniqueId); > +#define PRINTFLAG(var, flag) printflag((var), ACPI_LPIT_## flag, #flag) > + printf("\tFlags="); > + PRINTFLAG(lpit->Flags, STATE_DISABLED); > + PRINTFLAG_END(); > +#undef PRINTFLAG > + > + if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE) > + return acpi_print_native_lpit((ACPI_LPIT_NATIVE *)lpit); > +} > + > +static void > +acpi_walk_lpit(ACPI_TABLE_HEADER *table, void *first, > + void (*action)(ACPI_LPIT_HEADER *)) > +{ > + ACPI_LPIT_HEADER *subtable; > + char *end; > + > + subtable = first; > + end = (char *)table + table->Length; > + while ((char *)subtable < end) { > + printf("\n"); > + if (subtable->Length < sizeof(ACPI_LPIT_HEADER)) { > + warnx("invalid subtable length %u", subtable->Length); > + return; > + } > + action(subtable); > + subtable = (ACPI_LPIT_HEADER *)((char *)subtable + > + subtable->Length); > + } > +} > + > +static void > +acpi_handle_lpit(ACPI_TABLE_HEADER *sdp) > +{ > + ACPI_TABLE_LPIT *lpit; > + > + printf(BEGIN_COMMENT); > + acpi_print_sdt(sdp); > + lpit = (ACPI_TABLE_LPIT *)sdp; > + acpi_walk_lpit(sdp, (lpit + 1), acpi_print_lpit); > + > + printf(END_COMMENT); > +} > + > +static void > acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain, > uint32_t flags) > { > @@ -1693,6 +1767,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp) > acpi_handle_nfit(sdp); > else if (!memcmp(sdp->Signature, ACPI_SIG_WDDT, 4)) > acpi_handle_wddt(sdp); > + else if (!memcmp(sdp->Signature, ACPI_SIG_LPIT, 4)) > + acpi_handle_lpit(sdp); > else { > printf(BEGIN_COMMENT); > acpi_print_sdt(sdp); > > Modified: head/usr.sbin/acpi/acpidump/acpidump.8 > ============================================================================== > --- head/usr.sbin/acpi/acpidump/acpidump.8 Tue Jul 10 23:30:19 2018 (r336184) > +++ head/usr.sbin/acpi/acpidump/acpidump.8 Wed Jul 11 01:37:01 2018 (r336185) > @@ -29,7 +29,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd June 20, 2018 > +.Dd July 10, 2018 > .Dt ACPIDUMP 8 > .Os > .Sh NAME > @@ -103,6 +103,7 @@ utility dumps contents of the following tables: > .It FACS > .It FADT > .It HPET > +.It LPIT > .It MADT > .It MCFG > .It NFIT > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"