Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-07-06 Thread Arnd Bergmann
On Wed, Jul 6, 2022 at 8:33 AM Christophe Leroy
 wrote:

> As far as I can see in Kconfig, CONFIG_MMU is user selectable on the
> following architectures:
> - ARM
> - M68K
> - RISCV
> - SH
>
> And is disabled by default on XTENSA.

Right, the list is complete, though it's also default-enabled for
every CPU core on xtensa, and you can only disable it for
"custom" CPU cores.

Arnd

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-07-06 Thread Anshuman Khandual



On 7/6/22 12:34, Arnd Bergmann wrote:
> On Wed, Jul 6, 2022 at 8:33 AM Christophe Leroy
>  wrote:
> 
>> As far as I can see in Kconfig, CONFIG_MMU is user selectable on the
>> following architectures:
>> - ARM
>> - M68K
>> - RISCV
>> - SH
>>
>> And is disabled by default on XTENSA.
> 
> Right, the list is complete, though it's also default-enabled for
> every CPU core on xtensa, and you can only disable it for
> "custom" CPU cores.

ARM, M68K, RISCV all have got them inside wrapper or files which are
not built, without CONFIG_MMU. With build fixes for SH and XTENSA on
linux-next, I guess we are good.

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 2/3] m68k: bitops: Change __fls to return and accept unsigned long

2022-07-06 Thread Geert Uytterhoeven
On Fri, May 27, 2022 at 1:53 PM Amadeusz Sławiński
 wrote:
> As per asm-generic definition and other architectures __fls should
> return and accept unsigned long as its parameter.
>
> No functional change is expected as return value should fit in unsigned
> long.
>
> Reviewed-by: Cezary Rojewski 
> Signed-off-by: Amadeusz Sławiński 

Reviewed-by: Geert Uytterhoeven 
i.e. will queue in the m68k for-v5.20 branch.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 19/36] objtool/idle: Validate __cpuidle code as noinstr

2022-07-06 Thread Geert Uytterhoeven
On Wed, Jun 8, 2022 at 4:46 PM Peter Zijlstra  wrote:
> Idle code is very like entry code in that RCU isn't available. As
> such, add a little validation.
>
> Signed-off-by: Peter Zijlstra (Intel) 

>  arch/m68k/kernel/vmlinux-nommu.lds   |1 -
>  arch/m68k/kernel/vmlinux-std.lds |1 -
>  arch/m68k/kernel/vmlinux-sun3.lds|1 -

FWIW
Acked-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH V6 21/26] m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-06 Thread Geert Uytterhoeven
Hi Anshuman,

On Thu, Jun 30, 2022 at 7:19 AM Anshuman Khandual
 wrote:
> This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard
> vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks
> up a private and static protection_map[] array. Subsequently all __SXXX and
> __PXXX macros can be dropped which are no longer needed.
>
> Cc: Thomas Bogendoerfer 
> Cc: linux-m...@lists.linux-m68k.org
> Cc: linux-ker...@vger.kernel.org
> Signed-off-by: Anshuman Khandual 

Thanks for your patch!

> --- a/arch/m68k/include/asm/mcf_pgtable.h
> +++ b/arch/m68k/include/asm/mcf_pgtable.h
> @@ -91,60 +91,6 @@
>   * for use. In general, the bit positions are xwr, and P-items are
>   * private, the S-items are shared.
>   */

The comment above should be removed, too.

> -#define __P000 PAGE_NONE
> -#define __P001 __pgprot(CF_PAGE_VALID \
> -| CF_PAGE_ACCESSED \
> -| CF_PAGE_READABLE)

> --- a/arch/m68k/include/asm/motorola_pgtable.h
> +++ b/arch/m68k/include/asm/motorola_pgtable.h
> @@ -83,28 +83,6 @@ extern unsigned long mm_cachebits;
>  #define PAGE_COPY_C__pgprot(_PAGE_PRESENT | _PAGE_RONLY | _PAGE_ACCESSED)
>  #define PAGE_READONLY_C__pgprot(_PAGE_PRESENT | _PAGE_RONLY | 
> _PAGE_ACCESSED)

You might move the *_C definitions above into arch/m68k/mm/motorola.c
as well, as they are only used in the latter.

>
> -/*
> - * The m68k can't do page protection for execute, and considers that the 
> same are read.
> - * Also, write permissions imply read permissions. This is the closest we 
> can get..
> - */
> -#define __P000 PAGE_NONE_C
> -#define __P001 PAGE_READONLY_C
> -#define __P010 PAGE_COPY_C
> -#define __P011 PAGE_COPY_C
> -#define __P100 PAGE_READONLY_C
> -#define __P101 PAGE_READONLY_C
> -#define __P110 PAGE_COPY_C
> -#define __P111 PAGE_COPY_C
> -
> -#define __S000 PAGE_NONE_C
> -#define __S001 PAGE_READONLY_C
> -#define __S010 PAGE_SHARED_C
> -#define __S011 PAGE_SHARED_C
> -#define __S100 PAGE_READONLY_C
> -#define __S101 PAGE_READONLY_C
> -#define __S110 PAGE_SHARED_C
> -#define __S111 PAGE_SHARED_C
> -
>  #define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))
>
>  /*
> diff --git a/arch/m68k/include/asm/sun3_pgtable.h 
> b/arch/m68k/include/asm/sun3_pgtable.h
> index 5e4e753f0d24..9d919491765b 100644
> --- a/arch/m68k/include/asm/sun3_pgtable.h
> +++ b/arch/m68k/include/asm/sun3_pgtable.h
> @@ -71,23 +71,6 @@
>   * protection settings, valid (implying read and execute) and writeable. 
> These
>   * are as close as we can get...
>   */

The comment above should be removed, too.

> -#define __P000 PAGE_NONE
> -#define __P001 PAGE_READONLY

With the above fixed:
Reviewed-by: Geert Uytterhoeven 
Acked-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH V6 26/26] mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT

2022-07-06 Thread Geert Uytterhoeven
On Thu, Jun 30, 2022 at 7:20 AM Anshuman Khandual
 wrote:
> Now all the platforms enable ARCH_HAS_GET_PAGE_PROT. They define and export
> own vm_get_page_prot() whether custom or standard DECLARE_VM_GET_PAGE_PROT.
> Hence there is no need for default generic fallback for vm_get_page_prot().
> Just drop this fallback and also ARCH_HAS_GET_PAGE_PROT mechanism.
>
> Cc: Andrew Morton 
> Cc: linux...@kvack.org
> Cc: linux-ker...@vger.kernel.org
> Reviewed-by: Christoph Hellwig 
> Reviewed-by: Christophe Leroy 
> Signed-off-by: Anshuman Khandual 

>  arch/m68k/Kconfig   |  1 -

Reviewed-by: Geert Uytterhoeven 
Acked-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH V6 21/26] m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-06 Thread Anshuman Khandual



On 7/6/22 15:33, Geert Uytterhoeven wrote:
> Hi Anshuman,
> 
> On Thu, Jun 30, 2022 at 7:19 AM Anshuman Khandual
>  wrote:
>> This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard
>> vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks
>> up a private and static protection_map[] array. Subsequently all __SXXX and
>> __PXXX macros can be dropped which are no longer needed.
>>
>> Cc: Thomas Bogendoerfer 
>> Cc: linux-m...@lists.linux-m68k.org
>> Cc: linux-ker...@vger.kernel.org
>> Signed-off-by: Anshuman Khandual 
> 
> Thanks for your patch!
> 
>> --- a/arch/m68k/include/asm/mcf_pgtable.h
>> +++ b/arch/m68k/include/asm/mcf_pgtable.h
>> @@ -91,60 +91,6 @@
>>   * for use. In general, the bit positions are xwr, and P-items are
>>   * private, the S-items are shared.
>>   */
> 
> The comment above should be removed, too.

Sure, will do.

