lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ba7d8da0-dcc3-40b8-ad99-50ec17a74573@redhat.com>
Date: Wed, 11 Dec 2024 11:57:38 +0100
From: Thomas Huth <thuth@...hat.com>
To: Matthew Rosato <mjrosato@...ux.ibm.com>, joro@...tes.org,
 will@...nel.org, robin.murphy@....com, gerald.schaefer@...ux.ibm.com,
 schnelle@...ux.ibm.com
Cc: hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
 svens@...ux.ibm.com, borntraeger@...ux.ibm.com, clegoate@...hat.com,
 iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
 linux-s390@...r.kernel.org
Subject: Re: [PATCH 3/7] iommu/s390: add basic routines for region 1st and 2nd
 tables

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@...ux.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