All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Al Stone <al.stone@linaro.org>,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: linaro-kernel@lists.linaro.org, linux-ia64@vger.kernel.org,
	Jason Cooper <jason@lakedaemon.net>,
	patches@linaro.org, Catalin Marinas <catalin.marinas@arm.com>,
	linux-pm@vger.kernel.org, linaro-acpi@lists.linaro.org,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY
Date: Fri, 07 Aug 2015 10:04:22 +0100	[thread overview]
Message-ID: <55C47496.5070902@arm.com> (raw)
In-Reply-To: <1438894770-31163-3-git-send-email-al.stone@linaro.org>

Hi Al,

On 06/08/15 21:59, Al Stone wrote:
> Now that we have introduced the bad_madt_entry() function, and that
> function is being invoked in acpi_table_parse_madt() for us, there
> is no longer any need to use the BAD_MADT_ENTRY macro, or in the case
> of arm64, the BAD_MADT_GICC_ENTRY, too.
> 
> Signed-off-by: Al Stone <al.stone@linaro.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm64/include/asm/acpi.h | 8 --------
>  arch/arm64/kernel/smp.c       | 2 --
>  drivers/irqchip/irq-gic.c     | 6 ------
>  3 files changed, 16 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
> index 406485e..39248d3 100644
> --- a/arch/arm64/include/asm/acpi.h
> +++ b/arch/arm64/include/asm/acpi.h
> @@ -19,14 +19,6 @@
>  #include <asm/psci.h>
>  #include <asm/smp_plat.h>
>  
> -/* Macros for consistency checks of the GICC subtable of MADT */
> -#define ACPI_MADT_GICC_LENGTH	\
> -	(acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
> -
> -#define BAD_MADT_GICC_ENTRY(entry, end)						\
> -	(!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
> -	 (entry)->header.length != ACPI_MADT_GICC_LENGTH)
> -
>  /* Basic configuration for ACPI */
>  #ifdef	CONFIG_ACPI
>  /* ACPI table mapping after acpi_gbl_permanent_mmap is set */
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 50fb469..acd3b27 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -438,8 +438,6 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header,
>  	struct acpi_madt_generic_interrupt *processor;
>  
>  	processor = (struct acpi_madt_generic_interrupt *)header;
> -	if (BAD_MADT_GICC_ENTRY(processor, end))
> -		return -EINVAL;
>  
>  	acpi_table_print_madt_entry(header);
>  
> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> index 4dd8826..2735611 100644
> --- a/drivers/irqchip/irq-gic.c
> +++ b/drivers/irqchip/irq-gic.c
> @@ -1055,9 +1055,6 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
>  
>  	processor = (struct acpi_madt_generic_interrupt *)header;
>  
> -	if (BAD_MADT_GICC_ENTRY(processor, end))
> -		return -EINVAL;
> -
>  	/*
>  	 * There is no support for non-banked GICv1/2 register in ACPI spec.
>  	 * All CPU interface addresses have to be the same.
> @@ -1079,9 +1076,6 @@ gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header,
>  
>  	dist = (struct acpi_madt_generic_distributor *)header;
>  
> -	if (BAD_MADT_ENTRY(dist, end))
> -		return -EINVAL;
> -
>  	dist_phy_base = dist->base_address;
>  	return 0;
>  }
> 

Thanks a lot for doing this - the proliferation of this macro has been
driving me insane.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <marc.zyngier@arm.com>
To: Al Stone <al.stone@linaro.org>,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: linaro-kernel@lists.linaro.org, linux-ia64@vger.kernel.org,
	Jason Cooper <jason@lakedaemon.net>,
	patches@linaro.org, Catalin Marinas <catalin.marinas@arm.com>,
	linux-pm@vger.kernel.org, linaro-acpi@lists.linaro.org,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY
Date: Fri, 07 Aug 2015 09:04:22 +0000	[thread overview]
Message-ID: <55C47496.5070902@arm.com> (raw)
In-Reply-To: <1438894770-31163-3-git-send-email-al.stone@linaro.org>

Hi Al,

On 06/08/15 21:59, Al Stone wrote:
> Now that we have introduced the bad_madt_entry() function, and that
> function is being invoked in acpi_table_parse_madt() for us, there
> is no longer any need to use the BAD_MADT_ENTRY macro, or in the case
> of arm64, the BAD_MADT_GICC_ENTRY, too.
> 
> Signed-off-by: Al Stone <al.stone@linaro.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm64/include/asm/acpi.h | 8 --------
>  arch/arm64/kernel/smp.c       | 2 --
>  drivers/irqchip/irq-gic.c     | 6 ------
>  3 files changed, 16 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
> index 406485e..39248d3 100644
> --- a/arch/arm64/include/asm/acpi.h
> +++ b/arch/arm64/include/asm/acpi.h
> @@ -19,14 +19,6 @@
>  #include <asm/psci.h>
>  #include <asm/smp_plat.h>
>  
> -/* Macros for consistency checks of the GICC subtable of MADT */
> -#define ACPI_MADT_GICC_LENGTH	\
> -	(acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
> -
> -#define BAD_MADT_GICC_ENTRY(entry, end)						\
> -	(!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
> -	 (entry)->header.length != ACPI_MADT_GICC_LENGTH)
> -
>  /* Basic configuration for ACPI */
>  #ifdef	CONFIG_ACPI
>  /* ACPI table mapping after acpi_gbl_permanent_mmap is set */
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 50fb469..acd3b27 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -438,8 +438,6 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header,
>  	struct acpi_madt_generic_interrupt *processor;
>  
>  	processor = (struct acpi_madt_generic_interrupt *)header;
> -	if (BAD_MADT_GICC_ENTRY(processor, end))
> -		return -EINVAL;
>  
>  	acpi_table_print_madt_entry(header);
>  
> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> index 4dd8826..2735611 100644
> --- a/drivers/irqchip/irq-gic.c
> +++ b/drivers/irqchip/irq-gic.c
> @@ -1055,9 +1055,6 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
>  
>  	processor = (struct acpi_madt_generic_interrupt *)header;
>  
> -	if (BAD_MADT_GICC_ENTRY(processor, end))
> -		return -EINVAL;
> -
>  	/*
>  	 * There is no support for non-banked GICv1/2 register in ACPI spec.
>  	 * All CPU interface addresses have to be the same.
> @@ -1079,9 +1076,6 @@ gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header,
>  
>  	dist = (struct acpi_madt_generic_distributor *)header;
>  
> -	if (BAD_MADT_ENTRY(dist, end))
> -		return -EINVAL;
> -
>  	dist_phy_base = dist->base_address;
>  	return 0;
>  }
> 

Thanks a lot for doing this - the proliferation of this macro has been
driving me insane.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY
Date: Fri, 07 Aug 2015 10:04:22 +0100	[thread overview]
Message-ID: <55C47496.5070902@arm.com> (raw)
In-Reply-To: <1438894770-31163-3-git-send-email-al.stone@linaro.org>

Hi Al,

On 06/08/15 21:59, Al Stone wrote:
> Now that we have introduced the bad_madt_entry() function, and that
> function is being invoked in acpi_table_parse_madt() for us, there
> is no longer any need to use the BAD_MADT_ENTRY macro, or in the case
> of arm64, the BAD_MADT_GICC_ENTRY, too.
> 
> Signed-off-by: Al Stone <al.stone@linaro.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm64/include/asm/acpi.h | 8 --------
>  arch/arm64/kernel/smp.c       | 2 --
>  drivers/irqchip/irq-gic.c     | 6 ------
>  3 files changed, 16 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
> index 406485e..39248d3 100644
> --- a/arch/arm64/include/asm/acpi.h
> +++ b/arch/arm64/include/asm/acpi.h
> @@ -19,14 +19,6 @@
>  #include <asm/psci.h>
>  #include <asm/smp_plat.h>
>  
> -/* Macros for consistency checks of the GICC subtable of MADT */
> -#define ACPI_MADT_GICC_LENGTH	\
> -	(acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
> -
> -#define BAD_MADT_GICC_ENTRY(entry, end)						\
> -	(!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
> -	 (entry)->header.length != ACPI_MADT_GICC_LENGTH)
> -
>  /* Basic configuration for ACPI */
>  #ifdef	CONFIG_ACPI
>  /* ACPI table mapping after acpi_gbl_permanent_mmap is set */
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 50fb469..acd3b27 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -438,8 +438,6 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header,
>  	struct acpi_madt_generic_interrupt *processor;
>  
>  	processor = (struct acpi_madt_generic_interrupt *)header;
> -	if (BAD_MADT_GICC_ENTRY(processor, end))
> -		return -EINVAL;
>  
>  	acpi_table_print_madt_entry(header);
>  
> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> index 4dd8826..2735611 100644
> --- a/drivers/irqchip/irq-gic.c
> +++ b/drivers/irqchip/irq-gic.c
> @@ -1055,9 +1055,6 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
>  
>  	processor = (struct acpi_madt_generic_interrupt *)header;
>  
> -	if (BAD_MADT_GICC_ENTRY(processor, end))
> -		return -EINVAL;
> -
>  	/*
>  	 * There is no support for non-banked GICv1/2 register in ACPI spec.
>  	 * All CPU interface addresses have to be the same.
> @@ -1079,9 +1076,6 @@ gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header,
>  
>  	dist = (struct acpi_madt_generic_distributor *)header;
>  
> -	if (BAD_MADT_ENTRY(dist, end))
> -		return -EINVAL;
> -
>  	dist_phy_base = dist->base_address;
>  	return 0;
>  }
> 

Thanks a lot for doing this - the proliferation of this macro has been
driving me insane.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2015-08-07  9:04 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 20:59 [PATCH 0/5] ACPI: Provide better MADT subtable sanity checks Al Stone
2015-08-06 20:59 ` Al Stone
2015-08-06 20:59 ` Al Stone
2015-08-06 20:59 ` [PATCH 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-12 22:35   ` [Linaro-acpi] " Timur Tabi
2015-08-12 22:35     ` Timur Tabi
2015-08-12 22:35     ` [Linaro-acpi] [PATCH 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the mac Timur Tabi
2015-08-13  9:30     ` [Linaro-acpi] [PATCH 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Hanjun Guo
2015-08-13  9:30       ` Hanjun Guo
2015-08-13  9:30       ` [Linaro-acpi] [PATCH 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the mac Hanjun Guo
2015-08-13 15:43     ` [Linaro-acpi] [PATCH 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Al Stone
2015-08-13 15:43       ` Al Stone
2015-08-13 15:43       ` [Linaro-acpi] [PATCH 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the mac Al Stone
2015-08-13  9:28   ` [PATCH 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Hanjun Guo
2015-08-13  9:28     ` Hanjun Guo
2015-08-13  9:28     ` Hanjun Guo
2015-08-06 20:59 ` [PATCH 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-07  9:04   ` Marc Zyngier [this message]
2015-08-07  9:04     ` Marc Zyngier
2015-08-07  9:04     ` Marc Zyngier
2015-08-07 16:57   ` Catalin Marinas
2015-08-07 16:57     ` Catalin Marinas
2015-08-07 16:57     ` Catalin Marinas
2015-08-06 20:59 ` [PATCH 3/5] ACPI / IA64: remove usage of BAD_MADT_ENTRY Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59 ` [PATCH 4/5] ACPI / X86: " Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59 ` [PATCH 5/5] ACPI: remove definition of BAD_MADT_ENTRY macro Al Stone
2015-08-06 20:59   ` Al Stone
2015-08-06 20:59   ` Al Stone

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=55C47496.5070902@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=al.stone@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=jason@lakedaemon.net \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.