From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 0536A2147F8 for ; Thu, 10 Apr 2025 23:50:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744329012; cv=none; b=SH7Ygbak0DeP4ZytfPk1IppfXn8xTkYE1DGfJJL3ptCHLDS3vprT8+B9S9xD/52mRt86RR9GRt+YHMIGhBn+7QIVSwklmJtlTkcM204wLXsrDBBYOMzinEaRTtP81gA7LeDiqCQEHdfTbBzluEj3rW1Lsy6DH1kR2nhm0Ly31xU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744329012; c=relaxed/simple; bh=/TaCDQD9gujPzgIz+tQm/iK3rlI3gN/6gBVv4SmlB8g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Iz1F+b8plaK5D5Hj2bHEkaDDXrotdebnPABIe7TY0/fG/VKEAFEfR+S5X5zkZL1LlZq155LBD1A2uM1nbTGv+9jtU2cVju6lIKfmCA1eAmTyRufdxhstZk6Y/2y2S5xZ/X9oEAcneVu+JCEtz9DLr2Ps8RmnFAXeh5P4Vqa8lS8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=G7szoQni; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="G7szoQni" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-7c5e2fe5f17so136190185a.3 for ; Thu, 10 Apr 2025 16:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1744329010; x=1744933810; 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=/TaCDQD9gujPzgIz+tQm/iK3rlI3gN/6gBVv4SmlB8g=; b=G7szoQniuDaYE9r1VZifZJkSrvwcrrp5IEflSaJx44rzXepOe20MWhpWsfRm/Giz+8 XqGqb4AMHIz/DTsGheZEag8RcG/gX1zDKffshath9cFAzTgfOKhpUuQg4u75vXpi67vh ymM6oBgbYwWGuklS7TQJc9hHVKuzCl+cRlww4XAem3Rq7DZAkCu216Z0zX++uJ9QDXv0 PMdurGnVq6AO4kv7u2yvghn58wjK99AlddW7VXY3d4cdUSlMhs5j0JWhh6t1PbuQb3Y0 1ii9SrCcRZJh+i7OiUwhAUscON72y0oHob55E9HOheDaRGa9NQbUaBASgdOXVSN3X7ik ytYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744329010; x=1744933810; 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=/TaCDQD9gujPzgIz+tQm/iK3rlI3gN/6gBVv4SmlB8g=; b=qpjISoe2X7a4wc+w2OZKcHLdBMubEmNLNABEV8lzUkl5JQFMSGDFf/U5uwhwRXjINv 4C2it9LMTDzQ6pzICpAh1U+48BAIOKalB8uPRNe6owzs7jU9ITY3Y70a+zYTGq8EYFQ3 TaWvdz3WGGVNDtwSXFIAnTe+bRtRJofyY5spswpdUSpX5ClY3dek+t8pGKCnhPyo8q/e p1XdKaGlNOOopoR8E3n47ezuUgfa9AD+lTABlyYEeS24d1+KmwvGI2zMRPJ7wHnc3Ail 58xQ+5l5MPVL+MSjzd02kAXXRbjHTnI8Mh8mCNL7b0/bcfdRd+C6eUDgb6SySUvbL6kk NANw== X-Forwarded-Encrypted: i=1; AJvYcCUX9Ym5P48V3slluX+fw1a4xlP9Nm2XV/o3cHKhg9VpLV4z3QGCSt9HP+jFLI0NIb4aYkTvZveE9TMQvZc=@vger.kernel.org X-Gm-Message-State: AOJu0YxicK28hkcXHzjau7FLpX7tWjCFY0rpEXTmx8M0jmPG3iXfTZyQ 3excUrQQcRvwTOlbjdAnXaxTQf+JeqeZAPdWo2rS3jGvpt2XVbDTPa4NVoznUkk= X-Gm-Gg: ASbGncvVSmJcNAjlfEJvRIclj2A6f07FXqhLi4pshV2N0LFM+HKCE790XprNSjKYrwL sPi0pmYAIAirh6MC5T8hbXf5v1xeHmS9UpiIRkdkFUj9XWoP2CI33+CeR3FRZHSiGDpUgQDAI1J ygvaJDpddEDt2JzSdniW97xF0cwnV6wKztQxe3OiCC3H9kUKZLJpPPIOA48is+oDocCvHk42EX3 eAhKmojDYeYpURYCCu/QrNpU51l++j32wRNOeTsmh3jHvlehiMkFooCN4LXPPJRozbbR0Q1fiqz rSVqU1G2BnKmW9FYVOwMUBgZg4ik67db0M7okGkCCss96eNwY9l5HoEgbE1GqGMO+1xhO5t1RC2 uiJK89bWIhOS2N/MfWhU= X-Google-Smtp-Source: AGHT+IGBLI6Qr1HBGp7OT4pcrwS60eByYVaVonZGYRx+m25dpRuIj9JKldOpH5t3hWR9bGfwXIeN2g== X-Received: by 2002:a05:620a:c4a:b0:7c5:18bb:f8b8 with SMTP id af79cd13be357-7c7af0bd257mr150080685a.1.1744329009833; Thu, 10 Apr 2025 16:50:09 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-167-219-86.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.167.219.86]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c7a89f9639sm169568385a.78.2025.04.10.16.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 16:50:09 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1u31eq-00000000N6G-3QH5; Thu, 10 Apr 2025 20:50:08 -0300 Date: Thu, 10 Apr 2025 20:50:08 -0300 From: Jason Gunthorpe To: Dan Williams Cc: Roman Kisel , Robin Murphy , aleksander.lobakin@intel.com, andriy.shevchenko@linux.intel.com, arnd@arndb.de, bp@alien8.de, catalin.marinas@arm.com, corbet@lwn.net, dakr@kernel.org, dave.hansen@linux.intel.com, decui@microsoft.com, gregkh@linuxfoundation.org, haiyangz@microsoft.com, hch@lst.de, hpa@zytor.com, James.Bottomley@hansenpartnership.com, Jonathan.Cameron@huawei.com, kys@microsoft.com, leon@kernel.org, lukas@wunner.de, luto@kernel.org, m.szyprowski@samsung.com, martin.petersen@oracle.com, mingo@redhat.com, peterz@infradead.org, quic_zijuhu@quicinc.com, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, x86@kernel.org, apais@microsoft.com, benhill@microsoft.com, bperkins@microsoft.com, sunilmut@microsoft.com, Suzuki K Poulose , linux-coco@lists.linux.dev Subject: Re: [PATCH hyperv-next 5/6] arch, drivers: Add device struct bitfield to not bounce-buffer Message-ID: <20250410235008.GC63245@ziepe.ca> References: <20250409000835.285105-1-romank@linux.microsoft.com> <20250409000835.285105-6-romank@linux.microsoft.com> <0eb87302-fae8-4708-aaf8-d16e836e727f@arm.com> <0ab2849a-5c03-4a8c-891e-3cb89b20b0e4@linux.microsoft.com> <67f703099f124_71fe2949e@dwillia2-xfh.jf.intel.com.notmuch> Precedence: bulk X-Mailing-List: linux-hyperv@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: <67f703099f124_71fe2949e@dwillia2-xfh.jf.intel.com.notmuch> On Wed, Apr 09, 2025 at 04:30:17PM -0700, Dan Williams wrote: > Like Christoph said, a driver really has no business opting itself into > different DMA addressing domains. For TDISP we are also being careful to > make sure that flipping a device from shared to private is a suitably > violent event. This is because the Linux DMA layer does not have a > concept of allowing a device to have mappings from two different > addressing domains simultaneously. And this is a very important point, several of the architectures have two completely independent iommu tables, and maybe even completely different IOMMU instances for trusted and non-trusted DMA traffic. I expect configurations where trusted traffic is translated through the vIOMMU while non-trusted traffic is locked to an identity translation. There are more issue here than just swiotlb :\ > A "private_capable" flag might also make sense, but that is really a > property of a bus that need not be carried necessarily in 'struct > device'. However it works, it should be done before the driver is probed and remain stable for the duration of the driver attachment. From the iommu side the correct iommu domain, on the correct IOMMU instance to handle the expected traffic should be setup as the DMA API's iommu domain. Jason