> 
>> -#define __P000 PAGE_NONE
>> -#define __P001 __pgprot(CF_PAGE_VALID \
>> -| CF_PAGE_ACCESSED \
>> -| CF_PAGE_READABLE)
> 
>> --- a/arch/m68k/include/asm/motorola_pgtable.h
>> +++ b/arch/m68k/include/asm/motorola_pgtable.h
>> @@ -83,28 +83,6 @@ extern unsigned long mm_cachebits;
>>  #define PAGE_COPY_C__pgprot(_PAGE_PRESENT | _PAGE_RONLY | 
>> _PAGE_ACCESSED)
>>  #define PAGE_READONLY_C__pgprot(_PAGE_PRESENT | _PAGE_RONLY | 
>> _PAGE_ACCESSED)
> 
> You might move the *_C definitions above into arch/m68k/mm/motorola.c
> as well, as they are only used in the latter.

Okay, will do.

> 
>>
>> -/*
>> - * The m68k can't do page protection for execute, and considers that the 
>> same are read.
>> - * Also, write permissions imply read permissions. This is the closest we 
>> can get..
>> - */
>> -#define __P000 PAGE_NONE_C
>> -#define __P001 PAGE_READONLY_C
>> -#define __P010 PAGE_COPY_C
>> -#define __P011 PAGE_COPY_C
>> -#define __P100 PAGE_READONLY_C
>> -#define __P101 PAGE_READONLY_C
>> -#define __P110 PAGE_COPY_C
>> -#define __P111 PAGE_COPY_C
>> -
>> -#define __S000 PAGE_NONE_C
>> -#define __S001 PAGE_READONLY_C
>> -#define __S010 PAGE_SHARED_C
>> -#define __S011 PAGE_SHARED_C
>> -#define __S100 PAGE_READONLY_C
>> -#define __S101 PAGE_READONLY_C
>> -#define __S110 PAGE_SHARED_C
>> -#define __S111 PAGE_SHARED_C
>> -
>>  #define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))
>>
>>  /*
>> diff --git a/arch/m68k/include/asm/sun3_pgtable.h 
>> b/arch/m68k/include/asm/sun3_pgtable.h
>> index 5e4e753f0d24..9d919491765b 100644
>> --- a/arch/m68k/include/asm/sun3_pgtable.h
>> +++ b/arch/m68k/include/asm/sun3_pgtable.h
>> @@ -71,23 +71,6 @@
>>   * protection settings, valid (implying read and execute) and writeable. 
>> These
>>   * are as close as we can get...
>>   */
> 
> The comment above should be removed, too.

Sure, will do.

> 
>> -#define __P000 PAGE_NONE
>> -#define __P001 PAGE_READONLY
> 
> With the above fixed:
> Reviewed-by: Geert Uytterhoeven 
> Acked-by: Geert Uytterhoeven > 
> Gr{oetje,eeting}s,
> 
> Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
> -- Linus Torvalds
> 

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 03/36] cpuidle/poll: Ensure IRQ state is invariant

2022-07-06 Thread Rafael J. Wysocki
On Wed, Jun 8, 2022 at 4:47 PM Peter Zijlstra  wrote:
>
> cpuidle_state::enter() methods should be IRQ invariant
>
> Signed-off-by: Peter Zijlstra (Intel) 

Reviewed-by: Rafael J. Wysocki 

> ---
>  drivers/cpuidle/poll_state.c |4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/cpuidle/poll_state.c
> +++ b/drivers/cpuidle/poll_state.c
> @@ -17,7 +17,7 @@ static int __cpuidle poll_idle(struct cp
>
> dev->poll_time_limit = false;
>
> -   local_irq_enable();
> +   raw_local_irq_enable();
> if (!current_set_polling_and_test()) {
> unsigned int loop_count = 0;
> u64 limit;
> @@ -36,6 +36,8 @@ static int __cpuidle poll_idle(struct cp
> }
> }
> }
> +   raw_local_irq_disable();
> +
> current_clr_polling();
>
> return index;
>
>

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 05/36] cpuidle: Move IRQ state validation

