From: Thomas Huth <thuth@redhat.com>
To: Matthew Rosato <mjrosato@linux.ibm.com>,
joro@8bytes.org, will@kernel.org, robin.murphy@arm.com,
gerald.schaefer@linux.ibm.com, schnelle@linux.ibm.com
Cc: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com,
svens@linux.ibm.com, borntraeger@linux.ibm.com,
clegoate@redhat.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH 3/7] iommu/s390: add basic routines for region 1st and 2nd tables
Date: Wed, 11 Dec 2024 11:57:38 +0100 [thread overview]
Message-ID: <ba7d8da0-dcc3-40b8-ad99-50ec17a74573@redhat.com> (raw)
In-Reply-To: <20241209192549.107226-4-mjrosato@linux.ibm.com>
On 09/12/2024 20.25, Matthew Rosato wrote:
> Add common routines for region first and region second tables, similar
> to what already exists for region third tables. Routines added are
> for determining an index value based on address, getting and setting
> origin flags, and validating entries.
> These routines are not yet used, but will be in subsequent commits.
>
> Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
> ---
> arch/s390/include/asm/pci_dma.h | 2 ++
> drivers/iommu/s390-iommu.c | 56 +++++++++++++++++++++++++++++++++
> 2 files changed, 58 insertions(+)
>
> diff --git a/arch/s390/include/asm/pci_dma.h b/arch/s390/include/asm/pci_dma.h
> index 42d7cc4262ca..8d8962e4fd58 100644
> --- a/arch/s390/include/asm/pci_dma.h
> +++ b/arch/s390/include/asm/pci_dma.h
> @@ -55,6 +55,8 @@ enum zpci_ioat_dtype {
> #define ZPCI_PT_BITS 8
> #define ZPCI_ST_SHIFT (ZPCI_PT_BITS + PAGE_SHIFT)
> #define ZPCI_RT_SHIFT (ZPCI_ST_SHIFT + ZPCI_TABLE_BITS)
> +#define ZPCI_RS_SHIFT (ZPCI_RT_SHIFT + ZPCI_TABLE_BITS)
> +#define ZPCI_RF_SHIFT (ZPCI_RS_SHIFT + ZPCI_TABLE_BITS)
>
> #define ZPCI_RTE_FLAG_MASK 0x3fffUL
> #define ZPCI_RTE_ADDR_MASK (~ZPCI_RTE_FLAG_MASK)
> diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c
> index f6c27b6ab4c6..fcebc7415fb3 100644
> --- a/drivers/iommu/s390-iommu.c
> +++ b/drivers/iommu/s390-iommu.c
> @@ -36,6 +36,16 @@ struct s390_domain {
>
> static struct iommu_domain blocking_domain;
>
> +static inline unsigned int calc_rfx(dma_addr_t ptr)
> +{
> + return ((unsigned long)ptr >> ZPCI_RF_SHIFT) & ZPCI_INDEX_MASK;
> +}
Hi Matthew!
Correct me if I'm wrong, but IIRC Clang will barf at you when you declare a
"static inline" function in a .c file without using it? So this might break
bisection later when using Clang and -Werror ... maybe it's better to
introduce the functions just when they are also used?
Thomas
next prev parent reply other threads:[~2024-12-11 10:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 19:25 [PATCH 0/7] iommu/s390: support additional table regions Matthew Rosato
2024-12-09 19:25 ` [PATCH 1/7] iommu/s390: add initial fields to track table size Matthew Rosato
2024-12-09 19:25 ` [PATCH 2/7] s390/pci: set appropriate IOTA region type Matthew Rosato
2024-12-09 19:25 ` [PATCH 3/7] iommu/s390: add basic routines for region 1st and 2nd tables Matthew Rosato
2024-12-11 10:57 ` Thomas Huth [this message]
2024-12-09 19:25 ` [PATCH 4/7] iommu/s390: support cleanup of additional table regions Matthew Rosato
2024-12-09 19:25 ` [PATCH 5/7] iommu/s390: support iova_to_phys for " Matthew Rosato
2024-12-09 19:25 ` [PATCH 6/7] iommu/s390: support map/unmap " Matthew Rosato
2024-12-09 19:25 ` [PATCH 7/7] iommu/s390: allow larger region tables Matthew Rosato
2024-12-09 19:27 ` [PATCH 0/7] iommu/s390: support additional table regions Matthew Rosato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba7d8da0-dcc3-40b8-ad99-50ec17a74573@redhat.com \
--to=thuth@redhat.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=clegoate@redhat.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=robin.murphy@arm.com \
--cc=schnelle@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®