linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT pull] perf fix for 4.19
@ 2018-09-29 18:25 Thomas Gleixner
  2018-09-29 18:25 ` [GIT pull] timer fixes " Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Gleixner @ 2018-09-29 18:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, x86

Greg,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-for-linus

A single fix for a missing sanity check when a pinned event is tried to be
read on the wrong CPU due to a legit event scheduling failure.

Thanks,

	tglx

------------------>
Reinette Chatre (1):
      perf/core: Add sanity check to deal with pinned event failure


 kernel/events/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index c80549bf82c6..dcb093e7b377 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3935,6 +3935,12 @@ int perf_event_read_local(struct perf_event *event, u64 *value,
 		goto out;
 	}
 
+	/* If this is a pinned event it must be running on this CPU */
+	if (event->attr.pinned && event->oncpu != smp_processor_id()) {
+		ret = -EBUSY;
+		goto out;
+	}
+
 	/*
 	 * If the event is currently on this CPU, its either a per-task event,
 	 * or local to this CPU. Furthermore it means its ACTIVE (otherwise


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

* [GIT pull] timer fixes for 4.19
  2018-09-29 18:25 [GIT pull] perf fix for 4.19 Thomas Gleixner
@ 2018-09-29 18:25 ` Thomas Gleixner
  2018-09-29 22:24   ` Greg Kroah-Hartman
  2018-09-29 18:25 ` [GIT pull] x86 fix " Thomas Gleixner
  2018-09-29 22:24 ` [GIT pull] perf " Greg Kroah-Hartman
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2018-09-29 18:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, x86

Greg,

please pull the latest timers-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus

Three small fixes for clocksource drivers:

 - Proper error handling in the Atmel PIT driver
 
 - Add CLOCK_SOURCE_SUSPEND_NONSTOP for TI SoCs so suspend works again

 - Fix the next event function for Facebook Backpack-CMM BMC chips so
   usleep(100) doesnt sleep several milliseconds

Thanks,

	tglx

------------------>
Alexandre Belloni (1):
      clocksource/drivers/timer-atmel-pit: Properly handle error cases

Keerthy (1):
      clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs

Tao Ren (1):
      clocksource/drivers/fttmr010: Fix set_next_event handler


 drivers/clocksource/timer-atmel-pit.c | 20 ++++++++++++++------
 drivers/clocksource/timer-fttmr010.c  | 18 +++++++++++-------
 drivers/clocksource/timer-ti-32k.c    |  3 +++
 3 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c
index ec8a4376f74f..2fab18fae4fc 100644
--- a/drivers/clocksource/timer-atmel-pit.c
+++ b/drivers/clocksource/timer-atmel-pit.c
@@ -180,26 +180,29 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node)
 	data->base = of_iomap(node, 0);
 	if (!data->base) {
 		pr_err("Could not map PIT address\n");
-		return -ENXIO;
+		ret = -ENXIO;
+		goto exit;
 	}
 
 	data->mck = of_clk_get(node, 0);
 	if (IS_ERR(data->mck)) {
 		pr_err("Unable to get mck clk\n");
-		return PTR_ERR(data->mck);
+		ret = PTR_ERR(data->mck);
+		goto exit;
 	}
 
 	ret = clk_prepare_enable(data->mck);
 	if (ret) {
 		pr_err("Unable to enable mck\n");
-		return ret;
+		goto exit;
 	}
 
 	/* Get the interrupts property */
 	data->irq = irq_of_parse_and_map(node, 0);
 	if (!data->irq) {
 		pr_err("Unable to get IRQ from DT\n");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto exit;
 	}
 
 	/*
@@ -227,7 +230,7 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node)
 	ret = clocksource_register_hz(&data->clksrc, pit_rate);
 	if (ret) {
 		pr_err("Failed to register clocksource\n");
-		return ret;
+		goto exit;
 	}
 
 	/* Set up irq handler */
@@ -236,7 +239,8 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node)
 			  "at91_tick", data);
 	if (ret) {
 		pr_err("Unable to setup IRQ\n");
-		return ret;
+		clocksource_unregister(&data->clksrc);
+		goto exit;
 	}
 
 	/* Set up and register clockevents */
@@ -254,6 +258,10 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node)
 	clockevents_register_device(&data->clkevt);
 
 	return 0;
+
+exit:
+	kfree(data);
+	return ret;
 }
 TIMER_OF_DECLARE(at91sam926x_pit, "atmel,at91sam9260-pit",
 		       at91sam926x_pit_dt_init);
diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c
index c020038ebfab..cf93f6419b51 100644
--- a/drivers/clocksource/timer-fttmr010.c
+++ b/drivers/clocksource/timer-fttmr010.c
@@ -130,13 +130,17 @@ static int fttmr010_timer_set_next_event(unsigned long cycles,
 	cr &= ~fttmr010->t1_enable_val;
 	writel(cr, fttmr010->base + TIMER_CR);
 
-	/* Setup the match register forward/backward in time */
-	cr = readl(fttmr010->base + TIMER1_COUNT);
-	if (fttmr010->count_down)
-		cr -= cycles;
-	else
-		cr += cycles;
-	writel(cr, fttmr010->base + TIMER1_MATCH1);
+	if (fttmr010->count_down) {
+		/*
+		 * ASPEED Timer Controller will load TIMER1_LOAD register
+		 * into TIMER1_COUNT register when the timer is re-enabled.
+		 */
+		writel(cycles, fttmr010->base + TIMER1_LOAD);
+	} else {
+		/* Setup the match register forward in time */
+		cr = readl(fttmr010->base + TIMER1_COUNT);
+		writel(cr + cycles, fttmr010->base + TIMER1_MATCH1);
+	}
 
 	/* Start */
 	cr = readl(fttmr010->base + TIMER_CR);
diff --git a/drivers/clocksource/timer-ti-32k.c b/drivers/clocksource/timer-ti-32k.c
index 29e2e1a78a43..6949a9113dbb 100644
--- a/drivers/clocksource/timer-ti-32k.c
+++ b/drivers/clocksource/timer-ti-32k.c
@@ -97,6 +97,9 @@ static int __init ti_32k_timer_init(struct device_node *np)
 		return -ENXIO;
 	}
 
+	if (!of_machine_is_compatible("ti,am43"))
+		ti_32k_timer.cs.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP;
+
 	ti_32k_timer.counter = ti_32k_timer.base;
 
 	/*


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

* [GIT pull] x86 fix for 4.19
  2018-09-29 18:25 [GIT pull] perf fix for 4.19 Thomas Gleixner
  2018-09-29 18:25 ` [GIT pull] timer fixes " Thomas Gleixner
