Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9305390rwd; Wed, 21 Jun 2023 05:57:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bIvWNnRTH0lttGECHq11LEjcvu+lCJP9zirrw8ouyj7TI+bVRiIlZX0axdwKpOe2DynkM X-Received: by 2002:a17:90a:e398:b0:260:ff26:6dfa with SMTP id b24-20020a17090ae39800b00260ff266dfamr1186369pjz.38.1687352278497; Wed, 21 Jun 2023 05:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687352278; cv=none; d=google.com; s=arc-20160816; b=lZOlR9GEa7K9lw3mxtTetMoO6tmyy+N65tFaJiKKazkgQqVWgHThNFnLvksVW2OlkA aJS3wENdCEaxnvCdHd6zw/MZ/S+DFioptVytgKsfLNGVGswm29vEyZa3fmX+EtqP1eTR 7ij4LJtZ3s9a4t9Y6xaBpfWB+whLoL68iH63nnYAn4AyFC3OV4y2H0jAzkFPNQTf27y2 S2iKU97AJQmOXLHpYQqqzlrJAnTIhnO3A3KkLoerlepXAEElw4Y6MyKeUY1Y9u1417px WZ0J4+4saDxfFwZ+YF2upDaSPIoIyerqBXKmceYay22NawUp6dAX7DSBhHPtHrX28PlR 395g== 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=zvvqYzvYda8IzGokIkiImXdqHP8zc8ptBIh4wqWaw8g=; b=HY8hB8pcZw1m2yiQq8e6/yjuGQnXksVeJ17RLu0z27lY4sENE0RlIqtdOtcyhsKXJj ilbUD085LdKNQ+IZh05MjCCmPSZxIL+cstEXRcJvU/0PhtRMlW8pYs5KIyoHppwAGEnJ THeDpf39cCiL1+pg1MLFZKh7iXSoKKKaC4Jc6AIwWXlIPdTp/BaSp4i7GIACw6yVeOsH NYXB15ZmeIHbM4sJJp+d5jpQwJDqvEq5lROSmTjWq7Yusbbs4n+paqPR2LtMf+wCx2dm u/pMXY1Cc4bSxtEAios4VC64/wpJqUFiaOpHRZavsJGTYMdQB7U0SiD5QZwOjoznmiOj v+Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=j5RdqdWQ; 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 y63-20020a638a42000000b00542b188b326si3943237pgd.876.2023.06.21.05.57.45; Wed, 21 Jun 2023 05:57:58 -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=j5RdqdWQ; 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 S231752AbjFUMFM (ORCPT + 99 others); Wed, 21 Jun 2023 08:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231389AbjFUMEn (ORCPT ); Wed, 21 Jun 2023 08:04:43 -0400 Received: from xry111.site (xry111.site [89.208.246.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 736D51733 for ; Wed, 21 Jun 2023 05:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1687349082; bh=yX9aevHlBInKxhqR4k7YhhN0OhE5l/kYUpC23Hh9BzY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=j5RdqdWQcfEQFZJ9aEJRTCIXxblbBV1Ao0TJ3jUiPnqZ+3mFJSPmMo4mmf1grlom0 Uo0TaGYKknMtsFfoarMehwKW8TrAeAY1g8ZWreTK742fc0fOjgVEymQLpbZHTQ1MZc 2pcedsk4Piu0on5o1RiYzzEZ+iZHm6pZOSlFo+I0= 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 38BC065A44; Wed, 21 Jun 2023 08:04:41 -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 20:04:39 +0800 In-Reply-To: References: <0b663d8f6802e8dbf443397718234bcb6d0811c8.camel@xry111.site> <20230621111346.GFZJLbavDw1JiLi34n@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 19:18 +0800, Xi Ruoyao wrote: > On Wed, 2023-06-21 at 13:13 +0200, Borislav Petkov wrote: > > On Wed, Jun 21, 2023 at 06:57:40PM +0800, Xi Ruoyao wrote: > > > I intend to implement the same logic for Glibc.=C2=A0 I can understan= d "3DNow > > > implies PREFETCHW", but is there a bibliographical reference about "L= M > > > implies PREFETCHW" so I can convince the Glibc maintainers for the > > > change? > >=20 > > https://www.amd.com/system/files/TechDocs/24594.pdf >=20 > Thanks very much! Hmm, while it's true for AMD, the Intel SDM claims otherwise. It says prefetchw is only (really) supported with "Intel=C2=AE Core=E2=84=A2 M proc= essor family; 5th Generation Intel=C2=AE Core=E2=84=A2 processor family, Intel At= om processor based on Silvermont microarchitecture" or later. On the earlier Intel CPUs supporting LM, the prefetchw instruction is treated as NOP. Is the kernel code an oversight or we simply don't want to bother checking Intel vs. AMD here? --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University