All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug
@ 2017-12-18 22:46 David Hildenbrand
  2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: David Hildenbrand @ 2017-12-18 22:46 UTC (permalink / raw)
  To: qemu-s390x, qemu-devel
  Cc: Christian Borntraeger, Cornelia Huck, Richard Henderson, Alexander Graf

While trying to fix TCG so I can properly detect memory in kvm-unit-tests
... looks like I accidentally made memory hotplug under TCG work (whoops).

qemu-system-s390x ... -m 2048,maxmem=4096M,slots=4 ...

[root@localhost ~]# cat /proc/meminfo
MemTotal:        4143632 kB
MemFree:         3845248 kB
MemAvailable:    3947932 kB

[root@localhost ~]# lsmem
RANGE                                  SIZE  STATE REMOVABLE BLOCK
0x0000000000000000-0x000000000fffffff  256M online        no     0
0x0000000010000000-0x000000006fffffff  1.5G online       yes   1-6
0x0000000070000000-0x00000000ffffffff  2.3G online        no  7-15

Memory block size:       256M
Total online memory:       4G
Total offline memory:      0B

I am not sure if we want to have memory hotplug in its current form later
on (the guest can hotplug memory itself). This is different compared to
all other architectures. E.g. when booting Fedora 27, it will simply
hotplug and add all memory. This doesn't make any sense in the context of
VMs where you want to be able to control from the outside, when and how
much more memory is given to a VM. But anyhow, seems to work ...


David Hildenbrand (2):
  s390x/tcg: implement TEST PROTECTION
  s390x/sclp: fix missing be conversion

 hw/s390x/sclp.c           |  4 ++--
 target/s390x/helper.h     |  2 +-
 target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
 target/s390x/translate.c  |  2 +-
 4 files changed, 43 insertions(+), 6 deletions(-)

-- 
2.14.3

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION
  2017-12-18 22:46 [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug David Hildenbrand
@ 2017-12-18 22:46 ` David Hildenbrand
  2017-12-19  8:20   ` [Qemu-devel] [qemu-s390x] " Thomas Huth
  2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 2/2] s390x/sclp: fix missing be conversion David Hildenbrand
  2017-12-22 10:57 ` [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug Cornelia Huck
  2 siblings, 1 reply; 11+ messages in thread
From: David Hildenbrand @ 2017-12-18 22:46 UTC (permalink / raw)
  To: qemu-s390x, qemu-devel
  Cc: Christian Borntraeger, Cornelia Huck, Richard Henderson,
	Alexander Graf, David Hildenbrand

Linux uses TEST PROTECTION to sense for available memory locations.

Let's implement what we can for now (just as for the other instructions,
excluding AR mode and special protection mechanisms).

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/helper.h     |  2 +-
 target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
 target/s390x/translate.c  |  2 +-
 3 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/target/s390x/helper.h b/target/s390x/helper.h
index 2f17b62d3d..26c1b07b44 100644
--- a/target/s390x/helper.h
+++ b/target/s390x/helper.h
@@ -137,7 +137,7 @@ DEF_HELPER_FLAGS_4(lctlg, TCG_CALL_NO_WG, void, env, i32, i64, i32)
 DEF_HELPER_FLAGS_4(stctl, TCG_CALL_NO_WG, void, env, i32, i64, i32)
 DEF_HELPER_FLAGS_4(stctg, TCG_CALL_NO_WG, void, env, i32, i64, i32)
 DEF_HELPER_FLAGS_2(testblock, TCG_CALL_NO_WG, i32, env, i64)
-DEF_HELPER_FLAGS_2(tprot, TCG_CALL_NO_RWG, i32, i64, i64)
+DEF_HELPER_FLAGS_3(tprot, TCG_CALL_NO_RWG, i32, env, i64, i64)
 DEF_HELPER_FLAGS_2(iske, TCG_CALL_NO_RWG_SE, i64, env, i64)
 DEF_HELPER_FLAGS_3(sske, TCG_CALL_NO_RWG, void, env, i64, i64)
 DEF_HELPER_FLAGS_2(rrbe, TCG_CALL_NO_RWG, i32, env, i64)
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 2625d843b3..359e446c6f 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -1717,9 +1717,46 @@ uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr)
     return 0;
 }
 
-uint32_t HELPER(tprot)(uint64_t a1, uint64_t a2)
+uint32_t HELPER(tprot)(CPUS390XState *env, uint64_t a1, uint64_t a2)
 {
-    /* XXX implement */
+    S390CPU *cpu = s390_env_get_cpu(env);
+    CPUState *cs = CPU(cpu);
+
+    /*
+     * TODO: we currently don't handle all access protection types
+     * (including access-list and key-controlled) as well as AR mode.
+     */
+    if (!s390_cpu_virt_mem_check_write(cpu, a1, 0, 1)) {
+        /* Fetching permitted; storing permitted */
+        return 0;
+    }
+    switch (env->int_pgm_code) {
+    case PGM_PROTECTION:
+        /* Fetching permitted; storing not permitted */
+        cs->exception_index = 0;
+        return 1;
+    case PGM_ADDRESSING:
+        /* Fetching not permitted; storing not permitted */
+        cs->exception_index = 0;
+        return 2;
+    case PGM_ASCE_TYPE:
+    case PGM_REG_FIRST_TRANS:
+    case PGM_REG_SEC_TRANS:
+    case PGM_REG_THIRD_TRANS:
+    case PGM_SEGMENT_TRANS:
+    case PGM_PAGE_TRANS:
+    case PGM_ALET_SPEC:
+    case PGM_ALEN_SPEC:
+    case PGM_ALE_SEQ:
+    case PGM_ASTE_VALID:
+    case PGM_ASTE_SEQ:
+    case PGM_EXT_AUTH:
+        /* Translation not available */
+        cs->exception_index = 0;
+        return 3;
+    }
+    /* any other exception is forwarded to the guest */
+    s390_cpu_virt_mem_handle_exc(cpu, GETPC());
     return 0;
 }
 
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index eede2ed157..fdcc2ffb3d 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -4534,7 +4534,7 @@ static ExitStatus op_testblock(DisasContext *s, DisasOps *o)
 
 static ExitStatus op_tprot(DisasContext *s, DisasOps *o)
 {
-    gen_helper_tprot(cc_op, o->addr1, o->in2);
+    gen_helper_tprot(cc_op, cpu_env, o->addr1, o->in2);
     set_cc_static(s);
     return NO_EXIT;
 }
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v1 2/2] s390x/sclp: fix missing be conversion
  2017-12-18 22:46 [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug David Hildenbrand
  2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION David Hildenbrand
@ 2017-12-18 22:46 ` David Hildenbrand
  2017-12-19  8:25   ` [Qemu-devel] [qemu-s390x] " Thomas Huth
  2017-12-22 10:57 ` [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug Cornelia Huck
  2 siblings, 1 reply; 11+ messages in thread
From: David Hildenbrand @ 2017-12-18 22:46 UTC (permalink / raw)
  To: qemu-s390x, qemu-devel
  Cc: Christian Borntraeger, Cornelia Huck, Richard Henderson,
	Alexander Graf, David Hildenbrand

Linux crashes right now if maxmem > mem is specified on the command line.

On s390x, the guest can hotplug memory itself right now - very weird -
and e.g. Fedora 27 will simply add all memory it can when booting.

So now, we have at least the same behavior on TCG and KVM.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 hw/s390x/sclp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 9be0cb80ad..829c13bcf2 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -233,7 +233,7 @@ static void assign_storage(SCLPDevice *sclp, SCCB *sccb)
         sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);
         return;
     }
-    assign_addr = (assign_info->rn - 1) * mhd->rzm;
+    assign_addr = (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm;
 
     if ((assign_addr % MEM_SECTION_SIZE == 0) &&
         (assign_addr >= mhd->padded_ram_size)) {
@@ -292,7 +292,7 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *sccb)
         sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);
         return;
     }
-    unassign_addr = (assign_info->rn - 1) * mhd->rzm;
+    unassign_addr = (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm;
 
     /* if the addr is a multiple of 256 MB */
     if ((unassign_addr % MEM_SECTION_SIZE == 0) &&
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION
  2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION David Hildenbrand
@ 2017-12-19  8:20   ` Thomas Huth
  2017-12-19 10:32     ` David Hildenbrand
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2017-12-19  8:20 UTC (permalink / raw)
  To: David Hildenbrand, qemu-s390x, qemu-devel
  Cc: Cornelia Huck, Alexander Graf, Richard Henderson

On 18.12.2017 23:46, David Hildenbrand wrote:
> Linux uses TEST PROTECTION to sense for available memory locations.
> 
> Let's implement what we can for now (just as for the other instructions,
> excluding AR mode and special protection mechanisms).
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/helper.h     |  2 +-
>  target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
>  target/s390x/translate.c  |  2 +-
>  3 files changed, 41 insertions(+), 4 deletions(-)
> 
> diff --git a/target/s390x/helper.h b/target/s390x/helper.h
> index 2f17b62d3d..26c1b07b44 100644
> --- a/target/s390x/helper.h
> +++ b/target/s390x/helper.h
> @@ -137,7 +137,7 @@ DEF_HELPER_FLAGS_4(lctlg, TCG_CALL_NO_WG, void, env, i32, i64, i32)
>  DEF_HELPER_FLAGS_4(stctl, TCG_CALL_NO_WG, void, env, i32, i64, i32)
>  DEF_HELPER_FLAGS_4(stctg, TCG_CALL_NO_WG, void, env, i32, i64, i32)
>  DEF_HELPER_FLAGS_2(testblock, TCG_CALL_NO_WG, i32, env, i64)
> -DEF_HELPER_FLAGS_2(tprot, TCG_CALL_NO_RWG, i32, i64, i64)
> +DEF_HELPER_FLAGS_3(tprot, TCG_CALL_NO_RWG, i32, env, i64, i64)
>  DEF_HELPER_FLAGS_2(iske, TCG_CALL_NO_RWG_SE, i64, env, i64)
>  DEF_HELPER_FLAGS_3(sske, TCG_CALL_NO_RWG, void, env, i64, i64)
>  DEF_HELPER_FLAGS_2(rrbe, TCG_CALL_NO_RWG, i32, env, i64)
> diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
> index 2625d843b3..359e446c6f 100644
> --- a/target/s390x/mem_helper.c
> +++ b/target/s390x/mem_helper.c
> @@ -1717,9 +1717,46 @@ uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr)
>      return 0;
>  }
>  
> -uint32_t HELPER(tprot)(uint64_t a1, uint64_t a2)
> +uint32_t HELPER(tprot)(CPUS390XState *env, uint64_t a1, uint64_t a2)
>  {
> -    /* XXX implement */
> +    S390CPU *cpu = s390_env_get_cpu(env);
> +    CPUState *cs = CPU(cpu);
> +
> +    /*
> +     * TODO: we currently don't handle all access protection types
> +     * (including access-list and key-controlled) as well as AR mode.
> +     */

Maybe add some "if (a2 & 0xf0) qemu_log_mask(LOG_UNIMPL, ...)" so that
we've got a chance to detect such conditions later?

> +    if (!s390_cpu_virt_mem_check_write(cpu, a1, 0, 1)) {
> +        /* Fetching permitted; storing permitted */
> +        return 0;
> +    }
> +    switch (env->int_pgm_code) {
> +    case PGM_PROTECTION:
> +        /* Fetching permitted; storing not permitted */
> +        cs->exception_index = 0;
> +        return 1;
> +    case PGM_ADDRESSING:
> +        /* Fetching not permitted; storing not permitted */
> +        cs->exception_index = 0;
> +        return 2;
> +    case PGM_ASCE_TYPE:
> +    case PGM_REG_FIRST_TRANS:
> +    case PGM_REG_SEC_TRANS:
> +    case PGM_REG_THIRD_TRANS:
> +    case PGM_SEGMENT_TRANS:
> +    case PGM_PAGE_TRANS:
> +    case PGM_ALET_SPEC:
> +    case PGM_ALEN_SPEC:
> +    case PGM_ALE_SEQ:
> +    case PGM_ASTE_VALID:
> +    case PGM_ASTE_SEQ:
> +    case PGM_EXT_AUTH:
> +        /* Translation not available */
> +        cs->exception_index = 0;
> +        return 3;
> +    }
> +    /* any other exception is forwarded to the guest */
> +    s390_cpu_virt_mem_handle_exc(cpu, GETPC());
>      return 0;
>  }
>  
> diff --git a/target/s390x/translate.c b/target/s390x/translate.c
> index eede2ed157..fdcc2ffb3d 100644
> --- a/target/s390x/translate.c
> +++ b/target/s390x/translate.c
> @@ -4534,7 +4534,7 @@ static ExitStatus op_testblock(DisasContext *s, DisasOps *o)
>  
>  static ExitStatus op_tprot(DisasContext *s, DisasOps *o)
>  {
> -    gen_helper_tprot(cc_op, o->addr1, o->in2);
> +    gen_helper_tprot(cc_op, cpu_env, o->addr1, o->in2);
>      set_cc_static(s);
>      return NO_EXIT;
>  }
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH v1 2/2] s390x/sclp: fix missing be conversion
  2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 2/2] s390x/sclp: fix missing be conversion David Hildenbrand
