LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 06/15] rsxx: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/rsxx/dev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c
index 8ffa8260dcafe..6dde80b096c62 100644
--- a/drivers/block/rsxx/dev.c
+++ b/drivers/block/rsxx/dev.c
@@ -133,7 +133,7 @@ static void bio_dma_done_cb(struct rsxx_cardinfo *card,
 
 static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio)
 {
-	struct rsxx_cardinfo *card = q->queuedata;
+	struct rsxx_cardinfo *card = bio->bi_disk->private_data;
 	struct rsxx_bio_meta *bio_meta;
 	blk_status_t st = BLK_STS_IOERR;
 
@@ -282,8 +282,6 @@ int rsxx_setup_dev(struct rsxx_cardinfo *card)
 		card->queue->limits.discard_alignment   = RSXX_HW_BLK_SIZE;
 	}
 
-	card->queue->queuedata = card;
-
 	snprintf(card->gendisk->disk_name, sizeof(card->gendisk->disk_name),
 		 "rsxx%d", card->disk_id);
 	card->gendisk->major = card->major;
@@ -304,7 +302,6 @@ void rsxx_destroy_dev(struct rsxx_cardinfo *card)
 	card->gendisk = NULL;
 
 	blk_cleanup_queue(card->queue);
-	card->queue->queuedata = NULL;
 	unregister_blkdev(card->major, DRIVER_NAME);
 }
 
-- 
2.26.2


^ permalink raw reply related

