From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1254266180; Thu, 13 Feb 2025 20:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739478534; cv=none; b=Sdyuf9JbP/3avrCHM9N7gohjvk95NPoz4gj+w+vqFBbxp9/osnddLEV3v7+oOAs731zkiurafliIwbStpLb7fWTbIyOFqcL7MzTdE5Q63esEbq4amdG3Y7IaN3a851ituN46gLea2ULvcsCQAINVIPfR9HKVtNJ77l976+Wh1Vc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739478534; c=relaxed/simple; bh=nknWJ+z0SP3wafNg+nCOAUI+rJEqqS7g4A0g13t8JSE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IXn1rHNMxttky3KlVbJ7tq+Bw5CTIFnNjwLlZcaUrM4RtvyP2zo8tv9X5acWluTeXGkBzMpd5iU6hzmi+HNiUpOGNCh9yRqh5Gx8lQr/dZmzy9ncTNmn4x+q5OkEpUcLJ23xK0/xMqtFPjaOY8KLB1EAjLKiSkaCHqHR/lXdlJI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=UTxDWhaL; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="UTxDWhaL" Received: from DESKTOP-0403QTC. (unknown [20.236.11.102]) by linux.microsoft.com (Postfix) with ESMTPSA id 8833A203F3CB; Thu, 13 Feb 2025 12:28:51 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8833A203F3CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1739478532; bh=FVY3r1RNzm3lnez0t18kEbUj6IdxjFad9QEqEvSyVcs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:Reply-To:From; b=UTxDWhaLmrK+RIBYhfmZlfU+SvrmBBqYQNZoGWEz2tjVzT4yQC7trxO676DR7FvAV 1rlxBHV4FCCXWF8M730p8ExNvyaZGgFvqEd6wk9uuSze7bu1RwEhRWtPmYAAvWnkqh oXCBNq0UUKRMd8x9wwBieI4m3gmNo9QULiyx5tt4= Date: Thu, 13 Feb 2025 12:28:49 -0800 From: Jacob Pan To: Nicolin Chen Cc: , , , , , , , , , , , , , , , , , jacob.pan@linux.microsoft.com Subject: Re: [PATCH v1 01/13] genirq/msi: Store the IOMMU IOVA directly in msi_desc instead of iommu_cookie Message-ID: <20250213122849.34f5d1cb@DESKTOP-0403QTC.> In-Reply-To: References: Reply-To: jacob.pan@linux.microsoft.com X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Nicolin, On Sat, 8 Feb 2025 01:02:34 -0800 Nicolin Chen wrote: > -static inline void msi_desc_set_iommu_cookie(struct msi_desc *desc, > - const void > *iommu_cookie) +/** > + * iommu_dma_compose_msi_msg() - Apply translation to an MSI message > + * @desc: MSI descriptor prepared by iommu_dma_prepare_msi() > + * @msg: MSI message containing target physical address > + */ Is it IOVA not PA? > +static inline void iommu_dma_compose_msi_msg(struct msi_desc *desc, > + struct msi_msg *msg) > { > -} > +#ifdef CONFIG_IRQ_MSI_IOMMU > + if (desc->iommu_msi_page_shift) { > + u64 msi_iova = desc->iommu_msi_iova > + << desc->iommu_msi_page_shift; > + > + msg->address_hi = upper_32_bits(msi_iova); > + msg->address_lo = lower_32_bits(msi_iova) | > + (msg->address_lo & > + ((1 << > desc->iommu_msi_page_shift) - 1)); > + } > #endif > +}