@ 2017-12-19  8:25   ` Thomas Huth
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2017-12-19  8:25 UTC (permalink / raw)
  To: David Hildenbrand, qemu-s390x, qemu-devel
  Cc: Christian Borntraeger, Cornelia Huck, Alexander Graf, Richard Henderson

On 18.12.2017 23:46, David Hildenbrand wrote:
> Linux crashes right now if maxmem > mem is specified on the command line.
> 
> On s390x, the guest can hotplug memory itself right now - very weird -
> and e.g. Fedora 27 will simply add all memory it can when booting.
> 
> So now, we have at least the same behavior on TCG and KVM.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  hw/s390x/sclp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
> index 9be0cb80ad..829c13bcf2 100644
> --- a/hw/s390x/sclp.c
> +++ b/hw/s390x/sclp.c
> @@ -233,7 +233,7 @@ static void assign_storage(SCLPDevice *sclp, SCCB *sccb)
>          sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);
>          return;
>      }
> -    assign_addr = (assign_info->rn - 1) * mhd->rzm;
> +    assign_addr = (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm;
>  
>      if ((assign_addr % MEM_SECTION_SIZE == 0) &&
>          (assign_addr >= mhd->padded_ram_size)) {
> @@ -292,7 +292,7 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *sccb)
>          sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);
>          return;
>      }
> -    unassign_addr = (assign_info->rn - 1) * mhd->rzm;
> +    unassign_addr = (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm;
>  
>      /* if the addr is a multiple of 256 MB */
>      if ((unassign_addr % MEM_SECTION_SIZE == 0) &&
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION
  2017-12-19  8:20   ` [Qemu-devel] [qemu-s390x] " Thomas Huth
@ 2017-12-19 10:32     ` David Hildenbrand
  2017-12-21 17:17       ` Cornelia Huck
  0 siblings, 1 reply; 11+ messages in thread
From: David Hildenbrand @ 2017-12-19 10:32 UTC (permalink / raw)
  To: Thomas Huth, qemu-s390x, qemu-devel
  Cc: Cornelia Huck, Alexander Graf, Richard Henderson

