* [Qemu-devel] [PULL 0/4] Migration pull
From: Juan Quintela @ 2016-11-14 19:57 UTC (permalink / raw)
To: qemu-devel; +Cc: amit.shah, dgilbert
The following changes since commit 83c83f9a5266ff113060f887f106a47920fa6974:
Merge remote-tracking branch 'bonzini/tags/for-upstream' into staging (2016-11-11 12:51:50 +0000)
are available in the git repository at:
git://github.com/juanquintela/qemu.git tags/migration/20161114
for you to fetch changes up to 5c90308f07335451a08c030dc40a9eed4698152b:
migration: Fix return code of ram_save_iterate() (2016-11-14 19:35:41 +0100)
----------------------------------------------------------------
migration/next for 20161114
Hi
In this pull:
- two more tests (halil)
- fix return code of ram_save_iterate (thomas)
- fix assignment for has_x_chackponit_delay (zhang)
Please apply, Juan.
----------------------------------------------------------------
Halil Pasic (2):
tests/test-vmstate.c: add save_buffer util func
tests/test-vmstate.c: add array of pointer to struct
Thomas Huth (1):
migration: Fix return code of ram_save_iterate()
zhanghailiang (1):
migration: fix missing assignment for has_x_checkpoint_delay
hmp.c | 1 +
migration/migration.c | 1 +
migration/ram.c | 6 ++--
tests/test-vmstate.c | 97 ++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 90 insertions(+), 15 deletions(-)
^ permalink raw reply
* [Qemu-devel] [PULL 2/4] tests/test-vmstate.c: add save_buffer util func
From: Juan Quintela @ 2016-11-14 19:57 UTC (permalink / raw)
To: qemu-devel; +Cc: amit.shah, dgilbert, Halil Pasic
In-Reply-To: <1479153474-2401-1-git-send-email-quintela@redhat.com>
From: Halil Pasic <pasic@linux.vnet.ibm.com>
Let us de-duplicate some code by introducing an utility function for
saving a chunk of bytes (used when testing load based on wire).
Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: Guenther Hutzl <hutzl@linux.vnet.ibm.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
tests/test-vmstate.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index d8da26f..d513dc6 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -83,6 +83,13 @@ static void save_vmstate(const VMStateDescription *desc, void *obj)
qemu_fclose(f);
}
+static void save_buffer(const uint8_t *buf, size_t buf_size)
+{
+ QEMUFile *fsave = open_test_file(true);
+ qemu_put_buffer(fsave, buf, buf_size);
+ qemu_fclose(fsave);
+}
+
static void compare_vmstate(uint8_t *wire, size_t size)
{
QEMUFile *f = open_test_file(false);
@@ -309,15 +316,13 @@ static const VMStateDescription vmstate_versioned = {
static void test_load_v1(void)
{
- QEMUFile *fsave = open_test_file(true);
uint8_t buf[] = {
0, 0, 0, 10, /* a */
0, 0, 0, 30, /* c */
0, 0, 0, 0, 0, 0, 0, 40, /* d */
QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
};
- qemu_put_buffer(fsave, buf, sizeof(buf));
- qemu_fclose(fsave);
+ save_buffer(buf, sizeof(buf));
QEMUFile *loading = open_test_file(false);
TestStruct obj = { .b = 200, .e = 500, .f = 600 };
@@ -334,7 +339,6 @@ static void test_load_v1(void)
static void test_load_v2(void)
{
- QEMUFile *fsave = open_test_file(true);
uint8_t buf[] = {
0, 0, 0, 10, /* a */
0, 0, 0, 20, /* b */
@@ -344,8 +348,7 @@ static void test_load_v2(void)
0, 0, 0, 0, 0, 0, 0, 60, /* f */
QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
};
- qemu_put_buffer(fsave, buf, sizeof(buf));
- qemu_fclose(fsave);
+ save_buffer(buf, sizeof(buf));
QEMUFile *loading = open_test_file(false);
TestStruct obj;
@@ -423,7 +426,6 @@ static void test_save_skip(void)
static void test_load_noskip(void)
{
- QEMUFile *fsave = open_test_file(true);
uint8_t buf[] = {
0, 0, 0, 10, /* a */
0, 0, 0, 20, /* b */
@@ -433,8 +435,7 @@ static void test_load_noskip(void)
0, 0, 0, 0, 0, 0, 0, 60, /* f */
QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
};
- qemu_put_buffer(fsave, buf, sizeof(buf));
- qemu_fclose(fsave);
+ save_buffer(buf, sizeof(buf));
QEMUFile *loading = open_test_file(false);
TestStruct obj = { .skip_c_e = false };
@@ -451,7 +452,6 @@ static void test_load_noskip(void)
static void test_load_skip(void)
{
- QEMUFile *fsave = open_test_file(true);
uint8_t buf[] = {
0, 0, 0, 10, /* a */
0, 0, 0, 20, /* b */
@@ -459,8 +459,7 @@ static void test_load_skip(void)
0, 0, 0, 0, 0, 0, 0, 60, /* f */
QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
};
- qemu_put_buffer(fsave, buf, sizeof(buf));
- qemu_fclose(fsave);
+ save_buffer(buf, sizeof(buf));
QEMUFile *loading = open_test_file(false);
TestStruct obj = { .skip_c_e = true, .c = 300, .e = 500 };
--
2.7.4
^ permalink raw reply related
* [Qemu-devel] [PULL 4/4] migration: Fix return code of ram_save_iterate()
From: Juan Quintela @ 2016-11-14 19:57 UTC (permalink / raw)
To: qemu-devel; +Cc: amit.shah, dgilbert, Thomas Huth
In-Reply-To: <1479153474-2401-1-git-send-email-quintela@redhat.com>
From: Thomas Huth <thuth@redhat.com>
qemu_savevm_state_iterate() expects the iterators to return 1
when they are done, and 0 if there is still something left to do.
However, ram_save_iterate() does not obey this rule and returns
the number of saved pages instead. This causes a fatal hang with
ppc64 guests when you run QEMU like this (also works with TCG):
qemu-img create -f qcow2 /tmp/test.qcow2 1M
qemu-system-ppc64 -nographic -nodefaults -m 256 \
-hda /tmp/test.qcow2 -serial mon:stdio
... then switch to the monitor by pressing CTRL-a c and try to
save a snapshot with "savevm test1" for example.
After the first iteration, ram_save_iterate() always returns 0 here,
so that qemu_savevm_state_iterate() hangs in an endless loop and you
can only "kill -9" the QEMU process.
Fix it by using proper return values in ram_save_iterate().
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index fb9252d..a1c8089 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1987,7 +1987,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
int ret;
int i;
int64_t t0;
- int pages_sent = 0;
+ int done = 0;
rcu_read_lock();
if (ram_list.version != last_version) {
@@ -2007,9 +2007,9 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
pages = ram_find_and_save_block(f, false, &bytes_transferred);
/* no more pages to sent */
if (pages == 0) {
+ done = 1;
break;
}
- pages_sent += pages;
acct_info.iterations++;
/* we want to check in the 1st loop, just in case it was the 1st time
@@ -2044,7 +2044,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
return ret;
}
- return pages_sent;
+ return done;
}
/* Called with iothread lock */
--
2.7.4
^ permalink raw reply related
* Re: [PATCH 3/3] blk-mq: make the polling code adaptive
From: Jens Axboe @ 2016-11-14 19:58 UTC (permalink / raw)
To: Omar Sandoval; +Cc: axboe, linux-block, linux-fsdevel, hch
In-Reply-To: <20161114194305.GB31821@vader.DHCP.thefacebook.com>
On 11/14/2016 12:43 PM, Omar Sandoval wrote:
,9 +2539,10 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
>> * This will be replaced with the stats tracking code, using
>> * 'avg_completion_time / 2' as the pre-sleep target.
>> */
>> - kt = ktime_set(0, q->poll_nsec);
>> + kt = ktime_set(0, nsecs);
>>
>> - hrtimer_init_on_stack(&hs.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>> + mode = HRTIMER_MODE_REL;
>> + hrtimer_init_on_stack(&hs.timer, CLOCK_MONOTONIC, mode);
>> hrtimer_set_expires(&hs.timer, kt);
>>
>> hrtimer_init_sleeper(&hs, current);
>> @@ -2487,10 +2550,11 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
>> if (test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags))
>> break;
>> set_current_state(TASK_UNINTERRUPTIBLE);
>> - hrtimer_start_expires(&hs.timer, HRTIMER_MODE_REL);
>> + hrtimer_start_expires(&hs.timer, mode);
>> if (hs.task)
>> io_schedule();
>> hrtimer_cancel(&hs.timer);
>> + mode = HRTIMER_MODE_ABS;
>> } while (hs.task && !signal_pending(current));
>
> This fix should be folded into patch 2.
Good point, I'll do that.
--
Jens Axboe
^ permalink raw reply
* Re: [PATCH 3/3] blk-mq: make the polling code adaptive
From: Jens Axboe @ 2016-11-14 19:58 UTC (permalink / raw)
To: Omar Sandoval; +Cc: axboe, linux-block, linux-fsdevel, hch
In-Reply-To: <20161114194305.GB31821@vader.DHCP.thefacebook.com>
On 11/14/2016 12:43 PM, Omar Sandoval wrote:
,9 +2539,10 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
>> * This will be replaced with the stats tracking code, using
>> * 'avg_completion_time / 2' as the pre-sleep target.
>> */
>> - kt = ktime_set(0, q->poll_nsec);
>> + kt = ktime_set(0, nsecs);
>>
>> - hrtimer_init_on_stack(&hs.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>> + mode = HRTIMER_MODE_REL;
>> + hrtimer_init_on_stack(&hs.timer, CLOCK_MONOTONIC, mode);
>> hrtimer_set_expires(&hs.timer, kt);
>>
>> hrtimer_init_sleeper(&hs, current);
>> @@ -2487,10 +2550,11 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
>> if (test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags))
>> break;
>> set_current_state(TASK_UNINTERRUPTIBLE);
>> - hrtimer_start_expires(&hs.timer, HRTIMER_MODE_REL);
>> + hrtimer_start_expires(&hs.timer, mode);
>> if (hs.task)
>> io_schedule();
>> hrtimer_cancel(&hs.timer);
>> + mode = HRTIMER_MODE_ABS;
>> } while (hs.task && !signal_pending(current));
>
> This fix should be folded into patch 2.
Good point, I'll do that.
--
Jens Axboe
^ permalink raw reply
* [PATCH v2] Fix loading of module radeonfb on PowerMac
From: Mathieu Malaterre @ 2016-11-14 19:59 UTC (permalink / raw)
To: linux-fbdev
Cc: Lennart Sorensen, Tomi Valkeinen,
Jean-Christophe Plagniol-Villard, Benjamin Herrenschmidt,
linuxppc-dev, Mathieu Malaterre
When the linux kernel is build with (typical kernel ship with Debian
installer):
CONFIG_FB_OF=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_FB_RADEON=m
The offb driver takes precedence over module radeonfb. It is then
impossible to load the module, error reported is:
[ 96.551486] radeonfb 0000:00:10.0: enabling device (0006 -> 0007)
[ 96.551526] radeonfb 0000:00:10.0: BAR 0: can't reserve [mem 0x98000000-0x9fffffff pref]
[ 96.551531] radeonfb (0000:00:10.0): cannot request region 0.
[ 96.551545] radeonfb: probe of 0000:00:10.0 failed with error -16
This patch reproduce the behavior of the module radeon, so as to make it
possible to load radeonfb when offb is first loaded.
It should be noticed that `offb_destroy` is never called which explain the
need to skip error detection on the radeon side.
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Link: https://bugs.debian.org/826629#57
Link: https://bugzilla.kernel.org/show_bug.cgi?id\x119741
Suggested-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
---
drivers/video/fbdev/aty/radeon_base.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c
index 218339a..84d634b 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -2259,6 +2259,22 @@ static struct bin_attribute edid2_attr = {
.read = radeon_show_edid2,
};
+static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
+{
+ struct apertures_struct *ap;
+
+ ap = alloc_apertures(1);
+ if (!ap)
+ return -ENOMEM;
+
+ ap->ranges[0].base = pci_resource_start(pdev, 0);
+ ap->ranges[0].size = pci_resource_len(pdev, 0);
+
+ remove_conflicting_framebuffers(ap, KBUILD_MODNAME, false);
+ kfree(ap);
+
+ return 0;
+}
static int radeonfb_pci_register(struct pci_dev *pdev,
const struct pci_device_id *ent)
@@ -2314,19 +2330,27 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
rinfo->fb_base_phys = pci_resource_start (pdev, 0);
rinfo->mmio_base_phys = pci_resource_start (pdev, 2);
+ ret = radeon_kick_out_firmware_fb(pdev);
+ if (ret)
+ return ret;
+
/* request the mem regions */
ret = pci_request_region(pdev, 0, "radeonfb framebuffer");
if (ret < 0) {
printk( KERN_ERR "radeonfb (%s): cannot request region 0.\n",
pci_name(rinfo->pdev));
+#ifndef CONFIG_PPC
goto err_release_fb;
+#endif
}
ret = pci_request_region(pdev, 2, "radeonfb mmio");
if (ret < 0) {
printk( KERN_ERR "radeonfb (%s): cannot request region 2.\n",
pci_name(rinfo->pdev));
+#ifndef CONFIG_PPC
goto err_release_pci0;
+#endif
}
/* map the regions */
@@ -2511,10 +2535,12 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
iounmap(rinfo->mmio_base);
err_release_pci2:
pci_release_region(pdev, 2);
+#ifndef CONFIG_PPC
err_release_pci0:
pci_release_region(pdev, 0);
err_release_fb:
framebuffer_release(info);
+#endif
err_disable:
err_out:
return ret;
--
2.1.4
^ permalink raw reply related
* Re: [PATCH v7 13/14] mmc: sdhci-msm: Add calibration tuning for CDCLP533 circuit
From: Stephen Boyd @ 2016-11-14 19:59 UTC (permalink / raw)
To: Ritesh Harjani
Cc: ulf.hansson, linux-mmc, adrian.hunter, shawn.lin, andy.gross,
devicetree, linux-clk, david.brown, linux-arm-msm, georgi.djakov,
alex.lemberg, mateusz.nowak, Yuliy.Izrailov, asutoshd, kdorfman,
david.griego, stummala, venkatg, rnayak, pramod.gurav
In-Reply-To: <1479103248-9491-14-git-send-email-riteshh@codeaurora.org>
On 11/14, Ritesh Harjani wrote:
> @@ -575,6 +729,15 @@ static void sdhci_msm_set_uhs_signaling(struct sdhci_host *host,
> dev_dbg(mmc_dev(mmc), "%s: clock=%u uhs=%u ctrl_2=0x%x\n",
> mmc_hostname(host->mmc), host->clock, uhs, ctrl_2);
> sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
> +
> + spin_unlock_irq(&host->lock);
> + /* CDCLP533 HW calibration is only required for HS400 mode*/
> + if (host->clock > CORE_FREQ_100MHZ &&
> + msm_host->tuning_done && !msm_host->calibration_done &&
> + (mmc->ios.timing == MMC_TIMING_MMC_HS400))
Drop useless parenthesis.
> + if (!sdhci_msm_cdclp533_calibration(host))
> + msm_host->calibration_done = true;
> + spin_lock_irq(&host->lock);
> }
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply
* [PATCH v2] Fix loading of module radeonfb on PowerMac
From: Mathieu Malaterre @ 2016-11-14 19:59 UTC (permalink / raw)
To: linux-fbdev
Cc: Lennart Sorensen, Tomi Valkeinen,
Jean-Christophe Plagniol-Villard, Benjamin Herrenschmidt,
linuxppc-dev, Mathieu Malaterre
When the linux kernel is build with (typical kernel ship with Debian
installer):
CONFIG_FB_OF=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_FB_RADEON=m
The offb driver takes precedence over module radeonfb. It is then
impossible to load the module, error reported is:
[ 96.551486] radeonfb 0000:00:10.0: enabling device (0006 -> 0007)
[ 96.551526] radeonfb 0000:00:10.0: BAR 0: can't reserve [mem 0x98000000-0x9fffffff pref]
[ 96.551531] radeonfb (0000:00:10.0): cannot request region 0.
[ 96.551545] radeonfb: probe of 0000:00:10.0 failed with error -16
This patch reproduce the behavior of the module radeon, so as to make it
possible to load radeonfb when offb is first loaded.
It should be noticed that `offb_destroy` is never called which explain the
need to skip error detection on the radeon side.
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Link: https://bugs.debian.org/826629#57
Link: https://bugzilla.kernel.org/show_bug.cgi?id=119741
Suggested-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
---
drivers/video/fbdev/aty/radeon_base.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c
index 218339a..84d634b 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -2259,6 +2259,22 @@ static struct bin_attribute edid2_attr = {
.read = radeon_show_edid2,
};
+static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
+{
+ struct apertures_struct *ap;
+
+ ap = alloc_apertures(1);
+ if (!ap)
+ return -ENOMEM;
+
+ ap->ranges[0].base = pci_resource_start(pdev, 0);
+ ap->ranges[0].size = pci_resource_len(pdev, 0);
+
+ remove_conflicting_framebuffers(ap, KBUILD_MODNAME, false);
+ kfree(ap);
+
+ return 0;
+}
static int radeonfb_pci_register(struct pci_dev *pdev,
const struct pci_device_id *ent)
@@ -2314,19 +2330,27 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
rinfo->fb_base_phys = pci_resource_start (pdev, 0);
rinfo->mmio_base_phys = pci_resource_start (pdev, 2);
+ ret = radeon_kick_out_firmware_fb(pdev);
+ if (ret)
+ return ret;
+
/* request the mem regions */
ret = pci_request_region(pdev, 0, "radeonfb framebuffer");
if (ret < 0) {
printk( KERN_ERR "radeonfb (%s): cannot request region 0.\n",
pci_name(rinfo->pdev));
+#ifndef CONFIG_PPC
goto err_release_fb;
+#endif
}
ret = pci_request_region(pdev, 2, "radeonfb mmio");
if (ret < 0) {
printk( KERN_ERR "radeonfb (%s): cannot request region 2.\n",
pci_name(rinfo->pdev));
+#ifndef CONFIG_PPC
goto err_release_pci0;
+#endif
}
/* map the regions */
@@ -2511,10 +2535,12 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
iounmap(rinfo->mmio_base);
err_release_pci2:
pci_release_region(pdev, 2);
+#ifndef CONFIG_PPC
err_release_pci0:
pci_release_region(pdev, 0);
err_release_fb:
framebuffer_release(info);
+#endif
err_disable:
err_out:
return ret;
--
2.1.4
^ permalink raw reply related
* Re: [PATCH 1/3] block: fast-path for small and simple direct I/O requests
From: Jens Axboe @ 2016-11-14 20:00 UTC (permalink / raw)
To: Omar Sandoval; +Cc: axboe, linux-block, linux-fsdevel, hch, Christoph Hellwig
In-Reply-To: <20161114193339.GA31821@vader.DHCP.thefacebook.com>
On 11/14/2016 12:33 PM, Omar Sandoval wrote:
> On Fri, Nov 11, 2016 at 10:11:25PM -0700, Jens Axboe wrote:
>> From: Christoph Hellwig <hch@lst.de>
>>
>> This patch adds a small and simple fast patch for small direct I/O
>> requests on block devices that don't use AIO. Between the neat
>> bio_iov_iter_get_pages helper that avoids allocating a page array
>> for get_user_pages and the on-stack bio and biovec this avoid memory
>> allocations and atomic operations entirely in the direct I/O code
>> (lower levels might still do memory allocations and will usually
>> have at least some atomic operations, though).
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> Signed-off-by: Jens Axboe <axboe@fb.com>
>> ---
>> fs/block_dev.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 80 insertions(+)
>>
>
> [snip]
>
>> static ssize_t
>> blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
>> {
>> struct file *file = iocb->ki_filp;
>> struct inode *inode = bdev_file_inode(file);
>> + int nr_pages;
>>
>> + nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES);
>> + if (!nr_pages)
>> + return 0;
>> + if (is_sync_kiocb(iocb) && nr_pages <= DIO_INLINE_BIO_VECS)
>> + return __blkdev_direct_IO_simple(iocb, iter, nr_pages);
>> return __blockdev_direct_IO(iocb, inode, I_BDEV(inode), iter,
>> blkdev_get_block, NULL, NULL,
>> DIO_SKIP_DIO_COUNT);
>
> __blockdev_direct_IO() does a few cache prefetches that we're now
> bypassing, do we want to do the same in __blkdev_direct_IO_simple()?
> That's the stuff added in 65dd2aa90aa1 ("dio: optimize cache misses in
> the submission path").
Prefetches like that tend to grow stale, in my experience. So we should
probably just evaluate the new path cache behavior and see if it makes
sense.
--
Jens Axboe
^ permalink raw reply
* Re: [PATCH] attr: mark a file-local symbol as static
From: Stefan Beller @ 2016-11-14 20:00 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list
In-Reply-To: <83508d1f-e809-f6be-5afc-4c23195dbd08@ramsayjones.plus.com>
On Sun, Nov 13, 2016 at 8:42 AM, Ramsay Jones
<ramsay@ramsayjones.plus.com> wrote:
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Stefan,
>
> If you need to re-roll your 'sb/attr' branch, could you please
> squash this into the relevant patch.
will do. I have it applied locally
>
> Alternatively, since there is only a single call site for git_attr()
> (on line #1005), you could perhaps remove git_attr() and inline that
> call. (However, that does make that line exceed 80 columns).
I'll look into that.
Thanks,
Stefan
>
> Thanks!
>
> ATB,
> Ramsay Jones
>
> attr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/attr.c b/attr.c
> index 667ba85..84c4b08 100644
> --- a/attr.c
> +++ b/attr.c
> @@ -169,7 +169,7 @@ static struct git_attr *git_attr_internal(const char *name, int len)
> return a;
> }
>
> -struct git_attr *git_attr(const char *name)
> +static struct git_attr *git_attr(const char *name)
> {
> return git_attr_internal(name, strlen(name));
> }
> --
> 2.10.0
^ permalink raw reply
* + linux-next-rejects.patch added to -mm tree
From: akpm @ 2016-11-14 20:01 UTC (permalink / raw)
To: akpm, mm-commits
The patch titled
Subject: linux-next-rejects
has been added to the -mm tree. Its filename is
linux-next-rejects.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/linux-next-rejects.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/linux-next-rejects.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: linux-next-rejects
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memcontrol.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff -puN mm/memcontrol.c~linux-next-rejects mm/memcontrol.c
--- a/mm/memcontrol.c~linux-next-rejects
+++ a/mm/memcontrol.c
@@ -5767,10 +5767,10 @@ __setup("cgroup.memory=", cgroup_memory)
/*
* subsys_initcall() for memory controller.
*
- * Some parts like hotcpu_notifier() have to be initialized from this context
- * because of lock dependencies (cgroup_lock -> cpu hotplug) but basically
- * everything that doesn't depend on a specific mem_cgroup structure should
- * be initialized from here.
+ * Some parts like memcg_hotplug_cpu_dead() have to be initialized from this
+ * context because of lock dependencies (cgroup_lock -> cpu hotplug) but
+ * basically everything that doesn't depend on a specific mem_cgroup structure
+ * should be initialized from here.
*/
static int __init mem_cgroup_init(void)
{
@@ -5787,7 +5787,8 @@ static int __init mem_cgroup_init(void)
BUG_ON(!memcg_kmem_cache_create_wq);
#endif
- hotcpu_notifier(memcg_cpu_hotplug_callback, 0);
+ cpuhp_setup_state_nocalls(CPUHP_MM_MEMCQ_DEAD, "mm/memctrl:dead", NULL,
+ memcg_hotplug_cpu_dead);
for_each_possible_cpu(cpu)
INIT_WORK(&per_cpu_ptr(&memcg_stock, cpu)->work,
_
Patches currently in -mm which might be from akpm@linux-foundation.org are
i-need-old-gcc.patch
arm-arch-arm-include-asm-pageh-needs-personalityh.patch
prctl-remove-one-shot-limitation-for-changing-exe-link-fix.patch
mm.patch
mm-compaction-allow-compaction-for-gfp_nofs-requests-fix.patch
mm-mempolicy-clean-up-__gfp_thisnode-confusion-in-policy_zonelist-checkpatch-fixes.patch
mm-unexport-__get_user_pages_unlocked-checkpatch-fixes.patch
scripts-checkpatchpl-fix-spelling.patch
debug-more-properly-delay-for-secondary-cpus-fix.patch
ipc-sem-rework-task-wakeups-checkpatch-fixes.patch
ipc-sem-optimize-perform_atomic_semop-checkpatch-fixes.patch
ipc-sem-simplify-wait-wake-loop-checkpatch-fixes.patch
drivers-net-wireless-intel-iwlwifi-dvm-calibc-fix-min-warning.patch
kernel-forkc-export-kernel_thread-to-modules.patch
slab-leaks3-default-y.patch
linux-next-rejects.patch
^ permalink raw reply
* Re: [GIT PULL] fbdev fixes for 4.9
From: Mathieu Malaterre @ 2016-11-14 20:01 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <b74835d1-b878-55ec-65d3-dd3766a5b194@ti.com>
Tomi,
On Mon, Nov 14, 2016 at 5:25 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Mon, Nov 14, 2016 at 3:44 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>
>> Please pull two fbdev fixes for 4.9.
>
> No.
>
> This has obviously never even been test-compiled. It introduces two
> new annoying warnings.
Sorry about that noob error. I've just send a v2 a minute ago.
Thanks
^ permalink raw reply
* Re: [PATCH v7 04/14] ARM: dts: Add xo_clock to sdhc nodes on qcom platforms
From: Stephen Boyd @ 2016-11-14 20:01 UTC (permalink / raw)
To: Ritesh Harjani
Cc: ulf.hansson, linux-mmc, adrian.hunter, shawn.lin, andy.gross,
devicetree, linux-clk, david.brown, linux-arm-msm, georgi.djakov,
alex.lemberg, mateusz.nowak, Yuliy.Izrailov, asutoshd, kdorfman,
david.griego, stummala, venkatg, rnayak, pramod.gurav
In-Reply-To: <1479103248-9491-5-git-send-email-riteshh@codeaurora.org>
On 11/14, Ritesh Harjani wrote:
> Add xo_clock to sdhc clock node on all qcom platforms.
>
> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
> ---
> arch/arm/boot/dts/qcom-apq8084.dtsi | 14 ++++++++------
> arch/arm/boot/dts/qcom-msm8974.dtsi | 14 ++++++++------
> arch/arm64/boot/dts/qcom/msm8916.dtsi | 10 ++++++----
> arch/arm64/boot/dts/qcom/msm8996.dtsi | 9 +++++----
> 4 files changed, 27 insertions(+), 20 deletions(-)
>
Is there an update to
Documentation/devicetree/bindings/mmc/sdhci-msm.txt as well?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply
* Re: [RFC PATCH v3 06/20] x86: Add support to enable SME during early boot processing
From: Borislav Petkov @ 2016-11-14 20:01 UTC (permalink / raw)
To: Tom Lendacky
Cc: linux-arch, linux-efi, kvm, linux-doc, x86, linux-kernel,
kasan-dev, linux-mm, iommu, Rik van Riel,
Radim Krčmář, Arnd Bergmann, Jonathan Corbet,
Matt Fleming, Joerg Roedel, Konrad Rzeszutek Wilk, Paolo Bonzini,
Larry Woodman, Ingo Molnar, Andy Lutomirski, H. Peter Anvin,
Andrey Ryabinin, Alexander Potapenko
In-Reply-To: <178d7d21-ffbd-1083-9c64-f05378147e27@amd.com>
On Mon, Nov 14, 2016 at 12:18:44PM -0600, Tom Lendacky wrote:
> The %rsi register can be clobbered by the called function so I'm saving
> it since it points to the real mode data. I might be able to look into
> saving it earlier and restoring it before needed, but I though this
> might be clearer.
Ah, that's already in the comment earlier, I missed that.
> I can expand on the commit message about that. I was trying to keep the
> early boot-related code separate from the main code in arch/x86/mm dir.
... because?
It all gets linked into one monolithic image anyway and mem_encrypt.c
is not, like, really huge, right? IOW, I don't see a reason to spread
the code around the tree. OTOH, having everything in one file is much
better.
Or am I missing a good reason?
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply
* Re: [RFC PATCH v3 06/20] x86: Add support to enable SME during early boot processing
From: Borislav Petkov @ 2016-11-14 20:01 UTC (permalink / raw)
To: Tom Lendacky
Cc: linux-arch, linux-efi, kvm, linux-doc, x86, linux-kernel,
kasan-dev, linux-mm, iommu, Rik van Riel,
Radim Krčmář, Arnd Bergmann, Jonathan Corbet,
Matt Fleming, Joerg Roedel, Konrad Rzeszutek Wilk, Paolo Bonzini,
Larry Woodman, Ingo Molnar, Andy Lutomirski, H. Peter Anvin,
Andrey Ryabinin, Alexander Potapenko, Thomas Gleixner,
Dmitry Vyukov
In-Reply-To: <178d7d21-ffbd-1083-9c64-f05378147e27@amd.com>
On Mon, Nov 14, 2016 at 12:18:44PM -0600, Tom Lendacky wrote:
> The %rsi register can be clobbered by the called function so I'm saving
> it since it points to the real mode data. I might be able to look into
> saving it earlier and restoring it before needed, but I though this
> might be clearer.
Ah, that's already in the comment earlier, I missed that.
> I can expand on the commit message about that. I was trying to keep the
> early boot-related code separate from the main code in arch/x86/mm dir.
... because?
It all gets linked into one monolithic image anyway and mem_encrypt.c
is not, like, really huge, right? IOW, I don't see a reason to spread
the code around the tree. OTOH, having everything in one file is much
better.
Or am I missing a good reason?
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply
* + linux-next-git-rejects.patch added to -mm tree
From: akpm @ 2016-11-14 20:01 UTC (permalink / raw)
To: akpm, mm-commits
The patch titled
Subject: linux-next-git-rejects
has been added to the -mm tree. Its filename is
linux-next-git-rejects.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/linux-next-git-rejects.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/linux-next-git-rejects.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: linux-next-git-rejects
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/x86/kernel/cpu/amd.c | 12 ------------
1 file changed, 12 deletions(-)
diff -puN arch/x86/kernel/cpu/amd.c~linux-next-git-rejects arch/x86/kernel/cpu/amd.c
--- a/arch/x86/kernel/cpu/amd.c~linux-next-git-rejects
+++ a/arch/x86/kernel/cpu/amd.c
@@ -372,18 +372,6 @@ static void amd_detect_cmp(struct cpuinf
/* use socket ID also for last level cache */
per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
amd_get_topology(c);
-<<<<<<< HEAD
-
- /*
- * Fix percpu cpu_llc_id here as LLC topology is different
- * for Fam17h systems.
- */
- if (c->x86 != 0x17 || !cpuid_edx(0x80000006))
- return;
-
- per_cpu(cpu_llc_id, cpu) = c->apicid >> 3;
-=======
->>>>>>> linux-next/akpm-base
#endif
}
_
Patches currently in -mm which might be from akpm@linux-foundation.org are
i-need-old-gcc.patch
arm-arch-arm-include-asm-pageh-needs-personalityh.patch
prctl-remove-one-shot-limitation-for-changing-exe-link-fix.patch
mm.patch
mm-compaction-allow-compaction-for-gfp_nofs-requests-fix.patch
mm-mempolicy-clean-up-__gfp_thisnode-confusion-in-policy_zonelist-checkpatch-fixes.patch
mm-unexport-__get_user_pages_unlocked-checkpatch-fixes.patch
scripts-checkpatchpl-fix-spelling.patch
debug-more-properly-delay-for-secondary-cpus-fix.patch
ipc-sem-rework-task-wakeups-checkpatch-fixes.patch
ipc-sem-optimize-perform_atomic_semop-checkpatch-fixes.patch
ipc-sem-simplify-wait-wake-loop-checkpatch-fixes.patch
linux-next-git-rejects.patch
linux-next-rejects.patch
drivers-net-wireless-intel-iwlwifi-dvm-calibc-fix-min-warning.patch
kernel-forkc-export-kernel_thread-to-modules.patch
slab-leaks3-default-y.patch
^ permalink raw reply
* [merged] mm-remove-extra-newline-from-allocation-stall-warning.patch removed from -mm tree
From: akpm @ 2016-11-14 20:02 UTC (permalink / raw)
To: penguin-kernel, mhocko, mm-commits
The patch titled
Subject: mm: remove extra newline from allocation stall warning
has been removed from the -mm tree. Its filename was
mm-remove-extra-newline-from-allocation-stall-warning.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Subject: mm: remove extra newline from allocation stall warning
63f53dea0c9866e9 ("mm: warn about allocations which stall for too long")
by error embedded "\n" in the format string, resulting in strange output.
[ 722.876655] kworker/0:1: page alloction stalls for 160001ms, order:0
[ 722.876656] , mode:0x2400000(GFP_NOIO)
[ 722.876657] CPU: 0 PID: 6966 Comm: kworker/0:1 Not tainted 4.8.0+ #69
Link: http://lkml.kernel.org/r/1476026219-7974-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN mm/page_alloc.c~mm-remove-extra-newline-from-allocation-stall-warning mm/page_alloc.c
--- a/mm/page_alloc.c~mm-remove-extra-newline-from-allocation-stall-warning
+++ a/mm/page_alloc.c
@@ -3658,7 +3658,7 @@ retry:
/* Make sure we know about allocations which stall for too long */
if (time_after(jiffies, alloc_start + stall_timeout)) {
warn_alloc(gfp_mask,
- "page alloction stalls for %ums, order:%u\n",
+ "page allocation stalls for %ums, order:%u",
jiffies_to_msecs(jiffies-alloc_start), order);
stall_timeout += 10 * HZ;
}
_
Patches currently in -mm which might be from penguin-kernel@I-love.SAKURA.ne.jp are
hung_task-decrement-sysctl_hung_task_warnings-only-if-it-is-positive.patch
^ permalink raw reply
* [merged] mm-frontswap-make-sure-allocated-frontswap-map-is-assigned.patch removed from -mm tree
From: akpm @ 2016-11-14 20:02 UTC (permalink / raw)
To: vbabka, boris.ostrovsky, borntraeger, david.vrabel, jgross,
kirill.shutemov, konrad.wilk, stable, mm-commits
The patch titled
Subject: mm, frontswap: make sure allocated frontswap map is assigned
has been removed from the -mm tree. Its filename was
mm-frontswap-make-sure-allocated-frontswap-map-is-assigned.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Vlastimil Babka <vbabka@suse.cz>
Subject: mm, frontswap: make sure allocated frontswap map is assigned
Christian Borntraeger reports:
with commit 8ea1d2a1985a7ae096e ("mm, frontswap: convert frontswap_enabled
to static key") kmemleak complains about a memory leak in swapon
unreferenced object 0x3e09ba56000 (size 32112640):
comm "swapon", pid 7852, jiffies 4294968787 (age 1490.770s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<00000000003a2504>] __vmalloc_node_range+0x194/0x2d8
[<00000000003a2918>] vzalloc+0x58/0x68
[<00000000003b0af0>] SyS_swapon+0xd60/0x12f8
[<0000000000a3dc2e>] system_call+0xd6/0x270
[<ffffffffffffffff>] 0xffffffffffffffff
Turns out kmemleak is right. We now allocate the frontswap map depending on the
kernel config (and no longer on the enablement)
swapfile.c:
[...]
if (IS_ENABLED(CONFIG_FRONTSWAP))
frontswap_map = vzalloc(BITS_TO_LONGS(maxpages) * sizeof(long));
but later on this is passed along
--> enable_swap_info(p, prio, swap_map, cluster_info, frontswap_map);
and ignored if frontswap is disabled
--> frontswap_init(p->type, frontswap_map);
static inline void frontswap_init(unsigned type, unsigned long *map)
{
if (frontswap_enabled())
__frontswap_init(type, map);
}
Thing is, that frontswap map is never freed.
===
The leakage is relatively not that bad, because swapon is an infrequent
and privileged operation. However, if the first frontswap backend is
registered after a swap type has been already enabled, it will WARN_ON in
frontswap_register_ops() and frontswap will not be available for the swap
type.
Fix this by making sure the map is assigned by frontswap_init() as long as
CONFIG_FRONTSWAP is enabled.
Fixes: 8ea1d2a1985a ("mm, frontswap: convert frontswap_enabled to static key")
Link: http://lkml.kernel.org/r/20161026134220.2566-1-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/frontswap.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff -puN include/linux/frontswap.h~mm-frontswap-make-sure-allocated-frontswap-map-is-assigned include/linux/frontswap.h
--- a/include/linux/frontswap.h~mm-frontswap-make-sure-allocated-frontswap-map-is-assigned
+++ a/include/linux/frontswap.h
@@ -106,8 +106,9 @@ static inline void frontswap_invalidate_
static inline void frontswap_init(unsigned type, unsigned long *map)
{
- if (frontswap_enabled())
- __frontswap_init(type, map);
+#ifdef CONFIG_FRONTSWAP
+ __frontswap_init(type, map);
+#endif
}
#endif /* _LINUX_FRONTSWAP_H */
_
Patches currently in -mm which might be from vbabka@suse.cz are
^ permalink raw reply
* [merged] shmem-fix-pageflags-after-swapping-dma32-object.patch removed from -mm tree
From: akpm @ 2016-11-14 20:02 UTC (permalink / raw)
To: hughd, kirill.shutemov, stable, mm-commits
The patch titled
Subject: shmem: fix pageflags after swapping DMA32 object
has been removed from the -mm tree. Its filename was
shmem-fix-pageflags-after-swapping-dma32-object.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Hugh Dickins <hughd@google.com>
Subject: shmem: fix pageflags after swapping DMA32 object
If shmem_alloc_page() does not set PageLocked and PageSwapBacked, then
shmem_replace_page() needs to do so for itself. Without this, it puts
newpage on the wrong lru, re-unlocks the unlocked newpage, and system
descends into "Bad page" reports and freeze; or if CONFIG_DEBUG_VM=y, it
hits an earlier VM_BUG_ON_PAGE(!PageLocked), depending on config.
But shmem_replace_page() is not a common path: it's only called when
swapin (or swapoff) finds the page was already read into an unsuitable
zone: usually all zones are suitable, but gem objects for a few drm
devices (gma500, omapdrm, crestline, broadwater) require zone DMA32 if
there's more than 4GB of ram.
Fixes: 800d8c63b2e9 ("shmem: add huge pages support")
Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1611062003510.11253@eggly.anvils
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: <stable@vger.kernel.org> [4.8.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/shmem.c | 2 ++
1 file changed, 2 insertions(+)
diff -puN mm/shmem.c~shmem-fix-pageflags-after-swapping-dma32-object mm/shmem.c
--- a/mm/shmem.c~shmem-fix-pageflags-after-swapping-dma32-object
+++ a/mm/shmem.c
@@ -1483,6 +1483,8 @@ static int shmem_replace_page(struct pag
copy_highpage(newpage, oldpage);
flush_dcache_page(newpage);
+ __SetPageLocked(newpage);
+ __SetPageSwapBacked(newpage);
SetPageUptodate(newpage);
set_page_private(newpage, swap_index);
SetPageSwapCache(newpage);
_
Patches currently in -mm which might be from hughd@google.com are
^ permalink raw reply
* [merged] scripts-bloat-o-meter-fix-sigpipe.patch removed from -mm tree
From: akpm @ 2016-11-14 20:02 UTC (permalink / raw)
To: adobriyan, mpm, mm-commits
The patch titled
Subject: scripts/bloat-o-meter: fix SIGPIPE
has been removed from the -mm tree. Its filename was
scripts-bloat-o-meter-fix-sigpipe.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Alexey Dobriyan <adobriyan@gmail.com>
Subject: scripts/bloat-o-meter: fix SIGPIPE
Fix piping output to a program which quickly exits (read: head -n1)
$ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux | head -n1
add/remove: 0/0 grow/shrink: 9/60 up/down: 124/-305 (-181)
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Link: http://lkml.kernel.org/r/20161028204618.GA29923@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
scripts/bloat-o-meter | 3 +++
1 file changed, 3 insertions(+)
diff -puN scripts/bloat-o-meter~scripts-bloat-o-meter-fix-sigpipe scripts/bloat-o-meter
--- a/scripts/bloat-o-meter~scripts-bloat-o-meter-fix-sigpipe
+++ a/scripts/bloat-o-meter
@@ -8,6 +8,9 @@
# of the GNU General Public License, incorporated herein by reference.
import sys, os, re
+from signal import signal, SIGPIPE, SIG_DFL
+
+signal(SIGPIPE, SIG_DFL)
if len(sys.argv) != 3:
sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0])
_
Patches currently in -mm which might be from adobriyan@gmail.com are
kbuild-simpler-generation-of-assembly-constants.patch
proc-make-struct-pid_entry-len-unsigned.patch
proc-make-struct-struct-map_files_info-len-unsigned-int.patch
proc-just-list_del-struct-pde_opener.patch
proc-fix-type-of-struct-pde_opener-closing-field.patch
proc-kmalloc-struct-pde_opener.patch
proc-tweak-comments-about-2-stage-open-and-everything.patch
coredump-clarify-unsafe-core_pattern-warning.patch
^ permalink raw reply
* [merged] mm-cma-check-the-max-limit-for-cma-allocation.patch removed from -mm tree
From: akpm @ 2016-11-14 20:02 UTC (permalink / raw)
To: shashim, catalin.marinas, sfr, mm-commits
The patch titled
Subject: mm/cma.c: check the max limit for cma allocation
has been removed from the -mm tree. Its filename was
mm-cma-check-the-max-limit-for-cma-allocation.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Shiraz Hashim <shashim@codeaurora.org>
Subject: mm/cma.c: check the max limit for cma allocation
CMA allocation request size is represented by size_t that gets truncated
when same is passed as int to bitmap_find_next_zero_area_off.
We observe that during fuzz testing when cma allocation request is too
high, bitmap_find_next_zero_area_off still returns success due to the
truncation. This leads to kernel crash, as subsequent code assumes that
requested memory is available.
Fail cma allocation in case the request breaches the corresponding cma
region size.
Link: http://lkml.kernel.org/r/1478189211-3467-1-git-send-email-shashim@codeaurora.org
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/cma.c | 3 +++
1 file changed, 3 insertions(+)
diff -puN mm/cma.c~mm-cma-check-the-max-limit-for-cma-allocation mm/cma.c
--- a/mm/cma.c~mm-cma-check-the-max-limit-for-cma-allocation
+++ a/mm/cma.c
@@ -385,6 +385,9 @@ struct page *cma_alloc(struct cma *cma,
bitmap_maxno = cma_bitmap_maxno(cma);
bitmap_count = cma_bitmap_pages_to_bits(cma, count);
+ if (bitmap_count > bitmap_maxno)
+ return NULL;
+
for (;;) {
mutex_lock(&cma->lock);
bitmap_no = bitmap_find_next_zero_area_off(cma->bitmap,
_
Patches currently in -mm which might be from shashim@codeaurora.org are
^ permalink raw reply
* [merged] swapfile-fix-memory-corruption-via-malformed-swapfile.patch removed from -mm tree
From: akpm @ 2016-11-14 20:02 UTC (permalink / raw)
To: jann, hannes, hughd, jmarchan, keescook, kirill.shutemov, stable,
vbabka, mm-commits
The patch titled
Subject: swapfile: fix memory corruption via malformed swapfile
has been removed from the -mm tree. Its filename was
swapfile-fix-memory-corruption-via-malformed-swapfile.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Jann Horn <jann@thejh.net>
Subject: swapfile: fix memory corruption via malformed swapfile
When root activates a swap partition whose header has the wrong endianness,
nr_badpages elements of badpages are swabbed before nr_badpages has been
checked, leading to a buffer overrun of up to 8GB.
This normally is not a security issue because it can only be exploited by
root (more specifically, a process with CAP_SYS_ADMIN or the ability to
modify a swap file/partition), and such a process can already e.g. modify
swapped-out memory of any other userspace process on the system.
Testcase for reproducing the bug (must be run as root, should crash your
kernel):
=================
#include <stdlib.h>
#include <unistd.h>
#include <sys/swap.h>
#include <limits.h>
#include <err.h>
#include <string.h>
#include <stdio.h>
#define PAGE_SIZE 4096
#define __u32 unsigned int
// from include/linux/swap.h
union swap_header {
struct {
char reserved[PAGE_SIZE - 10];
char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */
} magic;
struct {
char bootbits[1024]; /* Space for disklabel etc. */
__u32 version;
__u32 last_page;
__u32 nr_badpages;
unsigned char sws_uuid[16];
unsigned char sws_volume[16];
__u32 padding[117];
__u32 badpages[1];
} info;
};
int main(void) {
char file[] = "/tmp/swapfile.XXXXXX";
int file_fd = mkstemp(file);
if (file_fd == -1)
err(1, "mkstemp");
if (ftruncate(file_fd, PAGE_SIZE))
err(1, "ftruncate");
union swap_header swap_header = {
.info = {
.version = __builtin_bswap32(1),
.nr_badpages = __builtin_bswap32(INT_MAX)
}
};
memcpy(swap_header.magic.magic, "SWAPSPACE2", 10);
if (write(file_fd, &swap_header, sizeof(swap_header)) !=
sizeof(swap_header))
err(1, "write");
// not because the attack needs it, just in case you forgot to
// sync yourself before crashing your machine
sync();
// now die
if (swapon(file, 0))
err(1, "swapon");
puts("huh, we survived");
if (swapoff(file))
err(1, "swapoff");
unlink(file);
}
=================
Link: http://lkml.kernel.org/r/1477949533-2509-1-git-send-email-jann@thejh.net
Signed-off-by: Jann Horn <jann@thejh.net>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/swapfile.c | 2 ++
1 file changed, 2 insertions(+)
diff -puN mm/swapfile.c~swapfile-fix-memory-corruption-via-malformed-swapfile mm/swapfile.c
--- a/mm/swapfile.c~swapfile-fix-memory-corruption-via-malformed-swapfile
+++ a/mm/swapfile.c
@@ -2224,6 +2224,8 @@ static unsigned long read_swap_header(st
swab32s(&swap_header->info.version);
swab32s(&swap_header->info.last_page);
swab32s(&swap_header->info.nr_badpages);
+ if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES)
+ return 0;
for (i = 0; i < swap_header->info.nr_badpages; i++)
swab32s(&swap_header->info.badpages[i]);
}
_
Patches currently in -mm which might be from jann@thejh.net are
^ permalink raw reply
* [merged] mm-hwpoison-fix-thp-split-handling-in-memory_failure.patch removed from -mm tree
From: akpm @ 2016-11-14 20:03 UTC (permalink / raw)
To: n-horiguchi, stable, mm-commits
The patch titled
Subject: mm: hwpoison: fix thp split handling in memory_failure()
has been removed from the -mm tree. Its filename was
mm-hwpoison-fix-thp-split-handling-in-memory_failure.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: mm: hwpoison: fix thp split handling in memory_failure()
When memory_failure() runs on a thp tail page after pmd is split, we
trigger the following VM_BUG_ON_PAGE():
[ 619.550520] page:ffffd7cd819b0040 count:0 mapcount:0 mapping: (null) index:0x1
[ 619.555486] flags: 0x1fffc000400000(hwpoison)
[ 619.556408] page dumped because: VM_BUG_ON_PAGE(!page_count(p))
[ 619.558998] ------------[ cut here ]------------
[ 619.561388] kernel BUG at /src/linux-dev/mm/memory-failure.c:1132!
memory_failure() passed refcount and page lock from tail page to head
page, which is not needed because we can pass any subpage to
split_huge_page().
Fixes: 61f5d698cc97 ("mm: re-enable THP")
Link: http://lkml.kernel.org/r/1477961577-7183-1-git-send-email-n-horiguchi@ah.jp.nec.com
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: <stable@vger.kernel.org> [4.5+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory-failure.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff -puN mm/memory-failure.c~mm-hwpoison-fix-thp-split-handling-in-memory_failure mm/memory-failure.c
--- a/mm/memory-failure.c~mm-hwpoison-fix-thp-split-handling-in-memory_failure
+++ a/mm/memory-failure.c
@@ -1112,10 +1112,10 @@ int memory_failure(unsigned long pfn, in
}
if (!PageHuge(p) && PageTransHuge(hpage)) {
- lock_page(hpage);
- if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) {
- unlock_page(hpage);
- if (!PageAnon(hpage))
+ lock_page(p);
+ if (!PageAnon(p) || unlikely(split_huge_page(p))) {
+ unlock_page(p);
+ if (!PageAnon(p))
pr_err("Memory failure: %#lx: non anonymous thp\n",
pfn);
else
@@ -1126,9 +1126,7 @@ int memory_failure(unsigned long pfn, in
put_hwpoison_page(p);
return -EBUSY;
}
- unlock_page(hpage);
- get_hwpoison_page(p);
- put_hwpoison_page(hpage);
+ unlock_page(p);
VM_BUG_ON_PAGE(!page_count(p), p);
hpage = compound_head(p);
}
_
Patches currently in -mm which might be from n-horiguchi@ah.jp.nec.com are
^ permalink raw reply
* [merged] mm-hwpoison-fix-thp-split-handling-in-memory_failure.patch removed from -mm tree
From: akpm @ 2016-11-14 20:03 UTC (permalink / raw)
To: n-horiguchi, stable, mm-commits
The patch titled
Subject: mm: hwpoison: fix thp split handling in memory_failure()
has been removed from the -mm tree. Its filename was
mm-hwpoison-fix-thp-split-handling-in-memory_failure.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: mm: hwpoison: fix thp split handling in memory_failure()
When memory_failure() runs on a thp tail page after pmd is split, we
trigger the following VM_BUG_ON_PAGE():
[ 619.550520] page:ffffd7cd819b0040 count:0 mapcount:0 mapping: (null) index:0x1
[ 619.555486] flags: 0x1fffc000400000(hwpoison)
[ 619.556408] page dumped because: VM_BUG_ON_PAGE(!page_count(p))
[ 619.558998] ------------[ cut here ]------------
[ 619.561388] kernel BUG at /src/linux-dev/mm/memory-failure.c:1132!
memory_failure() passed refcount and page lock from tail page to head
page, which is not needed because we can pass any subpage to
split_huge_page().
Fixes: 61f5d698cc97 ("mm: re-enable THP")
Link: http://lkml.kernel.org/r/1477961577-7183-1-git-send-email-n-horiguchi@ah.jp.nec.com
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: <stable@vger.kernel.org> [4.5+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory-failure.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff -puN mm/memory-failure.c~mm-hwpoison-fix-thp-split-handling-in-memory_failure mm/memory-failure.c
--- a/mm/memory-failure.c~mm-hwpoison-fix-thp-split-handling-in-memory_failure
+++ a/mm/memory-failure.c
@@ -1112,10 +1112,10 @@ int memory_failure(unsigned long pfn, in
}
if (!PageHuge(p) && PageTransHuge(hpage)) {
- lock_page(hpage);
- if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) {
- unlock_page(hpage);
- if (!PageAnon(hpage))
+ lock_page(p);
+ if (!PageAnon(p) || unlikely(split_huge_page(p))) {
+ unlock_page(p);
+ if (!PageAnon(p))
pr_err("Memory failure: %#lx: non anonymous thp\n",
pfn);
else
@@ -1126,9 +1126,7 @@ int memory_failure(unsigned long pfn, in
put_hwpoison_page(p);
return -EBUSY;
}
- unlock_page(hpage);
- get_hwpoison_page(p);
- put_hwpoison_page(hpage);
+ unlock_page(p);
VM_BUG_ON_PAGE(!page_count(p), p);
hpage = compound_head(p);
}
_
Patches currently in -mm which might be from n-horiguchi@ah.jp.nec.com are
^ permalink raw reply
* [merged] revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path.patch removed from -mm tree
From: akpm @ 2016-11-14 20:03 UTC (permalink / raw)
To: hdegoede, frowand.list, gregkh, paul.burton, regressions, robh+dt,
stable, tj, mm-commits
The patch titled
Subject: Revert "console: don't prefer first registered if DT specifies stdout-path"
has been removed from the -mm tree. Its filename was
revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Hans de Goede <hdegoede@redhat.com>
Subject: Revert "console: don't prefer first registered if DT specifies stdout-path"
This reverts commit 05fd007e4629 ("console: don't prefer first registered
if DT specifies stdout-path").
The reverted commit changes existing behavior on which many ARM boards
rely. Many ARM small-board-computers, like e.g. the Raspberry Pi have
both a video output and a serial console. Depending on whether the user
is using the device as a more regular computer; or as a headless device we
need to have the console on either one or the other.
Many users rely on the kernel behavior of the console being present on
both outputs, before the reverted commit the console setup with no
console= kernel arguments on an ARM board which sets stdout-path in dt
would look like this:
[root@localhost ~]# cat /proc/consoles
ttyS0 -W- (EC p a) 4:64
tty0 -WU (E p ) 4:1
Where as after the reverted commit, it looks like this:
[root@localhost ~]# cat /proc/consoles
ttyS0 -W- (EC p a) 4:64
This commit reverts commit 05fd007e4629 ("console: don't prefer first
registered if DT specifies stdout-path") restoring the original behavior.
Fixes: 05fd007e4629 ("console: don't prefer first registered if DT specifies stdout-path")
Link: http://lkml.kernel.org/r/20161104121135.4780-2-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/of/base.c | 2 --
include/linux/console.h | 6 ------
kernel/printk/printk.c | 13 +------------
3 files changed, 1 insertion(+), 20 deletions(-)
diff -puN drivers/of/base.c~revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path drivers/of/base.c
--- a/drivers/of/base.c~revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path
+++ a/drivers/of/base.c
@@ -2077,8 +2077,6 @@ void of_alias_scan(void * (*dt_alloc)(u6
name = of_get_property(of_aliases, "stdout", NULL);
if (name)
of_stdout = of_find_node_opts_by_path(name, &of_stdout_options);
- if (of_stdout)
- console_set_by_of();
}
if (!of_aliases)
diff -puN include/linux/console.h~revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path include/linux/console.h
--- a/include/linux/console.h~revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path
+++ a/include/linux/console.h
@@ -173,12 +173,6 @@ static inline void console_sysfs_notify(
#endif
extern bool console_suspend_enabled;
-#ifdef CONFIG_OF
-extern void console_set_by_of(void);
-#else
-static inline void console_set_by_of(void) {}
-#endif
-
/* Suspend and resume console messages over PM events */
extern void suspend_console(void);
extern void resume_console(void);
diff -puN kernel/printk/printk.c~revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path kernel/printk/printk.c
--- a/kernel/printk/printk.c~revert-console-dont-prefer-first-registered-if-dt-specifies-stdout-path
+++ a/kernel/printk/printk.c
@@ -253,17 +253,6 @@ static int preferred_console = -1;
int console_set_on_cmdline;
EXPORT_SYMBOL(console_set_on_cmdline);
-#ifdef CONFIG_OF
-static bool of_specified_console;
-
-void console_set_by_of(void)
-{
- of_specified_console = true;
-}
-#else
-# define of_specified_console false
-#endif
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.