From patchwork Wed Oct 28 15:11:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 40906 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 74E683972460; Wed, 28 Oct 2020 15:12:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74E683972460 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603897925; bh=8lKU0E/Bn4X9drG/XI+wTUitj4UndQsMOiPAAxd4lwI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=QvPRlL9vw2MYpu8LsV/R3b1S9a7cPu4G0sbZEduBv+PegiZUYk+6hZl+PIGCZEeJu 4yfgi71MDYDwlcDgUjWcDI3+HeSSDM5Lpz8ySeg+pT3Z5qCljdGeCOaG0SW0Gacuu4 NyB6t2za4XPCcowWf1amKY5tv3lxvTEfxc4LbGDQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 311863972030 for ; Wed, 28 Oct 2020 15:12:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 311863972030 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-mEujLl9WNGq8Ls-S84OEaA-1; Wed, 28 Oct 2020 11:12:00 -0400 X-MC-Unique: mEujLl9WNGq8Ls-S84OEaA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 739778015C3; Wed, 28 Oct 2020 15:11:59 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-113-60.ams2.redhat.com [10.36.113.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4701A6EF40; Wed, 28 Oct 2020 15:11:58 +0000 (UTC) To: H.J. Lu Subject: [PATCH] x86: Restore processing of cache size tunables in init_cacheinfo Date: Wed, 28 Oct 2020 16:11:56 +0100 Message-ID: <87v9euv0zn.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Cc: Sajan Karumanchi , Premachandra Mallappa , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Fixes and partially reverts commit 59803e81f96b479c17f583b31eac44b5 ("x86: Optimizing memcpy for AMD Zen architecture."). --- sysdeps/x86/cacheinfo.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sysdeps/x86/cacheinfo.h b/sysdeps/x86/cacheinfo.h index 1296c93b2b..0aec0e2875 100644 --- a/sysdeps/x86/cacheinfo.h +++ b/sysdeps/x86/cacheinfo.h @@ -354,11 +354,9 @@ init_cacheinfo (void) } } + /* Prefer cache size configure via tuning. */ if (cpu_features->data_cache_size != 0) - { - if (data == 0 || cpu_features->basic.kind != arch_kind_amd) - data = cpu_features->data_cache_size; - } + data = cpu_features->data_cache_size; if (data > 0) { @@ -370,11 +368,9 @@ init_cacheinfo (void) __x86_data_cache_size = data; } + /* Prefer cache size configure via tuning. */ if (cpu_features->shared_cache_size != 0) - { - if (shared == 0 || cpu_features->basic.kind != arch_kind_amd) - shared = cpu_features->shared_cache_size; - } + shared = cpu_features->shared_cache_size; if (shared > 0) {