* [PATCH 08/15] zram: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/zram/zram_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index ebb234f36909c..e1a6c74c7a4ba 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1593,7 +1593,7 @@ static void __zram_make_request(struct zram *zram, struct bio *bio)
  */
 static blk_qc_t zram_make_request(struct request_queue *queue, struct bio *bio)
 {
-	struct zram *zram = queue->queuedata;
+	struct zram *zram = bio->bi_disk->private_data;
 
 	if (!valid_io_request(zram, bio->bi_iter.bi_sector,
 					bio->bi_iter.bi_size)) {
@@ -1916,7 +1916,6 @@ static int zram_add(void)
 	zram->disk->first_minor = device_id;
 	zram->disk->fops = &zram_devops;
 	zram->disk->queue = queue;
-	zram->disk->queue->queuedata = zram;
 	zram->disk->private_data = zram;
 	snprintf(zram->disk->disk_name, 16, "zram%d", device_id);
 
-- 
2.26.2


^ permalink raw reply related

* [PATCH 05/15] ps3vram: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/ps3vram.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 821d4d8b1d763..5a1d1d137c724 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -587,7 +587,7 @@ static struct bio *ps3vram_do_bio(struct ps3_system_bus_device *dev,
 
 static blk_qc_t ps3vram_make_request(struct request_queue *q, struct bio *bio)
 {
-	struct ps3_system_bus_device *dev = q->queuedata;
+	struct ps3_system_bus_device *dev = bio->bi_disk->private_data;
 	struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
 	int busy;
 
@@ -745,7 +745,6 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)
 	}
 
 	priv->queue = queue;
-	queue->queuedata = dev;
 	blk_queue_max_segments(queue, BLK_MAX_SEGMENTS);
 	blk_queue_max_segment_size(queue, BLK_MAX_SEGMENT_SIZE);
 	blk_queue_max_hw_sectors(queue, BLK_SAFE_MAX_SECTORS);
-- 
2.26.2


^ permalink raw reply related

* [PATCH 03/15] drbd: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/drbd/drbd_main.c | 1 -
 drivers/block/drbd/drbd_req.c  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index c094c3c2c5d4d..be787b268f044 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2805,7 +2805,6 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
 	if (!q)
 		goto out_no_q;
 	device->rq_queue = q;
-	q->queuedata   = device;
 
 	disk = alloc_disk(1);
 	if (!disk)
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 840c3aef3c5c9..02c104a0c45e0 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1614,7 +1614,7 @@ void do_submit(struct work_struct *ws)
 
 blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio)
 {
-	struct drbd_device *device = (struct drbd_device *) q->queuedata;
+	struct drbd_device *device = bio->bi_disk->private_data;
 	unsigned long start_jif;
 
 	blk_queue_split(q, &bio);
-- 
2.26.2


^ permalink raw reply related

* remove a few uses of ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev

Hi all,

various bio based drivers use queue->queuedata despite already having
set up disk->private_data, which can be used just as easily.  This
series cleans them up to only use a single private data pointer.

blk-mq based drivers that have code pathes that can't easily get at
the gendisk are unaffected by this series.

^ permalink raw reply

* [PATCH 07/15] umem: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/umem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index d84e8a878df24..e59bff24e02cf 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -521,7 +521,8 @@ static int mm_check_plugged(struct cardinfo *card)
 
 static blk_qc_t mm_make_request(struct request_queue *q, struct bio *bio)
 {
-	struct cardinfo *card = q->queuedata;
+	struct cardinfo *card = bio->bi_disk->private_data;
+
 	pr_debug("mm_make_request %llu %u\n",
 		 (unsigned long long)bio->bi_iter.bi_sector,
 		 bio->bi_iter.bi_size);
@@ -888,7 +889,6 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	card->queue = blk_alloc_queue(mm_make_request, NUMA_NO_NODE);
 	if (!card->queue)
 		goto failed_alloc;
-	card->queue->queuedata = card;
 
 	tasklet_init(&card->tasklet, process_page, (unsigned long)card);
 
-- 
2.26.2


^ permalink raw reply related

* [PATCH 04/15] null_blk: stop using ->queuedata for bio mode
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/null_blk_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index 8efd8778e2095..d14df79feca89 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -1365,7 +1365,7 @@ static blk_qc_t null_queue_bio(struct request_queue *q, struct bio *bio)
 {
 	sector_t sector = bio->bi_iter.bi_sector;
 	sector_t nr_sectors = bio_sectors(bio);
-	struct nullb *nullb = q->queuedata;
+	struct nullb *nullb = bio->bi_disk->private_data;
 	struct nullb_queue *nq = nullb_to_queue(nullb);
 	struct nullb_cmd *cmd;
 
-- 
2.26.2


^ permalink raw reply related

* [PATCH 01/15] nfblock: use gendisk private_data
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/m68k/emu/nfblock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c
index c3a630440512e..5c6f04b00e866 100644
--- a/arch/m68k/emu/nfblock.c
+++ b/arch/m68k/emu/nfblock.c
@@ -61,7 +61,7 @@ struct nfhd_device {
 
 static blk_qc_t nfhd_make_request(struct request_queue *queue, struct bio *bio)
 {
-	struct nfhd_device *dev = queue->queuedata;
+	struct nfhd_device *dev = bio->bi_disk->private_data;
 	struct bio_vec bvec;
 	struct bvec_iter iter;
 	int dir, len, shift;
@@ -122,7 +122,6 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
 	if (dev->queue == NULL)
 		goto free_dev;
 
-	dev->queue->queuedata = dev;
 	blk_queue_logical_block_size(dev->queue, bsize);
 
 	dev->disk = alloc_disk(16);
@@ -136,6 +135,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
 	sprintf(dev->disk->disk_name, "nfhd%u", dev_id);
 	set_capacity(dev->disk, (sector_t)blocks * (bsize / 512));
 	dev->disk->queue = dev->queue;
+	dev->disk->private_data = dev;
 
 	add_disk(dev->disk);
 
-- 
2.26.2


^ permalink raw reply related

* [PATCH 09/15] lightnvm: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/lightnvm/core.c      | 1 -
 drivers/lightnvm/pblk-init.c | 2 +-
 drivers/lightnvm/pblk.h      | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index db38a68abb6c0..85c5490cdfd2e 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -400,7 +400,6 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
 	}
 
 	tdisk->private_data = targetdata;
-	tqueue->queuedata = targetdata;
 
 	mdts = (dev->geo.csecs >> 9) * NVM_MAX_VLBA;
 	if (dev->geo.mdts) {
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 9a967a2e83dd7..bec904ec0f7c0 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -49,7 +49,7 @@ struct bio_set pblk_bio_set;
 
 static blk_qc_t pblk_make_rq(struct request_queue *q, struct bio *bio)
 {
-	struct pblk *pblk = q->queuedata;
+	struct pblk *pblk = bio->bi_disk->private_data;
 
 	if (bio_op(bio) == REQ_OP_DISCARD) {
 		pblk_discard(pblk, bio);
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index 86ffa875bfe16..ed364afaed0d8 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -1255,7 +1255,7 @@ static inline int pblk_boundary_ppa_checks(struct nvm_tgt_dev *tgt_dev,
 				continue;
 		}
 
-		print_ppa(tgt_dev->q->queuedata, ppa, "boundary", i);
+		print_ppa(tgt_dev->disk->private_data, ppa, "boundary", i);
 
 		return 1;
 	}
-- 
2.26.2


^ permalink raw reply related

* [PATCH 10/15] bcache: stop setting ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/bcache/super.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index d98354fa28e3e..a0fb5af2beeda 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -871,7 +871,6 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size,
 		return -ENOMEM;
 
 	d->disk->queue			= q;
-	q->queuedata			= d;
 	q->backing_dev_info->congested_data = d;
 	q->limits.max_hw_sectors	= UINT_MAX;
 	q->limits.max_sectors		= UINT_MAX;
-- 
2.26.2


^ permalink raw reply related

* [PATCH 11/15] dm: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/dm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 0eb93da44ea2a..2aaae6c1ed312 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1783,7 +1783,7 @@ static blk_qc_t dm_process_bio(struct mapped_device *md,
 
 static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
 {
-	struct mapped_device *md = q->queuedata;
+	struct mapped_device *md = bio->bi_disk->private_data;
 	blk_qc_t ret = BLK_QC_T_NONE;
 	int srcu_idx;
 	struct dm_table *map;
@@ -1980,7 +1980,6 @@ static struct mapped_device *alloc_dev(int minor)
 	md->queue = blk_alloc_queue(dm_make_request, numa_node_id);
 	if (!md->queue)
 		goto bad;
-	md->queue->queuedata = md;
 
 	md->disk = alloc_disk_node(1, md->numa_node_id);
 	if (!md->disk)
-- 
2.26.2


^ permalink raw reply related

* [PATCH 12/15] md: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/md.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 271e8a5873549..c079ecf77c564 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -466,7 +466,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
 {
 	const int rw = bio_data_dir(bio);
 	const int sgrp = op_stat_group(bio_op(bio));
-	struct mddev *mddev = q->queuedata;
+	struct mddev *mddev = bio->bi_disk->private_data;
 	unsigned int sectors;
 
 	if (unlikely(test_bit(MD_BROKEN, &mddev->flags)) && (rw == WRITE)) {
@@ -5626,7 +5626,6 @@ static int md_alloc(dev_t dev, char *name)
 	mddev->queue = blk_alloc_queue(md_make_request, NUMA_NO_NODE);
 	if (!mddev->queue)
 		goto abort;
-	mddev->queue->queuedata = mddev;
 
 	blk_set_stacking_limits(&mddev->queue->limits);
 
-- 
2.26.2


^ permalink raw reply related

* [PATCH 14/15] nvdimm/btt: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvdimm/btt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 3b09419218d6f..eca3e48fefda1 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -1442,7 +1442,7 @@ static int btt_do_bvec(struct btt *btt, struct bio_integrity_payload *bip,
 static blk_qc_t btt_make_request(struct request_queue *q, struct bio *bio)
 {
 	struct bio_integrity_payload *bip = bio_integrity(bio);
-	struct btt *btt = q->queuedata;
+	struct btt *btt = bio->bi_disk->private_data;
 	struct bvec_iter iter;
 	unsigned long start;
 	struct bio_vec bvec;
@@ -1543,7 +1543,6 @@ static int btt_blk_init(struct btt *btt)
 	blk_queue_logical_block_size(btt->btt_queue, btt->sector_size);
 	blk_queue_max_hw_sectors(btt->btt_queue, UINT_MAX);
 	blk_queue_flag_set(QUEUE_FLAG_NONROT, btt->btt_queue);
-	btt->btt_queue->queuedata = btt;
 
 	if (btt_meta_size(btt)) {
 		int rc = nd_integrity_init(btt->btt_disk, btt_meta_size(btt));
-- 
2.26.2


^ permalink raw reply related

* [PATCH 13/15] nvdimm/blk: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvdimm/blk.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
index 43751fab9d36a..ffe4728bad8b1 100644
--- a/drivers/nvdimm/blk.c
+++ b/drivers/nvdimm/blk.c
@@ -165,7 +165,7 @@ static int nsblk_do_bvec(struct nd_namespace_blk *nsblk,
 static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
 {
 	struct bio_integrity_payload *bip;
-	struct nd_namespace_blk *nsblk;
+	struct nd_namespace_blk *nsblk = bio->bi_disk->private_data;
 	struct bvec_iter iter;
 	unsigned long start;
 	struct bio_vec bvec;
@@ -176,7 +176,6 @@ static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
 		return BLK_QC_T_NONE;
 
 	bip = bio_integrity(bio);
-	nsblk = q->queuedata;
 	rw = bio_data_dir(bio);
 	do_acct = nd_iostat_start(bio, &start);
 	bio_for_each_segment(bvec, bio, iter) {
@@ -258,7 +257,6 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)
 	blk_queue_max_hw_sectors(q, UINT_MAX);
 	blk_queue_logical_block_size(q, nsblk_sector_size(nsblk));
 	blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
-	q->queuedata = nsblk;
 
 	disk = alloc_disk(0);
 	if (!disk)
@@ -268,6 +266,7 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)
 	disk->fops		= &nd_blk_fops;
 	disk->queue		= q;
 	disk->flags		= GENHD_FL_EXT_DEVT;
+	disk->private_data	= nsblk;
 	nvdimm_namespace_disk_name(&nsblk->common, disk->disk_name);
 
 	if (devm_add_action_or_reset(dev, nd_blk_release_disk, disk))
-- 
2.26.2


^ permalink raw reply related

* [PATCH 15/15] nvdimm/pmem: stop using ->queuedata
From: Christoph Hellwig @ 2020-05-08 16:15 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-bcache, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, linux-kernel, Jim Paris, linux-block,
	Minchan Kim, linux-m68k, Philip Kelleher, linuxppc-dev,
	Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvdimm/pmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 2df6994acf836..f8dc5941215bf 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -196,7 +196,7 @@ static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio)
 	unsigned long start;
 	struct bio_vec bvec;
 	struct bvec_iter iter;
-	struct pmem_device *pmem = q->queuedata;
+	struct pmem_device *pmem = bio->bi_disk->private_data;
 	struct nd_region *nd_region = to_region(pmem);
 
 	if (bio->bi_opf & REQ_PREFLUSH)
@@ -231,7 +231,7 @@ static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio)
 static int pmem_rw_page(struct block_device *bdev, sector_t sector,
 		       struct page *page, unsigned int op)
 {
-	struct pmem_device *pmem = bdev->bd_queue->queuedata;
+	struct pmem_device *pmem = bdev->bd_disk->private_data;
 	blk_status_t rc;
 
 	if (op_is_write(op))
@@ -464,7 +464,6 @@ static int pmem_attach_disk(struct device *dev,
 	blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
 	if (pmem->pfn_flags & PFN_MAP)
 		blk_queue_flag_set(QUEUE_FLAG_DAX, q);
-	q->queuedata = pmem;
 
 	disk = alloc_disk_node(0, nid);
 	if (!disk)
@@ -474,6 +473,7 @@ static int pmem_attach_disk(struct device *dev,
 	disk->fops		= &pmem_fops;
 	disk->queue		= q;
 	disk->flags		= GENHD_FL_EXT_DEVT;
+	disk->private_data	= pmem;
 	disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
 	nvdimm_namespace_disk_name(ndns, disk->disk_name);
 	set_capacity(disk, (pmem->size - pmem->pfn_pad - pmem->data_offset)
-- 
2.26.2


^ permalink raw reply related

* [PATCH] selftests: powerpc: Add test for execute-disabled pkeys
From: Sandipan Das @ 2020-05-08 16:23 UTC (permalink / raw)
  To: mpe
  Cc: fweimer, aneesh.kumar, linuxram, linux-mm, linux-kselftest,
	linuxppc-dev, bauerman

Apart from read and write access, memory protection keys can
also be used for restricting execute permission of pages on
powerpc. This adds a test to verify if the feature works as
expected.

Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
---
 tools/testing/selftests/powerpc/mm/Makefile   |   3 +-
 .../selftests/powerpc/mm/pkey_exec_prot.c     | 326 ++++++++++++++++++
 2 files changed, 328 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/powerpc/mm/pkey_exec_prot.c

diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index b9103c4bb414..2816229f648b 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -3,7 +3,7 @@ noarg:
 	$(MAKE) -C ../
 
 TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao segv_errors wild_bctr \
-		  large_vm_fork_separation bad_accesses
+		  large_vm_fork_separation bad_accesses pkey_exec_prot
 TEST_GEN_PROGS_EXTENDED := tlbie_test
 TEST_GEN_FILES := tempfile
 
@@ -17,6 +17,7 @@ $(OUTPUT)/prot_sao: ../utils.c
 $(OUTPUT)/wild_bctr: CFLAGS += -m64
 $(OUTPUT)/large_vm_fork_separation: CFLAGS += -m64
 $(OUTPUT)/bad_accesses: CFLAGS += -m64
+$(OUTPUT)/pkey_exec_prot: CFLAGS += -m64
 
 $(OUTPUT)/tempfile:
 	dd if=/dev/zero of=$@ bs=64k count=1
diff --git a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
new file mode 100644
index 000000000000..b346ad205e68
--- /dev/null
+++ b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
@@ -0,0 +1,326 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/*
+ * Copyright 2020, Sandipan Das, IBM Corp.
+ *
+ * Test if applying execute protection on pages using memory
+ * protection keys works as expected.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+
+#include <time.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include "utils.h"
+
+/* Override definitions as they might be inconsistent */
+#undef PKEY_DISABLE_ACCESS
+#define PKEY_DISABLE_ACCESS	0x3
+
+#undef PKEY_DISABLE_WRITE
+#define PKEY_DISABLE_WRITE	0x2
+
+#undef PKEY_DISABLE_EXECUTE
+#define PKEY_DISABLE_EXECUTE	0x4
+
+/* Older distros might not define this */
+#ifndef SEGV_PKUERR
+#define SEGV_PKUERR	4
+#endif
+
+#define SYS_pkey_mprotect	386
+#define SYS_pkey_alloc		384
+#define SYS_pkey_free		385
+
+#define PKEY_BITS_PER_PKEY	2
+#define NR_PKEYS		32
+
+#define PKEY_BITS_MASK		((1UL << PKEY_BITS_PER_PKEY) - 1)
+
+static unsigned long pkeyreg_get(void)
+{
+	unsigned long uamr;
+
+	asm volatile("mfspr	%0, 0xd" : "=r"(uamr));
+	return uamr;
+}
+
+static void pkeyreg_set(unsigned long uamr)
+{
+	asm volatile("isync; mtspr	0xd, %0; isync;" : : "r"(uamr));
+}
+
+static void pkey_set_rights(int pkey, unsigned long rights)
+{
+	unsigned long uamr, shift;
+
+	shift = (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY;
+	uamr = pkeyreg_get();
+	uamr &= ~(PKEY_BITS_MASK << shift);
+	uamr |= (rights & PKEY_BITS_MASK) << shift;
+	pkeyreg_set(uamr);
+}
+
+static int sys_pkey_mprotect(void *addr, size_t len, int prot, int pkey)
+{
+	return syscall(SYS_pkey_mprotect, addr, len, prot, pkey);
+}
+
+static int sys_pkey_alloc(unsigned long flags, unsigned long rights)
+{
+	return syscall(SYS_pkey_alloc, flags, rights);
+}
+
+static int sys_pkey_free(int pkey)
+{
+	return syscall(SYS_pkey_free, pkey);
+}
+
+static volatile int fpkey, fcode, ftype, faults;
+static unsigned long pgsize, numinsns;
+static volatile unsigned int *faddr;
+static unsigned int *insns;
+
+static void segv_handler(int signum, siginfo_t *sinfo, void *ctx)
+{
+	/* Check if this fault originated because of the expected reasons */
+	if (sinfo->si_code != SEGV_ACCERR && sinfo->si_code != SEGV_PKUERR) {
+		printf("got an unexpected fault, code = %d\n",
+		       sinfo->si_code);
+		goto fail;
+	}
+
+	/* Check if this fault originated from the expected address */
+	if (sinfo->si_addr != (void *) faddr) {
+		printf("got an unexpected fault, addr = %p\n",
+		       sinfo->si_addr);
+		goto fail;
+	}
+
+	/* Check if the expected number of faults has been exceeded */
+	if (faults == 0)
+		goto fail;
+
+	fcode = sinfo->si_code;
+
+	/* Restore permissions in order to continue */
+	switch (fcode) {
+	case SEGV_ACCERR:
+		if (mprotect(insns, pgsize, PROT_READ | PROT_WRITE)) {
+			perror("mprotect");
+			goto fail;
+		}
+		break;
+	case SEGV_PKUERR:
+		if (sinfo->si_pkey != fpkey)
+			goto fail;
+
+		if (ftype == PKEY_DISABLE_ACCESS) {
+			pkey_set_rights(fpkey, 0);
+		} else if (ftype == PKEY_DISABLE_EXECUTE) {
+			/*
+			 * Reassociate the exec-only pkey with the region
+			 * to be able to continue. Unlike AMR, we cannot
+			 * set IAMR directly from userspace to restore the
+			 * permissions.
+			 */
+			if (mprotect(insns, pgsize, PROT_EXEC)) {
+				perror("mprotect");
+				goto fail;
+			}
+		} else {
+			goto fail;
+		}
+		break;
+	}
+
+	faults--;
+	return;
+
+fail:
+	/* Restore all page permissions to avoid repetitive faults */
+	if (mprotect(insns, pgsize, PROT_READ | PROT_WRITE | PROT_EXEC))
+		perror("mprotect");
+	if (sinfo->si_code == SEGV_PKUERR)
+		pkey_set_rights(sinfo->si_pkey, 0);
+	faults = -1;	/* Something unexpected happened */
+}
+
+static int pkeys_unsupported(void)
+{
+	bool using_hash = false;
+	char line[128];
+	int pkey;
+	FILE *f;
+
+	f = fopen("/proc/cpuinfo", "r");
+	FAIL_IF(!f);
+
+	/* Protection keys are currently supported on Hash MMU only */
+	while (fgets(line, sizeof(line), f)) {
+		if (strcmp(line, "MMU		: Hash\n") == 0) {
+			using_hash = true;
+			break;
+		}
+	}
+
+	fclose(f);
+	SKIP_IF(!using_hash);
+
+	/* Check if the system call is supported */
+	pkey = sys_pkey_alloc(0, 0);
+	SKIP_IF(pkey < 0);
+	sys_pkey_free(pkey);
+
+	return 0;
+}
+
+static int test(void)
+{
+	struct sigaction act;
+	int pkey, ret, i;
+
+	ret = pkeys_unsupported();
+	if (ret)
+		return ret;
+
+	/* Setup signal handler */
+	act.sa_handler = 0;
+	act.sa_sigaction = segv_handler;
+	FAIL_IF(sigprocmask(SIG_SETMASK, 0, &act.sa_mask) != 0);
+	act.sa_flags = SA_SIGINFO;
+	act.sa_restorer = 0;
+	FAIL_IF(sigaction(SIGSEGV, &act, NULL) != 0);
+
+	/* Setup executable region */
+	pgsize = sysconf(_SC_PAGESIZE);
+	numinsns = pgsize / sizeof(unsigned int);
+	insns = (unsigned int *) mmap(NULL, pgsize, PROT_READ | PROT_WRITE,
+				      MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+	FAIL_IF(insns == MAP_FAILED);
+
+	/* Write the instruction words */
+	for (i = 0; i < numinsns - 1; i++)
+		insns[i] = 0x60000000;		/* nop */
+
+	/*
+	 * Later, to jump to the executable region, we use a linked
+	 * branch which sets the return address automatically in LR.
+	 * Use that to return back.
+	 */
+	insns[numinsns - 1] = 0x4e800020;	/* blr */
+
+	/* Allocate a pkey that restricts execution */
+	pkey = sys_pkey_alloc(0, PKEY_DISABLE_EXECUTE);
+	FAIL_IF(pkey < 0);
+
+	/*
+	 * Pick a random instruction address from the executable
+	 * region.
+	 */
+	srand(time(NULL));
+	faddr = &insns[rand() % (numinsns - 1)];
+
+	/* The following two cases will avoid SEGV_PKUERR */
+	ftype = -1;
+	fpkey = -1;
+
+	/*
+	 * Read an instruction word from the address when AMR bits
+	 * are not set.
+	 *
+	 * This should not generate a fault as having PROT_EXEC
+	 * implicitly allows reads. The pkey currently restricts
+	 * execution only based on the IAMR bits. The AMR bits are
+	 * cleared.
+	 */
+	faults = 0;
+	FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
+	printf("read from %p, pkey is execute-disabled\n", (void *) faddr);
+	i = *faddr;
+	FAIL_IF(faults != 0);
+
+	/*
+	 * Write an instruction word to the address when AMR bits
+	 * are not set.
+	 *
+	 * This should generate an access fault as having just
+	 * PROT_EXEC also restricts writes. The pkey currently
+	 * restricts execution only based on the IAMR bits. The
+	 * AMR bits are cleared.
+	 */
+	faults = 1;
+	FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
+	printf("write to %p, pkey is execute-disabled\n", (void *) faddr);
+	*faddr = 0x60000000;	/* nop */
+	FAIL_IF(faults != 0 || fcode != SEGV_ACCERR);
+
+	/* The following three cases will generate SEGV_PKUERR */
+	ftype = PKEY_DISABLE_ACCESS;
+	fpkey = pkey;
+
+	/*
+	 * Read an instruction word from the address when AMR bits
+	 * are set.
+	 *
+	 * This should generate a pkey fault based on AMR bits only
+	 * as having PROT_EXEC implicitly allows reads.
+	 */
+	faults = 1;
+	FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
+	printf("read from %p, pkey is execute-disabled, access-disabled\n",
+	       (void *) faddr);
+	pkey_set_rights(pkey, PKEY_DISABLE_ACCESS);
+	i = *faddr;
+	FAIL_IF(faults != 0 || fcode != SEGV_PKUERR);
+
+	/*
+	 * Write an instruction word to the address when AMR bits
+	 * are set.
+	 *
+	 * This should generate two faults. First, a pkey fault based
+	 * on AMR bits and then an access fault based on PROT_EXEC.
+	 */
+	faults = 2;
+	FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
+	printf("write to %p, pkey is execute-disabled, access-disabled\n",
+	       (void *) faddr);
+	pkey_set_rights(pkey, PKEY_DISABLE_ACCESS);
+	*faddr = 0x60000000;	/* nop */
+	FAIL_IF(faults != 0 || fcode != SEGV_ACCERR);
+
+	/*
+	 * Jump to the executable region. This should generate a pkey
+	 * fault based on IAMR bits. AMR bits will not affect execution.
+	 */
+	faddr = insns;
+	ftype = PKEY_DISABLE_EXECUTE;
+	fpkey = pkey;
+	faults = 1;
+	FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
+	pkey_set_rights(pkey, PKEY_DISABLE_ACCESS);
+	printf("execute at %p, ", (void *) faddr);
+	printf("pkey is execute-disabled, access-disabled\n");
+
+	/* Branch into the executable region */
+	asm volatile("mtctr	%0" : : "r"((unsigned long) insns));
+	asm volatile("bctrl");
+	FAIL_IF(faults != 0 || fcode != SEGV_PKUERR);
+
+	/* Cleanup */
+	munmap((void *) insns, pgsize);
+	sys_pkey_free(pkey);
+
+	return 0;
+}
+
+int main(void)
+{
+	test_harness(test, "pkey_exec_prot");
+}
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH v7 2/5] seq_buf: Export seq_buf_printf() to external modules
From: Steven Rostedt @ 2020-05-08 16:27 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Cezary Rojewski, linux-nvdimm, linux-kernel, Piotr Maziarz,
	Aneesh Kumar K . V, Vaibhav Jain, linuxppc-dev
In-Reply-To: <20200508160935.GB19436@zn.tnic>

On Fri, 8 May 2020 18:09:35 +0200
Borislav Petkov <bp@alien8.de> wrote:

> On Fri, May 08, 2020 at 05:30:31PM +0530, Vaibhav Jain wrote:
> > I am referring to Kernel Loadable Modules with MODULE_LICENSE("GPL")
> > here.  
> 
> And what does "external" refer to? Because if it is out-of-tree, we
> don't export symbols for out-of-tree modules.

I've always wondered about this. Why not?

-- Steve

^ permalink raw reply

* Re: ioremap() called early from pnv_pci_init_ioda_phb()
From: Qian Cai @ 2020-05-08 17:41 UTC (permalink / raw)
  To: Christophe Leroy, Michael Ellerman; +Cc: linuxppc-dev, LKML
In-Reply-To: <B183CDAA-DA88-4760-9C1B-F73A8F7840E7@lca.pw>



> On May 8, 2020, at 10:39 AM, Qian Cai <cai@lca.pw> wrote:
> 
> Booting POWER9 PowerNV has this message,
> 
> "ioremap() called early from pnv_pci_init_ioda_phb+0x420/0xdfc. Use early_ioremap() instead”
> 
> but use the patch below will result in leaks because it will never call early_iounmap() anywhere. However, it looks me it was by design that phb->regs mapping would be there forever where it would be used in pnv_ioda_get_inval_reg(), so is just that check_early_ioremap_leak() initcall too strong?
> 
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -36,6 +36,7 @@
> #include <asm/firmware.h>
> #include <asm/pnv-pci.h>
> #include <asm/mmzone.h>
> +#include <asm/early_ioremap.h>
> 
> #include <misc/cxl-base.h>
> 
> @@ -3827,7 +3828,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
>        /* Get registers */
>        if (!of_address_to_resource(np, 0, &r)) {
>                phb->regs_phys = r.start;
> -               phb->regs = ioremap(r.start, resource_size(&r));
> +               phb->regs = early_ioremap(r.start, resource_size(&r));
>                if (phb->regs == NULL)
>                        pr_err("  Failed to map registers !\n”);

This will also trigger a panic with debugfs reads, so isn’t that this commit bogus at least for powerpc64?

d538aadc2718 (“powerpc/ioremap: warn on early use of ioremap()")

11017.617022][T122068] Faulting instruction address: 0xc0000000000db564
[11017.617257][T122066] Faulting instruction address: 0xc0000000000db564
[11017.617950][T122073] Faulting instruction address: 0xc0000000000db564
[11017.618888][T122064] BUG: Unable to handle kernel data access on read at 0xffffffffffe20e10
[11017.618935][T122064] Faulting instruction address: 0xc0000000000db564
[11017.737996][T122072] 
[11017.738010][T122073] Oops: Kernel access of bad area, sig: 11 [#2]
[11017.738024][T122073] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV
[11017.738051][T122073] Modules linked in: brd ext4 crc16 mbcache jbd2 loop kvm_hv kvm ip_tables x_tables xfs sd_mod bnx2x ahci libahci tg3 mdio libata libphy firmware_class dm_mirror dm_region_hash dm_log dm_mod
[11017.738110][T122073] CPU: 108 PID: 122073 Comm: read_all Tainted: G      D W         5.7.0-rc4-next-20200508+ #4
[11017.738138][T122073] NIP:  c0000000000db564 LR: c00000000056f660 CTR: c0000000000db550
[11017.738173][T122073] REGS: c000000374f6f980 TRAP: 0380   Tainted: G      D W          (5.7.0-rc4-next-20200508+)
[11017.738234][T122073] MSR:  9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 22002282  XER: 20040000
[11017.738278][T122073] CFAR: c00000000056f65c IRQMASK: 0 
[11017.738278][T122073] GPR00: c00000000056f660 c000000374f6fc10 c000000001689400 c000201ffc41aa00 
[11017.738278][T122073] GPR04: c000000374f6fc70 0000000000000000 0000000000000000 0000000000000001 
[11017.738278][T122073] GPR08: 0000000000000000 ffffffffffe20000 0000000000000000 c0000008ee380080 
[11017.738278][T122073] GPR12: c0000000000db550 c000201fff671280 0000000000000000 0000000000000000 
[11017.738278][T122073] GPR16: 0000000000000002 0000000010040800 000000001001ccd8 000000001001cc80 
[11017.738278][T122073] GPR20: 000000001001cc98 000000001001ccc8 000000001001cca8 000000001001cb48 
[11017.738278][T122073] GPR24: 0000000000000000 0000000000000000 00000000000003ff 00007fffebb67390 
[11017.738278][T122073] GPR28: c000000374f6fd90 c000200c0c6a7550 0000000000000000 c000200c0c6a7500 
[11017.738542][T122073] NIP [c0000000000db564] pnv_eeh_dbgfs_get_inbB+0x14/0x30
[11017.738579][T122073] LR [c00000000056f660] simple_attr_read+0xa0/0x180
[11017.738613][T122073] Call Trace:
[11017.738645][T122073] [c000000374f6fc10] [c00000000056f630] simple_attr_read+0x70/0x180 (unreliable)
[11017.738672][T122073] [c000000374f6fcb0] [c00000000064a2e0] full_proxy_read+0x90/0xe0
[11017.738686][T122073] [c000000374f6fd00] [c00000000051fe0c] __vfs_read+0x3c/0x70
[11017.738722][T122073] [c000000374f6fd20] [c00000000051feec] vfs_read+0xac/0x170
[11017.738757][T122073] [c000000374f6fd70] [c00000000052034c] ksys_read+0x7c/0x140
[11017.738818][T122073] [c000000374f6fdc0] [c000000000038af4] system_call_exception+0x114/0x1e0
[11017.738867][T122073] [c000000374f6fe20] [c00000000000c8f0] system_call_common+0xf0/0x278
[11017.738916][T122073] Instruction dump:
[11017.738948][T122073] 7c0004ac f9490d10 a14d0c78 38600000 b14d0c7a 4e800020 60000000 7c0802a6 
[11017.739001][T122073] 60000000 e9230278 e9290028 7c0004ac <e9290e10> 0c090000 4c00012c 38600000 
[11017.739052][T122073] ---[ end trace f68728a0d3053b5e ]---
[11017.828156][T122073] 
[11017.828170][T122068] Oops: Kernel access of bad area, sig: 11 [#3]
[11017.828184][T122068] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV
[11017.828209][T122068] Modules linked in: brd ext4 crc16 mbcache jbd2 loop kvm_hv kvm ip_tables x_tables xfs sd_mod bnx2x ahci libahci tg3 mdio libata libphy firmware_class dm_mirror dm_region_hash dm_log dm_mod
[11017.828265][T122068] CPU: 88 PID: 122068 Comm: read_all Tainted: G      D W         5.7.0-rc4-next-20200508+ #4
[11017.828303][T122068] NIP:  c0000000000db564 LR: c00000000056f660 CTR: c0000000000db550
[11017.828338][T122068] REGS: c000001ea20cf980 TRAP: 0380   Tainted: G      D W          (5.7.0-rc4-next-20200508+)
[11017.828386][T122068] MSR:  9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 22002282  XER: 20040000
[11017.828437][T122068] CFAR: c00000000056f65c IRQMASK: 0 
[11017.828437][T122068] GPR00: c00000000056f660 c000001ea20cfc10 c000000001689400 c000201ffc41aa00 
[11017.828437][T122068] GPR04: c000001ea20cfc70 0000000000000000 0000000000000000 0000000000000001 
[11017.828437][T122068] GPR08: 0000000000000000 ffffffffffe20000 0000000000000000 c0000018930e8880 
[11017.828437][T122068] GPR12: c0000000000db550 c000201fff691100 0000000000000000 0000000000000000 
[11017.828437][T122068] GPR16: 0000000000000002 0000000010040800 000000001001ccd8 000000001001cc80 
[11017.828437][T122068] GPR20: 000000001001cc98 000000001001ccc8 000000001001cca8 000000001001cb48 
[11017.828437][T122068] GPR24: 0000000000000000 0000000000000000 00000000000003ff 00007fffebb67390 
[11017.828437][T122068] GPR28: c000001ea20cfd90 c000200c0c6a4150 0000000000000000 c000200c0c6a4100 
[11017.828808][T122068] NIP [c0000000000db564] pnv_eeh_dbgfs_get_inbB+0x14/0x30
[11017.828856][T122068] LR [c00000000056f660] simple_attr_read+0xa0/0x180
[11017.828901][T122068] Call Trace:
[11017.828921][T122068] [c000001ea20cfc10] [c00000000056f630] simple_attr_read+0x70/0x180 (unreliable)
[11017.828983][T122068] [c000001ea20cfcb0] [c00000000064a2e0] full_proxy_read+0x90/0xe0
[11017.829030][T122068] [c000001ea20cfd00] [c00000000051fe0c] __vfs_read+0x3c/0x70
[11017.829043][T122068] [c000001ea20cfd20] [c00000000051feec] vfs_read+0xac/0x170
[11017.829056][T122068] [c000001ea20cfd70] [c00000000052034c] ksys_read+0x7c/0x140
[11017.829116][T122068] [c000001ea20cfdc0] [c000000000038af4] system_call_exception+0x114/0x1e0
[11017.829153][T122068] [c000001ea20cfe20] [c00000000000c8f0] system_call_common+0xf0/0x278
[11017.829215][T122068] Instruction dump:
[11017.829234][T122068] 7c0004ac f9490d10 a14d0c78 38600000 b14d0c7a 4e800020 60000000 7c0802a6 
[11017.829264][T122068] 60000000 e9230278 e9290028 7c0004ac <e9290e10> 0c090000 4c00012c 38600000 
[11017.829281][T122068] ---[ end trace f68728a0d3053b5f ]---
[11017.928173][T122068] 
[11017.928186][T122064] Oops: Kernel access of bad area, sig: 11 [#4]
[11017.928198][T122064] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV
[11017.928211][T122064] Modules linked in: brd ext4 crc16 mbcache jbd2 loop kvm_hv kvm ip_tables x_tables xfs sd_mod bnx2x ahci libahci tg3 mdio libata libphy firmware_class dm_mirror dm_region_hash dm_log dm_mod
[11017.928263][T122064] CPU: 120 PID: 122064 Comm: read_all Tainted: G      D W         5.7.0-rc4-next-20200508+ #4
[11017.928303][T122064] NIP:  c0000000000db564 LR: c00000000056f660 CTR: c0000000000db550
[11017.928351][T122064] REGS: c000000978bef980 TRAP: 0380   Tainted: G      D W          (5.7.0-rc4-next-20200508+)
[11017.928387][T122064] MSR:  9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 22002282  XER: 20040000
[11017.928416][T122064] CFAR: c00000000056f65c IRQMASK: 0 
[11017.928416][T122064] GPR00: c00000000056f660 c000000978befc10 c000000001689400 c000201ffc41aa00 
[11017.928416][T122064] GPR04: c000000978befc70 0000000000000000 0000000000000000 0000000000000001 
[11017.928416][T122064] GPR08: 0000000000000000 ffffffffffe20000 0000000000000000 c0000018930eaa80 
[11017.928416][T122064] GPR12: c0000000000db550 c000201fff667c80 0000000000000000 0000000000000000 
[11017.928416][T122064] GPR16: 0000000000000002 0000000010040800 000000001001ccd8 000000001001cc80 
[11017.928416][T122064] GPR20: 000000001001cc98 000000001001ccc8 000000001001cca8 000000001001cb48 
[11017.928416][T122064] GPR24: 0000000000000000 0000000000000000 00000000000003ff 00007fffebb67390 
[11017.928416][T122064] GPR28: c000000978befd90 c000200c0c6a2550 0000000000000000 c000200c0c6a2500 
[11017.928630][T122064] NIP [c0000000000db564] pnv_eeh_dbgfs_get_inbB+0x14/0x30
[11017.928657][T122064] LR [c00000000056f660] simple_attr_read+0xa0/0x180
[11017.928691][T122064] Call Trace:
[11017.928711][T122064] [c000000978befc10] [c00000000056f630] simple_attr_read+0x70/0x180 (unreliable)
[11017.928749][T122064] [c000000978befcb0] [c00000000064a2e0] full_proxy_read+0x90/0xe0
[11017.928810][T122064] [c000000978befd00] [c00000000051fe0c] __vfs_read+0x3c/0x70
[11017.928845][T122064] [c000000978befd20] [c00000000051feec] vfs_read+0xac/0x170
[11017.928896][T122064] [c000000978befd70] [c00000000052034c] ksys_read+0x7c/0x140
[11017.928946][T122064] [c000000978befdc0] [c000000000038af4] system_call_exception+0x114/0x1e0
[11017.928982][T122064] [c000000978befe20] [c00000000000c8f0] system_call_common+0xf0/0x278
[11017.928994][T122064] Instruction dump:
[11017.929014][T122064] 7c0004ac f9490d10 a14d0c78 38600000 b14d0c7a 4e800020 60000000 7c0802a6 
[11017.929068][T122064] 60000000 e9230278 e9290028 7c0004ac <e9290e10> 0c090000 4c00012c 38600000 
[11017.929085][T122064] ---[ end trace f68728a0d3053b60 ]---
[11018.018131][T122064] 
[11018.018143][T122067] Oops: Kernel access of bad area, sig: 11 [#5]
[11018.018155][T122067] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV
[11018.018178][T122067] Modules linked in: brd ext4 crc16 mbcache jbd2 loop kvm_hv kvm ip_tables x_tables xfs sd_mod bnx2x ahci libahci tg3 mdio libata libphy firmware_class dm_mirror dm_region_hash dm_log dm_mod
[11018.018231][T122067] CPU: 60 PID: 122067 Comm: read_all Tainted: G      D W         5.7.0-rc4-next-20200508+ #4
[11018.018254][T122067] NIP:  c0000000000db564 LR: c00000000056f660 CTR: c0000000000db550
[11018.018275][T122067] REGS: c000000e5a06f980 TRAP: 0380   Tainted: G      D W          (5.7.0-rc4-next-20200508+)
[11018.018307][T122067] MSR:  9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 22002282  XER: 20040000
[11018.018336][T122067] CFAR: c00000000056f65c IRQMASK: 0 
[11018.018336][T122067] GPR00: c00000000056f660 c000000e5a06fc10 c000000001689400 c000201ffc41aa00 
[11018.018336][T122067] GPR04: c000000e5a06fc70 0000000000000000 0000000000000000 0000000000000001 
[11018.018336][T122067] GPR08: 0000000000000000 ffffffffffe20000 0000000000000000 c0000018930ecc80 
[11018.018336][T122067] GPR12: c0000000000db550 c000001ffffcf200 0000000000000000 0000000000000000 
[11018.018336][T122067] GPR16: 0000000000000002 0000000010040800 000000001001ccd8 000000001001cc80 
[11018.018336][T122067] GPR20: 000000001001cc98 000000001001ccc8 000000001001cca8 000000001001cb48 
[11018.018336][T122067] GPR24: 0000000000000000 0000000000000000 00000000000003ff 00007fffebb67390 
[11018.018336][T122067] GPR28: c000000e5a06fd90 c000000007de7550 0000000000000000 c000000007de7500 
[11018.018552][T122067] NIP [c0000000000db564] pnv_eeh_dbgfs_get_inbB+0x14/0x30
[11018.018574][T122067] LR [c00000000056f660] simple_attr_read+0xa0/0x180
[11018.018602][T122067] Call Trace:
[11018.018619][T122067] [c000000e5a06fc10] [c00000000056f630] simple_attr_read+0x70/0x180 (unreliable)
[11018.018652][T122067] [c000000e5a06fcb0] [c00000000064a2e0] full_proxy_read+0x90/0xe0
[11018.018674][T122067] [c000000e5a06fd00] [c00000000051fe0c] __vfs_read+0x3c/0x70
[11018.018686][T122067] [c000000e5a06fd20] [c00000000051feec] vfs_read+0xac/0x170
[11018.018716][T122067] [c000000e5a06fd70] [c00000000052034c] ksys_read+0x7c/0x140
[11018.018747][T122067] [c000000e5a06fdc0] [c000000000038af4] system_call_exception+0x114/0x1e0
[11018.018779][T122067] [c000000e5a06fe20] [c00000000000c8f0] system_call_common+0xf0/0x278
[11018.018808][T122067] Instruction dump:
[11018.018825][T122067] 7c0004ac f9490d10 a14d0c78 38600000 b14d0c7a 4e800020 60000000 7c0802a6 
[11018.018850][T122067] 60000000 e9230278 e9290028 7c0004ac <e9290e10> 0c090000 4c00012c 38600000 
[11018.018875][T122067] ---[ end trace f68728a0d3053b61 ]---
[11018.108865][T122067] 
[11018.108875][T122070] Oops: Kernel access of bad area, sig: 11 [#6]
[11018.108887][T122070] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV
[11018.108909][T122070] Modules linked in: brd ext4 crc16 mbcache jbd2 loop kvm_hv kvm ip_tables x_tables xfs sd_mod bnx2x ahci libahci tg3 mdio libata libphy firmware_class dm_mirror dm_region_hash dm_log dm_mod
[11018.108949][T122070] CPU: 36 PID: 122070 Comm: read_all Tainted: G      D W         5.7.0-rc4-next-20200508+ #4
[11018.108981][T122070] NIP:  c0000000000db564 LR: c00000000056f660 CTR: c0000000000db550
[11018.109002][T122070] REGS: c000000a3628f980 TRAP: 0380   Tainted: G      D W          (5.7.0-rc4-next-20200508+)
[11018.109043][T122070] MSR:  9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 22002282  XER: 20040000
[11018.109077][T122070] CFAR: c00000000056f65c IRQMASK: 0 
[11018.109077][T122070] GPR00: c00000000056f660 c000000a3628fc10 c000000001689400 c000201ffc41aa00 
[11018.109077][T122070] GPR04: c000000a3628fc70 0000000000000000 0000000000000000 0000000000000001 
[11018.109077][T122070] GPR08: 0000000000000000 ffffffffffe20000 0000000000000000 c0000008ee384480 
[11018.109077][T122070] GPR12: c0000000000db550 c000001ffffe1e00 0000000000000000 0000000000000000 
[11018.109077][T122070] GPR16: 0000000000000002 0000000010040800 000000001001ccd8 000000001001cc80 
[11018.109077][T122070] GPR20: 000000001001cc98 000000001001ccc8 000000001001cca8 000000001001cb48 
[11018.109077][T122070] GPR24: 0000000000000000 0000000000000000 00000000000003ff 00007fffebb67390 
[11018.109077][T122070] GPR28: c000000a3628fd90 c0000002f5243950 0000000000000000 c0000002f5243900 
[11018.109256][T122070] NIP [c0000000000db564] pnv_eeh_dbgfs_get_inbB+0x14/0x30
[11018.109277][T122070] LR [c00000000056f660] simple_attr_read+0xa0/0x180
[11018.109296][T122070] Call Trace:
[11018.109314][T122070] [c000000a3628fc10] [c00000000056f630] simple_attr_read+0x70/0x180 (unreliable)
[11018.109346][T122070] [c000000a3628fcb0] [c00000000064a2e0] full_proxy_read+0x90/0xe0
[11018.109377][T122070] [c000000a3628fd00] [c00000000051fe0c] __vfs_read+0x3c/0x70
[11018.109417][T122070] [c000000a3628fd20] [c00000000051feec] vfs_read+0xac/0x170
[11018.109447][T122070] [c000000a3628fd70] [c00000000052034c] ksys_read+0x7c/0x140
[11018.109478][T122070] [c000000a3628fdc0] [c000000000038af4] system_call_exception+0x114/0x1e0
[11018.109510][T122070] [c000000a3628fe20] [c00000000000c8f0] system_call_common+0xf0/0x278
[11018.109548][T122070] Instruction dump:
[11018.109565][T122070] 7c0004ac f9490d10 a14d0c78 38600000 b14d0c7a 4e800020 60000000 7c0802a6 
[11018.109599][T122070] 60000000 e9230278 e9290028 7c0004ac <e9290e10> 0c090000 4c00012c 38600000 
[11018.109628][T122070] ---[ end trace f68728a0d3053b62 ]---
[11018.238625][T122070] 
[11018.238635][T122069] Oops: Kernel access of bad area, sig: 11 [#7]
[11018.238646][T122069] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV
[11018.238668][T122069] Modules linked in: brd ext4 crc16 mbcache jbd2 loop kvm_hv kvm ip_tables x_tables xfs sd_mod bnx2x ahci libahci tg3 mdio libata libphy firmware_class dm_mirror dm_region_hash dm_log dm_mod
[11018.238708][T122069] CPU: 48 PID: 122069 Comm: read_all Tainted: G      D W         5.7.0-rc4-next-20200508+ #4
[11018.238732][T122069] NIP:  c0000000000db564 LR: c00000000056f660 CTR: c0000000000db550
[11018.238761][T122069] REGS: c000001bf2e8f980 TRAP: 0380   Tainted: G      D W          (5.7.0-rc4-next-20200508+)
[11018.238793][T122069] MSR:  9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 22002282  XER: 20040000
[11018.238827][T122069] CFAR: c00000000056f65c IRQMASK: 0 
[11018.238827][T122069] GPR00: c00000000056f660 c000001bf2e8fc10 c000000001689400 c000201ffc41aa00 
[11018.238827][T122069] GPR04: c000001bf2e8fc70 0000000000000000 000000001ab703be ffffffff00018a2f 
[11018.238827][T122069] GPR08: 000000006c4a22da ffffffffffe20000 0000000000000000 0000000000000002 
[11018.238827][T122069] GPR12: c0000000000db550 c000001ffffd8800 0000000000000000 0000000000000000 
[11018.238827][T122069] GPR16: 0000000000000002 0000000010040800 000000001001ccd8 000000001001cc80 
[11018.238827][T122069] GPR20: 000000001001cc98 000000001001ccc8 000000001001cca8 000000001001cb48 
[11018.238827][T122069] GPR24: 0000000000000000 0000000000000000 00000000000003ff 00007fffebb67390 
[11018.238827][T122069] GPR28: c000001bf2e8fd90 c0000015bff0c950 0000000000000000 c0000015bff0c900 
[11018.239055][T122069] NIP [c0000000000db564] pnv_eeh_dbgfs_get_inbB+0x14/0x30
[11018.239086][T122069] LR [c00000000056f660] simple_attr_read+0xa0/0x180
[11018.239105][T122069] Call Trace:
[11018.239122][T122069] [c000001bf2e8fc10] [c00000000056f630] simple_attr_read+0x70/0x180 (unreliable)
[11018.239155][T122069] [c000001bf2e8fcb0] [c00000000064a2e0] full_proxy_read+0x90/0xe0
[11018.239186][T122069] [c000001bf2e8fd00] [c00000000051fe0c] __vfs_read+0x3c/0x70
[11018.239207][T122069] [c000001bf2e8fd20] [c00000000051feec] vfs_read+0xac/0x170
[11018.239228][T122069] [c000001bf2e8fd70] [c00000000052034c] ksys_read+0x7c/0x140
[11018.239240][T122069] [c000001bf2e8fdc0] [c000000000038af4] system_call_exception+0x114/0x1e0
[11018.239272][T122069] [c000001bf2e8fe20] [c00000000000c8f0] system_call_common+0xf0/0x278
[11018.239292][T122069] Instruction dump:
[11018.239309][T122069] 7c0004ac f9490d10 a14d0c78 38600000 b14d0c7a 4e800020 60000000 7c0802a6 
[11018.239342][T122069] 60000000 e9230278 e9290028 7c0004ac <e9290e10> 0c090000 4c00012c 38600000 
[11018.239377][T122069] ---[ end trace f68728a0d3053b63 ]---
[11018.738011][T122072] Kernel panic - not syncing: Fatal exception
[11020.409414]

> 
> [   23.080069][    T1] ------------[ cut here ]------------
> [   23.080089][    T1] Debug warning: early ioremap leak of 10 areas detected.
> [   23.080089][    T1] please boot with early_ioremap_debug and report the dmesg.
> [   23.080157][    T1] WARNING: CPU: 4 PID: 1 at mm/early_ioremap.c:99 check_early_ioremap_leak+0xd4/0x108
> [   23.080171][    T1] Modules linked in:
> [   23.080192][    T1] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.7.0-rc4-next-20200508+ #4
> [   23.080214][    T1] NIP:  c00000000103f2d8 LR: c00000000103f2d4 CTR: 0000000000000000
> [   23.080226][    T1] REGS: c00000003df0f860 TRAP: 0700   Not tainted  (5.7.0-rc4-next-20200508+)
> [   23.080259][    T1] MSR:  9000000000029033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 48000222  XER: 20040000
> [   23.080296][    T1] CFAR: c00000000010d5a8 IRQMASK: 0 
> [   23.080296][    T1] GPR00: c00000000103f2d4 c00000003df0faf0 c000000001689400 0000000000000072 
> [   23.080296][    T1] GPR04: 0000000000000006 0000000000000000 c00000003df0f7e4 0000000000000004 
> [   23.080296][    T1] GPR08: 0000001ffbb60000 0000000000000000 c00000003dee6680 0000000000000002 
> [   23.080296][    T1] GPR12: 0000000000000000 c000001fffffae00 c000000001057860 c0000000010578b0 
> [   23.080296][    T1] GPR16: c000000001002d38 c0000000014f0660 c0000000014f0680 c0000000014f06a0 
> [   23.080296][    T1] GPR20: c0000000014f06c0 c0000000014f06e0 c0000000014f0700 c0000000014f0720 
> [   23.080296][    T1] GPR24: c000000000c4bc30 c000000486b82000 c0000000015a0fe0 c0000000015a0fc0 
> [   23.080296][    T1] GPR28: 0000000000000010 0000000000000010 c000000001061e30 000000000000000a 
> [   23.080507][    T1] NIP [c00000000103f2d8] check_early_ioremap_leak+0xd4/0x108
> [   23.080530][    T1] LR [c00000000103f2d4] check_early_ioremap_leak+0xd0/0x108
> [   23.080552][    T1] Call Trace:
> [   23.080571][    T1] [c00000003df0faf0] [c00000000103f2d4] check_early_ioremap_leak+0xd0/0x108 (unreliable)
> [   23.080607][    T1] [c00000003df0fb80] [c00000000001130c] do_one_initcall+0xcc/0x660
> [   23.080648][    T1] [c00000003df0fc80] [c000000001004c18] kernel_init_freeable+0x480/0x568
> [   23.080681][    T1] [c00000003df0fdb0] [c000000000012180] kernel_init+0x24/0x194
> [   23.080713][    T1] [c00000003df0fe20] [c00000000000cb28] ret_from_kernel_thread+0x5c/0x74
> 
> This is from the early_ioremap_debug dmesg.
> 
> [    0.000000][    T0] ------------[ cut here ]------------
> [    0.000000][    T0] __early_ioremap(0x000600c3c0010000, 00010000) [0] => 00000000 + ffffffffffbe0000
> [    0.000000][    T0] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:162 __early_ioremap+0x2d8/0x408
> [    0.000000][    T0] Modules linked in:
> [    0.000000][    T0] CPU: 0 PID: 0 Comm: swapper Not tainted 5.7.0-rc4-next-20200508+ #4
> [    0.000000][    T0] NIP:  c00000000103f5e4 LR: c00000000103f5e0 CTR: c0000000001e77f0
> [    0.000000][    T0] REGS: c00000000168f980 TRAP: 0700   Not tainted  (5.7.0-rc4-next-20200508+)
> [    0.000000][    T0] MSR:  9000000000021033 <SF,HV,ME,IR,DR,RI,LE>  CR: 28000248  XER: 20040000
> [    0.000000][    T0] CFAR: c00000000010d5a8 IRQMASK: 1 
> [    0.000000][    T0] GPR00: c00000000103f5e0 c00000000168fc10 c000000001689400 0000000000000050 
> [    0.000000][    T0] GPR04: c00000000152f6f8 0000000000000000 c00000000168f904 0000000000000000 
> [    0.000000][    T0] GPR08: 0000000000000000 0000000000000000 c00000000162f600 0000000000000002 
> [    0.000000][    T0] GPR12: c0000000001e77f0 c000000005b30000 0000000000000000 0000000000000000 
> [    0.000000][    T0] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000001000 
> [    0.000000][    T0] GPR20: 0000000000000000 80000000000001ae 0000000000000000 0000000000000000 
> [    0.000000][    T0] GPR24: 0000000000010000 c000000001061da8 0000000000000008 0000000000000008 
> [    0.000000][    T0] GPR28: 0000000000000000 c000000001061db0 0000000000000000 c000000001061eb8 
> [    0.000000][    T0] NIP [c00000000103f5e4] __early_ioremap+0x2d8/0x408
> [    0.000000][    T0] LR [c00000000103f5e0] __early_ioremap+0x2d4/0x408
> [    0.000000][    T0] Call Trace:
> [    0.000000][    T0] [c00000000168fc10] [c00000000103f5e0] __early_ioremap+0x2d4/0x408 (unreliable)
> [    0.000000][    T0] [c00000000168fcf0] [c00000000101d010] pnv_pci_init_ioda_phb+0x420/0xdfc
> [    0.000000][    T0] [c00000000168fe10] [c00000000101c9b8] pnv_pci_init+0x12c/0x264
> [    0.000000][    T0] [c00000000168fe40] [c000000001016c40] pnv_setup_arch+0x2e4/0x330
> [    0.000000][    T0] [c00000000168fe80] [c000000001009dd0] setup_arch+0x3a0/0x3ec
> [    0.000000][    T0] [c00000000168fef0] [c000000001003ed0] start_kernel+0xb0/0x978
> [    0.000000][    T0] [c00000000168ff90] [c00000000000c790] start_here_common+0x1c/0x8c
> [    0.000000][    T0] Instruction dump:
> [    0.000000][    T0] 7d39ba14 3c82ff3c 3c62ff54 7f06c378 7f88e378 7fc7f378 38a10068 e9290110 
> [    0.000000][    T0] 38849e90 3863e8f0 4b0cdf65 60000000 <0fe00000> 2bbe000f 409d0018 3c62fff1 
> [    0.000000][    T0] irq event stamp: 0
> [    0.000000][    T0] hardirqs last  enabled at (0): [<0000000000000000>] 0x0
> [    0.000000][    T0] hardirqs last disabled at (0): [<0000000000000000>] 0x0
> [    0.000000][    T0] softirqs last  enabled at (0): [<0000000000000000>] 0x0
> [    0.000000][    T0] softirqs last disabled at (0): [<0000000000000000>] 0x0
> 


^ permalink raw reply

* Re: [PATCH v4 02/14] arm: add support for folded p4d page tables
From: Mike Rapoport @ 2020-05-08 17:42 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Rich Felker, linux-ia64, Geert Uytterhoeven, Fenghua Yu, linux-mm,
	Paul Mackerras, Will Deacon, kvmarm, Jonas Bonn, Brian Cain,
	linux-hexagon, linux-sh, Russell King, Ley Foon Tan,
	Catalin Marinas, uclinux-h8-devel, linux-arch, Arnd Bergmann,
	Bartlomiej Zolnierkiewicz, Łukasz Stelmach, kvm-ppc,
	Stefan Kristiansson, openrisc, Stafford Horne, Guan Xuetao,
	linux-arm-kernel, Tony Luck, Yoshinori Sato, linux-kernel,
	Marc Zyngier, nios2-dev, Andrew Morton, linuxppc-dev,
	Mike Rapoport
In-Reply-To: <98229ab1-fbf8-0a89-c5d6-270c828799e7@samsung.com>

On Fri, May 08, 2020 at 08:53:27AM +0200, Marek Szyprowski wrote:
> Hi Mike,
> 
> On 07.05.2020 18:11, Mike Rapoport wrote:
> > On Thu, May 07, 2020 at 02:16:56PM +0200, Marek Szyprowski wrote:
> >> On 14.04.2020 17:34, Mike Rapoport wrote:
> >>> From: Mike Rapoport <rppt@linux.ibm.com>
> >>>
> >>> Implement primitives necessary for the 4th level folding, add walks of p4d
> >>> level where appropriate, and remove __ARCH_USE_5LEVEL_HACK.
> >>>
> >>> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> >> Today I've noticed that kexec is broken on ARM 32bit. Bisecting between
> >> current linux-next and v5.7-rc1 pointed to this commit. I've tested this
> >> on Odroid XU4 and Raspberry Pi4 boards. Here is the relevant log:
> >>
> >> # kexec --kexec-syscall -l zImage --append "$(cat /proc/cmdline)"
> >> memory_range[0]:0x40000000..0xbe9fffff
> >> memory_range[0]:0x40000000..0xbe9fffff
> >> # kexec -e
> >> kexec_core: Starting new kernel
> >> 8<--- cut here ---
> >> Unable to handle kernel paging request at virtual address c010f1f4
> >> pgd = c6817793
> >> [c010f1f4] *pgd=4000041e(bad)
> >> Internal error: Oops: 80d [#1] PREEMPT ARM
> >> Modules linked in:
> >> CPU: 0 PID: 1329 Comm: kexec Tainted: G        W
> >> 5.7.0-rc3-00127-g6cba81ed0f62 #611
> >> Hardware name: Samsung Exynos (Flattened Device Tree)
> >> PC is at machine_kexec+0x40/0xfc
> > Any chance you have the debug info in this kernel?
> > scripts/faddr2line would come handy here.
> 
> # ./scripts/faddr2line --list vmlinux machine_kexec+0x40
> machine_kexec+0x40/0xf8:
> 
> machine_kexec at arch/arm/kernel/machine_kexec.c:182
>   177            reboot_code_buffer = 
> page_address(image->control_code_page);
>   178
>   179            /* Prepare parameters for reboot_code_buffer*/
>   180            set_kernel_text_rw();
>   181            kexec_start_address = image->start;
>  >182<           kexec_indirection_page = page_list;
>   183            kexec_mach_type = machine_arch_type;
>   184            kexec_boot_atags = image->arch.kernel_r2;
>   185
>   186            /* copy our kernel relocation code to the control code 
> page */
>   187            reboot_entry = fncpy(reboot_code_buffer,

Can you please try the patch below:

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 963b5284d284..f86b3d17928e 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -571,7 +571,7 @@ static inline void section_update(unsigned long addr, pmdval_t mask,
 {
 	pmd_t *pmd;
 
-	pmd = pmd_off_k(addr);
+	pmd = pmd_offset(pud_offset(p4d_offset(pgd_offset(mm, addr), addr), addr), addr);
 
 #ifdef CONFIG_ARM_LPAE
 	pmd[0] = __pmd((pmd_val(pmd[0]) & mask) | prot);

>  > ...
> 
> Best regards
> -- 
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
> 

-- 
Sincerely yours,
Mike.

^ permalink raw reply related

* [PATCH 0/2] selftests: vm: pkeys: Some powerpc fixes
From: Sandipan Das @ 2020-05-08 17:49 UTC (permalink / raw)
  To: akpm
  Cc: fweimer, aneesh.kumar, linuxram, linux-mm, linux-kselftest,
	linuxppc-dev, bauerman

Some fixes for the powerpc bits w.r.t to the way the pkey
access rights are defined and how the permission register
is updated.

Sandipan Das (2):
  selftests: vm: pkeys: Fix powerpc access right definitions
  selftests: vm: pkeys: Fix powerpc access right updates

 tools/testing/selftests/vm/pkey-powerpc.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

-- 
2.17.1


^ permalink raw reply

* [PATCH 1/2] selftests: vm: pkeys: Fix powerpc access right definitions
From: Sandipan Das @ 2020-05-08 17:49 UTC (permalink / raw)
  To: akpm
  Cc: fweimer, aneesh.kumar, linuxram, linux-mm, linux-kselftest,
	linuxppc-dev, bauerman
In-Reply-To: <cover.1588959697.git.sandipan@linux.ibm.com>

For powerpc, PKEY_DISABLE_WRITE and PKEY_DISABLE_ACCESS are
redefined only if the system headers already define them.
Otherwise, the test fails to compile due to their absence.
This makes sure that they are always defined irrespective of
them being present in the system headers.

Fixes: 130f573c2a79 ("selftests/vm/pkeys: introduce powerpc support")
Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
---
 tools/testing/selftests/vm/pkey-powerpc.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/vm/pkey-powerpc.h b/tools/testing/selftests/vm/pkey-powerpc.h
index 3a761e51a587..eb5077de8f1e 100644
--- a/tools/testing/selftests/vm/pkey-powerpc.h
+++ b/tools/testing/selftests/vm/pkey-powerpc.h
@@ -16,15 +16,11 @@
 #define fpregs			fp_regs
 #define si_pkey_offset		0x20
 
-#ifdef PKEY_DISABLE_ACCESS
 #undef PKEY_DISABLE_ACCESS
-# define PKEY_DISABLE_ACCESS	0x3  /* disable read and write */
-#endif
+#define PKEY_DISABLE_ACCESS	0x3  /* disable read and write */
 
-#ifdef PKEY_DISABLE_WRITE
 #undef PKEY_DISABLE_WRITE
-# define PKEY_DISABLE_WRITE	0x2
-#endif
+#define PKEY_DISABLE_WRITE	0x2
 
 #define NR_PKEYS		32
 #define NR_RESERVED_PKEYS_4K	27 /* pkey-0, pkey-1, exec-only-pkey
-- 
2.17.1


^ permalink raw reply related

* [PATCH 2/2] selftests: vm: pkeys: Fix powerpc access right updates
From: Sandipan Das @ 2020-05-08 17:49 UTC (permalink / raw)
  To: akpm
  Cc: fweimer, aneesh.kumar, linuxram, linux-mm, linux-kselftest,
	linuxppc-dev, bauerman
In-Reply-To: <cover.1588959697.git.sandipan@linux.ibm.com>

The Power ISA mandates that all writes to the Authority
Mask Register (AMR) must always be preceded as well as
succeeded by a context-synchronizing instruction. This
applies to both the privileged and unprivileged variants
of the Move To AMR instruction.

Fixes: 130f573c2a79 ("selftests/vm/pkeys: introduce powerpc support")
Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Suggested-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
---
 tools/testing/selftests/vm/pkey-powerpc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/vm/pkey-powerpc.h b/tools/testing/selftests/vm/pkey-powerpc.h
index eb5077de8f1e..1ebb586b2fbc 100644
--- a/tools/testing/selftests/vm/pkey-powerpc.h
+++ b/tools/testing/selftests/vm/pkey-powerpc.h
@@ -55,7 +55,8 @@ static inline void __write_pkey_reg(u64 pkey_reg)
 	dprintf4("%s() changing %016llx to %016llx\n",
 			 __func__, __read_pkey_reg(), pkey_reg);
 
-	asm volatile("mtspr 0xd, %0" : : "r" ((unsigned long)(amr)) : "memory");
+	asm volatile("isync; mtspr 0xd, %0; isync"
+		     : : "r" ((unsigned long)(amr)) : "memory");
 
 	dprintf4("%s() pkey register after changing %016llx to %016llx\n",
 			__func__, __read_pkey_reg(), pkey_reg);
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH 2/2] selftests: vm: pkeys: Fix powerpc access right updates
From: Florian Weimer @ 2020-05-08 18:01 UTC (permalink / raw)
  To: Sandipan Das
  Cc: aneesh.kumar, linuxram, linux-mm, linux-kselftest, akpm,
	linuxppc-dev, bauerman
In-Reply-To: <5f65cf37be993760de8112a88da194e3ccbb2bf8.1588959697.git.sandipan@linux.ibm.com>

* Sandipan Das:

> The Power ISA mandates that all writes to the Authority
> Mask Register (AMR) must always be preceded as well as
> succeeded by a context-synchronizing instruction. This
> applies to both the privileged and unprivileged variants
> of the Move To AMR instruction.

Ugh.  Do you have a reference for that?

We need to fix this in glibc.

Thanks,
Florian


^ permalink raw reply

* Re: remove a few uses of ->queuedata
From: Dan Williams @ 2020-05-08 18:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-xtensa, linux-raid, Sergey Senozhatsky,
	linux-nvdimm, Geoff Levand, Linux Kernel Mailing List, Jim Paris,
	linux-block, Minchan Kim, linux-m68k, Philip Kelleher,
	linux-bcache, linuxppc-dev, Joshua Morris, Nitin Gupta, drbd-dev
In-Reply-To: <20200508161517.252308-1-hch@lst.de>

On Fri, May 8, 2020 at 9:16 AM Christoph Hellwig <hch@lst.de> wrote:
>
> Hi all,
>
> various bio based drivers use queue->queuedata despite already having
> set up disk->private_data, which can be used just as easily.  This
> series cleans them up to only use a single private data pointer.

...but isn't the queue pretty much guaranteed to be cache hot and the
gendisk cache cold? I'm not immediately seeing what else needs the
gendisk in the I/O path. Is there another motivation I'm missing?

^ permalink raw reply

* Re: [PATCH 2/2] selftests: vm: pkeys: Fix powerpc access right updates
From: Sandipan Das @ 2020-05-08 19:54 UTC (permalink / raw)
  To: Florian Weimer
  Cc: aneesh.kumar, linuxram, linux-mm, linux-kselftest, akpm,
	linuxppc-dev, bauerman
In-Reply-To: <87blmymhkx.fsf@oldenburg2.str.redhat.com>

Hi Florian,

On 08/05/20 11:31 pm, Florian Weimer wrote:
> * Sandipan Das:
> 
>> The Power ISA mandates that all writes to the Authority
>> Mask Register (AMR) must always be preceded as well as
>> succeeded by a context-synchronizing instruction. This
>> applies to both the privileged and unprivileged variants
>> of the Move To AMR instruction.
> 
> Ugh.  Do you have a reference for that?
> 
> We need to fix this in glibc.
> 

This is from Table 6 of Chapter 11 in page 1134 of Power
ISA 3.0B. The document can be found here:
https://ibm.ent.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv

- Sandipan

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox