Skip to contentSkip to conversation

s390x: remove direct reference to mem_path global form s390x code

PATCH Superseded Igor Mammedov 4 participants 6 messages Jan 28, 2019 – Jan 29, 2019

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 s390x: remove direct reference to mem_path global form s390x code

I plan to deprecate -mem-path option and replace it with memory-backend, for that it's necessary to get rid of mem_path global variable. Do it for s390x case, replacing it with alternative way to enable 1Mb hugepages capability.

Todo that replace qemu_mempath_getpagesize() with qemu_getrampagesize() which also checks for -mem-path provided RAM.

---
v2:
* s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes David Hildenbrand <[email protected]>

---
 target/s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/s390x/kvm.c +2 -2
index 2ebf26a..90766fa 100644
@@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
 
 static int kvm_s390_configure_mempath_backing(KVMState *s)
 {
-    size_t path_psize = qemu_mempath_getpagesize(mem_path);
+    size_t path_psize = qemu_getrampagesize();
 
     if (path_psize == 4 * KiB) {
         return 0;
@@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
+    if (kvm_s390_configure_mempath_backing(s)) {
         return -EINVAL;
     }
 
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 32 lines · Igor Mammedov

I plan to deprecate -mem-path option and replace it with memory-backend, for that it's necessary to get rid of mem_path global variable. Do it for s390x case, replacing it with alternative way to enable 1Mb hugepages capability.

Todo that replace qemu_mempath_getpagesize() with qemu_getrampagesize() which also checks for -mem-path provided RAM.

---
v2:
* s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes David Hildenbrand <[email protected]>

---
 target/s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/s390x/kvm.c +1 -1
index 2ebf26a..90766fa 100644
@@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
 
 static int kvm_s390_configure_mempath_backing(KVMState *s)
 {
-    size_t path_psize = qemu_mempath_getpagesize(mem_path);
+    size_t path_psize = qemu_getrampagesize();
 
     if (path_psize == 4 * KiB) {
         return 0;

target/s390x/kvm.c int kvm_arch_init(MachineState *ms, KVMState *s) · line 325

Quoted 8 lines
target/s390x/kvm.c +1 -1
@@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
+    if (kvm_s390_configure_mempath_backing(s)) {
         return -EINVAL;
     }
 

Nice!

Signature · 3 lines
Thanks,

David / dhildenb
#2 lore raw
In reply to Igor Mammedov
Quoted 6 lines · Igor Mammedov

I plan to deprecate -mem-path option and replace it with memory-backend, for that it's necessary to get rid of mem_path global variable. Do it for s390x case, replacing it with alternative way to enable 1Mb hugepages capability.

Todo that replace qemu_mempath_getpagesize() with qemu_getrampagesize()

I guess this should be: "To do that, replace ..."

Quoted 34 lines

which also checks for -mem-path provided RAM.

---
v2:
* s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes David Hildenbrand <[email protected]>

---
 target/s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/s390x/kvm.c +2 -2
index 2ebf26a..90766fa 100644
@@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
 
 static int kvm_s390_configure_mempath_backing(KVMState *s)
 {
-    size_t path_psize = qemu_mempath_getpagesize(mem_path);
+    size_t path_psize = qemu_getrampagesize();
 
     if (path_psize == 4 * KiB) {
         return 0;
@@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
+    if (kvm_s390_configure_mempath_backing(s)) {
         return -EINVAL;
     }
 
#3 lore raw

PATCH v3 1/1 s390x: remove direct reference to mem_path global form s390x code

I plan to deprecate -mem-path option and replace it with memory-backend, for that it's necessary to get rid of mem_path global variable. Do it for s390x case, replacing it with alternative way to enable 1Mb hugepages capability.

To do that, replace qemu_mempath_getpagesize() with qemu_getrampagesize() which also checks for -mem-path provided RAM.

---
v3:
fixup, typo in commit msg (Philippe Mathieu-Daudé <[email protected]>)
v2:
* s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes David Hildenbrand <[email protected]>

---
 target/s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/s390x/kvm.c +2 -2
index 2ebf26a..90766fa 100644
@@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
 
 static int kvm_s390_configure_mempath_backing(KVMState *s)
 {
-    size_t path_psize = qemu_mempath_getpagesize(mem_path);
+    size_t path_psize = qemu_getrampagesize();
 
     if (path_psize == 4 * KiB) {
         return 0;
@@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
+    if (kvm_s390_configure_mempath_backing(s)) {
         return -EINVAL;
     }
 
Signature · 1 line
2.7.4
#4 lore raw

On Mon, 28 Jan 2019 16:32:38 +0100
Igor Mammedov <[email protected]> wrote:

In the subject: s/form/from/

Quoted 34 lines

I plan to deprecate -mem-path option and replace it with memory-backend, for that it's necessary to get rid of mem_path global variable. Do it for s390x case, replacing it with alternative way to enable 1Mb hugepages capability.

To do that, replace qemu_mempath_getpagesize() with qemu_getrampagesize() which also checks for -mem-path provided RAM.

---
v3:
fixup, typo in commit msg (Philippe Mathieu-Daudé <[email protected]>)
v2:
* s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes David Hildenbrand <[email protected]>

---
 target/s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/s390x/kvm.c +1 -1
index 2ebf26a..90766fa 100644
@@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
 
 static int kvm_s390_configure_mempath_backing(KVMState *s)
 {
-    size_t path_psize = qemu_mempath_getpagesize(mem_path);
+    size_t path_psize = qemu_getrampagesize();
 
     if (path_psize == 4 * KiB) {
         return 0;

target/s390x/kvm.c int kvm_arch_init(MachineState *ms, KVMState *s) · line 325

Quoted 8 lines
target/s390x/kvm.c +1 -1
@@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
+    if (kvm_s390_configure_mempath_backing(s)) {
         return -EINVAL;
     }
 

This needs an #include "exec/ram_addr.h", or the compilation fails.

Should I fix it up while applying, or will you resend?

#5 lore raw
Quoted 50 lines · On Tue, 29 Jan 2019 13:39:31 +0100 Cornelia Huck <[email protected]> wrote:

On Mon, 28 Jan 2019 16:32:38 +0100
Igor Mammedov <[email protected]> wrote:

In the subject: s/form/from/

Quoted 34 lines

I plan to deprecate -mem-path option and replace it with memory-backend, for that it's necessary to get rid of mem_path global variable. Do it for s390x case, replacing it with alternative way to enable 1Mb hugepages capability.

To do that, replace qemu_mempath_getpagesize() with qemu_getrampagesize() which also checks for -mem-path provided RAM.

---
v3:
fixup, typo in commit msg (Philippe Mathieu-Daudé <[email protected]>)
v2:
* s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes David Hildenbrand <[email protected]>

---
 target/s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/s390x/kvm.c +1 -1
index 2ebf26a..90766fa 100644
@@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
 
 static int kvm_s390_configure_mempath_backing(KVMState *s)
 {
-    size_t path_psize = qemu_mempath_getpagesize(mem_path);
+    size_t path_psize = qemu_getrampagesize();
 
     if (path_psize == 4 * KiB) {
         return 0;

target/s390x/kvm.c int kvm_arch_init(MachineState *ms, KVMState *s) · line 325

Quoted 8 lines
target/s390x/kvm.c +1 -1
@@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
+    if (kvm_s390_configure_mempath_backing(s)) {
         return -EINVAL;
     }
 

This needs an #include "exec/ram_addr.h", or the compilation fails.

Quoted 1 line

Should I fix it up while applying, or will you resend?

I'll resend