Jan Beulich | 2 Sep 14:46 2015

[PATCH v2] x86: fix small LDT allocation for Xen

While commit 37868fe113 ("x86/ldt: Make modify_ldt synchronous") added
a nice comment explaining that Xen needs page-aligned whole page chunks
for guest descriptor tables, it then nevertheless used kzalloc() on the
small size path. As I'm unaware of guarantees for kmalloc(PAGE_SIZE, )
to return page-aligned memory blocks, I believe this needs to be
switched back to __get_free_page().

Signed-off-by: Jan Beulich <jbeulich <at> suse.com>
Cc: Andy Lutomirski <luto <at> kernel.org>
Cc: Boris Ostrovsky <boris.ostrovsky <at> oracle.com>
Cc: David Vrabel <david.vrabel <at> citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk <at> oracle.com>
---
v2: Also adjust the freeing side.
---
 arch/x86/kernel/ldt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 4.2/arch/x86/kernel/ldt.c
+++ 4.2-x86-LDT-alloc/arch/x86/kernel/ldt.c
 <at>  <at>  -58,7 +58,7  <at>  <at>  static struct ldt_struct *alloc_ldt_stru
 	if (alloc_size > PAGE_SIZE)
 		new_ldt->entries = vzalloc(alloc_size);
 	else