On 19.12.2017 09:20, Thomas Huth wrote:
> On 18.12.2017 23:46, David Hildenbrand wrote:
>> Linux uses TEST PROTECTION to sense for available memory locations.
>>
>> Let's implement what we can for now (just as for the other instructions,
>> excluding AR mode and special protection mechanisms).
>>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
>>  target/s390x/helper.h     |  2 +-
>>  target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
>>  target/s390x/translate.c  |  2 +-
>>  3 files changed, 41 insertions(+), 4 deletions(-)
>>
>> diff --git a/target/s390x/helper.h b/target/s390x/helper.h
>> index 2f17b62d3d..26c1b07b44 100644
>> --- a/target/s390x/helper.h
>> +++ b/target/s390x/helper.h
>> @@ -137,7 +137,7 @@ DEF_HELPER_FLAGS_4(lctlg, TCG_CALL_NO_WG, void, env, i32, i64, i32)
>>  DEF_HELPER_FLAGS_4(stctl, TCG_CALL_NO_WG, void, env, i32, i64, i32)
>>  DEF_HELPER_FLAGS_4(stctg, TCG_CALL_NO_WG, void, env, i32, i64, i32)
>>  DEF_HELPER_FLAGS_2(testblock, TCG_CALL_NO_WG, i32, env, i64)
>> -DEF_HELPER_FLAGS_2(tprot, TCG_CALL_NO_RWG, i32, i64, i64)
>> +DEF_HELPER_FLAGS_3(tprot, TCG_CALL_NO_RWG, i32, env, i64, i64)
>>  DEF_HELPER_FLAGS_2(iske, TCG_CALL_NO_RWG_SE, i64, env, i64)
>>  DEF_HELPER_FLAGS_3(sske, TCG_CALL_NO_RWG, void, env, i64, i64)
>>  DEF_HELPER_FLAGS_2(rrbe, TCG_CALL_NO_RWG, i32, env, i64)
>> diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
>> index 2625d843b3..359e446c6f 100644
>> --- a/target/s390x/mem_helper.c
>> +++ b/target/s390x/mem_helper.c
>> @@ -1717,9 +1717,46 @@ uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr)
>>      return 0;
>>  }
>>  
>> -uint32_t HELPER(tprot)(uint64_t a1, uint64_t a2)
>> +uint32_t HELPER(tprot)(CPUS390XState *env, uint64_t a1, uint64_t a2)
>>  {
>> -    /* XXX implement */
>> +    S390CPU *cpu = s390_env_get_cpu(env);
>> +    CPUState *cs = CPU(cpu);
>> +
>> +    /*
>> +     * TODO: we currently don't handle all access protection types
>> +     * (including access-list and key-controlled) as well as AR mode.
>> +     */
> 
> Maybe add some "if (a2 & 0xf0) qemu_log_mask(LOG_UNIMPL, ...)" so that
> we've got a chance to detect such conditions later?
> 

In general I would agree, however as such acess-list + storage key stuff
is missing literally all over the place, I don't think it is very helpful.

Once (if ever) we implement it, we will have to go through the whole PoP
either way and fixup all functions.

Thanks!

-- 

Thanks,

David / dhildenb

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION
  2017-12-19 10:32     ` David Hildenbrand
@ 2017-12-21 17:17       ` Cornelia Huck
  0 siblings, 0 replies; 11+ messages in thread
From: Cornelia Huck @ 2017-12-21 17:17 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: Thomas Huth, qemu-s390x, qemu-devel, Alexander Graf, Richard Henderson

On Tue, 19 Dec 2017 11:32:16 +0100
David Hildenbrand <david@redhat.com> wrote:

> On 19.12.2017 09:20, Thomas Huth wrote:
> > On 18.12.2017 23:46, David Hildenbrand wrote:  

> >> +    /*
> >> +     * TODO: we currently don't handle all access protection types
> >> +     * (including access-list and key-controlled) as well as AR mode.
> >> +     */  
> > 
> > Maybe add some "if (a2 & 0xf0) qemu_log_mask(LOG_UNIMPL, ...)" so that
> > we've got a chance to detect such conditions later?
> >   
> 
> In general I would agree, however as such acess-list + storage key stuff
> is missing literally all over the place, I don't think it is very helpful.
> 
> Once (if ever) we implement it, we will have to go through the whole PoP
> either way and fixup all functions.

The TODO is fine with me.

Out of curiousity, do you already have an idea how much work that would
be? (Not asking for patches right now, mind you :)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug
  2017-12-18 22:46 [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug David Hildenbrand
  2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION David Hildenbrand
  2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 2/2] s390x/sclp: fix missing be conversion David Hildenbrand
@ 2017-12-22 10:57 ` Cornelia Huck
  2018-01-12 10:43   ` [Qemu-devel] [qemu-s390x] " David Hildenbrand
  2 siblings, 1 reply; 11+ messages in thread
From: Cornelia Huck @ 2017-12-22 10:57 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: qemu-s390x, qemu-devel, Christian Borntraeger, Richard Henderson,
	Alexander Graf

On Mon, 18 Dec 2017 23:46:14 +0100
David Hildenbrand <david@redhat.com> wrote:

> While trying to fix TCG so I can properly detect memory in kvm-unit-tests
> ... looks like I accidentally made memory hotplug under TCG work (whoops).

:)

