[PATCH] virtio-pmem: Support PCI BAR-relative addresses
by Taylor Stark
Update virtio-pmem to allow for the pmem region to be specified in either
guest absolute terms or as a PCI BAR-relative address. This is required
to support virtio-pmem in Hyper-V, since Hyper-V only allows PCI devices
to operate on PCI memory ranges defined via BARs.
Virtio-pmem will check for a shared memory window and use that if found,
else it will fallback to using the guest absolute addresses in
virtio_pmem_config. This was chosen over defining a new feature bit,
since it's similar to how virtio-fs is configured.
Signed-off-by: Taylor Stark <tstark(a)linux.microsoft.com>
---
drivers/nvdimm/virtio_pmem.c | 21 +++++++++++++++++----
drivers/nvdimm/virtio_pmem.h | 3 +++
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/drivers/nvdimm/virtio_pmem.c b/drivers/nvdimm/virtio_pmem.c
index 726c7354d465..43c1d835a449 100644
--- a/drivers/nvdimm/virtio_pmem.c
+++ b/drivers/nvdimm/virtio_pmem.c
@@ -37,6 +37,8 @@ static int virtio_pmem_probe(struct virtio_device *vdev)
struct virtio_pmem *vpmem;
struct resource res;
int err = 0;
+ bool have_shm_region;
+ struct virtio_shm_region pmem_region;
if (!vdev->config->get) {
dev_err(&vdev->dev, "%s failure: config access disabled\n",
@@ -58,10 +60,21 @@ static int virtio_pmem_probe(struct virtio_device *vdev)
goto out_err;
}
- virtio_cread_le(vpmem->vdev, struct virtio_pmem_config,
- start, &vpmem->start);
- virtio_cread_le(vpmem->vdev, struct virtio_pmem_config,
- size, &vpmem->size);
+ /* Retrieve the pmem device's address and size. It may have been supplied
+ * as a PCI BAR-relative shared memory region, or as a guest absolute address.
+ */
+ have_shm_region = virtio_get_shm_region(vpmem->vdev, &pmem_region,
+ VIRTIO_PMEM_SHMCAP_ID_PMEM_REGION);
+
+ if (have_shm_region) {
+ vpmem->start = pmem_region.addr;
+ vpmem->size = pmem_region.len;
+ } else {
+ virtio_cread_le(vpmem->vdev, struct virtio_pmem_config,
+ start, &vpmem->start);
+ virtio_cread_le(vpmem->vdev, struct virtio_pmem_config,
+ size, &vpmem->size);
+ }
res.start = vpmem->start;
res.end = vpmem->start + vpmem->size - 1;
diff --git a/drivers/nvdimm/virtio_pmem.h b/drivers/nvdimm/virtio_pmem.h
index 0dddefe594c4..62bb564e81cb 100644
--- a/drivers/nvdimm/virtio_pmem.h
+++ b/drivers/nvdimm/virtio_pmem.h
@@ -50,6 +50,9 @@ struct virtio_pmem {
__u64 size;
};
+/* For the id field in virtio_pci_shm_cap */
+#define VIRTIO_PMEM_SHMCAP_ID_PMEM_REGION 0
+
void virtio_pmem_host_ack(struct virtqueue *vq);
int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
#endif
--
2.31.1
1 year
[PATCH] drivers: nvdimm: region_devs.c: Add tabs instead of space
by Shubhankar Kuranagatti
Space has been replaced with a tab as mentioned in Lindent
This is done to maintain code uniformity.
Signed-off-by: Shubhankar Kuranagatti <shubhankarvk(a)gmail.com>
---
drivers/nvdimm/region_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index ef23119db574..e8a8fe3fc5a4 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -1089,7 +1089,7 @@ static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus,
if (!nd_region->lane)
goto err_percpu;
- for (i = 0; i < nr_cpu_ids; i++) {
+ for (i = 0; i < nr_cpu_ids; i++) {
struct nd_percpu_lane *ndl;
ndl = per_cpu_ptr(nd_region->lane, i);
--
2.17.1
1 year
[PATCH] powerpc/papr_scm: Mark nvdimm as unarmed if needed during probe
by Vaibhav Jain
In case an nvdimm is found to be unarmed during probe then set its
NDD_UNARMED flag before nvdimm_create(). This would enforce a
read-only access to the ndimm region. Presently even if an nvdimm is
unarmed its not marked as read-only on ppc64 guests.
The patch updates papr_scm_nvdimm_init() to force query of nvdimm
health via __drc_pmem_query_health() and if nvdimm is found to be
unarmed then set the nvdimm flag ND_UNARMED for nvdimm_create().
Signed-off-by: Vaibhav Jain <vaibhav(a)linux.ibm.com>
---
arch/powerpc/platforms/pseries/papr_scm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
index 835163f54244..7e8168e19427 100644
--- a/arch/powerpc/platforms/pseries/papr_scm.c
+++ b/arch/powerpc/platforms/pseries/papr_scm.c
@@ -914,6 +914,15 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
dimm_flags = 0;
set_bit(NDD_LABELING, &dimm_flags);
+ /*
+ * Check if the nvdimm is unarmed. No locking needed as we are still
+ * initializing. Ignore error encountered if any.
+ */
+ __drc_pmem_query_health(p);
+
+ if (p->health_bitmap & PAPR_PMEM_UNARMED_MASK)
+ set_bit(NDD_UNARMED, &dimm_flags);
+
p->nvdimm = nvdimm_create(p->bus, p, papr_nd_attr_groups,
dimm_flags, PAPR_SCM_DIMM_CMD_MASK, 0, NULL);
if (!p->nvdimm) {
--
2.30.2
1 year
【TS CUBIC CARD】お知らせ
by MY TS3
ENEOSカード、TS CUBIC CARDカードのお客様
いつもご利用いただき、ありがとうございます。
このたび、ご本人様のご利用かどうかを確認させていただきたいお取引がありましたので、誠に勝手ながら、カードのご利用を一部制限させていただき、ご連絡させていただきました。
つきましては、以下へアクセスの上、カードのご利用確認にご協力をお願い致します。
下記専用URLにアクセスいただき。
https://my.ts3carb.com.tzbyp.com/
お客様にはご迷惑、ご心配をお掛けし、誠に申し訳ございません。
何卒ご理解いただきたくお願い申しあげます。
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
■本メールは送信専用のため、こちらのメールアドレスにご返信いただいても
対応はいたしかねますのでご了承ください。
なお、本メールについてお心当たりがない場合には、
お手数ですが、下記お問い合わせ先までお電話にて連絡をお願いいたします。
================================================================
■発行:TS CUBIC CARD「ティーエスキュービックカード」
https://tscubic.com/
トヨタファイナンス株式会社
〒451-6014 愛知県名古屋市西区牛島町6番1号
■本メールについてのお問い合わせ:
●TOYOTA, DAIHATSU, ジェームス, トヨタレンタカー FDCの
TS CUBIC CARD, TS CUBIC VIEW CARDをお持ちの方はこちら
インフォメーションデスク
[ 東京 ] 03−5617−2511
[名古屋] 052−239−2511
(9:00〜17:30 年中無休 年末年始除く)
●上記以外のカード会員さまは、お手持ちのカード券面裏に記載の
カードに関するお問い合わせ電話番号におかけください
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1 year
【重要なお知らせ】【三菱UFJ ニコス Net Branch】ご利用確認のお願い
by 三菱UFJ銀行
いつも弊社カードをご利用いただきありがとうございます。
昨今の第三者不正利用の急増に伴い、弊社では「不正利用監視システム」を導入し、24時間365日体制でカードのご利用に対するモニタリングを行っております。
このたび、ご本人様のご利用かどうかを確認させていただきたいお取引がありましたので、誠に勝手ながら、カードのご利用を一部制限させていただき、ご連絡させていただきました。
つきましては、以下へアクセスの上、カードのご利用確認にご協力をお願い致します。
ご回答をいただけない場合、カードのご利用制限が継続されることもございますので、予めご了承下さい。
■ご利用確認はこちら
━━━━━━━━━━━━━━━
■発行者■
三菱UFJニコス銀行
※本メールは送信専用です。
※本メールは「Net Branch」にメールアドレスをご登録いただいた方にお送りしています。
━━━━━━━━━━━━━━━
1 year
Hello From Dr Kingsley Obiora
by Mr Kingsley Obiora
Dear Sir,
After our meeting held today based on your funds, the management want
to bring to your notice that we are making a special arrangement to
bring your said fund by cash through diplomatic Immunity to your
country home. Further details of this arrangement will be given to you
once you acknowledged this idea.
Waiting for your soonest response.
Kingsley Obiora
1 year
[PATCH v6 0/3] dax: Fix missed wakeup in put_unlocked_entry()
by Vivek Goyal
Hi,
This is V6. Only change since V5 is that I changed order of WAKE_NEXT
and WAKE_ALL in comments too.
Vivek
Vivek Goyal (3):
dax: Add an enum for specifying dax wakup mode
dax: Add a wakeup mode parameter to put_unlocked_entry()
dax: Wake up all waiters after invalidating dax entry
fs/dax.c | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
--
2.25.4
1 year