* [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly
@ 2019-03-30 0:57 Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 02/15] ext4: report real fs size after failed resize Sasha Levin
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Stephane Eranian, Andi Kleen, Jiri Olsa, Kan Liang,
Arnaldo Carvalho de Melo, Sasha Levin
From: Stephane Eranian <eranian@google.com>
[ Upstream commit d9c1bb2f6a2157b38e8eb63af437cb22701d31ee ]
On mmap(), perf_events generates a RECORD_MMAP record and then checks
which events are interested in this record. There are currently 2
versions of mmap records: RECORD_MMAP and RECORD_MMAP2. MMAP2 is larger.
The event configuration controls which version the user level tool
accepts.
If the event->attr.mmap2=1 field then MMAP2 record is returned. The
perf_event_mmap_output() takes care of this. It checks attr->mmap2 and
corrects the record fields before putting it in the sampling buffer of
the event. At the end the function restores the modified MMAP record
fields.
The problem is that the function restores the size but not the type.
Thus, if a subsequent event only accepts MMAP type, then it would
instead receive an MMAP2 record with a size of MMAP record.
This patch fixes the problem by restoring the record type on exit.
Signed-off-by: Stephane Eranian <eranian@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Fixes: 13d7a2410fa6 ("perf: Add attr->mmap2 attribute to an event")
Link: http://lkml.kernel.org/r/20190307185233.225521-1-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index fd8dea2b36ec..41d83a9aacaf 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5533,6 +5533,7 @@ static void perf_event_mmap_output(struct perf_event *event,
struct perf_output_handle handle;
struct perf_sample_data sample;
int size = mmap_event->event_id.header.size;
+ u32 type = mmap_event->event_id.header.type;
int ret;
if (!perf_event_mmap_match(event, data))
@@ -5576,6 +5577,7 @@ static void perf_event_mmap_output(struct perf_event *event,
perf_output_end(&handle);
out:
mmap_event->event_id.header.size = size;
+ mmap_event->event_id.header.type = type;
}
static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 02/15] ext4: report real fs size after failed resize
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 03/15] ALSA: echoaudio: add a check for ioremap_nocache Sasha Levin
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Lukas Czerner, Theodore Ts'o, Sasha Levin, linux-ext4
From: Lukas Czerner <lczerner@redhat.com>
[ Upstream commit 6c7328400e0488f7d49e19e02290ba343b6811b2 ]
Currently when the file system resize using ext4_resize_fs() fails it
will report into log that "resized filesystem to <requested block
count>". However this may not be true in the case of failure. Use the
current block count as returned by ext4_blocks_count() to report the
block count.
Additionally, report a warning that "error occurred during file system
resize"
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ext4/resize.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 96372539dc06..196b9d3fa3b9 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -2042,6 +2042,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
free_flex_gd(flex_gd);
if (resize_inode != NULL)
iput(resize_inode);
- ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", n_blocks_count);
+ if (err)
+ ext4_warning(sb, "error (%d) occurred during "
+ "file system resize", err);
+ ext4_msg(sb, KERN_INFO, "resized filesystem to %llu",
+ ext4_blocks_count(es));
return err;
}
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 03/15] ALSA: echoaudio: add a check for ioremap_nocache
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 02/15] ext4: report real fs size after failed resize Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 04/15] ALSA: sb8: add a check for request_region Sasha Levin
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Kangjie Lu, Takashi Iwai, Sasha Levin
From: Kangjie Lu <kjlu@umn.edu>
[ Upstream commit 6ade657d6125ec3ec07f95fa51e28138aef6208f ]
In case ioremap_nocache fails, the fix releases chip and returns
an error code upstream to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/echoaudio/echoaudio.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 3a1fe2c79b4a..c07bf03a07bc 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1990,6 +1990,11 @@ static int snd_echo_create(struct snd_card *card,
}
chip->dsp_registers = (volatile u32 __iomem *)
ioremap_nocache(chip->dsp_registers_phys, sz);
+ if (!chip->dsp_registers) {
+ dev_err(chip->card->dev, "ioremap failed\n");
+ snd_echo_free(chip);
+ return -ENOMEM;
+ }
if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) {
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 04/15] ALSA: sb8: add a check for request_region
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 02/15] ext4: report real fs size after failed resize Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 03/15] ALSA: echoaudio: add a check for ioremap_nocache Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 05/15] IB/mlx4: Fix race condition between catas error reset and aliasguid flows Sasha Levin
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Kangjie Lu, Takashi Iwai, Sasha Levin
From: Kangjie Lu <kjlu@umn.edu>
[ Upstream commit dcd0feac9bab901d5739de51b3f69840851f8919 ]
In case request_region fails, the fix returns an error code to
avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/isa/sb/sb8.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 6c32b3aa34af..938262d3aa7b 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
/* block the 0x388 port to avoid PnP conflicts */
acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
+ if (!acard->fm_res) {
+ err = -EBUSY;
+ goto _err;
+ }
if (port[dev] != SNDRV_AUTO_PORT) {
if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 05/15] IB/mlx4: Fix race condition between catas error reset and aliasguid flows
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (2 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 04/15] ALSA: sb8: add a check for request_region Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 06/15] mmc: davinci: remove extraneous __init annotation Sasha Levin
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jack Morgenstein, Leon Romanovsky, Jason Gunthorpe, Sasha Levin,
linux-rdma
From: Jack Morgenstein <jackm@dev.mellanox.co.il>
[ Upstream commit 587443e7773e150ae29e643ee8f41a1eed226565 ]
Code review revealed a race condition which could allow the catas error
flow to interrupt the alias guid query post mechanism at random points.
Thiis is fixed by doing cancel_delayed_work_sync() instead of
cancel_delayed_work() during the alias guid mechanism destroy flow.
Fixes: a0c64a17aba8 ("mlx4: Add alias_guid mechanism")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c
index 0eb141c41416..fb60229bf191 100644
--- a/drivers/infiniband/hw/mlx4/alias_GUID.c
+++ b/drivers/infiniband/hw/mlx4/alias_GUID.c
@@ -579,8 +579,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev)
unsigned long flags;
for (i = 0 ; i < dev->num_ports; i++) {
- cancel_delayed_work(&dev->sriov.alias_guid.ports_guid[i].alias_guid_work);
det = &sriov->alias_guid.ports_guid[i];
+ cancel_delayed_work_sync(&det->alias_guid_work);
spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags);
while (!list_empty(&det->cb_list)) {
cb_ctx = list_entry(det->cb_list.next,
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 06/15] mmc: davinci: remove extraneous __init annotation
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (3 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 05/15] IB/mlx4: Fix race condition between catas error reset and aliasguid flows Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 07/15] ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration Sasha Levin
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Arnd Bergmann, Ulf Hansson, Sasha Levin, linux-mmc
From: Arnd Bergmann <arnd@arndb.de>
[ Upstream commit 9ce58dd7d9da3ca0d7cb8c9568f1c6f4746da65a ]
Building with clang finds a mistaken __init tag:
WARNING: vmlinux.o(.text+0x5e4250): Section mismatch in reference from the function davinci_mmcsd_probe() to the function .init.text:init_mmcsd_host()
The function davinci_mmcsd_probe() references
the function __init init_mmcsd_host().
This is often because davinci_mmcsd_probe lacks a __init
annotation or the annotation of init_mmcsd_host is wrong.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/davinci_mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 5d4c5e0fba2f..7e154a8213e2 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1147,7 +1147,7 @@ static inline void mmc_davinci_cpufreq_deregister(struct mmc_davinci_host *host)
{
}
#endif
-static void __init init_mmcsd_host(struct mmc_davinci_host *host)
+static void init_mmcsd_host(struct mmc_davinci_host *host)
{
mmc_davinci_reset_ctrl(host, 1);
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 07/15] ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (4 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 06/15] mmc: davinci: remove extraneous __init annotation Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 08/15] thermal/int340x_thermal: fix mode setting Sasha Levin
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Colin Ian King, Takashi Iwai, Sasha Levin
From: Colin Ian King <colin.king@canonical.com>
[ Upstream commit b4748e7ab731e436cf5db4786358ada5dd2db6dd ]
The function snd_opl3_drum_switch declaration in the header file
has the order of the two arguments on_off and vel swapped when
compared to the definition arguments of vel and on_off. Fix this
by swapping them around to match the definition.
This error predates the git history, so no idea when this error
was introduced.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/drivers/opl3/opl3_voice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/drivers/opl3/opl3_voice.h b/sound/drivers/opl3/opl3_voice.h
index a371c075ac87..e26702559f61 100644
--- a/sound/drivers/opl3/opl3_voice.h
+++ b/sound/drivers/opl3/opl3_voice.h
@@ -41,7 +41,7 @@ void snd_opl3_timer_func(unsigned long data);
/* Prototypes for opl3_drums.c */
void snd_opl3_load_drums(struct snd_opl3 *opl3);
-void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan);
+void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off, struct snd_midi_channel *chan);
/* Prototypes for opl3_oss.c */
#ifdef CONFIG_SND_SEQUENCER_OSS
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 08/15] thermal/int340x_thermal: fix mode setting
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (5 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 07/15] ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 09/15] tools/power turbostat: return the exit status of a command Sasha Levin
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Matthew Garrett, Matthew Garrett, Zhang Rui, Sasha Levin,
linux-pm
From: Matthew Garrett <matthewgarrett@google.com>
[ Upstream commit 396ee4d0cd52c13b3f6421b8d324d65da5e7e409 ]
int3400 only pushes the UUID into the firmware when the mode is flipped
to "enable". The current code only exposes the mode flag if the firmware
supports the PASSIVE_1 UUID, which not all machines do. Remove the
restriction.
Signed-off-by: Matthew Garrett <mjg59@google.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/thermal/int340x_thermal/int3400_thermal.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c
index edc1cce117ba..7b96b20e939a 100644
--- a/drivers/thermal/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/int340x_thermal/int3400_thermal.c
@@ -208,10 +208,9 @@ static int int3400_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv);
- if (priv->uuid_bitmap & 1 << INT3400_THERMAL_PASSIVE_1) {
- int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
- int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
- }
+ int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
+ int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
+
priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0,
priv, &int3400_thermal_ops,
&int3400_thermal_params, 0, 0);
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 09/15] tools/power turbostat: return the exit status of a command
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (6 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 08/15] thermal/int340x_thermal: fix mode setting Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 10/15] perf top: Fix error handling in cmd_top() Sasha Levin
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: David Arcari, Rafael J . Wysocki, Sasha Levin, linux-pm
From: David Arcari <darcari@redhat.com>
[ Upstream commit 2a95496634a017c19641f26f00907af75b962f01 ]
turbostat failed to return a non-zero exit status even though the
supplied command (turbostat <command>) failed. Currently when turbostat
forks a command it returns zero instead of the actual exit status of the
command. Modify the code to return the exit status.
Signed-off-by: David Arcari <darcari@redhat.com>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index f771e09eef33..06e1bf9bf1a8 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -2347,6 +2347,9 @@ int fork_it(char **argv)
signal(SIGQUIT, SIG_IGN);
if (waitpid(child_pid, &status, 0) == -1)
err(status, "waitpid");
+
+ if (WIFEXITED(status))
+ status = WEXITSTATUS(status);
}
/*
* n.b. fork_it() does not check for errors from for_all_cpus()
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 10/15] perf top: Fix error handling in cmd_top()
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (7 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 09/15] tools/power turbostat: return the exit status of a command Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 11/15] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() Sasha Levin
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Changbin Du, Alexei Starovoitov, Daniel Borkmann, Namhyung Kim,
Peter Zijlstra, Steven Rostedt, Arnaldo Carvalho de Melo,
Sasha Levin
From: Changbin Du <changbin.du@gmail.com>
[ Upstream commit 70c819e4bf1c5f492768b399d898d458ccdad2b6 ]
We should go to the cleanup path, to avoid leaks, detected using gcc's
ASan.
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20190316080556.3075-9-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-top.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c5b9c3f01d85..ea02883c3405 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1256,8 +1256,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
symbol_conf.priv_size = sizeof(struct annotation);
symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
- if (symbol__init(NULL) < 0)
- return -1;
+ status = symbol__init(NULL);
+ if (status < 0)
+ goto out_delete_evlist;
sort__setup_elide(stdout);
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 11/15] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test()
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (8 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 10/15] perf top: Fix error handling in cmd_top() Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 12/15] x86/hpet: Prevent potential NULL pointer dereference Sasha Levin
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Changbin Du, Alexei Starovoitov, Daniel Borkmann, Namhyung Kim,
Peter Zijlstra, Steven Rostedt, Arnaldo Carvalho de Melo,
Sasha Levin
From: Changbin Du <changbin.du@gmail.com>
[ Upstream commit d982b33133284fa7efa0e52ae06b88f9be3ea764 ]
=================================================================
==20875==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1160 byte(s) in 1 object(s) allocated from:
#0 0x7f1b6fc84138 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee138)
#1 0x55bd50005599 in zalloc util/util.h:23
#2 0x55bd500068f5 in perf_evsel__newtp_idx util/evsel.c:327
#3 0x55bd4ff810fc in perf_evsel__newtp /home/work/linux/tools/perf/util/evsel.h:216
#4 0x55bd4ff81608 in test__perf_evsel__tp_sched_test tests/evsel-tp-sched.c:69
#5 0x55bd4ff528e6 in run_test tests/builtin-test.c:358
#6 0x55bd4ff52baf in test_and_print tests/builtin-test.c:388
#7 0x55bd4ff543fe in __cmd_test tests/builtin-test.c:583
#8 0x55bd4ff5572f in cmd_test tests/builtin-test.c:722
#9 0x55bd4ffc4087 in run_builtin /home/changbin/work/linux/tools/perf/perf.c:302
#10 0x55bd4ffc45c6 in handle_internal_command /home/changbin/work/linux/tools/perf/perf.c:354
#11 0x55bd4ffc49ca in run_argv /home/changbin/work/linux/tools/perf/perf.c:398
#12 0x55bd4ffc5138 in main /home/changbin/work/linux/tools/perf/perf.c:520
#13 0x7f1b6e34809a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
Indirect leak of 19 byte(s) in 1 object(s) allocated from:
#0 0x7f1b6fc83f30 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf30)
#1 0x7f1b6e3ac30f in vasprintf (/lib/x86_64-linux-gnu/libc.so.6+0x8830f)
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Fixes: 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint format fields")
Link: http://lkml.kernel.org/r/20190316080556.3075-17-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/evsel-tp-sched.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
index 5ce11eac4dd3..959bdb4a79ad 100644
--- a/tools/perf/tests/evsel-tp-sched.c
+++ b/tools/perf/tests/evsel-tp-sched.c
@@ -78,5 +78,6 @@ int test__perf_evsel__tp_sched_test(void)
if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
ret = -1;
+ perf_evsel__delete(evsel);
return ret;
}
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 12/15] x86/hpet: Prevent potential NULL pointer dereference
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (9 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 11/15] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 13/15] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors Sasha Levin
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Aditya Pakki, Thomas Gleixner, kjlu, Borislav Petkov,
H. Peter Anvin, Kees Cook, Joe Perches, Nicolai Stange,
Roland Dreier, Sasha Levin
From: Aditya Pakki <pakki001@umn.edu>
[ Upstream commit 2e84f116afca3719c9d0a1a78b47b48f75fd5724 ]
hpet_virt_address may be NULL when ioremap_nocache fail, but the code lacks
a check.
Add a check to prevent NULL pointer dereference.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: kjlu@umn.edu
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Joe Perches <joe@perches.com>
Cc: Nicolai Stange <nstange@suse.de>
Cc: Roland Dreier <roland@purestorage.com>
Link: https://lkml.kernel.org/r/20190319021958.17275-1-pakki001@umn.edu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/hpet.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 319bcb9372fe..3e9c5725732f 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -799,6 +799,8 @@ int __init hpet_enable(void)
return 0;
hpet_set_mapping();
+ if (!hpet_virt_address)
+ return 0;
/*
* Read the period and check for a sane value:
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 13/15] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (10 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 12/15] x86/hpet: Prevent potential NULL pointer dereference Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 14/15] iommu/vt-d: Check capability before disabling protected memory Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 15/15] fix incorrect error code mapping for OBJECTID_NOT_FOUND Sasha Levin
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Matthew Whitehead, Thomas Gleixner, luto, Sasha Levin
From: Matthew Whitehead <tedheadster@gmail.com>
[ Upstream commit 18fb053f9b827bd98cfc64f2a35df8ab19745a1d ]
There are comments in processor-cyrix.h advising you to _not_ make calls
using the deprecated macros in this style:
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
This is because it expands the macro into a non-functioning calling
sequence. The calling order must be:
outb(CX86_CCR2, 0x22);
inb(0x23);
From the comments:
* When using the old macros a line like
* setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
* gets expanded to:
* do {
* outb((CX86_CCR2), 0x22);
* outb((({
* outb((CX86_CCR2), 0x22);
* inb(0x23);
* }) | 0x88), 0x23);
* } while (0);
The new macros fix this problem, so use them instead. Tested on an
actual Geode processor.
Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: luto@kernel.org
Link: https://lkml.kernel.org/r/1552596361-8967-2-git-send-email-tedheadster@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/cpu/cyrix.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index aaf152e79637..0007827196a4 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -120,7 +120,7 @@ static void set_cx86_reorder(void)
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
/* Load/Store Serialize to mem access disable (=reorder it) */
- setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
+ setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
/* set load/store serialize from 1GB to 4GB */
ccr3 |= 0xe0;
setCx86(CX86_CCR3, ccr3);
@@ -131,11 +131,11 @@ static void set_cx86_memwb(void)
printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
/* CCR2 bit 2: unlock NW bit */
- setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
+ setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
/* set 'Not Write-through' */
write_cr0(read_cr0() | X86_CR0_NW);
/* CCR2 bit 2: lock NW bit and set WT1 */
- setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
+ setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14);
}
/*
@@ -149,14 +149,14 @@ static void geode_configure(void)
local_irq_save(flags);
/* Suspend on halt power saving and enable #SUSP pin */
- setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
+ setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
ccr3 = getCx86(CX86_CCR3);
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
/* FPU fast, DTE cache, Mem bypass */
- setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
+ setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38);
setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
set_cx86_memwb();
@@ -291,7 +291,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
/* GXm supports extended cpuid levels 'ala' AMD */
if (c->cpuid_level == 2) {
/* Enable cxMMX extensions (GX1 Datasheet 54) */
- setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
+ setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1);
/*
* GXm : 0x30 ... 0x5f GXm datasheet 51
@@ -314,7 +314,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
if (dir1 > 7) {
dir0_msn++; /* M II */
/* Enable MMX extensions (App note 108) */
- setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
+ setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
} else {
/* A 6x86MX - it has the bug. */
set_cpu_bug(c, X86_BUG_COMA);
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 14/15] iommu/vt-d: Check capability before disabling protected memory
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (11 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 13/15] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 15/15] fix incorrect error code mapping for OBJECTID_NOT_FOUND Sasha Levin
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Lu Baolu, Jacob Pan, mark gross, Joerg Roedel, Sasha Levin, iommu
From: Lu Baolu <baolu.lu@linux.intel.com>
[ Upstream commit 5bb71fc790a88d063507dc5d445ab8b14e845591 ]
The spec states in 10.4.16 that the Protected Memory Enable
Register should be treated as read-only for implementations
not supporting protected memory regions (PLMR and PHMR fields
reported as Clear in the Capability register).
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: mark gross <mgross@intel.com>
Suggested-by: Ashok Raj <ashok.raj@intel.com>
Fixes: f8bab73515ca5 ("intel-iommu: PMEN support")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/intel-iommu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 2068cb59f7ed..b1966269f26a 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -1402,6 +1402,9 @@ static void iommu_disable_protect_mem_regions(struct intel_iommu *iommu)
u32 pmen;
unsigned long flags;
+ if (!cap_plmr(iommu->cap) && !cap_phmr(iommu->cap))
+ return;
+
raw_spin_lock_irqsave(&iommu->register_lock, flags);
pmen = readl(iommu->reg + DMAR_PMEN_REG);
pmen &= ~DMA_PMEN_EPM;
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH AUTOSEL 3.18 15/15] fix incorrect error code mapping for OBJECTID_NOT_FOUND
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
` (12 preceding siblings ...)
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 14/15] iommu/vt-d: Check capability before disabling protected memory Sasha Levin
@ 2019-03-30 0:57 ` Sasha Levin
13 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2019-03-30 0:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Steve French, Amir Goldstein, Sasha Levin, linux-cifs
From: Steve French <stfrench@microsoft.com>
[ Upstream commit 85f9987b236cf46e06ffdb5c225cf1f3c0acb789 ]
It was mapped to EIO which can be confusing when user space
queries for an object GUID for an object for which the server
file system doesn't support (or hasn't saved one).
As Amir Goldstein suggested this is similar to ENOATTR
(equivalently ENODATA in Linux errno definitions) so
changing NT STATUS code mapping for OBJECTID_NOT_FOUND
to ENODATA.
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/cifs/smb2maperror.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index 98c25b969ab8..7e93d5706bf6 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -1034,7 +1034,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
{STATUS_UNFINISHED_CONTEXT_DELETED, -EIO,
"STATUS_UNFINISHED_CONTEXT_DELETED"},
{STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"},
- {STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"},
+ /* Note that ENOATTTR and ENODATA are the same errno */
+ {STATUS_OBJECTID_NOT_FOUND, -ENODATA, "STATUS_OBJECTID_NOT_FOUND"},
{STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"},
{STATUS_WRONG_CREDENTIAL_HANDLE, -EIO,
"STATUS_WRONG_CREDENTIAL_HANDLE"},
--
2.19.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2019-03-30 0:58 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-30 0:57 [PATCH AUTOSEL 3.18 01/15] perf/core: Restore mmap record type correctly Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 02/15] ext4: report real fs size after failed resize Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 03/15] ALSA: echoaudio: add a check for ioremap_nocache Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 04/15] ALSA: sb8: add a check for request_region Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 05/15] IB/mlx4: Fix race condition between catas error reset and aliasguid flows Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 06/15] mmc: davinci: remove extraneous __init annotation Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 07/15] ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 08/15] thermal/int340x_thermal: fix mode setting Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 09/15] tools/power turbostat: return the exit status of a command Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 10/15] perf top: Fix error handling in cmd_top() Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 11/15] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 12/15] x86/hpet: Prevent potential NULL pointer dereference Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 13/15] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 14/15] iommu/vt-d: Check capability before disabling protected memory Sasha Levin
2019-03-30 0:57 ` [PATCH AUTOSEL 3.18 15/15] fix incorrect error code mapping for OBJECTID_NOT_FOUND Sasha Levin
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).