[PATCH V5 4/4] kvm: add a check if pfn is from NVDIMM pmem.

2018-09-07 Thread Zhang Yi
operations will be missed due to this mistreatment to pmem pages, for example, a page may not have chance to be unpinned for KVM guest(in kvm_release_pfn_clean), not able to be marked as dirty/accessed(in kvm_set_pfn_dirty/accessed) etc. Signed-off-by: Zhang Yi Acked-by: Pankaj Gupta --- virt/kvm

[PATCH V5 2/4] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-09-07 Thread Zhang Yi
driver hotplug the device memory. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu Reviewed-by: Jan Kara --- drivers/dax/pmem.c | 1 + include/linux/memremap.h | 8 2 files changed, 9 insertions(+) diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c index fd49b24..fb3f363 100644

[PATCH V5 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-09-07 Thread Zhang Yi
/2018/7/10/135 V3: https://lkml.org/lkml/2018/8/9/17 V4: https://lkml.org/lkml/2018/8/22/17 V5: [PATCH V3 1/4] Reviewed-by: David / Acked-by: Pankaj [PATCH V3 2/4] Reviewed-by: Jan [PATCH V3 3/4] Acked-by: Jan [PATCH V3 4/4] Added "Acked-by: Pankaj", Added in-line comments: Dave Z

[PATCH V5 1/4] kvm: remove redundant reserved page check

2018-09-07 Thread Zhang Yi
PageReserved() is already checked inside kvm_is_reserved_pfn(), remove it from kvm_set_pfn_dirty(). Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu Reviewed-by: David Hildenbrand Acked-by: Pankaj Gupta --- virt/kvm/kvm_main.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions

[PATCH V5 3/4] mm: add a function to differentiate the pages is from DAX device memory

2018-09-07 Thread Zhang Yi
MEMORY_DEVICE_FS_DAX, we can use is_dax_page() to differentiate the pages is DAX device memory or not. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu Acked-by: Jan Kara --- include/linux/mm.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index

[PATCH V4 4/4] kvm: add a check if pfn is from NVDIMM pmem.

2018-08-21 Thread Zhang Yi
operations will be missed due to this mistreatment to pmem pages, for example, a page may not have chance to be unpinned for KVM guest(in kvm_release_pfn_clean), not able to be marked as dirty/accessed(in kvm_set_pfn_dirty/accessed) etc. Signed-off-by: Zhang Yi --- virt/kvm/kvm_main.c | 8 ++-- 1

[PATCH V4 2/4] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-08-21 Thread Zhang Yi
driver hotplug the device memory. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu Reviewed-by: Jan Kara --- drivers/dax/pmem.c | 1 + include/linux/memremap.h | 8 2 files changed, 9 insertions(+) diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c index fd49b24..fb3f363 100644

[PATCH V4 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-08-21 Thread Zhang Yi
/2018/7/10/135 V3: https://lkml.org/lkml/2018/8/9/17 V4: [PATCH V3 1/4] Added "Reviewed-by: David / Acked-by: Pankaj" [PATCH V3 2/4] Added "Reviewed-by: Jan" [PATCH V3 3/4] Added "Acked-by: Jan" [PATCH V3 4/4] Fix several typos Zhang Yi (4): kvm: remove redu

Re: [PATCH V3 3/4] mm: add a function to differentiate the pages is from DAX device memory

2018-08-13 Thread Zhang,Yi
; or fs_dax pages to kvm for DIMM/NVDIMM backend). Together with the type >> MEMORY_DEVICE_FS_DAX, we can use is_dax_page() to differentiate the pages >> is DAX device memory or not. >> >> Signed-off-by: Zhang Yi >> Signed-off-by: Zhang Yu >> --- >> incl

Re: [PATCH V3 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-08-13 Thread Zhang,Yi
On 2018年08月09日 17:02, Jan Kara wrote: > On Thu 09-08-18 18:52:48, Zhang Yi wrote: >> For device specific memory space, when we move these area of pfn to >> memory zone, we will set the page reserved flag at that time, some of >> these reserved for

Re: [PATCH V3 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-08-13 Thread Zhang,Yi
On 2018年08月10日 21:27, David Hildenbrand wrote: > On 09.08.2018 12:52, Zhang Yi wrote: >> For device specific memory space, when we move these area of pfn to >> memory zone, we will set the page reserved flag at that time, some of >> these reserved for

[PATCH V2 1/1] device-dax: check for vma range while dax_mmap.

2018-08-12 Thread Zhang Yi
of the device dax, it will trigger a fault with qemu. Signed-off-by: Zhang Yi --- drivers/dax/device.c | 29 + 1 file changed, 29 insertions(+) diff --git a/drivers/dax/device.c b/drivers/dax/device.c index 108c37f..6fe8c30 100644 --- a/drivers/dax/device.c +++ b/drivers/dax

Re: [RFC PATCH 1/1] device-dax: check for vma range while dax_mmap.

2018-08-08 Thread Zhang,Yi
On 2018年08月08日 08:05, Dave Jiang wrote: > > On 08/02/2018 02:32 AM, Zhang,Yi wrote: >> >> On 2018年08月02日 03:40, Dave Jiang wrote: >>> On 07/31/2018 04:46 AM, Zhang Yi wrote: >>>> It should be prevent user map an illegal vma range which larger than >&g

[PATCH V3 4/4] kvm: add a check if pfn is from NVDIMM pmem.

2018-08-08 Thread Zhang Yi
operations will be missed due to this mistreatment to pmem pages. For example, a page may not have chance to be unpinned for KVM guest(in kvm_release_pfn_clean); not able to be marked as dirty/accessed(in kvm_set_pfn_dirty/accessed) etc Signed-off-by: Zhang Yi --- virt/kvm/kvm_main.c | 8 ++-- 1

[PATCH V3 2/4] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-08-08 Thread Zhang Yi
driver hotplug the device memory. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- drivers/dax/pmem.c | 1 + include/linux/memremap.h | 8 2 files changed, 9 insertions(+) diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c index fd49b24..fb3f363 100644 --- a/drivers/dax

[PATCH V3 3/4] mm: add a function to differentiate the pages is from DAX device memory

2018-08-08 Thread Zhang Yi
MEMORY_DEVICE_FS_DAX, we can use is_dax_page() to differentiate the pages is DAX device memory or not. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- include/linux/mm.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 68a5121..de5cbc3

[PATCH V3 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-08-08 Thread Zhang Yi
/2018/7/10/135 V3: [PATCH V3 1/4] Needs Comments. [PATCH V3 2/4] Update the description of MEMORY_DEVICE_DEV_DAX: Jan [PATCH V3 3/4] Acked-by: Jan in V2 [PATCH V3 4/4] Needs Comments. Zhang Yi (4): kvm: remove redundant reserved page check mm: introduce memory type MEMORY_DEVICE_DEV_DAX mm

[PATCH V3 1/4] kvm: remove redundant reserved page check

2018-08-08 Thread Zhang Yi
PageReserved() is already checked inside kvm_is_reserved_pfn(), remove it from kvm_set_pfn_dirty(). Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- virt/kvm/kvm_main.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

Re: [PATCH V2 2/4] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-08-07 Thread Zhang,Yi
On 2018年08月07日 17:11, Jan Kara wrote: > On Wed 11-07-18 01:01:59, Zhang Yi wrote: >> Currently, NVDIMM pages will be marked 'PageReserved'. However, unlike >> other reserved PFNs, pages on NVDIMM shall still behave like normal ones >> in many cases, i.e. when used as backen

Re: [RFC PATCH 1/1] device-dax: check for vma range while dax_mmap.

2018-08-01 Thread Zhang,Yi
On 2018年08月02日 03:40, Dave Jiang wrote: > > On 07/31/2018 04:46 AM, Zhang Yi wrote: >> It should be prevent user map an illegal vma range which larger than >> dax device phiscal resourse, as we don't have swap logic while page >> faulting in dax device. > This pa

[RFC PATCH 1/1] device-dax: check for vma range while dax_mmap.

2018-07-30 Thread Zhang Yi
of mapped rang. By using an illegal size that exceeds the physical resource of /dev/dax, then it will triger qemu a signal fault while accessing these label area. Signed-off-by: Zhang Yi --- drivers/dax/device.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers

Re: [PATCH V2 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-07-20 Thread Zhang,Yi
Thanks Paolo, let's wait Jan 's comments. Thank you, Paolo. Regards Yi On 2018年07月20日 16:32, Paolo Bonzini wrote: > On 20/07/2018 16:11, Zhang,Yi wrote: >> Added Jiang,Dave, >> >> Ping for further review, comments. > I need an Acked-by from the MM people to merge th

Re: [PATCH V2 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-07-20 Thread Zhang,Yi
Added Jiang,Dave, Ping for further review, comments. Thanks All Regards Yi. On 2018年07月11日 01:01, Zhang Yi wrote: > For device specific memory space, when we move these area of pfn to > memory zone, we will set the page reserved flag at that time, some of > these reserved for de

Re: [PATCH V2 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-07-13 Thread Zhang,Yi
Ping for further review, comments. Thanks All Regards Yi. On 2018年07月11日 01:01, Zhang Yi wrote: > For device specific memory space, when we move these area of pfn to > memory zone, we will set the page reserved flag at that time, some of > these reserved for device mmio,

[PATCH V2 3/4] mm: add a function to differentiate the pages is from DAX device memory

2018-07-10 Thread Zhang Yi
MEMORY_DEVICE_FS_DAX, we can use is_dax_page() to differentiate the pages is DAX device memory or not. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- include/linux/mm.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 6e19265..9f0f690

[PATCH V2 4/4] kvm: add a check if pfn is from NVDIMM pmem.

2018-07-10 Thread Zhang Yi
operations will be missed due to this mistreatment to pmem pages. For example, a page may not have chance to be unpinned for KVM guest(in kvm_release_pfn_clean); not able to be marked as dirty/accessed(in kvm_set_pfn_dirty/accessed) etc Signed-off-by: Zhang Yi --- virt/kvm/kvm_main.c | 8 ++-- 1

[PATCH V2 2/4] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-07-10 Thread Zhang Yi
driver hotplug the device memory. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- drivers/dax/pmem.c | 1 + include/linux/memremap.h | 9 + 2 files changed, 10 insertions(+) diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c index fd49b24..fb3f363 100644 --- a/drivers/dax

[PATCH V2 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-07-10 Thread Zhang Yi
for MEMORY_DEVICE_DEV_DAX memory type in comment block *Add is_dax_page() in mm.h to differentiate the pages is from DAX device. *Remove the function kvm_is_nd_pfn(). Zhang Yi (4): kvm: remove redundant reserved page check mm: introduce memory type MEMORY_DEVICE_DEV_DAX mm: add a function

Re: [PATCH 3/3] kvm: add a function to check if page is from NVDIMM pmem.

2018-07-04 Thread Zhang,Yi
On 2018年07月04日 23:25, Paolo Bonzini wrote: > On 04/07/2018 17:30, Zhang Yi wrote: >> For device specific memory space, when we move these area of pfn to >> memory zone, we will set the page reserved flag at that time, some of >> these reserved for

[PATCH 2/3] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-07-04 Thread Zhang Yi
type MEMORY_DEVICE_FS_DAX, we can differentiate the pages on NVDIMM with the normal reserved pages. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- drivers/dax/pmem.c | 1 + include/linux/memremap.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/dax/pmem.c b/drivers/dax

[PATCH 3/3] kvm: add a function to check if page is from NVDIMM pmem.

2018-07-04 Thread Zhang Yi
operations will be missed due to this mistreatment to pmem pages. For example, a page may not have chance to be unpinned for KVM guest(in kvm_release_pfn_clean); not able to be marked as dirty/accessed(in kvm_set_pfn_dirty/accessed) etc. Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- virt/kvm

[PATCH 1/3] kvm: remove redundant reserved page check

2018-07-04 Thread Zhang Yi
PageReserved() is already checked inside kvm_is_reserved_pfn(), remove it from kvm_set_pfn_dirty(). Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- virt/kvm/kvm_main.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

[PATCH 0/3] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-07-04 Thread Zhang Yi
operations will be missed due to this mistreatment to pmem pages. For example, a page may not have chance to be unpinned for KVM guest(in kvm_release_pfn_clean); not able to be marked as dirty/accessed(in kvm_set_pfn_dirty/accessed) etc. Zhang Yi (3): kvm: remove redundant reserved page check mm

Re: [Qemu-devel] [RFC PATCH 1/1] nvdimm: let qemu requiring section alignment of pmem resource.

2018-06-11 Thread Zhang,Yi
On 一, 2018-06-11 at 19:55 -0700, Dan Williams wrote: > On Mon, Jun 11, 2018 at 9:26 AM, Stefan Hajnoczi > wrote: > > > > On Mon, Jun 11, 2018 at 06:54:25PM +0800, Zhang Yi wrote: > > > > > > Nvdimm driver use Memory hot-plug APIs to map it's pmem resource,

[Qemu-devel] [RFC PATCH 1/1] nvdimm: let qemu requiring section alignment of pmem resource.

2018-06-10 Thread Zhang Yi
align to the 128 MB memory section size. Signed-off-by: Zhang Yi --- hw/mem/nvdimm.c | 2 +- include/hw/mem/nvdimm.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 4087aca..ff6e171 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem