Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3704844imu; Mon, 28 Jan 2019 09:20:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN4TNU5hkvfeeoTcHOD6uj4jmm8+M3d5y8T7GzLvHswPz7QSPFZJ7bxIWMM0kBWMpomxw66y X-Received: by 2002:a17:902:c85:: with SMTP id 5mr22903195plt.339.1548696000750; Mon, 28 Jan 2019 09:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696000; cv=none; d=google.com; s=arc-20160816; b=E9GUgfcOrUeRfCGDQnapA0gQ4+MqpQ4y4rZN2ooJUzQ8owoRAqosx1UA7uZCqBwx5F 8lEzzM7YVA9TaEInruwOW0iT0N5cctLriDqRKG9Wb6yVEGUFgwV4VSViHE7+xb/kME7/ +3Em/Zeic33HvlNFckyR0niLx1v2v/SPOl72iAw2w/XLibTsew/T8sWy+1gWGKIlZZE0 h6BJwModsoptikPPNCO1mFCM6IYUIgYYf3WWWb127Lb9NHDaID+lSD/g2Uuz8uLAOOyG hVNsBNdznZxbrFvGKmrDJGHBh3vsZyemT7+QOanizDS9+HlLODjEmXDtMpsE6oQ4xAHP Ud8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=a4l/pRXbJ2iMX9tA7ZVQyy+UnFsrK4NLq5oRrG91tXw=; b=AVXThWH1M7LA5uc+zykXJuLYeaAh2ozy4Tma494fl6YOJVG4YbwY1EiJdqPa8Ka40K KYy0bneMREThoJGt8Iz5b+dOMCgrNbWu9GNmcCGt3KVKXTruw7OEiYaP+HTJdc4/CraS YOUJeb3tc9S0rGrkFJyxQJ2Bqq23acZ4h91VQUCmdrbQTh84Mk5Uv/wWD6oGarSHmmEF oy0ppQaij6IR/nTXcVbmbaXTZjxiYFZ8KXXkioQuJzSQDs76j1z9CPWtTeyrh6Wwn5Nx 7zOWm78MLG/OVmrfifNgG5/bZZ61pJBTk6q3/K59nLXftsdeLe+8rvDs/UmYBfetxubZ imQg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x24si32400424plr.379.2019.01.28.09.19.44; Mon, 28 Jan 2019 09:20:00 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732222AbfA1RTH (ORCPT + 99 others); Mon, 28 Jan 2019 12:19:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36354 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732138AbfA1RTF (ORCPT ); Mon, 28 Jan 2019 12:19:05 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A3BFC059B6D; Mon, 28 Jan 2019 17:19:04 +0000 (UTC) Received: from redhat.com (ovpn-123-79.rdu2.redhat.com [10.10.123.79]) by smtp.corp.redhat.com (Postfix) with SMTP id 1C4225DEB4; Mon, 28 Jan 2019 17:19:03 +0000 (UTC) Date: Mon, 28 Jan 2019 12:19:02 -0500 From: "Michael S. Tsirkin" To: Joerg Roedel Cc: Christoph Hellwig , Jason Wang , Konrad Rzeszutek Wilk , Jens Axboe , virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, jfehlig@suse.com, jon.grimm@amd.com, brijesh.singh@amd.com, jroedel@suse.de Subject: Re: [PATCH 2/5] swiotlb: Add is_swiotlb_active() function Message-ID: <20190128121749-mutt-send-email-mst@kernel.org> References: <20190123163049.24863-1-joro@8bytes.org> <20190123163049.24863-3-joro@8bytes.org> <20190123212755.GA9032@lst.de> <20190124082923.GI32526@8bytes.org> <20190124084107.GA19441@lst.de> <20190124150000.GN32526@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124150000.GN32526@8bytes.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 28 Jan 2019 17:19:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 24, 2019 at 04:00:00PM +0100, Joerg Roedel wrote: > On Thu, Jan 24, 2019 at 09:41:07AM +0100, Christoph Hellwig wrote: > > On Thu, Jan 24, 2019 at 09:29:23AM +0100, Joerg Roedel wrote: > > > > As I've just introduced and fixed a bug in this area in the current > > > > cycle - I don't think no_iotlb_memory is what your want (and maybe > > > > not useful at all): if the arch valls swiotlb_exit after previously > > > > initializing a buffer it won't be set. You probably want to check > > > > for non-zero io_tlb_start and/or io_tlb_end. > > > > > > Okay, but that requires that I also set io_tlb_start and friends back to > > > zero in the failure path of swiotlb_init(). Otherwise it could be left > > > non-zero in case swiotlb_init_with_tbl() returns an error. > > > > Indeed, and we'll need to do that anyway as otherwise the dma mapping > > path might cause problems similar to the one when swiotlb_exit is > > called that I fixed. > > Turns out the the error path in swiotlb_init() is redundant because it > will never be executed. If the function returns it will always return 0 > because in case of failure it will just panic (through memblock_alloc). > > I'll clean that up in a separate patch-set. There are more users of that > function and all of them panic when the function fails. > > > Joerg OK so are you going to post a new version then? Time's running out for 5.0. This isn't a regression so maybe we should just defer it all to 5.1. -- MST