linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT pull] core/urgent for v5.14-rc3
@ 2021-07-25  9:22 Thomas Gleixner
  2021-07-25  9:22 ` [GIT pull] efi/urgent " Thomas Gleixner
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Thomas Gleixner @ 2021-07-25  9:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest core/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-2021-07-25

up to:  e9ba16e68cce: smpboot: Mark idle_init() as __always_inlined to work around aggressive compiler un-inlining

A single update for the boot code to prevent aggressive un-inlining which
causes a section mismatch.

Thanks,

	tglx

------------------>
Ingo Molnar (1):
      smpboot: Mark idle_init() as __always_inlined to work around aggressive compiler un-inlining


 kernel/smpboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index e4163042c4d6..21b7953f8242 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -47,7 +47,7 @@ void __init idle_thread_set_boot_cpu(void)
  *
  * Creates the thread if it does not exist.
  */
-static inline void idle_init(unsigned int cpu)
+static inline void __always_inline idle_init(unsigned int cpu)
 {
 	struct task_struct *tsk = per_cpu(idle_threads, cpu);
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [GIT pull] efi/urgent for v5.14-rc3
  2021-07-25  9:22 [GIT pull] core/urgent for v5.14-rc3 Thomas Gleixner
@ 2021-07-25  9:22 ` Thomas Gleixner
  2021-07-25 17:49   ` pr-tracker-bot
  2021-07-25  9:22 ` [GIT pull] locking/urgent " Thomas Gleixner
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Thomas Gleixner @ 2021-07-25  9:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest efi/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-urgent-2021-07-25

up to:  ddab1e71d2df: Merge tag 'efi-urgent-for-v5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/urgent

A set of EFI fixes:

  - Prevent memblock and I/O reserved resources to get out of sync when EFI
    memreserve is in use.

  - Don't claim a non-existing table is invalid

  - Don't warn when firmware memory is already reserved correctly

Thanks,

	tglx

------------------>
Atish Patra (1):
      efi/libstub: Fix the efi_load_initrd function description

Borislav Petkov (1):
      efi/mokvar: Reserve the table only if it is in boot services data

Marc Zyngier (1):
      firmware/efi: Tell memblock about EFI iomem reservations

Michal Suchanek (1):
      efi/tpm: Differentiate missing and invalid final event log table.


 drivers/firmware/efi/efi.c                     | 13 ++++++++++++-
 drivers/firmware/efi/libstub/efi-stub-helper.c |  4 ++--
 drivers/firmware/efi/mokvar-table.c            |  5 ++++-
 drivers/firmware/efi/tpm.c                     |  8 +++++---
 4 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 4b7ee3fa9224..847f33ffc4ae 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -896,6 +896,7 @@ static int __init efi_memreserve_map_root(void)
 static int efi_mem_reserve_iomem(phys_addr_t addr, u64 size)
 {
 	struct resource *res, *parent;
+	int ret;
 
 	res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
 	if (!res)
@@ -908,7 +909,17 @@ static int efi_mem_reserve_iomem(phys_addr_t addr, u64 size)
 
 	/* we expect a conflict with a 'System RAM' region */
 	parent = request_resource_conflict(&iomem_resource, res);
-	return parent ? request_resource(parent, res) : 0;
+	ret = parent ? request_resource(parent, res) : 0;
+
+	/*
+	 * Given that efi_mem_reserve_iomem() can be called at any
+	 * time, only call memblock_reserve() if the architecture
+	 * keeps the infrastructure around.
+	 */
+	if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK) && !ret)
+		memblock_reserve(addr, size);
+
+	return ret;
 }
 
 int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size)
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
index aa8da0a49829..ae87dded989d 100644
--- a/drivers/firmware/efi/libstub/efi-stub-helper.c
+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
@@ -630,8 +630,8 @@ efi_status_t efi_load_initrd_cmdline(efi_loaded_image_t *image,
  * @image:	EFI loaded image protocol
  * @load_addr:	pointer to loaded initrd
  * @load_size:	size of loaded initrd
- * @soft_limit:	preferred size of allocated memory for loading the initrd
- * @hard_limit:	minimum size of allocated memory
+ * @soft_limit:	preferred address for loading the initrd
+ * @hard_limit:	upper limit address for loading the initrd
  *
  * Return:	status code
  */
diff --git a/drivers/firmware/efi/mokvar-table.c b/drivers/firmware/efi/mokvar-table.c
index d8bc01340686..38722d2009e2 100644
--- a/drivers/firmware/efi/mokvar-table.c
+++ b/drivers/firmware/efi/mokvar-table.c
@@ -180,7 +180,10 @@ void __init efi_mokvar_table_init(void)
 		pr_err("EFI MOKvar config table is not valid\n");
 		return;
 	}
