From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 66A6B1F8F14 for ; Wed, 8 Jan 2025 12:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736338414; cv=none; b=K/H8Q6NMmrv6xe6RmmG3OjJ7iKnVauXfYYrVlZi43rGXnZXbrgu1rbjYss/E2mnjRVOdB9gaa6mdW9ihZMtF/wsm40C1fZTQ6HdQZUeviC3DvmOZAGl65lN1pB3WQdverqzo5vJ5mPlxwzTZ1dyqBF+PxVSmTraaBRUWPJT+Ze8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736338414; c=relaxed/simple; bh=aTUCe0dIJTabxq65+duMjvQ0xwrlksWU9hqQl/Sd1VU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=POWgRdxCzq6FqbwkWAxRLv33NZEVX1x5m95c1QP8v3h3IJUc9+FklHpw6LH8YvFKBb5obQ8MkJOQx0uHS0fjZl0W417upF4RhxaTx3Eu6p7iGxEMbJQM8ZCBLOMCX1QE6vt3IM/MqZBQhg/24pdS8UXqtUb3b506SJwJcoj6SlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FWQgHzVE; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FWQgHzVE" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-43621d2dd4cso46835e9.0 for ; Wed, 08 Jan 2025 04:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736338412; x=1736943212; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RrYofVOoKvKwnZPsYWd13Rqdme4LuIQHlAMqCcS50NY=; b=FWQgHzVEKx9zRZFwZbAV5X+UrsV0EapC/rwS5LfOSuoeXd6fewgrmr6nBMdydpBDRj fvRsz83B6LQQxzx8AmQfzdUJQ2uBErn0LVAkoQOqX1VbCFBNE8pZ/C7vK22tZWdW8JPt upImf7lST8xzKJnh7fNyBzmylnArj2O32etdx8JibrVqfmyUdnJ15fhJyCTKDdmBJRA7 xr8OZsfyuojWNC+thHifJv2gbdwADGRa5cO4W7TIPJ84hGRF7VHOdgTLWxRXG2aTkuuv SFSFViqq73Re/WuPyg568ghUCxkxcJLseVfIC3SXlIE+fA2PgwlCoTRkbMm2XrfIu7QN S5tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736338412; x=1736943212; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RrYofVOoKvKwnZPsYWd13Rqdme4LuIQHlAMqCcS50NY=; b=hyOYvn30+yX+GhDSxGE+SsR/Dk4QegL2QoRyJsc4q/voJcMU2AwTOV9DyYHjVCtStu R3CwSWwPZz95d06J4LcR0SbLDdx3k8M4TseIWEQd2Nn6cwT380/lTIk03875d0kuLFfN 3TgBiGIQayMwoyO2VkjNmwc7JT51Ww5/nXRbzIQaZGxZby+kVqgixMTH73fzWtxbc5df 2hvxhwzmJPDRY8J+PMaPbmZ7fZYhx+X0OVq7AE3oBW41kXqzghcgE8BzOnpMuFEn2IU2 sytHhEvQ7aheoqrowmbKTAHdsEcfqOb2KCz8RnTnW9p8HD7dIb9wEo7BCtliky8aS9SE IDyA== X-Forwarded-Encrypted: i=1; AJvYcCURxfC+ToDQI+QhYvBkF2t60/VAv0PZxMPL060LTKurzRFqH52h8zFkK+NI9rLj0TV4ZnkqpuzIMb1l88g=@vger.kernel.org X-Gm-Message-State: AOJu0YzoqpNSkk4GYZC5NbN392U2zyW5fHfsxyMN6j7EeJCUOvMvsQ0j 5Hh1bQ6MDKFhRjYLRa62tFOvy1rkI7KNDHkfDGijt72kEEkFzLuT6GQGpbXZ9Q== X-Gm-Gg: ASbGncvzv7FsXybkZLNpT328SCqlJ+f2to31KgY3fR1xTaSBpJJ+nHbQZRBZcixDkhk nVTmkXB6bv2hjPb5YrYEG/46UdVhVNwByTwPKsvzABC6h3On6RpkqC8K+Z2+BCqafPVYykuyvub TNZjzGJIilHs8WpEVfi2G14nBSu+tAckahL+BE7MnRxhyE6u4nR6I6V75graIkv2EaMzXZK4flQ +ph9xWN+I0ElMl3GR0GWAAUXoS6k4fKLmjGzDVWg3MW0tSFk7+KK8RlxQE9EXrUDwTNpAG25qiE PJ4j4wRdY8E0+xc4UWU= X-Google-Smtp-Source: AGHT+IFSxU9Nih+nRcbTdqUehEVnjBOqg3Pc7JvHWVRd2oCHQ3onm9/9x+7dn/+oiTY0W8mf2rq1iQ== X-Received: by 2002:a05:600c:4818:b0:42c:9e35:cde6 with SMTP id 5b1f17b1804b1-436e1f879cdmr1023645e9.2.1736338411667; Wed, 08 Jan 2025 04:13:31 -0800 (PST) Received: from google.com (216.131.76.34.bc.googleusercontent.com. [34.76.131.216]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e89ca5sm18817135e9.29.2025.01.08.04.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 04:13:31 -0800 (PST) Date: Wed, 8 Jan 2025 12:13:27 +0000 From: Mostafa Saleh To: Jason Gunthorpe Cc: Robin Murphy , iommu@lists.linux.dev, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, robdclark@gmail.com, joro@8bytes.org, jean-philippe@linaro.org, nicolinc@nvidia.com, vdonnefort@google.com, qperret@google.com, tabba@google.com, danielmentz@google.com, tzukui@google.com Subject: Re: [RFC PATCH v2 55/58] drivers/iommu: Add deferred map_sg operations Message-ID: References: <20241212180423.1578358-1-smostafa@google.com> <20241212180423.1578358-56-smostafa@google.com> <20250102201831.GB26854@ziepe.ca> <20250103154757.GG26854@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250103154757.GG26854@ziepe.ca> On Fri, Jan 03, 2025 at 11:47:57AM -0400, Jason Gunthorpe wrote: > On Fri, Jan 03, 2025 at 03:35:20PM +0000, Mostafa Saleh wrote: > > > An alternative approach as Robin suggested, is to treat all iommu_map as sg map, > > and when the driver gets the iotlb_sync_map() call it can just issue the hypercall, > > however this call only provides the IOVA range, which requires extra work or locking > > as mentioned in the thread, and as Robin mentioned s390 doing something similar, > > I was highlighting that in their driver, this call only notifies the hypervisor > > about an IOVA and not an actual pv map as pKVM, so it much simpler in their case. > > Oh, that is much clearer, maybe incorporate some of that into the > commit message. Sure. > > We are going in a general direction of trying to make the fast dma > mapping path not require sg, so adding sg specific optimizations to > the low level driver is not good. > > Batching the hypercalls in the gather and then flushing to execute the > batch seems more reasonable. > > You could probably work on advancing this infrastructure separately > via virtio-iommu.. That was my impression also, I mentioned it in the commit message, but for virtio-iommu we need a change in the standard to define this operation, I can look into that. Thanks, Mostafa > > Jason