> 
> qemu-system-s390x ... -m 2048,maxmem=4096M,slots=4 ...
> 
> [root@localhost ~]# cat /proc/meminfo
> MemTotal:        4143632 kB
> MemFree:         3845248 kB
> MemAvailable:    3947932 kB
> 
> [root@localhost ~]# lsmem
> RANGE                                  SIZE  STATE REMOVABLE BLOCK
> 0x0000000000000000-0x000000000fffffff  256M online        no     0
> 0x0000000010000000-0x000000006fffffff  1.5G online       yes   1-6
> 0x0000000070000000-0x00000000ffffffff  2.3G online        no  7-15
> 
> Memory block size:       256M
> Total online memory:       4G
> Total offline memory:      0B
> 
> I am not sure if we want to have memory hotplug in its current form later
> on (the guest can hotplug memory itself). This is different compared to
> all other architectures. E.g. when booting Fedora 27, it will simply
> hotplug and add all memory. This doesn't make any sense in the context of
> VMs where you want to be able to control from the outside, when and how
> much more memory is given to a VM. But anyhow, seems to work ...

Yes, s390x is different from anyone else in that respect.

I played with it for a bit and it behaves exactly the same under kvm
and under tcg.

> 
> 
> David Hildenbrand (2):
>   s390x/tcg: implement TEST PROTECTION
>   s390x/sclp: fix missing be conversion
> 
>  hw/s390x/sclp.c           |  4 ++--
>  target/s390x/helper.h     |  2 +-
>  target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
>  target/s390x/translate.c  |  2 +-
>  4 files changed, 43 insertions(+), 6 deletions(-)
> 

Thanks, applied.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug
  2017-12-22 10:57 ` [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug Cornelia Huck
@ 2018-01-12 10:43   ` David Hildenbrand
  2018-01-12 10:51     ` Cornelia Huck
  0 siblings, 1 reply; 11+ messages in thread
From: David Hildenbrand @ 2018-01-12 10:43 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Christian Borntraeger, qemu-s390x, qemu-devel, Alexander Graf,
	Richard Henderson


>> David Hildenbrand (2):
>>   s390x/tcg: implement TEST PROTECTION
>>   s390x/sclp: fix missing be conversion
>>
>>  hw/s390x/sclp.c           |  4 ++--
>>  target/s390x/helper.h     |  2 +-
>>  target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
>>  target/s390x/translate.c  |  2 +-
>>  4 files changed, 43 insertions(+), 6 deletions(-)
>>
> 
> Thanks, applied.
> 

FWIW, just found out I interpreted the PGM_ADRESSING case wrong, will
resend once I fixed it.

-- 

Thanks,

David / dhildenb

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug
  2018-01-12 10:43   ` [Qemu-devel] [qemu-s390x] " David Hildenbrand