-	efi_mem_reserve(efi.mokvar_table, map_size_needed);
+
+	if (md.type == EFI_BOOT_SERVICES_DATA)
+		efi_mem_reserve(efi.mokvar_table, map_size_needed);
+
 	efi_mokvar_table_size = map_size_needed;
 }
 
diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index c1955d320fec..8f665678e9e3 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -62,9 +62,11 @@ int __init efi_tpm_eventlog_init(void)
 	tbl_size = sizeof(*log_tbl) + log_tbl->size;
 	memblock_reserve(efi.tpm_log, tbl_size);
 
-	if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR ||
-	    log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
-		pr_warn(FW_BUG "TPM Final Events table missing or invalid\n");
+	if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) {
+		pr_info("TPM Final Events table not present\n");
+		goto out;
+	} else if (log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
+		pr_warn(FW_BUG "TPM Final Events table invalid\n");
 		goto out;
 	}
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [GIT pull] locking/urgent for v5.14-rc3
  2021-07-25  9:22 [GIT pull] core/urgent for v5.14-rc3 Thomas Gleixner
  2021-07-25  9:22 ` [GIT pull] efi/urgent " Thomas Gleixner
@ 2021-07-25  9:22 ` Thomas Gleixner
  2021-07-25 17:49   ` pr-tracker-bot
  2021-07-25  9:22 ` [GIT pull] timers/urgent " Thomas Gleixner
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Thomas Gleixner @ 2021-07-25  9:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest locking/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2021-07-25

up to:  e48a12e546ec: jump_labels: Mark __jump_label_transform() as __always_inlined to work around aggressive compiler un-inlining

A single fix for jump labels to prevent the compiler from agressive
un-inlining which results in a section mismatch.

Thanks,

	tglx

------------------>
Ingo Molnar (1):
      jump_labels: Mark __jump_label_transform() as __always_inlined to work around aggressive compiler un-inlining


 arch/x86/kernel/jump_label.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c
index 674906fad43b..68f091ba8443 100644
--- a/arch/x86/kernel/jump_label.c
+++ b/arch/x86/kernel/jump_label.c
@@ -79,9 +79,10 @@ __jump_label_patch(struct jump_entry *entry, enum jump_label_type type)
 	return (struct jump_label_patch){.code = code, .size = size};
 }
 
-static inline void __jump_label_transform(struct jump_entry *entry,
-					  enum jump_label_type type,
-					  int init)
+static __always_inline void
+__jump_label_transform(struct jump_entry *entry,
+		       enum jump_label_type type,
+		       int init)
 {
 	const struct jump_label_patch jlp = __jump_label_patch(entry, type);
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [GIT pull] timers/urgent for v5.14-rc3
  2021-07-25  9:22 [GIT pull] core/urgent for v5.14-rc3 Thomas Gleixner
  2021-07-25  9:22 ` [GIT pull] efi/urgent " Thomas Gleixner
  2021-07-25  9:22 ` [GIT pull] locking/urgent " Thomas Gleixner
@ 2021-07-25  9:22 ` Thomas Gleixner
  2021-07-25 17:49   ` pr-tracker-bot
  2021-07-25 17:49 ` [GIT pull] core/urgent " pr-tracker-bot
  2021-07-25 18:06 ` Linus Torvalds
  4 siblings, 1 reply; 10+ messages in thread
From: Thomas Gleixner @ 2021-07-25  9:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest timers/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2021-07-25

up to:  ff5a6a3550ce: Merge branch 'timers/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into timers/urgent


A samll set of timer related fixes:

 - Plug a race between rearm and process tick in the posix CPU timers code

 - Make the optimization to avoid recalculation of the next timer interrupt
   work correctly when there are no timers pending.


Thanks,

	tglx

------------------>
Frederic Weisbecker (1):
      posix-cpu-timers: Fix rearm racing against process tick

Nicolas Saenz Julienne (1):
      timers: Fix get_next_timer_interrupt() with no timers pending


 kernel/time/posix-cpu-timers.c | 10 +++++-----
 kernel/time/timer.c            |  8 +++++---
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 29a5e54e6e10..517be7fd175e 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -991,6 +991,11 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer)
 	if (!p)
 		goto out;
 