-		new_ldt->entries = kzalloc(PAGE_SIZE, GFP_KERNEL);
+		new_ldt->entries = (void *)__get_free_page(GFP_KERNEL|__GFP_ZERO);

 	if (!new_ldt->entries) {
 		kfree(new_ldt);
 <at>  <at>  -95,7 +95,7  <at>  <at>  static void free_ldt_struct(struct ldt_s
(Continue reading)

Tejun Heo | 2 Sep 14:34 2015

[GIT PULL] percpu changes for 4.3

Hello,

Minor cleanups.

Thanks.

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git for-4.3

for you to fetch changes up to 292c24a073ee34c629966eec8b48d54b0a206667:

  percpu: clean up of schunk->map[] assignment in pcpu_setup_first_chunk (2015-07-21 11:31:00 -0400)

----------------------------------------------------------------
Baoquan He (1):
      percpu: clean up of schunk->map[] assignment in pcpu_setup_first_chunk

Tejun Heo (1):
      percpu: update incorrect comment for this_cpu_*() operations

 include/linux/percpu-defs.h | 6 ++----
 mm/percpu.c                 | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

--

-- 
(Continue reading)

Tejun Heo | 2 Sep 14:31 2015

[GIT PULL] libata changes for 4.3

Hello, Linus.

Nothing interesting.  A couple device specific minor updates and a
kernel doc change.

Thanks.

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git for-4.3

for you to fetch changes up to d6e9b704d9553ee9d54baddcc6d9b63a4574f272:

  ata: pata_arasam_cf: Use devm_clk_get (2015-08-22 09:36:06 -0700)

----------------------------------------------------------------
Geert Uytterhoeven (1):
      ata: sata_rcar: Remove obsolete sata-r8a779* platform_device_id entries

Randy Dunlap (1):
      libata: fix libata-core.c kernel-doc warning

Vaishali Thakkar (1):
      ata: pata_arasam_cf: Use devm_clk_get

 drivers/ata/libata-core.c    |  1 +
(Continue reading)

Tejun Heo | 2 Sep 14:27 2015

[GIT PULL] workqueue changes for 4.3

Hello, Linus.

Only three trivial changes for workqueue this time - doc, MAINTAINERS
and EXPORT_SYMBOL updates.

Thanks.

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-4.3

for you to fetch changes up to 355c06633e233a57155b827ebe99b91c35bc1f5c:

  workqueue: fix some docbook warnings (2015-08-17 15:48:24 -0400)

----------------------------------------------------------------
Jonathan Corbet (1):
      workqueue: fix some docbook warnings

Lai Jiangshan (1):
      workqueue: add myself as a dedicated reviwer

Tim Gardner (1):
      workqueue: Make flush_workqueue() available again to non GPL modules

 MAINTAINERS               | 1 +
(Continue reading)

Adrian Hunter | 2 Sep 14:15 2015
Picon

[PATCH V2 0/7] x86/insn: perf tools: Add a few new x86 instructions

Hi

Here is version 2.

perf tools has a copy of the x86 instruction decoder for decoding
Intel PT.  This patch set adds a perf tools test to use it to
test new instructions.  Subsequent patches add a few new x86
instructions, or very slightly modify them in the case of MPX.
Those changes affect both perf tools and x86/insn.

I suggest Arnaldo takes all these patches as they mainly affect
perf tools, at least in terms of lines-of-code.

Changes in V2:

    perf tools: Display build warning if x86 instruction decoder differs from kernel
	New patch (slightly modified from the proposal and so without Jiri's Ack)

    x86/insn: perf tools: Pedantically tweak opcode map for MPX instructions
	Tweaked comment to refer to: tools/perf/perf test "x86 ins"

    x86/insn: perf tools: Add new SHA instructions
	Tweaked comment to refer to: tools/perf/perf test "x86 ins"

    x86/insn: perf tools: Add new memory instructions
	Tweaked comment to refer to: tools/perf/perf test "x86 ins"

    x86/insn: perf tools: Add new memory protection keys instructions
	New patch

(Continue reading)

Sudip Mukherjee | 2 Sep 13:24 2015
Picon

[PATCH 1/4] drivers/misc/sgi-gru: remove unused variable

These variables were only assigned some value and were never used.

Signed-off-by: Sudip Mukherjee <sudip <at> vectorindia.org>
---

I have removed the variables in the functions gru_dump_tfm() and
gru_dump_tgh() but it appeared that the intended logic might have been
something like:
bytes = GRU_NUM_TFM * GRU_CACHE_LINE_BYTES;
if (bytes > ubufend - ubuf)
	return -EFBIG;

But since I was not sure so removing the variable was the safe choice as
it is not changing the logic.

 drivers/misc/sgi-gru/grukdump.c     | 12 ++----------
 drivers/misc/sgi-gru/grukservices.c |  2 --
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c
index a3700a5..fa515e3 100644
--- a/drivers/misc/sgi-gru/grukdump.c
+++ b/drivers/misc/sgi-gru/grukdump.c
 <at>  <at>  -78,11 +78,7  <at>  <at>  static int gru_dump_tfm(struct gru_state *gru,
 		void __user *ubuf, void __user *ubufend)
 {
 	struct gru_tlb_fault_map *tfm;
-	int i, ret, bytes;
-
-	bytes = GRU_NUM_TFM * GRU_CACHE_LINE_BYTES;
(Continue reading)

Willy Tarreau | 2 Sep 13:22 2015
Picon

Kernel Recipes 2015 conference at end of month

Hi,

as a reminder, the Kernel Recipes 2015 conference is scheduled at the
end of this month in Paris. Registrations opened yesterday but there
are still some places left. More about it here :

       https://kernel-recipes.org/

Cheers,
Willy

Andrey Konovalov | 2 Sep 13:08 2015
Picon

Use-after-free in page_cache_async_readahead

Hi!

While running KASAN on 4.2 with Trinity I got the following report:

==================================================================
BUG: KASan: use after free in page_cache_async_readahead+0x2cb/0x3f0
at addr ffff880034bf6690
Read of size 8 by task sshd/2571
=============================================================================
BUG kmalloc-16 (Tainted: G        W      ): kasan: bad access detected
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: Allocated in bdi_init+0x168/0x960 age=554826 cpu=0 pid=6
[<      none      >] __slab_alloc+0x492/0x4b0 mm/slub.c:2405
[<     inlined    >] kmem_cache_alloc_trace+0x13b/0x170
slab_alloc_node mm/slub.c:2473
[<     inlined    >] kmem_cache_alloc_trace+0x13b/0x170 slab_alloc
mm/slub.c:2515
[<      none      >] kmem_cache_alloc_trace+0x13b/0x170 mm/slub.c:2532
[<     inlined    >] bdi_init+0x168/0x960 kzalloc include/linux/slab.h:430
[<     inlined    >] bdi_init+0x168/0x960 cgwb_bdi_init mm/backing-dev.c:749
[<      none      >] bdi_init+0x168/0x960 mm/backing-dev.c:775
[<      none      >] blk_alloc_queue_node+0x147/0x670 block/blk-core.c:654
[<      none      >] blk_init_queue_node+0x1f/0x60 block/blk-core.c:750
[<      none      >] blk_init_queue+0xe/0x10 block/blk-core.c:741
[<      none      >] __scsi_alloc_queue+0x14/0x30 drivers/scsi/scsi_lib.c:2139
[<      none      >] scsi_alloc_queue+0x32/0xa0 drivers/scsi/scsi_lib.c:2151
[<      none      >] scsi_alloc_sdev+0x73b/0xd50 drivers/scsi/scsi_scan.c:266
[<      none      >] scsi_probe_and_add_lun+0x1545/0x2180
(Continue reading)

Mike Rapoport | 2 Sep 13:08 2015
Picon

[PATCH] regmap: fix compilation warning

Explicitly initialize ret to -EINVAL in regmap_raw_read to fix the
following compilation warning:

  CC      drivers/base/regmap/regmap.o
linux/drivers/base/regmap/regmap.c: In function ‘regmap_raw_read’:
linux/drivers/base/regmap/regmap.c:2174:6: warning: ‘ret’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
  int ret, i;
      ^

Signed-off-by: Mike Rapoport <mike.rapoport <at> gmail.com>
---
 drivers/base/regmap/regmap.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 7111d04..ba0aab4 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
 <at>  <at>  -2171,14 +2171,15  <at>  <at>  int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
 	size_t val_bytes = map->format.val_bytes;
 	size_t val_count = val_len / val_bytes;
 	unsigned int v;
-	int ret, i;
+	int i;
+	int ret = -EINVAL;

 	if (!map->bus)
-		return -EINVAL;
+		return ret;
(Continue reading)

Zhenzhong Duan | 2 Sep 12:51 2015
Picon

[PATCH] xen: fix the check of e_pfn in xen_find_pfn_range

On some numa system, after dom0 up, we see below warning even if there are
enough pfn ranges could be used for remapping.
"Unable to find available pfn range, not remapping identity pages"

Fix it to avoid getting a memory region of zero size in xen_find_pfn_range.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan <at> oracle.com>
---
  arch/x86/xen/setup.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index a3a7546..c11f6b2 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
 <at>  <at>  -178,7 +178,7  <at>  <at>  static unsigned long __init xen_find_pfn_range(
  		e_pfn = PFN_DOWN(entry->addr + entry->size);

  		/* We only care about E820 after this */
-		if (e_pfn < *min_pfn)
+		if (e_pfn <= *min_pfn)
  			continue;

  		s_pfn = PFN_UP(entry->addr);
--

-- 
1.7.3

Sudip Mukherjee | 2 Sep 12:44 2015
Picon

[PATCH] regulator: core: fix possible NULL dereference

We were checking rdev->supply for NULL after dereferencing it. Lets
check for rdev->supply along with _regulator_is_enabled() and call
regulator_enable() only if rdev->supply is not NULL.

Signed-off-by: Sudip Mukherjee <sudip <at> vectorindia.org>
---
 drivers/regulator/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7a85ac9..9283d9f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
 <at>  <at>  -1422,11 +1422,10  <at>  <at>  static int regulator_resolve_supply(struct regulator_dev *rdev)
 		return ret;

 	/* Cascade always-on state to supply */
-	if (_regulator_is_enabled(rdev)) {
+	if (_regulator_is_enabled(rdev) && rdev->supply) {
 		ret = regulator_enable(rdev->supply);
 		if (ret < 0) {
-			if (rdev->supply)
-				_regulator_put(rdev->supply);
+			_regulator_put(rdev->supply);
 			return ret;
 		}
 	}
--

-- 
1.9.1

(Continue reading)


Gmane