@ 2018-01-12 10:51     ` Cornelia Huck
  2018-01-12 10:52       ` David Hildenbrand
  0 siblings, 1 reply; 11+ messages in thread
From: Cornelia Huck @ 2018-01-12 10:51 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: Christian Borntraeger, qemu-s390x, qemu-devel, Alexander Graf,
	Richard Henderson

On Fri, 12 Jan 2018 11:43:00 +0100
David Hildenbrand <david@redhat.com> wrote:

> >> David Hildenbrand (2):
> >>   s390x/tcg: implement TEST PROTECTION
> >>   s390x/sclp: fix missing be conversion
> >>
> >>  hw/s390x/sclp.c           |  4 ++--
> >>  target/s390x/helper.h     |  2 +-
> >>  target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
> >>  target/s390x/translate.c  |  2 +-
> >>  4 files changed, 43 insertions(+), 6 deletions(-)
> >>  
> > 
> > Thanks, applied.
> >   
> 
> FWIW, just found out I interpreted the PGM_ADRESSING case wrong, will
> resend once I fixed it.
> 

I'd prefer a fixup patch on top, as I have already queued stuff on top
of this.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [qemu-s390x] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug
  2018-01-12 10:51     ` Cornelia Huck
@ 2018-01-12 10:52       ` David Hildenbrand
  0 siblings, 0 replies; 11+ messages in thread
From: David Hildenbrand @ 2018-01-12 10:52 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Christian Borntraeger, qemu-s390x, qemu-devel, Alexander Graf,
	Richard Henderson

On 12.01.2018 11:51, Cornelia Huck wrote:
> On Fri, 12 Jan 2018 11:43:00 +0100
> David Hildenbrand <david@redhat.com> wrote:
> 
>>>> David Hildenbrand (2):
>>>>   s390x/tcg: implement TEST PROTECTION
>>>>   s390x/sclp: fix missing be conversion
>>>>
>>>>  hw/s390x/sclp.c           |  4 ++--
>>>>  target/s390x/helper.h     |  2 +-
>>>>  target/s390x/mem_helper.c | 41 +++++++++++++++++++++++++++++++++++++++--
>>>>  target/s390x/translate.c  |  2 +-
>>>>  4 files changed, 43 insertions(+), 6 deletions(-)
>>>>  
>>>
>>> Thanks, applied.
>>>   
>>
>> FWIW, just found out I interpreted the PGM_ADRESSING case wrong, will
>> resend once I fixed it.
>>
> 
> I'd prefer a fixup patch on top, as I have already queued stuff on top
> of this.
> 

Can do!

-- 

Thanks,

David / dhildenb

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-01-12 10:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18 22:46 [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug David Hildenbrand
2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 1/2] s390x/tcg: implement TEST PROTECTION David Hildenbrand
2017-12-19  8:20   ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2017-12-19 10:32     ` David Hildenbrand
2017-12-21 17:17       ` Cornelia Huck
2017-12-18 22:46 ` [Qemu-devel] [PATCH v1 2/2] s390x/sclp: fix missing be conversion David Hildenbrand
2017-12-19  8:25   ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2017-12-22 10:57 ` [Qemu-devel] [PATCH v1 0/2] s390x/tcg: TEST PROTECTION and memory hotplug Cornelia Huck
2018-01-12 10:43   ` [Qemu-devel] [qemu-s390x] " David Hildenbrand
2018-01-12 10:51     ` Cornelia Huck
2018-01-12 10:52       ` David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.