Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9408281rwd; Wed, 21 Jun 2023 07:08:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4URglPcgGlMQuQsY6gnXEB/euzfMzNzegAh6NtENdxi73pnXs8rR8w6vYp/7hv6zuUbzeM X-Received: by 2002:a17:90a:4b06:b0:256:797b:5039 with SMTP id g6-20020a17090a4b0600b00256797b5039mr14578945pjh.9.1687356485098; Wed, 21 Jun 2023 07:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687356485; cv=none; d=google.com; s=arc-20160816; b=vx4iC4u7GvKHYOqbvI3glULx2tkSO+fE8JI9OMwsXSZ/iFDreqft9VKUdae7XIWurx MY8QespO6S/8DF3ZuLV2vrK5VVzEhWygq2AuzcaoWGlTKMgWgOgN24siaNc0NH2Y0Uet 7ftLLt0bRuaePVyUcbEpw01kwx4o7RZd9h6mHDdiihv8DSOmAiJQltuBQjyWAkYmPNc9 fiyZNv3ZMzOTkpZC4Y45oVwWBXad85FTkgSJbWwZf6QdkAyfaPyok/FQqH3pm2IHy1dV ERaWz8cmhw7QwQOphgcySBkTcv5Qv+RYmSsKYWkL06AqiO0IuCbeP6304nWX9YZ3F+pn v88g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=mKMqUuWKo4We6APzwpiPt0WTyPKwoFAwN9+UkpLCRtE=; b=xF1/JCGVIaealFa/sp3amPa3QIbsQaG4sNTddWcIwJ4kwAT7iTqju4Bn63r0NT4HFd z1KFezxB0tWvhWNGHgAsIKDs1noeRyT46gsaYyR8fg1UkbGJj9yhD7X9lGZNhRjjUYp/ nVdMpzVJeeJk5JiG+JDI9+hl5/eYFGsefID69bQCEOKVWo76WncwwtrN7puGksbTBAtx Ks4OyeEuGk10vHrG+knJnQwRJ80rpVDTS6fkS8UPD2pI5K1MAey8MtJ71ffRZi5728js tcurmsSa+K5o8DXl6xHvzZ302CUzDOZwPYRaEqfW5zW6iU9A2e+eMLRw+l+HdXYeSBYN rUeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=KC0DQHUZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020a17090a55c900b00256ae6cfd31si4145864pjm.101.2023.06.21.07.07.44; Wed, 21 Jun 2023 07:08:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=KC0DQHUZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231450AbjFUNrk (ORCPT + 99 others); Wed, 21 Jun 2023 09:47:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbjFUNrj (ORCPT ); Wed, 21 Jun 2023 09:47:39 -0400 Received: from xry111.site (xry111.site [89.208.246.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DED18E6E for ; Wed, 21 Jun 2023 06:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1687355258; bh=mKMqUuWKo4We6APzwpiPt0WTyPKwoFAwN9+UkpLCRtE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=KC0DQHUZkjXHWXaKGJ0UQnv2k/xQabEBosK5yr17/Rp6taOu4ZxqZxr/VsvZnvBjU CgLYuyHwcLl+zSBoRXLHvyHqfdqOVmL1tui7gI6iHIRcf8HJ7MPiqdgiGwM/zW3/IF EQu4v05yHkl87bHHTMdKGcTF24Ae6ENl82tNrRKk= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id BA66665A7B; Wed, 21 Jun 2023 09:47:37 -0400 (EDT) Message-ID: Subject: Re: A question about prefetchw detection in "x86/asm: Cleanup prefetch primitives" From: Xi Ruoyao To: Borislav Petkov Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner Date: Wed, 21 Jun 2023 21:47:36 +0800 In-Reply-To: <20230621134645.GIZJL/Rf1IdeLMQGl2@fat_crate.local> References: <0b663d8f6802e8dbf443397718234bcb6d0811c8.camel@xry111.site> <20230621111346.GFZJLbavDw1JiLi34n@fat_crate.local> <20230621125749.GGZJLzzUw0rA3goV1X@fat_crate.local> <20230621130955.GHZJL2o771lIEPURUl@fat_crate.local> <29beee7faf370ea892cb4e5a85ddd1f7ee132164.camel@xry111.site> <20230621134645.GIZJL/Rf1IdeLMQGl2@fat_crate.local> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.3 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2023-06-21 at 15:46 +0200, Borislav Petkov wrote: > On Wed, Jun 21, 2023 at 09:19:34PM +0800, Xi Ruoyao wrote: > > On Wed, 2023-06-21 at 15:09 +0200, Borislav Petkov wrote: > > > On Wed, Jun 21, 2023 at 09:06:51PM +0800, Xi Ruoyao wrote: > > > > I think it's not an issue in the kernel itself, but announcing > > > > 3dnowprefetch in /proc/cpuinfo for an old Intel CPU w/o real > > > > prefetchw > > > > implementation seems problematic (to me). > > >=20 > > > And this is a problem because? > >=20 > > If a code generator parses /proc/cpuinfo for CPU capabilities, it > > may > > generates a no-op prefetchw instead of prefetcht0 as a fallback. >=20 > Err, go back. >=20 > That code snippet you pasted, did you see where that comes from? >=20 > A function called init_amd(). >=20 > Now, is Intel hardware and SDM PREFETCHW text at all relevant here? Oh s**t, I'm completely stupid :(. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University