+	/* Protect timer list r/w in arm_timer() */
+	sighand = lock_task_sighand(p, &flags);
+	if (unlikely(sighand == NULL))
+		goto out;
+
 	/*
 	 * Fetch the current sample and update the timer's expiry time.
 	 */
@@ -1001,11 +1006,6 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer)
 
 	bump_cpu_timer(timer, now);
 
-	/* Protect timer list r/w in arm_timer() */
-	sighand = lock_task_sighand(p, &flags);
-	if (unlikely(sighand == NULL))
-		goto out;
-
 	/*
 	 * Now re-arm for the new expiry time.
 	 */
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 3fadb58fc9d7..9eb11c2209e5 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -207,6 +207,7 @@ struct timer_base {
 	unsigned int		cpu;
 	bool			next_expiry_recalc;
 	bool			is_idle;
+	bool			timers_pending;
 	DECLARE_BITMAP(pending_map, WHEEL_SIZE);
 	struct hlist_head	vectors[WHEEL_SIZE];
 } ____cacheline_aligned;
@@ -595,6 +596,7 @@ static void enqueue_timer(struct timer_base *base, struct timer_list *timer,
 		 * can reevaluate the wheel:
 		 */
 		base->next_expiry = bucket_expiry;
+		base->timers_pending = true;
 		base->next_expiry_recalc = false;
 		trigger_dyntick_cpu(base, timer);
 	}
@@ -1582,6 +1584,7 @@ static unsigned long __next_timer_interrupt(struct timer_base *base)
 	}
 
 	base->next_expiry_recalc = false;
+	base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA);
 
 	return next;
 }
@@ -1633,7 +1636,6 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
 	struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
 	u64 expires = KTIME_MAX;
 	unsigned long nextevt;
