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] [thread-next>] [day] [month] [year] [list]
Message-ID: <YTEGhPnQkgOiOHf7@kernel.org>
Date:   Thu, 2 Sep 2021 20:14:44 +0300
From:   Mike Rapoport <rppt@...nel.org>
To:     Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc:     linux-kernel@...r.kernel.org, vijayendra.suman@...cle.com,
        mlombard@...hat.com, pjones@...hat.com,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM

On Thu, Sep 02, 2021 at 02:03:13PM +0000, Konrad Rzeszutek Wilk wrote:
> The isa_bus_to_virt is only needed under X86 and in fact the code
> that sets the ibft_phys_addr is only compiled under X86.
> 
> As such lets just ifdef the code.
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Vijayendra Suman <vijayendra.suman@...cle.com>
> CC: Maurizio Lombardi <mlombard@...hat.com>
> CC: Mike Rapoport <rppt@...nel.org>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
> ---
>  drivers/firmware/iscsi_ibft.c | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
> index 612a59e213df..7cde1a7a3ab1 100644
> --- a/drivers/firmware/iscsi_ibft.c
> +++ b/drivers/firmware/iscsi_ibft.c
> @@ -86,7 +86,7 @@ MODULE_VERSION(IBFT_ISCSI_VERSION);
>  
>  static struct acpi_table_ibft *ibft_addr;
>  
> -#ifndef CONFIG_ISCSI_IBFT_FIND
> +#ifdef CONFIG_ISCSI_IBFT_FIND
>  phys_addr_t ibft_phys_addr;
>  #endif

I think this declaration should be removed after you added
acpi_find_ibft_region().

Before your changes we had ibft_phys_addr defined in iscsi_ibft_find.c for
CONFIG_ISCSI_IBFT_FIND=y and the declaration above was needed to avoid
compilation error in ibft_init().

With the only use of ibft_phys_addr hidden under #ifdef CONFIG_ISCSI_IBFT_FIND
this declaration actually hides ibft_phys_addr defined in
iscsi_ibft_find.c.

>  
> @@ -851,7 +851,21 @@ static void __init acpi_find_ibft_region(void)
>  {
>  }
>  #endif
> -
> +#ifdef CONFIG_ISCSI_IBFT_FIND
> +static int __init acpi_find_isa_region(void)
> +{
> +	if (ibft_phys_addr) {
> +		ibft_addr = isa_bus_to_virt(ibft_phys_addr);
> +		return 0;
> +	}
> +	return -ENODEV;
> +}
> +#else
> +static int __init acpi_find_isa_region(void)
> +{
> +	return -ENODEV;
> +}
> +#endif
>  /*
>   * ibft_init() - creates sysfs tree entries for the iBFT data.
>   */
> @@ -864,9 +878,7 @@ static int __init ibft_init(void)
>  	   is called before ACPI tables are parsed and it only does
>  	   legacy finding.
>  	*/
> -	if (ibft_phys_addr)
> -		ibft_addr = isa_bus_to_virt(ibft_phys_addr);
> -	else
> +	if (acpi_find_isa_region())
>  		acpi_find_ibft_region();
>  
>  	if (ibft_addr) {
> -- 
> 2.27.0
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