Re: [Qemu-devel] [PATCH] spapr: make default PHB optionnal

2017-07-12 Thread Shivaprasad G Bhat
On 07/12/2017 04:25 PM, Andrea Bolognani wrote: [libvir-list added to the loop] On Tue, 2017-07-04 at 10:47 +0200, Greg Kurz wrote: On Tue, 4 Jul 2017 17:29:01 +1000 David Gibson wrote: On Mon, Jul 03, 2017 at 06:48:25PM +0200, Greg Kurz wrote: The sPAPR

[Qemu-devel] [PATCH v4] linux-user: ppc64: don't use volatile register during safe_syscall

2018-07-30 Thread Shivaprasad G Bhat
G Bhat Tested-by: Richard Henderson Tested-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier --- v3: https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg05559.html Changes from v3: Added cfi_offset directive as suggested and a minor comment/code line swap

Re: [Qemu-devel] [PATCH] linux-user: ppc64: don't use volatile register during safe_syscall

2018-07-27 Thread Shivaprasad G Bhat
On 07/26/2018 10:56 PM, Richard Henderson wrote: On 07/25/2018 11:48 PM, Shivaprasad G Bhat wrote: Reference: https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#REG This document is for _CALL_ELF < 2. For ppc64le, the document is at https://openpowerfoundation.org

[Qemu-devel] [PATCH] linux-user: ppc64: don't use volatile register during safe_syscall

