From patchwork Thu Mar 20 15:45:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 26719 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EBD4B20143 for ; Thu, 20 Mar 2014 15:47:52 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf3566475iec.11 for ; Thu, 20 Mar 2014 08:47:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=nIxYIKvICckXrkrlCGNMdE6/DwkYMCR/NNpFVzdU4uQ=; b=L3K0VwZAgWDhI7eCPN3FGstm1wzfW+bUxBxLK1CfAJsiXlnmeBty9kaxcK6MyBL7nP d9weA90AM3jr18EHO12F6YeMFbgPv1jMWbJ5Afnq9PyHzdjvFnbvXctF7xFrapu/aHfB sVTJ7HWZ4x/KAlV0xjyZIGzC2jIAatncGAQo9tc+7449d5uFX8NlJiX62TL+S2DhTjph ExNWHo0SEsKTs84m59AhX827M3YZ6WTC47BQAnAgdkal0rVpCHALYaE3rtEjt97Q1DXb /ScTWRv1x+4Pk/f/eHJ0DhYI7OmlLx2KwepQlyJBrPpdrhXpzngVPltZZpAqMUnmXyNC ELfA== X-Gm-Message-State: ALoCoQlO2DqRBSuGPqVUQtgZViwV2Q6OP9rIo8joEz7/i36c7mOYSMEMfn/4HGakv87UasWn2uJh X-Received: by 10.182.19.231 with SMTP id i7mr3862556obe.25.1395330472379; Thu, 20 Mar 2014 08:47:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.209 with SMTP id f75ls316943qgd.48.gmail; Thu, 20 Mar 2014 08:47:52 -0700 (PDT) X-Received: by 10.52.173.165 with SMTP id bl5mr20032677vdc.13.1395330472295; Thu, 20 Mar 2014 08:47:52 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id j20si511933vcx.19.2014.03.20.08.47.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:47:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so1161209vcb.4 for ; Thu, 20 Mar 2014 08:47:52 -0700 (PDT) X-Received: by 10.58.77.37 with SMTP id p5mr463398vew.62.1395330472205; Thu, 20 Mar 2014 08:47:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp398572vck; Thu, 20 Mar 2014 08:47:51 -0700 (PDT) X-Received: by 10.221.22.71 with SMTP id qv7mr4302706vcb.34.1395330471465; Thu, 20 Mar 2014 08:47:51 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id yv5si517972veb.26.2014.03.20.08.47.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:47:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQfAb-0004AE-7p; Thu, 20 Mar 2014 15:46:13 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQfAZ-00049v-N2 for xen-devel@lists.xen.org; Thu, 20 Mar 2014 15:46:11 +0000 Received: from [85.158.143.35:62096] by server-3.bemta-4.messagelabs.com id 97/06-13602-34D0B235; Thu, 20 Mar 2014 15:46:11 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1395330368!3603483!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25725 invoked from network); 20 Mar 2014 15:46:10 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 20 Mar 2014 15:46:10 -0000 X-IronPort-AV: E=Sophos;i="4.97,695,1389744000"; d="scan'208";a="111935187" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 20 Mar 2014 15:46:07 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Thu, 20 Mar 2014 11:46:05 -0400 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WQfAT-0006O2-NN; Thu, 20 Mar 2014 15:46:05 +0000 From: Ian Campbell To: Date: Thu, 20 Mar 2014 15:45:49 +0000 Message-ID: <1395330365-9901-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395330336.3104.12.camel@kazak.uk.xensource.com> References: <1395330336.3104.12.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Keir Fraser , Ian Campbell , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, Jan Beulich Subject: [Xen-devel] [PATCH 01/17] xen: x86 & generic: change to __builtin_prefetch() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Quoting Andi Kleen in Linux b483570a13be from 2007: gcc 3.2+ supports __builtin_prefetch, so it's possible to use it on all architectures. Change the generic fallback in linux/prefetch.h to use it instead of noping it out. gcc should do the right thing when the architecture doesn't support prefetching Undefine the x86-64 inline assembler version and use the fallback. ARM wants to use the builtins. Fix a pair of spelling errors, one of which was from Lucas De Marchi in the Linux tree. Signed-off-by: Ian Campbell Cc: Keir Fraser Cc: Jan Beulich Reviewed-by: Jan Beulich --- xen/include/xen/prefetch.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/xen/include/xen/prefetch.h b/xen/include/xen/prefetch.h index 8d7d3ff..ba73998 100644 --- a/xen/include/xen/prefetch.h +++ b/xen/include/xen/prefetch.h @@ -28,24 +28,17 @@ prefetchw(x) - prefetches the cacheline at "x" for write spin_lock_prefetch(x) - prefectches the spinlock *x for taking - there is also PREFETCH_STRIDE which is the architecure-prefered + there is also PREFETCH_STRIDE which is the architecture-preferred "lookahead" size for prefetching streamed operations. */ -/* - * These cannot be do{}while(0) macros. See the mental gymnastics in - * the loop macro. - */ - #ifndef ARCH_HAS_PREFETCH -#define ARCH_HAS_PREFETCH -static inline void prefetch(const void *x) {;} +#define prefetch(x) __builtin_prefetch(x) #endif #ifndef ARCH_HAS_PREFETCHW -#define ARCH_HAS_PREFETCHW -static inline void prefetchw(const void *x) {;} +#define prefetchw(x) __builtin_prefetch(x,1) #endif #ifndef ARCH_HAS_SPINLOCK_PREFETCH