-	bool is_max_delta;
 
 	/*
 	 * Pretend that there is no timer pending if the cpu is offline.
@@ -1646,7 +1648,6 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
 	if (base->next_expiry_recalc)
 		base->next_expiry = __next_timer_interrupt(base);
 	nextevt = base->next_expiry;
-	is_max_delta = (nextevt == base->clk + NEXT_TIMER_MAX_DELTA);
 
 	/*
 	 * We have a fresh next event. Check whether we can forward the
@@ -1664,7 +1665,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
 		expires = basem;
 		base->is_idle = false;
 	} else {
-		if (!is_max_delta)
+		if (base->timers_pending)
 			expires = basem + (u64)(nextevt - basej) * TICK_NSEC;
 		/*
 		 * If we expect to sleep more than a tick, mark the base idle.
@@ -1947,6 +1948,7 @@ int timers_prepare_cpu(unsigned int cpu)
 		base = per_cpu_ptr(&timer_bases[b], cpu);
 		base->clk = jiffies;
 		base->next_expiry = base->clk + NEXT_TIMER_MAX_DELTA;
+		base->timers_pending = false;
 		base->is_idle = false;
 	}
 	return 0;


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [GIT pull] timers/urgent for v5.14-rc3
  2021-07-25  9:22 ` [GIT pull] timers/urgent " Thomas Gleixner
@ 2021-07-25 17:49   ` pr-tracker-bot
  0 siblings, 0 replies; 10+ messages in thread
From: pr-tracker-bot @ 2021-07-25 17:49 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linus Torvalds, linux-kernel, x86

The pull request you sent on Sun, 25 Jul 2021 09:22:04 -0000:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2021-07-25

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/12e9bd168c85b1e8a8ef2dd2cb34250f29656c71

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT pull] efi/urgent for v5.14-rc3
  2021-07-25  9:22 ` [GIT pull] efi/urgent " Thomas Gleixner
@ 2021-07-25 17:49   ` pr-tracker-bot
  0 siblings, 0 replies; 10+ messages in thread
From: pr-tracker-bot @ 2021-07-25 17:49 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linus Torvalds, linux-kernel, x86

The pull request you sent on Sun, 25 Jul 2021 09:22:01 -0000:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-urgent-2021-07-25

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/e049597e7ec11fdc276d787d320b01ef1f647c4a

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT pull] core/urgent for v5.14-rc3
  2021-07-25  9:22 [GIT pull] core/urgent for v5.14-rc3 Thomas Gleixner
                   ` (2 preceding siblings ...)
  2021-07-25  9:22 ` [GIT pull] timers/urgent " Thomas Gleixner
@ 2021-07-25 17:49 ` pr-tracker-bot
  2021-07-25 18:06 ` Linus Torvalds
  4 siblings, 0 replies; 10+ messages in thread
From: pr-tracker-bot @ 2021-07-25 17:49 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linus Torvalds, linux-kernel, x86

The pull request you sent on Sun, 25 Jul 2021 09:22:00 -0000:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-2021-07-25

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/9041a4d2ee2f551981689cb12066a872879f5d07

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT pull] locking/urgent for v5.14-rc3
  2021-07-25  9:22 ` [GIT pull] locking/urgent " Thomas Gleixner
@ 2021-07-25 17:49   ` pr-tracker-bot
  0 siblings, 0 replies; 10+ messages in thread
From: pr-tracker-bot @ 2021-07-25 17:49 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linus Torvalds, linux-kernel, x86

The pull request you sent on Sun, 25 Jul 2021 09:22:03 -0000:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2021-07-25

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/d1b178254ca39a89b3c6407e29e87dd25734399e

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT pull] core/urgent for v5.14-rc3
  2021-07-25  9:22 [GIT pull] core/urgent for v5.14-rc3 Thomas Gleixner
                   ` (3 preceding siblings ...)
  2021-07-25 17:49 ` [GIT pull] core/urgent " pr-tracker-bot
@ 2021-07-25 18:06 ` Linus Torvalds
  2021-07-25 19:49   ` Thomas Gleixner
  4 siblings, 1 reply; 10+ messages in thread
From: Linus Torvalds @ 2021-07-25 18:06 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar
  Cc: Linux Kernel Mailing List, the arch/x86 maintainers

On Sun, Jul 25, 2021 at 2:23 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> A single update for the boot code to prevent aggressive un-inlining which
> causes a section mismatch.

Argh, I did my usual allmodconfig build tests and this looked clean,
and I've already pushed it out.

But I do my clang builds separately, and that showed the bug:

> -static inline void idle_init(unsigned int cpu)
> +static inline void __always_inline idle_init(unsigned int cpu)

Yeah, that's a bit too many "inline"s, and clang quite reasonably
warns about it:

   kernel/smpboot.c:50:20: warning: duplicate 'inline' declaration
specifier [-Wduplicate-decl-specifier]

Plus now that I look at it, it also has that __always_inline misplaced
- we should put things like "static" and "inline" (and
"__always_inline") before the function type specifiers.

So that function definition _should_ have been

    static __always_inline void idle_init(unsigned int cpu)

instead.

Oh well. I'll fix it up as a separate patch. I wish I had done the
clang build before pushing it out - and I wish the -tip tree started
tested clang as well at least in _some_ configuration.

              Linus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT pull] core/urgent for v5.14-rc3
  2021-07-25 18:06 ` Linus Torvalds
@ 2021-07-25 19:49   ` Thomas Gleixner
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Gleixner @ 2021-07-25 19:49 UTC (permalink / raw)
  To: Linus Torvalds, Ingo Molnar
  Cc: Linux Kernel Mailing List, the arch/x86 maintainers

On Sun, Jul 25 2021 at 11:06, Linus Torvalds wrote:
> On Sun, Jul 25, 2021 at 2:23 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> So that function definition _should_ have been
>
>     static __always_inline void idle_init(unsigned int cpu)
>
> instead.
>
> Oh well. I'll fix it up as a separate patch. I wish I had done the
> clang build before pushing it out - and I wish the -tip tree started
> tested clang as well at least in _some_ configuration.

Bah, obvious and I overlooked it when staring at the diff. Duly noted
that clang will be part of the procedure soonish.

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-25 19:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-25  9:22 [GIT pull] core/urgent for v5.14-rc3 Thomas Gleixner
2021-07-25  9:22 ` [GIT pull] efi/urgent " Thomas Gleixner
2021-07-25 17:49   ` pr-tracker-bot
2021-07-25  9:22 ` [GIT pull] locking/urgent " Thomas Gleixner
2021-07-25 17:49   ` pr-tracker-bot
2021-07-25  9:22 ` [GIT pull] timers/urgent " Thomas Gleixner
2021-07-25 17:49   ` pr-tracker-bot
2021-07-25 17:49 ` [GIT pull] core/urgent " pr-tracker-bot
2021-07-25 18:06 ` Linus Torvalds
2021-07-25 19:49   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).