2022-07-06 Thread Rafael J. Wysocki
On Wed, Jun 8, 2022 at 4:47 PM Peter Zijlstra  wrote:
>
> Make cpuidle_enter_state() consistent with the s2idle variant and
> verify ->enter() always returns with interrupts disabled.
>
> Signed-off-by: Peter Zijlstra (Intel) 
> ---
>  drivers/cpuidle/cpuidle.c |   10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -234,7 +234,11 @@ int cpuidle_enter_state(struct cpuidle_d
> stop_critical_timings();
> if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
> rcu_idle_enter();
> +
> entered_state = target_state->enter(dev, drv, index);
> +   if (WARN_ONCE(!irqs_disabled(), "%ps leaked IRQ state", 
> target_state->enter))

I'm not sure if dumping a call trace here is really useful and
WARN_ON() often gets converted to panic().

I would print an error message with pr_warn_once().

Otherwise LGTM.

> +   raw_local_irq_disable();
> +
> if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
> rcu_idle_exit();
> start_critical_timings();
> @@ -246,12 +250,8 @@ int cpuidle_enter_state(struct cpuidle_d
> /* The cpu is no longer idle or about to enter idle. */
> sched_idle_set_state(NULL);
>
> -   if (broadcast) {
> -   if (WARN_ON_ONCE(!irqs_disabled()))
> -   local_irq_disable();
> -
> +   if (broadcast)
> tick_broadcast_exit();
> -   }
>
> if (!cpuidle_state_is_coupled(drv, index))
> local_irq_enable();
>
>

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 17/36] acpi_idle: Remove tracing

2022-07-06 Thread Rafael J. Wysocki
On Wed, Jun 8, 2022 at 4:47 PM Peter Zijlstra  wrote:
>
> All the idle routines are called with RCU disabled, as such there must
> not be any tracing inside.
>
> Signed-off-by: Peter Zijlstra (Intel) 

This actually does some additional code duplication cleanup which
would be good to mention in the changelog.  Or even move to a separate
patch for that matter.

Otherwise LGTM.

> ---
>  drivers/acpi/processor_idle.c |   24 +---
>  1 file changed, 13 insertions(+), 11 deletions(-)
>
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -108,8 +108,8 @@ static const struct dmi_system_id proces
>  static void __cpuidle acpi_safe_halt(void)
>  {
> if (!tif_need_resched()) {
> -   safe_halt();
> -   local_irq_disable();
> +   raw_safe_halt();
> +   raw_local_irq_disable();
> }
>  }
>
> @@ -524,16 +524,21 @@ static int acpi_idle_bm_check(void)
> return bm_status;
>  }
>
> -static void wait_for_freeze(void)
> +static __cpuidle void io_idle(unsigned long addr)
>  {
> +   /* IO port based C-state */
> +   inb(addr);
> +
>  #ifdef CONFIG_X86
> /* No delay is needed if we are in guest */
> if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
> return;
>  #endif
> -   /* Dummy wait op - must do something useless after P_LVL2 read
> -  because chipsets cannot guarantee that STPCLK# signal
> -  gets asserted in time to freeze execution properly. */
> +   /*
> +* Dummy wait op - must do something useless after P_LVL2 read
> +* because chipsets cannot guarantee that STPCLK# signal
> +* gets asserted in time to freeze execution properly.
> +*/
> inl(acpi_gbl_FADT.xpm_timer_block.address);
>  }
>
> @@ -553,9 +558,7 @@ static void __cpuidle acpi_idle_do_entry
> } else if (cx->entry_method == ACPI_CSTATE_HALT) {
> acpi_safe_halt();
> } else {
> -   /* IO port based C-state */
> -   inb(cx->address);
> -   wait_for_freeze();
> +   io_idle(cx->address);
> }
>
> perf_lopwr_cb(false);
> @@ -577,8 +580,7 @@ static int acpi_idle_play_dead(struct cp
> if (cx->entry_method == ACPI_CSTATE_HALT)
> safe_halt();
> else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
> -   inb(cx->address);
> -   wait_for_freeze();
> +   io_idle(cx->address);
> } else
> return -ENODEV;
>
>
>

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 18/36] cpuidle: Annotate poll_idle()

