Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1304911ybe; Fri, 6 Sep 2019 15:30:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwigARFU6i7kwXkMbIQ0Gm92/cBmLuhoSmjCgUzw7z+bdhfFVjIs6xxU3dJs+i8Z0SJ5Qfj X-Received: by 2002:a63:c203:: with SMTP id b3mr10052645pgd.450.1567809010512; Fri, 06 Sep 2019 15:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567809010; cv=none; d=google.com; s=arc-20160816; b=Wz9f7bGCYvKovVU4CYC0L+imsyWy+Ef757n1IVZX7CvhMFrDLPmVjEwH845G4kspd8 78oWHzvAKnemJDVD6fxakRB74H1LoxNVFClwS9/ic+fZKV1z45KyJjGBU9TAqTIyuIoX pRQeRa++5p5nUdgMDlii/Sqnou4StDi7vRv3ads+0vyvfMqe1KnRjWTICrEVvPa/YFjU +HwUf2tNrS4uNq52jA189BQBRG/mPJXmwfcRtcKjELrx+W+PB+H1bH5PS7VJHk2HlpXh 5uLH65i0LOgpwCHMWsxPmQo50Ot9xs/ffJs15XzpLysHfZaNQpBf3OwWlQXoMgExX7wW zp2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LcPHW4r8mffrhLcAn5ZQ28hULNrOVL421NpV7I5Fz7k=; b=VTOKX+j4l1GLciXZYrtdYejI7uat79cJYSbOvTCY5YQffgxS9tj7JSt5pCJblJgPRF M13QOZboDJPW2+LFbYMNdCGy4t7SVs/ZCf3xZoAQ9TZmiX00usk+UhMfZ84HI8e71Fie Lck6Ts2NFSrV14/3unLZzFkaqU0cLZJHV7xtRkUTrzfk9kJwlJtPFnWhf4Yq01+DWncB 27/om2rkUXXkxb+b8Hu4zHKylFaRAdM7sjq3Tktkm+6wfQpa/Jvc3FqCzwfikcA3TNX/ fyZxgWXY2gSPRCcoOFpLrv8dvO00lEHhgX+pxMwC9XlvswyV6s6t0dWI3wKaUWvfXkJm z7dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si5901633pjn.71.2019.09.06.15.29.55; Fri, 06 Sep 2019 15:30:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393850AbfIFOB2 (ORCPT + 99 others); Fri, 6 Sep 2019 10:01:28 -0400 Received: from verein.lst.de ([213.95.11.211]:57552 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732131AbfIFOB2 (ORCPT ); Fri, 6 Sep 2019 10:01:28 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C476768B05; Fri, 6 Sep 2019 16:01:23 +0200 (CEST) Date: Fri, 6 Sep 2019 16:01:23 +0200 From: Christoph Hellwig To: Boris Ostrovsky Cc: Christoph Hellwig , Stefano Stabellini , Konrad Rzeszutek Wilk , gross@suse.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/11] swiotlb-xen: simplify cache maintainance Message-ID: <20190906140123.GA9894@lst.de> References: <20190905113408.3104-1-hch@lst.de> <20190905113408.3104-10-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 09:52:12AM -0400, Boris Ostrovsky wrote: > We need nop definitions of these two for x86. > > Everything builds now but that's probably because the calls are under > 'if (!dev_is_dma_coherent(dev))' which is always false so compiler > optimized is out. I don't think we should rely on that. That is how a lot of the kernel works. Provide protypes only for code that is semantically compiled, but can't ever be called due to IS_ENABLED() checks. It took me a while to get used to it, but it actually is pretty nice as the linker does the work for you to check that it really is never called. Much better than say a BUILD_BUG_ON().