Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1378502lqb; Thu, 30 May 2024 08:30:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWl25nZaSvXpVoIy6CSPK6CGF0DRBD6uqK7nv41evxYU7HmNeYc/XjVwbfF/UTdPF+mFLk10wWxUBwpfQpjI67sXv9UWYivurbImxYL2A== X-Google-Smtp-Source: AGHT+IHMyfz6PfuwRFwszmWx9vgnVegLKNB8THHQ/wiujO9FD5L2BJeNLd7qR2Zz8RVuunXq86fB X-Received: by 2002:a2e:80c9:0:b0:2ea:8349:46bf with SMTP id 38308e7fff4ca-2ea847c6c51mr15937221fa.3.1717083026930; Thu, 30 May 2024 08:30:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717083026; cv=pass; d=google.com; s=arc-20160816; b=iu0/muhm6wdn6e3Ax2eepVgiam/zbVmX6S+0w1FSnWqigMNtUhlnnYZS3IqRutgg9F QGhM3CZTyQMto8G9XnEXKO1dxOLcQAPJn9dO8Dl7U65yaVWKFFNIK4RbdTQzbWIP6L8J oxkpyQ4m6Dgl86ffhUCL0MEU4b4bkSzHcBH9g09TJ5UqVj++K2YAbtPQz+DBxfT9ZRTW W1eW2v1NFnV9jThzxQBCwhinmicHDM9CDeoiZy324NJrqamMxkJ485H2EESbs5AvMPHH 4wkpnzcvI0KQE0wC44zsKN9Nq94mIk31GQmAjmcAA260vJl33QV6qbEBvOeBBXgNM82L 8J3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=vfRTfm9PXIfDsjwFwFKFqJQ/IgaytwUE/fEPjM3ptoM=; fh=UXYae3rQMLPF+I6ELZ0wvOmB5LvL+7C6M0baVbjpyOE=; b=R/0oVQ+z9u84T0YIU3mzwziKKiBqNN6d9RM+wQh8dmuyC+X2MhsQ4yf8u41UHZyg9K eOdf4Q7ztK+/2Lc3laXUZi1hhFx6hOrhSipXHRwgPECsXUglWD++dFEpzP4XvbE60Fhl v8ncSMl8mrXZrs0dhpP+aR0MnbxEs53LGyK3e/3sF4vhypPMX2XeGacKnZrJk0FPXarv bNesmrSv9c4oSeeYRpKrzVHfzsYDJCAVdmAGxG3gHzoZIljY4PGq0PXO8XbnDLzWZgXm fPmEWNc+rLmP1EfDecCjTCK1D79B4JYkP3hjFXjXUL/7bd6l/PLxYoDPtg0okZmo9qCd q49w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=RwxRXyhJ; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-195600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57852386aa4si7598665a12.175.2024.05.30.08.30.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 08:30:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=RwxRXyhJ; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-195600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7983A1F219BF for ; Thu, 30 May 2024 15:30:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E29317F507; Thu, 30 May 2024 15:30:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="RwxRXyhJ" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C9CC176246 for ; Thu, 30 May 2024 15:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717083021; cv=none; b=pJRLGk27sccETFrBa6ZW4gqxT1SG3oMc/lWkPU9OISaXnjuybxrRxiTeZUkrXqX2EF0aWS61optLoN3nLh5VXuGwGem9BIQSJlg30V4twZ+Ohs4k5xnflaF0GI4qMxJK4dVET1jCeeZVQ0cPRK3H+5D38aO7c3JLjYQTdcLTb+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717083021; c=relaxed/simple; bh=iaQfvQSJKPuqC/g7uIa9elYYZ+csDMb2TH/hJRRLu2c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kG8OnY5aywvOGGd+84pbf5mXFSOgk6rAzNicWjoDGofZvo2nk69xiJCKVeYVIHynbD/+8rP+0AqwXsqtLdiFAXKnDNxDbaoN7yvjhB2ja0lw+KcnF3/xICSakZWGpEYHk6aDiCsXpccX7fqLANcK2HdLKlfjg8xuq0idiSw6kgU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=RwxRXyhJ; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-421124a04d6so11061385e9.3 for ; Thu, 30 May 2024 08:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1717083017; x=1717687817; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vfRTfm9PXIfDsjwFwFKFqJQ/IgaytwUE/fEPjM3ptoM=; b=RwxRXyhJhkRItncwlXfKJajxvWK4y60x3N+EzuX6Kk62gFA3h1T1X9dDFfuVzRAQsS +h1tAuPkp7DiDB+us1DEpFjc2MUU0arDklSNBr22EoGhwsf5cimeZxMcPGes/NQG83Df eSzLJJuzEjIv/WVrkDrCWKIb541kyddFLhRNs23+LkTcj/IBoqvXVdvrzSGS6MfXDlE7 Pq1JXtyfpeqp0zDFm9RPU6Tl0AqEe+/9NcHp5avMdEiNafywN55O9A+PGgWzIE5pJUdZ 356DtD4a1uyseP4XUL3G4Iv3pg63PrH4IogdwoU2qb7/UDNkEWIwvW52j6crzEJpZHgq sXVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717083017; x=1717687817; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vfRTfm9PXIfDsjwFwFKFqJQ/IgaytwUE/fEPjM3ptoM=; b=m1S6JP2lM0VmAnG6IPk5dQ2/pwOXImRCgttDOOxw0qtxSsRyBWOGdvXMxRgc3A04hV 7g/jXcd/K/ThPLj2lAQpfHPy186qRXrHeFs6USrxhUIlszL9uUBXSukU4d1o7agEHAuo pp4SMpXw7tYAmsS3tsjwLQgMe8ptk/Q4sIjX/gwbSM8VDUzjKrenqm4X5ccvbKEz3reO cB/RO95S8Nrc+eDDrti4whpohNNDyqekEp14KDSulcSfYqZXrV6hoTwaFWILX0vNoJrr C9yP+390IY6z4w8Y4OCxg4SkebdH+ARJlQi0t2UDc2cnWqRZACyWkD/pjTCzTmHMWZk5 P/jA== X-Forwarded-Encrypted: i=1; AJvYcCUUyOou67yoV2E5L/43G9Exyrw+8dIHnxkP58KXnwQ/UU7sXwSieKyXAVb5HcoaIlSr+pg1vEzCt/gMMitKBojr6wdsEqxuUffaSjTW X-Gm-Message-State: AOJu0YxId96FUVWCE3DTN8ay2xEBZH8a9PwMXWI4tzrP/0/VZOUatyCt idQuNIEieiHKUaa4jldZTPvb666/IXIAUAbfyD3hA/7YqoYVyNGDTxA9lMd4QIc= X-Received: by 2002:a05:600c:3d8b:b0:421:29e1:998 with SMTP id 5b1f17b1804b1-42129e10af2mr9062085e9.39.1717083017479; Thu, 30 May 2024 08:30:17 -0700 (PDT) Received: from ?IPV6:2a10:bac0:b000:5de0:a23:f1c3:862a:5eac? ([2a10:bac0:b000:5de0:a23:f1c3:862a:5eac]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212706c952sm28153545e9.26.2024.05.30.08.30.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 May 2024 08:30:17 -0700 (PDT) Message-ID: <186d2d79-b7c2-4fab-8243-4c7080412074@suse.com> Date: Thu, 30 May 2024 18:30:15 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] prefetch: Add ARCH_HAS_PREFETCH definition when the architecture is not defined To: Youling Tang , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Mateusz Guzik , Youling Tang References: <20240529032059.899347-1-youling.tang@linux.dev> <20240529032059.899347-2-youling.tang@linux.dev> From: Nikolay Borisov Content-Language: en-US In-Reply-To: <20240529032059.899347-2-youling.tang@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 29.05.24 г. 6:20 ч., Youling Tang wrote: > From: Youling Tang > > After commit ab483570a13b ("x86 & generic: change to __builtin_prefetch()"), the > __builtin_prefetch implementation will be used by default, so add its definition > to return to a state similar to before commit[1]. I find those references to the past state somewhat confusing and not really adding sustenance to the explanation. > > Currently prefetch_range() will be empty implemented under the x86_64 architecture, > there was a concrete implementation before "x86 & generic: change to > __builtin_prefetch()", so fix it. Actually prefetch_range will be empty for every architecture which doesn't defined ARCH_HAS_PREFETCH and since we have a working generic fallback this indeed seems backwards. So defining ARCH_HAS_PREFETCH makes sense. Reviewed-by: Nikolay Borisov > > No similar changes have been made to ARCH_HAS_PREFETCHW at this time. > > [1]: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/include/linux/prefetch.h?id=8e4f2fd31bf737abb392e694898a1496157623b5 > > Fixes: ab483570a13b ("x86 & generic: change to __builtin_prefetch()") > Signed-off-by: Youling Tang > --- > include/linux/prefetch.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h > index b068e2e60939..162b7105e37c 100644 > --- a/include/linux/prefetch.h > +++ b/include/linux/prefetch.h > @@ -36,6 +36,7 @@ struct page; > */ > > #ifndef ARCH_HAS_PREFETCH > +#define ARCH_HAS_PREFETCH > #define prefetch(x) __builtin_prefetch(x) > #endif >