2022-07-06 Thread Rafael J. Wysocki
On Wed, Jun 8, 2022 at 4:46 PM Peter Zijlstra  wrote:
>
> The __cpuidle functions will become a noinstr class, as such they need
> explicit annotations.
>
> Signed-off-by: Peter Zijlstra (Intel) 

Reviewed-by: Rafael J. Wysocki 

> ---
>  drivers/cpuidle/poll_state.c |6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> --- a/drivers/cpuidle/poll_state.c
> +++ b/drivers/cpuidle/poll_state.c
> @@ -13,7 +13,10 @@
>  static int __cpuidle poll_idle(struct cpuidle_device *dev,
>struct cpuidle_driver *drv, int index)
>  {
> -   u64 time_start = local_clock();
> +   u64 time_start;
> +
> +   instrumentation_begin();
> +   time_start = local_clock();
>
> dev->poll_time_limit = false;
>
> @@ -39,6 +42,7 @@ static int __cpuidle poll_idle(struct cp
> raw_local_irq_disable();
>
> current_clr_polling();
> +   instrumentation_end();
>
> return index;
>  }
>
>

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour

2022-07-06 Thread Rafael J. Wysocki
On Wed, Jun 8, 2022 at 4:46 PM Peter Zijlstra  wrote:
>
> Current arch_cpu_idle() is called with IRQs disabled, but will return
> with IRQs enabled.
>
> However, the very first thing the generic code does after calling
> arch_cpu_idle() is raw_local_irq_disable(). This means that
> architectures that can idle with IRQs disabled end up doing a
> pointless 'enable-disable' dance.
>
> Therefore, push this IRQ disabling into the idle function, meaning
> that those architectures can avoid the pointless IRQ state flipping.
>
> Signed-off-by: Peter Zijlstra (Intel) 

Acked-by: Rafael J. Wysocki 

> ---
>  arch/alpha/kernel/process.c  |1 -
>  arch/arc/kernel/process.c|3 +++
>  arch/arm/kernel/process.c|1 -
>  arch/arm/mach-gemini/board-dt.c  |3 ++-
>  arch/arm64/kernel/idle.c |1 -
>  arch/csky/kernel/process.c   |1 -
>  arch/csky/kernel/smp.c   |2 +-
>  arch/hexagon/kernel/process.c|1 -
>  arch/ia64/kernel/process.c   |1 +
>  arch/microblaze/kernel/process.c |1 -
>  arch/mips/kernel/idle.c  |8 +++-
>  arch/nios2/kernel/process.c  |1 -
>  arch/openrisc/kernel/process.c   |1 +
>  arch/parisc/kernel/process.c |2 --
>  arch/powerpc/kernel/idle.c   |5 ++---
>  arch/riscv/kernel/process.c  |1 -
>  arch/s390/kernel/idle.c  |1 -
>  arch/sh/kernel/idle.c|1 +
>  arch/sparc/kernel/leon_pmc.c |4 
>  arch/sparc/kernel/process_32.c   |1 -
>  arch/sparc/kernel/process_64.c   |3 ++-
>  arch/um/kernel/process.c |1 -
>  arch/x86/coco/tdx/tdx.c  |3 +++
>  arch/x86/kernel/process.c|   15 ---
>  arch/xtensa/kernel/process.c |1 +
>  kernel/sched/idle.c  |2 --
>  26 files changed, 28 insertions(+), 37 deletions(-)
>
> --- a/arch/alpha/kernel/process.c
> +++ b/arch/alpha/kernel/process.c
> @@ -57,7 +57,6 @@ EXPORT_SYMBOL(pm_power_off);
>  void arch_cpu_idle(void)
>  {
> wtint(0);
> -   raw_local_irq_enable();
>  }
>
>  void arch_cpu_idle_dead(void)
> --- a/arch/arc/kernel/process.c
> +++ b/arch/arc/kernel/process.c
> @@ -114,6 +114,8 @@ void arch_cpu_idle(void)
> "sleep %0   \n"
> :
> :"I"(arg)); /* can't be "r" has to be embedded const */
> +
> +   raw_local_irq_disable();
>  }
>
>  #else  /* ARC700 */
> @@ -122,6 +124,7 @@ void arch_cpu_idle(void)
>  {
> /* sleep, but enable both set E1/E2 (levels of interrupts) before 
> committing */
> __asm__ __volatile__("sleep 0x3 \n");
> +   raw_local_irq_disable();
>  }
>
>  #endif
> --- a/arch/arm/kernel/process.c
> +++ b/arch/arm/kernel/process.c
> @@ -78,7 +78,6 @@ void arch_cpu_idle(void)
> arm_pm_idle();
> else
> cpu_do_idle();
> -   raw_local_irq_enable();
>  }
>
>  void arch_cpu_idle_prepare(void)
> --- a/arch/arm/mach-gemini/board-dt.c
> +++ b/arch/arm/mach-gemini/board-dt.c
> @@ -42,8 +42,9 @@ static void gemini_idle(void)
>  */
>
> /* FIXME: Enabling interrupts here is racy! */
> -   local_irq_enable();
> +   raw_local_irq_enable();
> cpu_do_idle();
> +   raw_local_irq_disable();
>  }
>
>  static void __init gemini_init_machine(void)
> --- a/arch/arm64/kernel/idle.c
> +++ b/arch/arm64/kernel/idle.c
> @@ -42,5 +42,4 @@ void noinstr arch_cpu_idle(void)
>  * tricks
>  */
> cpu_do_idle();
> -   raw_local_irq_enable();
>  }
> --- a/arch/csky/kernel/process.c
> +++ b/arch/csky/kernel/process.c
> @@ -101,6 +101,5 @@ void arch_cpu_idle(void)
>  #ifdef CONFIG_CPU_PM_STOP
> asm volatile("stop\n");
>  #endif
> -   raw_local_irq_enable();
>  }
>  #endif
> --- a/arch/csky/kernel/smp.c
> +++ b/arch/csky/kernel/smp.c
> @@ -314,7 +314,7 @@ void arch_cpu_idle_dead(void)
> while (!secondary_stack)
> arch_cpu_idle();
>
> -   local_irq_disable();
> +   raw_local_irq_disable();
>
> asm volatile(
> "movsp, %0\n"
> --- a/arch/hexagon/kernel/process.c
> +++ b/arch/hexagon/kernel/process.c
> @@ -44,7 +44,6 @@ void arch_cpu_idle(void)
>  {
> __vmwait();
> /*  interrupts wake us up, but irqs are still disabled */
> -   raw_local_irq_enable();
>  }
>
>  /*
> --- a/arch/ia64/kernel/process.c
> +++ b/arch/ia64/kernel/process.c
> @@ -241,6 +241,7 @@ void arch_cpu_idle(void)
> (*mark_idle)(1);
>
> raw_safe_halt();
> +   raw_local_irq_disable();
>
> if (mark_idle)
> (*mark_idle)(0);
> --- a/arch/microblaze/kernel/process.c
> +++ b/arch/microblaze/kernel/process.c
> @@ -138,5 +138,4 @@ int dump_fpu(struct pt_regs *regs, elf_f
>
>  void arch_cpu_idle(void)
>  {
> -   raw_local_irq_enable();
>  }
> --- a/arch/mips/kernel/idle.c
> +++ b/arch/mips/kernel/idle.c
> @@ -33,13 +33,13 @@ static void __cpuidle r3081_wait(void)
>  {
>   

Re: [PATCH 31/36] cpuidle,acpi: Make noinstr clean

2022-07-06 Thread Rafael J. Wysocki
On Wed, Jun 8, 2022 at 4:47 PM Peter Zijlstra  wrote:
>
> vmlinux.o: warning: objtool: io_idle+0xc: call to __inb.isra.0() leaves 
> .noinstr.text section
> vmlinux.o: warning: objtool: acpi_idle_enter+0xfe: call to num_online_cpus() 
> leaves .noinstr.text section
> vmlinux.o: warning: objtool: acpi_idle_enter+0x115: call to 
> acpi_idle_fallback_to_c1.isra.0() leaves .noinstr.text section
>
> Signed-off-by: Peter Zijlstra (Intel) 

Acked-by: Rafael J. Wysocki 

> ---
>  arch/x86/include/asm/shared/io.h |4 ++--
>  drivers/acpi/processor_idle.c|2 +-
>  include/linux/cpumask.h  |4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> --- a/arch/x86/include/asm/shared/io.h
> +++ b/arch/x86/include/asm/shared/io.h
> @@ -5,13 +5,13 @@
>  #include 
>
>  #define BUILDIO(bwl, bw, type) \
> -static inline void __out##bwl(type value, u16 port)\
> +static __always_inline void __out##bwl(type value, u16 port)   \
>  {  \
> asm volatile("out" #bwl " %" #bw "0, %w1"   \
>  : : "a"(value), "Nd"(port));   \
>  }  \
> \
> -static inline type __in##bwl(u16 port) \
> +static __always_inline type __in##bwl(u16 port)  
>   \
>  {  \
> type value; \
> asm volatile("in" #bwl " %w1, %" #bw "0"\
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -593,7 +593,7 @@ static int acpi_idle_play_dead(struct cp
> return 0;
>  }
>
> -static bool acpi_idle_fallback_to_c1(struct acpi_processor *pr)
> +static __always_inline bool acpi_idle_fallback_to_c1(struct acpi_processor 
> *pr)
>  {
> return IS_ENABLED(CONFIG_HOTPLUG_CPU) && !pr->flags.has_cst &&
> !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED);
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -908,9 +908,9 @@ static inline const struct cpumask *get_
>   * concurrent CPU hotplug operations unless invoked from a cpuhp_lock held
>   * region.
>   */
> -static inline unsigned int num_online_cpus(void)
> +static __always_inline unsigned int num_online_cpus(void)
>  {
> -   return atomic_read(&__num_online_cpus);
> +   return arch_atomic_read(&__num_online_cpus);
>  }
>  #define num_possible_cpus()cpumask_weight(cpu_possible_mask)
>  #define num_present_cpus() cpumask_weight(cpu_present_mask)
>
>

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [linux-next:master] BUILD REGRESSION 2a2aa3f05338270aecbe2492fda910d6c17e0102

2022-07-06 Thread Vineet Gupta




On 7/5/22 23:49, Dan Carpenter wrote:

[ trimmed massive CC list (see below) ]

What's going on with all the arch/arc build breakage on linux-next?

regards,
dan carpenter

To: kernel test robot 
Cc: Andrew Morton ,
virtualizat...@lists.linux-foundation.org,
usbb2k-api-...@nongnu.org, tipc-discuss...@lists.sourceforge.net,
target-de...@vger.kernel.org, sound-open-firmw...@alsa-project.org,
samba-techni...@lists.samba.org, rds-de...@oss.oracle.com,
patc...@opensource.cirrus.com, osmocom-net-g...@lists.osmocom.org,
openipmi-develo...@lists.sourceforge.net, nvd...@lists.linux.dev,
n...@lists.linux.dev, netfilter-de...@vger.kernel.org,
net...@vger.kernel.org, mjpeg-us...@lists.sourceforge.net,
megaraidlinux@broadcom.com, linuxppc-...@lists.ozlabs.org,
linux1394-de...@lists.sourceforge.net, linux-...@vger.kernel.org,
linux-w...@vger.kernel.org, linux-wirel...@vger.kernel.org,
linux-watch...@vger.kernel.org, linux-...@vger.kernel.org,
linux-unio...@vger.kernel.org, linux-te...@vger.kernel.org,
linux-st...@st-md-mailman.stormreply.com,
linux-stag...@lists.linux.dev, linux-ser...@vger.kernel.org,
linux-s...@vger.kernel.org, linux-s...@vger.kernel.org,
linux-samsung-...@vger.kernel.org,
linux-rockc...@lists.infradead.org,
linux-renesas-...@vger.kernel.org, linux-r...@vger.kernel.org,
linux-r...@vger.kernel.org, linux...@vger.kernel.org,
linux-...@lists.infradead.org, linux-perf-us...@vger.kernel.org,
linux-...@vger.kernel.org, linux-parp...@lists.infradead.org,
linux-par...@vger.kernel.org, linux-o...@vger.kernel.org,
linux-...@lists.01.org, linux-...@lists.infradead.org,
linux-...@vger.kernel.org, linux...@kvack.org,
linux-media...@lists.infradead.org, linux-me...@vger.kernel.org,
linux-l...@vger.kernel.org, linux-integr...@vger.kernel.org,
linux-in...@vger.kernel.org, linux-...@vger.kernel.org,
linux-...@vger.kernel.org, linux-hw...@vger.kernel.org,
linux-fsde...@vger.kernel.org, linux-f...@vger.kernel.org,
linux-fb...@vger.kernel.org, linux-e...@vger.kernel.org,
linux-...@vger.kernel.org, linux-...@vger.kernel.org,
linux-cry...@vger.kernel.org, linux-...@vger.kernel.org,
linux-c...@vger.kernel.org, linux-...@vger.kernel.org,
linux-bt...@vger.kernel.org, linux-blueto...@vger.kernel.org,
linux-bl...@vger.kernel.org, linux-bca...@vger.kernel.org,
linux-arm-...@vger.kernel.org, linux-arm-ker...@lists.infradead.org,
linux-amlo...@lists.infradead.org, linaro-mm-...@lists.linaro.org,
legousb-de...@lists.sourceforge.net, k...@vger.kernel.org,
keyri...@vger.kernel.org, isdn4li...@listserv.isdn4linux.de,
io...@lists.linux.dev, io...@lists.linux-foundation.org,
intel-wired-...@lists.osuosl.org, dri-de...@lists.freedesktop.org,
dm-de...@redhat.com, devicet...@vger.kernel.org,
d...@openvswitch.org, d...@vger.kernel.org, da...@lists.linux.dev,
coret...@netfilter.org, cgro...@vger.kernel.org,
ceph-de...@vger.kernel.org, appar...@lists.ubuntu.com,
amd-...@lists.freedesktop.org, alsa-de...@alsa-project.org,
accessrunner-gene...@lists.sourceforge.net


linux-snps-arc is not there, does one need to subscribe to these ?


On Wed, Jul 06, 2022 at 07:41:36AM +0800, kernel test robot wrote:

tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
branch HEAD: 2a2aa3f05338270aecbe2492fda910d6c17e0102  Add linux-next specific 
files for 20220705

Error/Warning reports:

https://lore.kernel.org/linux-doc/202207051821.3f0erisl-...@intel.com

Error/Warning: (recently discovered and may have been fixed)

Documentation/PCI/endpoint/pci-vntb-function.rst:82: WARNING: Unexpected 
indentation.
Documentation/PCI/endpoint/pci-vntb-howto.rst:131: WARNING: Title underline too 
short.
drivers/pci/endpoint/functions/pci-epf-vntb.c:975:5: warning: no previous 
prototype for 'pci_read' [-Wmissing-prototypes]
drivers/pci/endpoint/functions/pci-epf-vntb.c:984:5: warning: no previous 
prototype for 'pci_write' [-Wmissing-prototypes]

Unverified Error/Warning (likely false positive, please contact us if 
interested):

block/partitions/efi.c:223:1: internal compiler error: in arc_ifcvt, at 
config/arc/arc.c:9637
block/sed-opal.c:427:1: internal compiler error: in arc_ifcvt, at 
config/arc/arc.c:9637
crypto/asymmetric_keys/pkcs7_verify.c:311:1: internal compiler error: in 
arc_ifcvt, at config/arc/arc.c:9637
drivers/ata/libata-core.c:2802:1: internal compiler error: in arc_ifcvt, at 
config/arc/arc.c:9637
drivers/ata/libata-eh.c:2842:1: internal compiler error: in arc_ifcvt, at 
config/arc/arc.c:9637
drivers/ata/sata_dwc_460ex.c:691:1: internal compiler error: in arc_ifcvt, at 
config/arc/arc.c:9637
drivers/base/power/runtime.c:1570:1: inter