2018-07-26 Thread Shivaprasad G Bhat
. The registers r0-r13 are not to be used here as they have volatile/designated/reserved usages. Change the code to use r14 which is non-volatile and is appropriate for local use in safe_syscall. Signed-off-by: Shivaprasad G Bhat --- Steps to reproduce: On PPC host, issue `qemu-ppc64le /usr/bin/cc -E

[Qemu-devel] [PATCH v2] linux-user: ppc64: don't use volatile register during safe_syscall

2018-07-26 Thread Shivaprasad G Bhat
. Reference: https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#REG Signed-off-by: Shivaprasad G Bhat Tested-by: Laurent Vivier Reviewed-by: Laurent Vivier --- v1: https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg05089.html Changes from v1: Fixed the commit message

[Qemu-devel] [PATCH v3] linux-user: ppc64: don't use volatile register during safe_syscall

2018-07-30 Thread Shivaprasad G Bhat
G Bhat --- v2: https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg05102.html Changes from v2: Added code to store and restore r14 register. v1: https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg05089.html Changes from v1: Fixed the commit message as suggested linux-user/host

Re: [Qemu-devel] [PATCH] linux-user: elf: mmap all the target-pages of hostpage for data segment

2018-08-28 Thread Shivaprasad G Bhat
On 08/27/2018 06:55 PM, Laurent Vivier wrote: Le 27/08/2018 à 14:37, Shivaprasad G Bhat a écrit : If the hostpage size is greater than the TARGET_PAGESIZE, the target-pages of size TARGET_PAGESIZE are marked valid only till the length requested during the elfload. The glibc attempts

[Qemu-devel] [PATCH v2] linux-user: elf: mmap all the target-pages of hostpage for data segment

2018-08-28 Thread Shivaprasad G Bhat
. Signed-off-by: Shivaprasad G Bhat --- v1: https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05730.html Changes from v1: - Made the conditionals consistent with the commit "33143c446e" and changed the commit message accordingly. linux-user/elfloa

[Qemu-devel] [PATCH v3] linux-user: elf: mmap all the target-pages of hostpage for data segment

2018-08-29 Thread Shivaprasad G Bhat
. Signed-off-by: Shivaprasad G Bhat --- v2: https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05943.html Changes from v2: - Simplified the macro as suggested. - Fixed some grammatical error in commit message. v1: https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05730.html Changes

[Qemu-devel] [PATCH] linux-user: elf: mmap all the target-pages of hostpage for data segment

2018-08-27 Thread Shivaprasad G Bhat
manifest somewhere else, none the less. The fix here is to map all the target-pages of the hostpage during the ELF load for data segment to allow the glibc for proper consumption. Signed-off-by: Shivaprasad G Bhat --- linux-user/elfload.c | 24 +--- 1 file changed, 17 insertions

[Qemu-devel] [PATCH] linux-user: ppc64: use the correct values for F_*LK64s

2018-07-11 Thread Shivaprasad G Bhat
ng this. Signed-off-by: Shivaprasad G Bhat --- linux-user/syscall.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7b9ac3b408..1693e69ce0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -250,6 +250,20 @@ static t

[Qemu-devel] [PATCH v4] linux-user: ppc64: use the correct values for F_*LK64s

2018-07-13 Thread Shivaprasad G Bhat
_OFFSET64 is defined in qemu sources(also refer sysdeps/unix/sysv/linux/bits/fcntl-linux.h). Do the value adjustment just like it is done by glibc source by using F_GETLK value of 5. That way, we make the syscalls with the actual supported values in Qemu. The patch is taking this approach. Signed-off-by

[Qemu-devel] [PATCH v2] linux-user: ppc64: use the correct values for F_*LK64s

2018-07-12 Thread Shivaprasad G Bhat
_OFFSET64 is defined in qemu sources(also refer sysdeps/unix/sysv/linux/bits/fcntl-linux.h). Do the value adjustment just like it is done by glibc source by using F_GETLK value of 5. That way, we make the syscalls with the actual supported values in Qemu. The patch is taking this approach. Signed-off-by

Re: [Qemu-devel] [PATCH] linux-user: ppc64: use the correct values for F_*LK64s

2018-07-12 Thread Shivaprasad G Bhat
On 07/12/2018 12:36 PM, Laurent Vivier wrote: Le 12/07/2018 à 09:00, Shivaprasad G Bhat a écrit : On 07/12/2018 02:21 AM, Laurent Vivier wrote: Le 11/07/2018 à 15:04, Laurent Vivier a écrit : Le 11/07/2018 à 12:55, Shivaprasad G Bhat a écrit : Qemu includes the glibc headers for the host

[Qemu-devel] [PATCH v3] linux-user: ppc64: use the correct values for F_*LK64s

2018-07-13 Thread Shivaprasad G Bhat
_OFFSET64 is defined in qemu sources(also refer sysdeps/unix/sysv/linux/bits/fcntl-linux.h). Do the value adjustment just like it is done by glibc source by using F_GETLK value of 5. That way, we make the syscalls with the actual supported values in Qemu. The patch is taking this approach. Signed-off-by

Re: [Qemu-devel] [PATCH] linux-user: ppc64: use the correct values for F_*LK64s

2018-07-12 Thread Shivaprasad G Bhat
On 07/12/2018 02:21 AM, Laurent Vivier wrote: Le 11/07/2018 à 15:04, Laurent Vivier a écrit : Le 11/07/2018 à 12:55, Shivaprasad G Bhat a écrit : Qemu includes the glibc headers for the host defines and target headers are part of the qemu source themselves. The glibc has the F_GETLK64

Re: [Qemu-devel] [RFC PATCH 3/4] spapr: Add NVDIMM device support

2019-02-19 Thread Shivaprasad G Bhat
On 02/19/2019 01:41 PM, Igor Mammedov wrote: On Tue, 05 Feb 2019 23:26:27 -0600 Shivaprasad G Bhat wrote: Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm device interface in QEMU to support virtual NVDIMM devices for Power (May have to re-look at this later). Create

Re: [Qemu-devel] [PATCH] machine: Move acpi_nvdimm_state into struct MachineState

2019-03-05 Thread Shivaprasad G Bhat
On 03/01/2019 07:36 PM, Eric Auger wrote: As NVDIMM support is looming for ARM and SPAPR, let's move the acpi_nvdimm_state to the generic machine struct Name - "acpi_nvdimm_state" sounds very x86 specific. Could you please rename ? Thanks, Shivaprasad instead of duplicating the same code

Re: [Qemu-devel] [RFC PATCH 3/4] spapr: Add NVDIMM device support

2019-02-28 Thread Shivaprasad G Bhat
Hi Igor, Thanks for the elaboration. Please find my response inline. On 02/21/2019 07:42 PM, Igor Mammedov wrote: On Tue, 19 Feb 2019 14:59:25 +0530 Shivaprasad G Bhat wrote: On 02/19/2019 01:41 PM, Igor Mammedov wrote: On Tue, 05 Feb 2019 23:26:27 -0600 Shivaprasad G Bhat wrote: Add

[Qemu-devel] [RFC PATCH 3/4] spapr: Add NVDIMM device support

2019-02-06 Thread Shivaprasad G Bhat
-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0.img,share=yes,size=512m device_add nvdimm,label-size=128k,memdev=memnvdimm0,id=nvdimm0,slot=0 Signed-off-by: Shivaprasad G Bhat Signed-off-by: Bharata B Rao [Early implementation] --- default-configs/ppc64-softmmu.mak |1

[Qemu-devel] [RFC PATCH 4/4] spapr: Add Hcalls to support PAPR NVDIMM device

2019-02-06 Thread Shivaprasad G Bhat
. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_hcall.c | 230 include/hw/ppc/spapr.h | 12 ++- 2 files changed, 240 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 17bcaa3822..40553e80d6 100644

[Qemu-devel] [RFC PATCH 0/4] ppc: spapr: virtual NVDIMM support

2019-02-06 Thread Shivaprasad G Bhat
mm0,slot=0 --- Shivaprasad G Bhat (4): mem: make nvdimm_device_list global mem: implement memory_device_set_region_size spapr: Add NVDIMM device support spapr: Add Hcalls to support PAPR NVDIMM device default-configs/ppc64-softmmu.mak |1 hw/acp

[Qemu-devel] [RFC PATCH 1/4] mem: make nvdimm_device_list global

2019-02-06 Thread Shivaprasad G Bhat
nvdimm_device_list is required for parsing the list for devices in subsequent patches. Move it to common area. Signed-off-by: Shivaprasad G Bhat --- hw/acpi/nvdimm.c| 27 --- hw/mem/nvdimm.c | 27 +++ include/hw/mem/nvdimm.h

[Qemu-devel] [RFC PATCH 2/4] mem: implement memory_device_set_region_size

2019-02-06 Thread Shivaprasad G Bhat
Required for PAPR NVDIMM implementation. Need memory_device_set_region_size for aligning the size to the SCM block size. Signed-off-by: Shivaprasad G Bhat --- hw/mem/memory-device.c | 15 +++ include/hw/mem/memory-device.h |2 ++ 2 files changed, 17 insertions(+) diff

Re: [Qemu-devel] [RFC PATCH 3/4] spapr: Add NVDIMM device support

2019-02-18 Thread Shivaprasad G Bhat
On 02/18/2019 04:32 AM, David Gibson wrote: On Fri, Feb 15, 2019 at 04:41:09PM +0530, Shivaprasad G Bhat wrote: Thanks for the comments David. Please find my replies inline.. On 02/12/2019 07:19 AM, David Gibson wrote: On Tue, Feb 05, 2019 at 11:26:27PM -0600, Shivaprasad G Bhat wrote

Re: [Qemu-devel] [RFC PATCH 4/4] spapr: Add Hcalls to support PAPR NVDIMM device

2019-02-15 Thread Shivaprasad G Bhat
On 02/12/2019 07:58 AM, David Gibson wrote: On Tue, Feb 05, 2019 at 11:26:41PM -0600, Shivaprasad G Bhat wrote: This patch implements few of the necessary hcalls for the nvdimm support. PAPR semantics is such that each NVDIMM device is comprising of multiple SCM(Storage Class Memory) blocks

Re: [Qemu-devel] [RFC PATCH 3/4] spapr: Add NVDIMM device support

2019-02-15 Thread Shivaprasad G Bhat
Thanks for the comments David. Please find my replies inline.. On 02/12/2019 07:19 AM, David Gibson wrote: On Tue, Feb 05, 2019 at 11:26:27PM -0600, Shivaprasad G Bhat wrote: Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm device interface in QEMU to support virtual

Re: [Qemu-devel] [RFC v2 PATCH 2/3] spapr: Add NVDIMM device support

2019-05-17 Thread Shivaprasad G Bhat
On 05/16/2019 07:02 AM, David Gibson wrote: On Wed, May 15, 2019 at 12:30:07PM +0530, Shivaprasad G Bhat wrote: Hi David, Thanks for the comments. Replies inline.. On 05/14/2019 07:52 AM, David Gibson wrote: On Mon, May 13, 2019 at 04:28:02AM -0500, Shivaprasad G Bhat wrote: Add support

[Qemu-devel] [RFC v2 PATCH 0/3] ppc: spapr: virtual NVDIMM support

2019-05-13 Thread Shivaprasad G Bhat
different values. - Addressed comments for v1 Shivaprasad G Bhat (3): mem: make nvdimm_device_list global spapr: Add NVDIMM device support spapr: Add Hcalls to support PAPR NVDIMM device default-configs/ppc64-softmmu.mak |1 hw/acpi/nvdimm.c | 27

[Qemu-devel] [RFC v2 PATCH 2/3] spapr: Add NVDIMM device support

2019-05-13 Thread Shivaprasad G Bhat
monitor as below object_add memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0,share=yes,size=1073872896 device_add nvdimm,label-size=128k,uuid=75a3cdd7-6a2f-4791-8d15-fe0a920e8e9e,memdev=memnvdimm0,id=nvdimm0,slot=0 Signed-off-by: Shivaprasad G Bhat Signed-off-by: Bharata B

[Qemu-devel] [RFC v2 PATCH 1/3] mem: make nvdimm_device_list global

2019-05-13 Thread Shivaprasad G Bhat
nvdimm_device_list is required for parsing the list for devices in subsequent patches. Move it to common area. Signed-off-by: Shivaprasad G Bhat Reviewed-By: Igor Mammedov --- This looks to break the mips*-softmmu build. The mips depend on CONFIG_NVDIMM_ACPI, adding CONFIG_NVDIMM looks wrong

[Qemu-devel] [RFC v2 PATCH 3/3] spapr: Add Hcalls to support PAPR NVDIMM device

2019-05-13 Thread Shivaprasad G Bhat
for a subset of SCM blocks of a virtual NVDIMM. Hence it is safe to do bind/unbind everything during the object_add/del. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_hcall.c | 202 include/hw/ppc/spapr.h |7 +- 2 files changed, 208

Re: [Qemu-devel] [RFC v2 PATCH 2/3] spapr: Add NVDIMM device support

2019-05-15 Thread Shivaprasad G Bhat
Hi David, Thanks for the comments. Replies inline.. On 05/14/2019 07:52 AM, David Gibson wrote: On Mon, May 13, 2019 at 04:28:02AM -0500, Shivaprasad G Bhat wrote: Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm device interface in QEMU to support virtual NVDIMM devices

Re: [Qemu-devel] [RFC v2 PATCH 3/3] spapr: Add Hcalls to support PAPR NVDIMM device

2019-07-10 Thread Shivaprasad G Bhat
On 05/14/2019 10:08 AM, David Gibson wrote: On Mon, May 13, 2019 at 04:28:36AM -0500, Shivaprasad G Bhat wrote: This patch implements few of the necessary hcalls for the nvdimm support. PAPR semantics is such that each NVDIMM device is comprising of multiple SCM(Storage Class Memory) blocks

Re: [Qemu-devel] [RFC v2 PATCH 3/3] spapr: Add Hcalls to support PAPR NVDIMM device

2019-07-10 Thread Shivaprasad G Bhat
Thanks for the comments Fabiano. On 05/22/2019 11:38 PM, Fabiano Rosas wrote: Shivaprasad G Bhat writes: + +ddc = NVDIMM_GET_CLASS(nvdimm); +ddc->read_label_data(nvdimm, [0], numBytesToRead, offset); + +return H_SUCCESS; +} + + +static target_ulong h_scm_write_metad

[Qemu-devel] [PATCH v3] ppc: make idle_timer a per-cpu variable

2019-07-18 Thread Shivaprasad G Bhat
The current code is broken for more than vcpu as each thread would overwrite and there were memory leaks. Make it part of PowerPCCPU so that every thread has a separate one. Avoid using the timer_new_ns which is not the preferred way to create timers. Signed-off-by: Shivaprasad G Bhat --- v2

[Qemu-devel] [PATCH v4] ppc: make idle_timer a per-cpu variable

2019-07-19 Thread Shivaprasad G Bhat
The current code is broken for more than vcpu as each thread would overwrite idle_timer and there were memory leaks. Make it part of PowerPCCPU so that every thread has a separate one. Avoid using the timer_new_ns which is not the preferred way to create timers. Signed-off-by: Shivaprasad G Bhat

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3] ppc: make idle_timer a per-cpu variable

2019-07-19 Thread Shivaprasad G Bhat
On 07/18/2019 09:47 PM, Greg Kurz wrote: On Thu, 18 Jul 2019 10:21:28 -0500 Shivaprasad G Bhat wrote: +PowerPCCPU *cpu = POWERPC_CPU(cs); + +timer_deinit(>idle_timer); As stated in the timer.h header file, timer_del() should always be called before timer_deinit(). With that fi

[Qemu-devel] [PATCH v5] ppc: remove the idle_timer logic

2019-07-24 Thread Shivaprasad G Bhat
The KVM_CAP_PPC_IRQ_LEVEL is part of the kernel now since 2.6.37. Drop the redundant logic which is not excercised on new the kernels anymore. Signed-off-by: Shivaprasad G Bhat --- v4: https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg04456.html Changes from v4: - it was discussed

[Qemu-devel] [PATCH v6] ppc: remove idle_timer logic

2019-07-24 Thread Shivaprasad G Bhat
The KVM_CAP_PPC_IRQ_LEVEL is part of the kernel now since 2.6.37. Drop the redundant logic which is not excercised on new the kernels anymore. Exit with error on older kernels. Signed-off-by: Shivaprasad G Bhat --- v5: https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg05301.html Changes

[Qemu-devel] [PATCH v2 2/4] ppc: fix memory leak in spapr_dt_drc()

2019-07-17 Thread Shivaprasad G Bhat
Leaking the drc_name while preparing the DT properties. Fixing that. Also, remove the const qualifier from spapr_drc_name(). Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_drc.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc

[Qemu-devel] [PATCH v2 3/4] ppc: fix leak in h_client_architecture_support

2019-07-17 Thread Shivaprasad G Bhat
Free all SpaprOptionVector local pointers after use. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_hcall.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 6808d4cda8..71cfe7c41d 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc

[Qemu-devel] [PATCH v2 1/4] ppc: fix memory leak in spapr_caps_add_properties

2019-07-17 Thread Shivaprasad G Bhat
Free the capability name string after setting the capability. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_caps.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index bbb001f84a..0263c78d69 100644 --- a/hw/ppc

[Qemu-devel] [PATCH v2 0/4] ppc: Fix some memory leaks

2019-07-17 Thread Shivaprasad G Bhat
Valgrind showed some memory leaks while running qemu-system-ppc64. Fixing them in this series. --- Shivaprasad G Bhat (4): ppc: fix memory leak in spapr_caps_add_properties ppc: fix memory leak in spapr_dt_drc() ppc: fix leak in h_client_architecture_support ppc: dont

[Qemu-devel] [PATCH v2 4/4] ppc: dont overwrite initialized idle_timer

2019-07-17 Thread Shivaprasad G Bhat
The check to see if the idle_timer is already initialized is missing. Every vcpu thread would call kvm_arch_init_vcpu() and overwrite the idle_timer resulting in a memory leak. Patch fixes that. Signed-off-by: Shivaprasad G Bhat --- target/ppc/kvm.c |3 ++- 1 file changed, 2 insertions

Re: [Qemu-devel] [RFC v2 PATCH 2/3] spapr: Add NVDIMM device support

2019-07-16 Thread Shivaprasad G Bhat
Hi Fabiano, On 05/22/2019 09:37 PM, Fabiano Rosas wrote: Shivaprasad G Bhat writes: +/* Create DT entries for cold plugged NVDIMM devices */ +dimms = nvdimm_get_device_list(); +for (; dimms; dimms = dimms->next) { +NVDIMMDevice *nvdimm = dimms-&g

[Qemu-devel] [PATCH] ppc: Fix some memory leaks

2019-07-16 Thread Shivaprasad G Bhat
valgrind showed some memory leaks while running qemu-system-ppc64. Fixing them in this patch. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_caps.c |2 ++ hw/ppc/spapr_drc.c |5 - hw/ppc/spapr_hcall.c |2 ++ target/ppc/kvm.c |3 ++- 4 files changed, 10 insertions

[Qemu-devel] [PATCH v7] ppc: remove idle_timer logic

2019-07-25 Thread Shivaprasad G Bhat
with error on older kernels. Signed-off-by: Shivaprasad G Bhat --- v6: https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg05378.html Changes from v6: - switched to error_report instead of fprintf --- target/ppc/kvm.c | 75 -- 1 file

[Qemu-devel] [PATCH] ppc: remove redundant capability check for unset irq

2019-07-25 Thread Shivaprasad G Bhat
The KVM_CAP_PPC_UNSET_IRQ is part of kernel since v2.6.36. Kernels older than that are not supported anymore. So, remove the checks. Signed-off-by: Shivaprasad G Bhat --- target/ppc/kvm.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc

Re: [PATCH v3 2/3] spapr: Add NVDIMM device support

2019-12-10 Thread Shivaprasad G Bhat
On 12/06/2019 07:22 AM, David Gibson wrote: On Wed, Nov 27, 2019 at 09:50:54AM +0530, Bharata B Rao wrote: On Fri, Nov 22, 2019 at 10:42 AM David Gibson wrote: Ok. A number of queries about this. 1) The PAPR spec for ibm,dynamic-memory-v2 says that the first word in each entry is the

[PATCH v4 3/4] spapr: Add NVDIMM device support

2019-12-17 Thread Shivaprasad G Bhat
-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0,share=yes,size=1073872896 device_add nvdimm,label-size=128k,uuid=75a3cdd7-6a2f-4791-8d15-fe0a920e8e9e,memdev=memnvdimm0,id=nvdimm0,slot=0 Signed-off-by: Shivaprasad G Bhat Signed-off-by: Bharata B Rao [Early

[PATCH v4 4/4] spapr: Add Hcalls to support PAPR NVDIMM device

2019-12-17 Thread Shivaprasad G Bhat
to do bind/unbind everything during the device_add/del. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/Makefile.objs |2 hw/ppc/spapr_nvdimm.c | 337 include/hw/ppc/spapr.h |8 + 3 files changed, 345 insertions(+), 2 deletions

Re: [PATCH v3 3/3] spapr: Add Hcalls to support PAPR NVDIMM device

2019-12-16 Thread Shivaprasad G Bhat
Hi David, On 11/22/2019 10:41 AM, David Gibson wrote: On Mon, Oct 14, 2019 at 01:38:16PM -0500, Shivaprasad G Bhat wrote: device_add/del phase itself instead. The guest kernel makes bind/unbind requests for the virtual NVDIMM device at the region level granularity. Without interleaving, each

[PATCH v4 0/4] ppc: spapr: virtual NVDIMM support

2019-12-17 Thread Shivaprasad G Bhat
-implemented hcalls - Changed the hcalls to different kinds of checks and return different values. - Addressed comments for v1 Shivaprasad G Bhat (4): mem: move nvdimm_device_list to utilities nvdimm: add uuid property to nvdimm spapr: Add NVDIMM device support

[PATCH v4 2/4] nvdimm: add uuid property to nvdimm

2019-12-17 Thread Shivaprasad G Bhat
For ppc64, PAPR requires the nvdimm device to have UUID property set in the device tree. Add an option to get it from the user. Signed-off-by: Shivaprasad G Bhat --- hw/mem/nvdimm.c | 40 include/hw/mem/nvdimm.h |7 +++ 2 files changed

[PATCH v4 1/4] mem: move nvdimm_device_list to utilities

2019-12-17 Thread Shivaprasad G Bhat
nvdimm_device_list is required for parsing the list for devices in subsequent patches. Move it to common utility area. Signed-off-by: Shivaprasad G Bhat Reviewed-by: Igor Mammedov --- hw/acpi/nvdimm.c| 28 +--- include/qemu/nvdimm-utils.h |7

Re: [PATCH v3 2/3] spapr: Add NVDIMM device support

2019-12-12 Thread Shivaprasad G Bhat
On 12/11/2019 01:35 PM, Igor Mammedov wrote: On Wed, 11 Dec 2019 09:44:11 +0530 Shivaprasad G Bhat wrote: On 12/06/2019 07:22 AM, David Gibson wrote: On Wed, Nov 27, 2019 at 09:50:54AM +0530, Bharata B Rao wrote: On Fri, Nov 22, 2019 at 10:42 AM David Gibson wrote: Ok. A number

Re: [PATCH v3 2/3] spapr: Add NVDIMM device support

2019-12-16 Thread Shivaprasad G Bhat
Hi David, On 11/22/2019 10:00 AM, David Gibson wrote: On Mon, Oct 14, 2019 at 01:37:50PM -0500, Shivaprasad G Bhat wrote: --- index 62f1a42592..815167e42f 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -708,6 +708,17 @@ static void spapr_drc_phb_class_init(ObjectClass *k, void

Re: [PATCH v3 1/3] mem: move nvdimm_device_list to utilities

2019-11-20 Thread Shivaprasad G Bhat
Hi Igor, On 11/19/2019 12:43 PM, Igor Mammedov wrote: On Mon, 14 Oct 2019 13:37:37 -0500 Shivaprasad G Bhat wrote: nvdimm_device_list is required for parsing the list for devices in subsequent patches. Move it to common utility area. Signed-off-by: Shivaprasad G Bhat --- hw/acpi

[PATCH v3 2/3] spapr: Add NVDIMM device support

2019-10-14 Thread Shivaprasad G Bhat
-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0,share=yes,size=1073872896 device_add nvdimm,label-size=128k,uuid=75a3cdd7-6a2f-4791-8d15-fe0a920e8e9e,memdev=memnvdimm0,id=nvdimm0,slot=0 Signed-off-by: Shivaprasad G Bhat Signed-off-by: Bharata B Rao [Early

[PATCH v3 3/3] spapr: Add Hcalls to support PAPR NVDIMM device

2019-10-14 Thread Shivaprasad G Bhat
for a subset of SCM blocks of a virtual NVDIMM. Hence it is safe to do bind/unbind everything during the device_add/del. Signed-off-by: Shivaprasad G Bhat --- --- hw/ppc/spapr_hcall.c | 300 include/hw/ppc/spapr.h |8 + 2 files changed, 307

[PATCH v3 1/3] mem: move nvdimm_device_list to utilities

2019-10-14 Thread Shivaprasad G Bhat
nvdimm_device_list is required for parsing the list for devices in subsequent patches. Move it to common utility area. Signed-off-by: Shivaprasad G Bhat --- hw/acpi/nvdimm.c| 28 +--- include/qemu/nvdimm-utils.h |7 +++ util/Makefile.objs

[PATCH v3 0/3] ppc: spapr: virtual NVDIMM support

2019-10-14 Thread Shivaprasad G Bhat
for v1 Shivaprasad G Bhat (3): mem: move nvdimm_device_list to utilities spapr: Add NVDIMM device support spapr: Add Hcalls to support PAPR NVDIMM device default-configs/ppc64-softmmu.mak |1 hw/acpi/nvdimm.c | 28 --- hw/mem/Kconfig

[PATCH] spapr: Fix Coverity warning while validating nvdimm options

2020-02-26 Thread Shivaprasad G Bhat
tion again. As this a false positive in this case, assert if not valid to be safe. Reported-by: Coverity (CID 1419883) Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdi

Re: [PULL 07/20] spapr: Add NVDIMM device support

2020-02-26 Thread Shivaprasad G Bhat
On 02/25/2020 03:30 PM, Peter Maydell wrote: On Fri, 21 Feb 2020 at 03:37, David Gibson wrote: From: Shivaprasad G Bhat Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm device interface in QEMU to support virtual NVDIMM devices for Power. +} + +uuidstr

[PATCH v2] spapr: Fix Coverity warning while validating nvdimm options

2020-02-27 Thread Shivaprasad G Bhat
tion again. As this a false positive in this case, assert if not valid to be safe. Also, error_abort if QOM accessor encounters error while fetching the uuid property. Reported-by: Coverity (CID 1419883) Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c |7 +-- 1 file changed, 5

Re: [PATCH] spapr: Fix Coverity warning while validating nvdimm options

2020-02-27 Thread Shivaprasad G Bhat
On 02/27/2020 05:58 PM, Greg Kurz wrote: On Wed, 26 Feb 2020 13:49:27 +0100 Greg Kurz wrote: -qemu_uuid_parse(uuidstr, ); ... cause a segv in there because uuidstr will be dereferenced at some point without checking if it's NULL. AFAICT there are two scenarios that can cause

Re: [PATCH v4 3/4] spapr: Add NVDIMM device support

2020-01-30 Thread Shivaprasad G Bhat
On 01/03/2020 06:50 AM, David Gibson wrote: On Tue, Dec 17, 2019 at 02:49:14AM -0600, Shivaprasad G Bhat wrote: Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm device interface in QEMU to support virtual NVDIMM devices for Power. Create the required DT entries

[PATCH v5 0/4] ppc: spapr: virtual NVDIMM support

2020-01-30 Thread Shivaprasad G Bhat
series no longer needed. - Removed un-implemented hcalls - Changed the hcalls to different kinds of checks and return different values. - Addressed comments for v1 Shivaprasad G Bhat (4): mem: move nvdimm_device_list to utilities nvdimm: add uuid property to nvdimm

[PATCH v5 2/4] nvdimm: add uuid property to nvdimm

2020-01-30 Thread Shivaprasad G Bhat
For ppc64, PAPR requires the nvdimm device to have UUID property set in the device tree. Add an option to get it from the user. Signed-off-by: Shivaprasad G Bhat Reviewed-by: David Gibson --- hw/mem/nvdimm.c | 40 include/hw/mem/nvdimm.h

[PATCH v5 3/4] spapr: Add NVDIMM device support

2020-01-30 Thread Shivaprasad G Bhat
-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0,share=yes,size=1073872896 device_add nvdimm,label-size=128k,uuid=75a3cdd7-6a2f-4791-8d15-fe0a920e8e9e,memdev=memnvdimm0,id=nvdimm0,slot=0 Signed-off-by: Shivaprasad G Bhat Signed-off-by: Bharata B Rao [Early

[PATCH v5 1/4] mem: move nvdimm_device_list to utilities

2020-01-30 Thread Shivaprasad G Bhat
nvdimm_device_list is required for parsing the list for devices in subsequent patches. Move it to common utility area. Signed-off-by: Shivaprasad G Bhat Reviewed-by: Igor Mammedov Reviewed-by: David Gibson --- hw/acpi/nvdimm.c| 28 +--- include/qemu

Re: [PATCH v4 4/4] spapr: Add Hcalls to support PAPR NVDIMM device

2020-01-30 Thread Shivaprasad G Bhat
On 01/03/2020 07:14 AM, David Gibson wrote: On Tue, Dec 17, 2019 at 02:49:36AM -0600, Shivaprasad G Bhat wrote: This patch implements few of the necessary hcalls for the nvdimm support. Fixing all the comments. Of course, we're not *actually* unbinding anything. But I guess the idea here

[PATCH v5 4/4] spapr: Add Hcalls to support PAPR NVDIMM device

2020-01-30 Thread Shivaprasad G Bhat
to do bind/unbind everything during the device_add/del. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/Makefile.objs |2 hw/ppc/spapr_nvdimm.c | 327 include/hw/ppc/spapr.h |8 + 3 files changed, 335 insertions(+), 2 deletions

[PATCH v6 4/4] spapr: Add Hcalls to support PAPR NVDIMM device

2020-02-09 Thread Shivaprasad G Bhat
to do bind/unbind everything during the device_add/del. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c | 298 include/hw/ppc/spapr.h |8 + 2 files changed, 305 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_nvdimm.c b

[PATCH v6 2/4] nvdimm: add uuid property to nvdimm

2020-02-09 Thread Shivaprasad G Bhat
For ppc64, PAPR requires the nvdimm device to have UUID property set in the device tree. Add an option to get it from the user. Signed-off-by: Shivaprasad G Bhat Reviewed-by: David Gibson Reviewed-by: Igor Mammedov --- hw/mem/nvdimm.c | 40

[PATCH v6 3/4] spapr: Add NVDIMM device support

2020-02-09 Thread Shivaprasad G Bhat
-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm0,share=yes,size=1073872896 device_add nvdimm,label-size=128k,uuid=75a3cdd7-6a2f-4791-8d15-fe0a920e8e9e,memdev=memnvdimm0,id=nvdimm0,slot=0 Signed-off-by: Shivaprasad G Bhat Signed-off-by: Bharata B Rao [Early

[PATCH v6 1/4] mem: move nvdimm_device_list to utilities

2020-02-09 Thread Shivaprasad G Bhat
nvdimm_device_list is required for parsing the list for devices in subsequent patches. Move it to common utility area. Signed-off-by: Shivaprasad G Bhat Reviewed-by: Igor Mammedov Reviewed-by: David Gibson --- hw/acpi/nvdimm.c| 28 +--- include/qemu

[PATCH v6 0/4] ppc: spapr: virtual NVDIMM support

2020-02-09 Thread Shivaprasad G Bhat
to different kinds of checks and return different values. - Addressed comments for v1 --- Shivaprasad G Bhat (4): mem: move nvdimm_device_list to utilities nvdimm: add uuid property to nvdimm spapr: Add NVDIMM device support spapr: Add Hcalls to support PAPR NVDIMM device

Re: [PATCH v5 3/4] spapr: Add NVDIMM device support

2020-02-09 Thread Shivaprasad G Bhat
On 02/04/2020 09:29 AM, David Gibson wrote: On Thu, Jan 30, 2020 at 05:48:15AM -0600, Shivaprasad G Bhat wrote: Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm device interface in QEMU to support virtual NVDIMM devices for Power. Create the required DT entries

Re: [PATCH v2 01/10] nvdimm: Plug memory leak in uuid property setter

2020-05-06 Thread Shivaprasad G Bhat
On 05/05/2020 03:48 PM, Markus Armbruster wrote: nvdimm_set_uuid() leaks memory on qemu_uuid_parse() failure. Fix that. Fixes: 6c5627bb24dcd68c997857a8b671617333b1289f Cc: Xiao Guangrong Cc: Shivaprasad G Bhat Signed-off-by: Markus Armbruster Thanks for finding and fixing this Markus

[RFC Qemu PATCH v2 2/2] spapr: nvdimm: Implement async flush hcalls

2020-11-30 Thread Shivaprasad G Bhat
and enables explicit asynchronous flush requests from guest. It can be disabled by setting syn-dax=on. Signed-off-by: Shivaprasad G Bhat --- hw/mem/nvdimm.c |1 + hw/ppc/spapr_nvdimm.c | 79 +++ include/hw/mem/nvdimm.h | 10 ++ include/hw

[RFC Qemu PATCH v2 1/2] spapr: drc: Add support for async hcalls at the drc level

2020-11-30 Thread Shivaprasad G Bhat
The patch adds support for async hcalls at the DRC level for the spapr devices. To be used by spapr-scm devices in the patch/es to follow. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_drc.c | 149 include/hw/ppc/spapr_drc.h | 25

[RFC Qemu PATCH v2 0/2] spapr: nvdimm: Asynchronus flush hcall support

2020-11-30 Thread Shivaprasad G Bhat
ml Changes from v1 - Fixed a missed-out unlock - using QLIST_FOREACH instead of QLIST_FOREACH_SAFE while generating token Shivaprasad G Bhat (2): spapr: drc: Add support for async hcalls at the drc level spapr: nvdimm: Implement async flush hcalls hw/mem/nvdimm.c

[RFC PATCH 2/2] spapr: nvdimm: Implement async flush hcalls

2020-11-25 Thread Shivaprasad G Bhat
and enables explicit asynchronous flush requests from guest. It can be disabled by setting syn-dax=on. Signed-off-by: Shivaprasad G Bhat --- hw/mem/nvdimm.c |1 + hw/ppc/spapr_nvdimm.c | 79 +++ include/hw/mem/nvdimm.h | 10 ++ include/hw

[RFC PATCH 1/2] spapr: drc: Add support for async hcalls at the drc level

2020-11-25 Thread Shivaprasad G Bhat
The patch adds support for async hcalls at the DRC level for the spapr devices. To be used by spapr-scm devices in the patch/es to follow. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_drc.c | 146 include/hw/ppc/spapr_drc.h | 25

[RFC PATCH 0/2] spapr: scm: Asynchronus flush hcall support

2020-11-25 Thread Shivaprasad G Bhat
de64,logbufs=8,logbsize=32k,noquota) [root@atest-guest ~]# ./mapsync /mnt1/newfile> When sync-dax=off [root@atest-guest ~]# ./mapsync /mnt2/newfile> when sync-dax=on Failed to mmap with Operation not supported --- Shivaprasad G Bhat (2): spapr: drc: Add support for as

Re: [RFC Qemu PATCH v2 1/2] spapr: drc: Add support for async hcalls at the drc level

2021-01-18 Thread Shivaprasad G Bhat
Thanks for the comments! On 12/28/20 2:08 PM, David Gibson wrote: On Mon, Dec 21, 2020 at 01:08:53PM +0100, Greg Kurz wrote: ... The overall idea looks good but I think you should consider using a thread pool to implement it. See below. I am not convinced, however. Specifically, attaching

[PATCH v5 0/3] spapr: nvdimm: Introduce spapr-nvdimm device

2021-05-18 Thread Shivaprasad G Bhat
'on' on previous machines. - Miscellanious minor fixes. v1 - https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg06330.html Changes from v1 - Fixed a missed-out unlock - using QLIST_FOREACH instead of QLIST_FOREACH_SAFE while generating token Shivaprasad G Bhat (3):

[PATCH v5 3/3] spapr: nvdimm: Introduce spapr-nvdimm device

2021-05-18 Thread Shivaprasad G Bhat
the backend doesn't have pmem="yes", the device tree property "ibm,hcall-flush-required" is set, and the guest makes hcall H_SCM_FLUSH requesting for an explicit flush. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c | 46 +

[PATCH v5 2/3] spapr: nvdimm: Implement H_SCM_FLUSH hcall

2021-05-18 Thread Shivaprasad G Bhat
. The necessary nvdimm flush specific vmstate structures are added to the spapr machine vmstate. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr.c|6 + hw/ppc/spapr_nvdimm.c | 240 + include/hw/ppc/spapr.h| 11 ++ include/hw/ppc

[PATCH v5 1/3] spapr: nvdimm: Forward declare and move the definitions

2021-05-18 Thread Shivaprasad G Bhat
The subsequent patches add definitions which tend to get the compilation to cyclic dependency. So, prepare with forward declarations, move the definitions and clean up. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c | 12 include/hw/ppc/spapr_nvdimm.h | 14

[PATCH] spapr: nvdimm: Fix the persistent-memory root node name in device tree

2021-05-26 Thread Shivaprasad G Bhat
t would fail, so fix that. Reported-by: Aneesh Kumar K.V Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdimm.c index 252204e25f..d7a4a0a051 100644 --- a/hw/ppc/spapr_n

[PATCH REBASED v5 1/2] spapr: nvdimm: Implement H_SCM_FLUSH hcall

2021-07-07 Thread Shivaprasad G Bhat
. The necessary nvdimm flush specific vmstate structures are added to the spapr machine vmstate. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr.c|6 + hw/ppc/spapr_nvdimm.c | 240 + include/hw/ppc/spapr.h| 11 ++ include/hw/ppc

[PATCH REBASED v5 0/3] spapr: nvdimm: Introduce spapr-nvdimm device

2021-07-07 Thread Shivaprasad G Bhat
.gnu.org/archive/html/qemu-devel/2020-11/msg06330.html Changes from v1 - Fixed a missed-out unlock - using QLIST_FOREACH instead of QLIST_FOREACH_SAFE while generating token Shivaprasad G Bhat (2): spapr: nvdimm: Implement H_SCM_FLUSH hcall spapr: nvdimm: Introduce spa

[PATCH REBASED v5 2/2] spapr: nvdimm: Introduce spapr-nvdimm device

2021-07-07 Thread Shivaprasad G Bhat
the backend doesn't have pmem="yes", the device tree property "ibm,hcall-flush-required" is set, and the guest makes hcall H_SCM_FLUSH requesting for an explicit flush. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c | 46 +

[PATCH v4 3/3] nvdimm: Enable sync-dax device property for nvdimm

2021-04-28 Thread Shivaprasad G Bhat
to request for flushes explicitly. This would be the default behaviour without sync-dax property set for the nvdimm device. For old pSeries machine, the default is 'unsafe'. For non-PPC platforms, the mode is set to 'unsafe' as the default. Signed-off-by: Shivaprasad G Bhat --- hw/arm/virt.c

[PATCH v4 1/3] spapr: nvdimm: Forward declare and move the definitions

2021-04-28 Thread Shivaprasad G Bhat
The subsequent patches add definitions which tend to get the compilation to cyclic dependency. So, prepare with forward declarations, move the defitions and clean up. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr_nvdimm.c | 12 include/hw/ppc/spapr_nvdimm.h | 14

[PATCH v4 2/3] spapr: nvdimm: Implement H_SCM_FLUSH hcall

2021-04-28 Thread Shivaprasad G Bhat
flush specific vmstate structures are added to the spapr machine vmstate. Signed-off-by: Shivaprasad G Bhat --- hw/ppc/spapr.c|6 + hw/ppc/spapr_nvdimm.c | 234 + include/hw/ppc/spapr.h| 10 ++ include/hw/ppc

[PATCH v4 0/3] nvdimm: Enable sync-dax property for nvdimm

2021-04-28 Thread Shivaprasad G Bhat
l Changes from v1 - Fixed a missed-out unlock - using QLIST_FOREACH instead of QLIST_FOREACH_SAFE while generating token Shivaprasad G Bhat (3): spapr: nvdimm: Forward declare and move the definitions spapr: nvdimm: Implement H_SCM_FLUSH hcall nvdimm: Enable sync-dax dev

  1   2   >