From patchwork Wed Mar 26 13:38:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27126 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 41C2C20062 for ; Wed, 26 Mar 2014 13:40:43 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id pa12sf4618465veb.0 for ; Wed, 26 Mar 2014 06:40:43 -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=zxZ6knKFNfUPztFNfv/aM0O72I6Sy/IrbIUQ9wBTVuE=; b=nNJi8yYbnLvnWo37RTbkHhrfKRV5lejIJNuvRE+m8cXc/z4CtQOKNa3uCoRvpY46ER QxfWqRGiop2r+mTUwXRcdOJ/59ZQScxXHBtX/xQV0VowFfycPjCiw4P/lx1/FkUWJsr1 XEoHr/2E+2gBxir2rN3xAfO/+K6Aq9p61LH3hbsrONv4W6cZf+V7HyPszRxvRx1zZKW9 i4vyq1UPX5ZUrKxy0NPDnWMk2WbaS4VFcKcyZ42arFeEYDrmHNeMg6JHr+VOYr6B0Rsh N1FYanafw0tSRukRhyAaD6Swud5kaL5J3y0r6NAfduNDzfWKvgo5LcQvpm7Uj9P5Y+Yx 4qhw== X-Gm-Message-State: ALoCoQnRNIUQAKPLXvc3lDZlpaSWEfnVZkRgXjXIUYMRu0hO6TiJ2u6p4EzR5Ypz5Y1OD9Z2R/pf X-Received: by 10.236.179.66 with SMTP id g42mr28716737yhm.17.1395841242988; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.44.72 with SMTP id f66ls604487qga.47.gmail; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) X-Received: by 10.58.190.99 with SMTP id gp3mr556225vec.32.1395841242895; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id sv2si4636457vdc.39.2014.03.26.06.40.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:40:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id lf12so2327560vcb.39 for ; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) X-Received: by 10.58.4.68 with SMTP id i4mr2965982vei.8.1395841242808; Wed, 26 Mar 2014 06:40:42 -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 i9csp47118vck; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) X-Received: by 10.221.3.195 with SMTP id nz3mr179243vcb.35.1395841242238; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id av10si4532628ved.36.2014.03.26.06.40.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:40:42 -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 1WSo2l-0004OO-9o; Wed, 26 Mar 2014 13:38:59 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSo2i-0004Le-SA for xen-devel@lists.xen.org; Wed, 26 Mar 2014 13:38:57 +0000 Received: from [193.109.254.147:45235] by server-15.bemta-14.messagelabs.com id EC/BA-15813-078D2335; Wed, 26 Mar 2014 13:38:56 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1395841134!4276384!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12567 invoked from network); 26 Mar 2014 13:38:55 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 26 Mar 2014 13:38:55 -0000 X-IronPort-AV: E=Sophos;i="4.97,735,1389744000"; d="scan'208";a="115045014" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 26 Mar 2014 13:38:53 +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; Wed, 26 Mar 2014 09:38:52 -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 1WSo2f-00074X-2N; Wed, 26 Mar 2014 13:38:53 +0000 From: Ian Campbell To: Date: Wed, 26 Mar 2014 13:38:36 +0000 Message-ID: <1395841133-2223-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395841009.12547.11.camel@kazak.uk.xensource.com> References: <1395841009.12547.11.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Keir Fraser , julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v2 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.180 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 Reviewed-by: Jan Beulich Cc: Keir Fraser --- 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