@ 2018-09-29 18:25 ` Thomas Gleixner
  2018-09-29 22:24   ` Greg Kroah-Hartman
  2018-09-29 22:24 ` [GIT pull] perf " Greg Kroah-Hartman
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2018-09-29 18:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, x86

Greg,

please pull the latest x86-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus

A single fix for the AMD memory encryption boot code so it does not read
random garbage instead of the cached encryption bit when a kexec kernel is
allocated above the 32bit address limit.

Thanks,

	tglx

------------------>
Kairui Song (1):
      x86/boot: Fix kexec booting failure in the SEV bit detection code


 arch/x86/boot/compressed/mem_encrypt.S | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/arch/x86/boot/compressed/mem_encrypt.S b/arch/x86/boot/compressed/mem_encrypt.S
index eaa843a52907..a480356e0ed8 100644
--- a/arch/x86/boot/compressed/mem_encrypt.S
+++ b/arch/x86/boot/compressed/mem_encrypt.S
@@ -25,20 +25,6 @@ ENTRY(get_sev_encryption_bit)
 	push	%ebx
 	push	%ecx
 	push	%edx
-	push	%edi
-
-	/*
-	 * RIP-relative addressing is needed to access the encryption bit
-	 * variable. Since we are running in 32-bit mode we need this call/pop
-	 * sequence to get the proper relative addressing.
-	 */
-	call	1f
-1:	popl	%edi
-	subl	$1b, %edi
-
-	movl	enc_bit(%edi), %eax
-	cmpl	$0, %eax
-	jge	.Lsev_exit
 
 	/* Check if running under a hypervisor */
 	movl	$1, %eax
@@ -69,15 +55,12 @@ ENTRY(get_sev_encryption_bit)
 
 	movl	%ebx, %eax
 	andl	$0x3f, %eax		/* Return the encryption bit location */
-	movl	%eax, enc_bit(%edi)
 	jmp	.Lsev_exit
 
 .Lno_sev:
 	xor	%eax, %eax
-	movl	%eax, enc_bit(%edi)
 
 .Lsev_exit:
-	pop	%edi
 	pop	%edx
 	pop	%ecx
 	pop	%ebx
@@ -113,8 +96,6 @@ ENTRY(set_sev_encryption_mask)
 ENDPROC(set_sev_encryption_mask)
 
 	.data
-enc_bit:
-	.int	0xffffffff
 
 #ifdef CONFIG_AMD_MEM_ENCRYPT
 	.balign	8


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

* Re: [GIT pull] perf fix for 4.19
  2018-09-29 18:25 [GIT pull] perf fix for 4.19 Thomas Gleixner
  2018-09-29 18:25 ` [GIT pull] timer fixes " Thomas Gleixner
  2018-09-29 18:25 ` [GIT pull] x86 fix " Thomas Gleixner
@ 2018-09-29 22:24 ` Greg Kroah-Hartman
  2 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-29 22:24 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, x86

On Sat, Sep 29, 2018 at 08:25:47PM +0200, Thomas Gleixner wrote:
> Greg,
> 
> please pull the latest perf-urgent-for-linus git tree from:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-for-linus

Now pulled, thanks.

greg k-h

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

* Re: [GIT pull] x86 fix for 4.19
  2018-09-29 18:25 ` [GIT pull] x86 fix " Thomas Gleixner
@ 2018-09-29 22:24   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-29 22:24 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, x86

On Sat, Sep 29, 2018 at 08:25:48PM +0200, Thomas Gleixner wrote:
> Greg,
> 
> please pull the latest x86-urgent-for-linus git tree from:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus

Now pulled, thanks.

greg k-h

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

* Re: [GIT pull] timer fixes for 4.19
  2018-09-29 18:25 ` [GIT pull] timer fixes " Thomas Gleixner
@ 2018-09-29 22:24   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-29 22:24 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, x86

On Sat, Sep 29, 2018 at 08:25:47PM +0200, Thomas Gleixner wrote:
> Greg,
> 
> please pull the latest timers-urgent-for-linus git tree from:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus

Now pulled, thanks.

greg k-h

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

end of thread, other threads:[~2018-09-29 22:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-29 18:25 [GIT pull] perf fix for 4.19 Thomas Gleixner
2018-09-29 18:25 ` [GIT pull] timer fixes " Thomas Gleixner
2018-09-29 22:24   ` Greg Kroah-Hartman
2018-09-29 18:25 ` [GIT pull] x86 fix " Thomas Gleixner
2018-09-29 22:24   ` Greg Kroah-Hartman
2018-09-29 22:24 ` [GIT pull] perf " Greg Kroah-Hartman

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).