From patchwork Thu May 19 17:06:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 624162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r9ctF6bs6z9t3h for ; Fri, 20 May 2016 03:06:45 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=yBoGo1KZ; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :mime-version:content-type; q=dns; s=default; b=qHdhnlDoUHk9/7DG PP++MXkUUIUbrYnZimzZ2HETuImidHWg0imHR4oaO08qX0zXxqBQ0pDzeBAyknXV i94+MtNM747u0yTgltClnXHe3zzXVhwGYFy2YTtPygN6RjVYnS5Lif31Od/WgkbU n8CGIU+SIRy83pu+WJtJFnF67Vw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :mime-version:content-type; s=default; bh=5s2FDyikN2djmylnGcNGJj 1uqo8=; b=yBoGo1KZ0cmvGnfqF+/vt+gZiKJwcpjyWxz41D8KAXBFdYancsGL4M pO4mOPbafq47SqhLsLJhw7DKxQmDNA+j16fieh7t4mAulAZn6HvgRnEOPg4j3POv I4D9hdXzjo0FMUvD1PiGfADVRBCg/qqlPuRDEoMQ/Km7R4f+cyKhc= Received: (qmail 18896 invoked by alias); 19 May 2016 17:06:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 18697 invoked by uid 89); 19 May 2016 17:06:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=sk:1f46d9d, sk:8adf828, reserved, Reserved X-HELO: mga09.intel.com X-ExtLoop1: 1 Date: Thu, 19 May 2016 10:06:17 -0700 From: "H.J. Lu" To: GNU C Library Subject: [committed, PATCH] [BZ #20119] Correct Intel processor level type mask from CPUID Message-ID: <20160519170617.GA10580@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) Intel CPUID with EAX == 11 returns: ECX Bits 07 - 00: Level number. Same value in ECX input. Bits 15 - 08: Level type. ^^^^^^^^^^^^^^^^^^^^^^^^ This is level type. Bits 31 - 16: Reserved. Intel processor level type mask should be 0xff00, not 0xff0. Tested on x86. Checked in. [BZ #20119] * sysdeps/x86/cacheinfo.c (init_cacheinfo): Correct Intel processor level type mask for CPUID with EAX == 11. --- ChangeLog | 6 ++++++ sysdeps/x86/cacheinfo.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8adf828..7ba904d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2016-05-19 H.J. Lu + [BZ #20119] + * sysdeps/x86/cacheinfo.c (init_cacheinfo): Correct Intel + processor level type mask for CPUID with EAX == 11. + +2016-05-19 H.J. Lu + * sysdeps/x86/cacheinfo.c (init_cacheinfo): Skip counting logical threads if the HTT bit is 0. * sysdeps/x86/cpu-features.h (bit_cpu_HTT): New. diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c index 1f46d9d..020d3fd 100644 --- a/sysdeps/x86/cacheinfo.c +++ b/sysdeps/x86/cacheinfo.c @@ -552,7 +552,7 @@ init_cacheinfo (void) __cpuid_count (11, i++, eax, ebx, ecx, edx); int shipped = ebx & 0xff; - int type = ecx & 0xff0; + int type = ecx & 0xff00; if (shipped == 0 || type == 0) break; else if (type == 0x200)