All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next)
@ 2014-10-01 14:02 Christian Borntraeger
  2014-10-01 14:02 ` [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit Christian Borntraeger
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Christian Borntraeger @ 2014-10-01 14:02 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: KVM, Gleb Natapov, Alexander Graf, Cornelia Huck, Jens Freimann,
	linux-s390, Christian Borntraeger

Paolo,

let's use the additional week that Linus gave us for growing next by
adding two small enhancements.

The following changes since commit cec26bc3c125b5dd12a02f04133cd91eae3f1622:

  KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode (2014-09-29 15:36:33 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git  tags/kvm-s390-next-20141001

for you to fetch changes up to ce2e4f0b75a567d25375b52476662c724304e476:

  KVM: s390: count vcpu wakeups in stat.halt_wakeup (2014-10-01 14:42:14 +0200)

----------------------------------------------------------------
KVM: s390: Small enhancements for 3.18 (next)

Provide TOD CLOCK steering to the guest and add cpu wakeup counter.

----------------------------------------------------------------
Christian Borntraeger (1):
      KVM: s390/facilities: allow TOD-CLOCK steering facility bit

David Hildenbrand (1):
      KVM: s390: count vcpu wakeups in stat.halt_wakeup

 arch/s390/include/asm/kvm_host.h | 1 +
 arch/s390/kvm/interrupt.c        | 1 +
 arch/s390/kvm/kvm-s390.c         | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

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

* [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit
  2014-10-01 14:02 [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next) Christian Borntraeger
@ 2014-10-01 14:02 ` Christian Borntraeger
  2014-10-01 14:17   ` Alexander Graf
  2014-10-01 14:02 ` [GIT PULL 2/2] KVM: s390: count vcpu wakeups in stat.halt_wakeup Christian Borntraeger
  2014-10-02 11:45 ` [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next) Paolo Bonzini
  2 siblings, 1 reply; 8+ messages in thread
From: Christian Borntraeger @ 2014-10-01 14:02 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: KVM, Gleb Natapov, Alexander Graf, Cornelia Huck, Jens Freimann,
	linux-s390, Christian Borntraeger

There is nothing to do for KVM to support TOD-CLOCK steering.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
---
 arch/s390/kvm/kvm-s390.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 56a411c..0d5aa88 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -1786,7 +1786,7 @@ static int __init kvm_s390_init(void)
 		return -ENOMEM;
 	}
 	memcpy(vfacilities, S390_lowcore.stfle_fac_list, 16);
-	vfacilities[0] &= 0xff82fff3f4fc2000UL;
+	vfacilities[0] &= 0xff82fffbf47c2000UL;
 	vfacilities[1] &= 0x005c000000000000UL;
 	return 0;
 }
-- 
1.9.3

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

* [GIT PULL 2/2] KVM: s390: count vcpu wakeups in stat.halt_wakeup
  2014-10-01 14:02 [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next) Christian Borntraeger
  2014-10-01 14:02 ` [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit Christian Borntraeger
@ 2014-10-01 14:02 ` Christian Borntraeger
  2014-10-02 11:45 ` [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next) Paolo Bonzini
  2 siblings, 0 replies; 8+ messages in thread
From: Christian Borntraeger @ 2014-10-01 14:02 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: KVM, Gleb Natapov, Alexander Graf, Cornelia Huck, Jens Freimann,
	linux-s390, David Hildenbrand, Christian Borntraeger

From: David Hildenbrand <dahi@linux.vnet.ibm.com>

This patch introduces the halt_wakeup counter used by common code and uses it to
count vcpu wakeups done in s390 arch specific code.

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/include/asm/kvm_host.h | 1 +
 arch/s390/kvm/interrupt.c        | 1 +
 arch/s390/kvm/kvm-s390.c         | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 1a6f6fd..2175f911 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -192,6 +192,7 @@ struct kvm_vcpu_stat {
 	u32 exit_stop_request;
 	u32 exit_validity;
 	u32 exit_instruction;
+	u32 halt_wakeup;
 	u32 instruction_lctl;
 	u32 instruction_lctlg;
 	u32 instruction_stctl;
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 4cad00a..a398384 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -626,6 +626,7 @@ void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu)
 		 */
 		vcpu->preempted = true;
 		wake_up_interruptible(&vcpu->wq);
+		vcpu->stat.halt_wakeup++;
 	}
 }
 
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0d5aa88..55aade4 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -50,6 +50,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
 	{ "exit_instruction", VCPU_STAT(exit_instruction) },
 	{ "exit_program_interruption", VCPU_STAT(exit_program_interruption) },
 	{ "exit_instr_and_program_int", VCPU_STAT(exit_instr_and_program) },
+	{ "halt_wakeup", VCPU_STAT(halt_wakeup) },
 	{ "instruction_lctlg", VCPU_STAT(instruction_lctlg) },
 	{ "instruction_lctl", VCPU_STAT(instruction_lctl) },
 	{ "instruction_stctl", VCPU_STAT(instruction_stctl) },
-- 
1.9.3

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

* Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit
  2014-10-01 14:02 ` [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit Christian Borntraeger
@ 2014-10-01 14:17   ` Alexander Graf
  2014-10-01 18:27     ` Christian Borntraeger
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Graf @ 2014-10-01 14:17 UTC (permalink / raw)
  To: Christian Borntraeger, Paolo Bonzini
  Cc: KVM, Gleb Natapov, Cornelia Huck, Jens Freimann, linux-s390



On 01.10.14 16:02, Christian Borntraeger wrote:
> There is nothing to do for KVM to support TOD-CLOCK steering.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
> ---
>  arch/s390/kvm/kvm-s390.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 56a411c..0d5aa88 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -1786,7 +1786,7 @@ static int __init kvm_s390_init(void)
>  		return -ENOMEM;
>  	}
>  	memcpy(vfacilities, S390_lowcore.stfle_fac_list, 16);
> -	vfacilities[0] &= 0xff82fff3f4fc2000UL;
> +	vfacilities[0] &= 0xff82fffbf47c2000UL;

Can we please convert this into something readable soon? :)


Alex

>  	vfacilities[1] &= 0x005c000000000000UL;
>  	return 0;
>  }
> 

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

* Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit
  2014-10-01 14:17   ` Alexander Graf
@ 2014-10-01 18:27     ` Christian Borntraeger
  2014-10-02  8:22       ` Heiko Carstens
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Borntraeger @ 2014-10-01 18:27 UTC (permalink / raw)
  To: Alexander Graf, Paolo Bonzini
  Cc: KVM, Gleb Natapov, Cornelia Huck, Jens Freimann, linux-s390

On 10/01/2014 04:17 PM, Alexander Graf wrote:
> 
> 
> On 01.10.14 16:02, Christian Borntraeger wrote:
>> There is nothing to do for KVM to support TOD-CLOCK steering.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
>> ---
>>  arch/s390/kvm/kvm-s390.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index 56a411c..0d5aa88 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -1786,7 +1786,7 @@ static int __init kvm_s390_init(void)
>>  		return -ENOMEM;
>>  	}
>>  	memcpy(vfacilities, S390_lowcore.stfle_fac_list, 16);
>> -	vfacilities[0] &= 0xff82fff3f4fc2000UL;
>> +	vfacilities[0] &= 0xff82fffbf47c2000UL;
> 
> Can we please convert this into something readable soon? :)

It will be sooner when you send patches ;-)
The facility numbers are documented in the POP (chapter 4 last page) in IBM notation (bit0 is the MSB)
It probably makes sense to do this for the non-KVM part as well. When you grep
for test_facility under arch/s390 there are lots of numerical value.

Hmm, maybe we can find somebody that wants to increase the patch counter?

Christian


> 
> 
> Alex
> 
>>  	vfacilities[1] &= 0x005c000000000000UL;
>>  	return 0;
>>  }
>>
> 

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

* Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit
  2014-10-01 18:27     ` Christian Borntraeger
@ 2014-10-02  8:22       ` Heiko Carstens
  2014-10-02  8:47         ` Christian Borntraeger
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Carstens @ 2014-10-02  8:22 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Alexander Graf, Paolo Bonzini, KVM, Gleb Natapov, Cornelia Huck,
	Jens Freimann, linux-s390

On Wed, Oct 01, 2014 at 08:27:38PM +0200, Christian Borntraeger wrote:
> On 10/01/2014 04:17 PM, Alexander Graf wrote:
> > 
> > 
> > On 01.10.14 16:02, Christian Borntraeger wrote:
> >> There is nothing to do for KVM to support TOD-CLOCK steering.
> >>
> >> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> >> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
> >> ---
> >>  arch/s390/kvm/kvm-s390.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> >> index 56a411c..0d5aa88 100644
> >> --- a/arch/s390/kvm/kvm-s390.c
> >> +++ b/arch/s390/kvm/kvm-s390.c
> >> @@ -1786,7 +1786,7 @@ static int __init kvm_s390_init(void)
> >>  		return -ENOMEM;
> >>  	}
> >>  	memcpy(vfacilities, S390_lowcore.stfle_fac_list, 16);
> >> -	vfacilities[0] &= 0xff82fff3f4fc2000UL;
> >> +	vfacilities[0] &= 0xff82fffbf47c2000UL;
> > 
> > Can we please convert this into something readable soon? :)
> 
> It will be sooner when you send patches ;-)
> The facility numbers are documented in the POP (chapter 4 last page) in
> IBM notation (bit0 is the MSB)
> It probably makes sense to do this for the non-KVM part as well. When you grep
> for test_facility under arch/s390 there are lots of numerical value.

These numbers _are_ a wart and were the source of a couple of bugs e.g.
in our ALS code already.
However converting these bitfields to something readable doesn't seem
to be easy, since I'd like to have variable size array initializers which
set the bits depening on the symbolic name (e.g. set bits 19, 20 and 139
and automatically choose the correct size of the array):
..something like INIT_FACILITY_ARRAY(FAC19, FAC20, FAC139)

And of course this should work for asm code as well.

> Hmm, maybe we can find somebody that wants to increase the patch counter?

If you think this is trivial, please send a patch which does this.

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

* Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit
  2014-10-02  8:22       ` Heiko Carstens
@ 2014-10-02  8:47         ` Christian Borntraeger
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Borntraeger @ 2014-10-02  8:47 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Alexander Graf, Paolo Bonzini, KVM, Gleb Natapov, Cornelia Huck,
	Jens Freimann, linux-s390

Am 02.10.2014 10:22, schrieb Heiko Carstens:
> On Wed, Oct 01, 2014 at 08:27:38PM +0200, Christian Borntraeger wrote:
>> On 10/01/2014 04:17 PM, Alexander Graf wrote:
>>>
>>>
>>> On 01.10.14 16:02, Christian Borntraeger wrote:
>>>> There is nothing to do for KVM to support TOD-CLOCK steering.
>>>>
>>>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>>>> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
>>>> ---
>>>>  arch/s390/kvm/kvm-s390.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>>> index 56a411c..0d5aa88 100644
>>>> --- a/arch/s390/kvm/kvm-s390.c
>>>> +++ b/arch/s390/kvm/kvm-s390.c
>>>> @@ -1786,7 +1786,7 @@ static int __init kvm_s390_init(void)
>>>>  		return -ENOMEM;
>>>>  	}
>>>>  	memcpy(vfacilities, S390_lowcore.stfle_fac_list, 16);
>>>> -	vfacilities[0] &= 0xff82fff3f4fc2000UL;
>>>> +	vfacilities[0] &= 0xff82fffbf47c2000UL;
>>>
>>> Can we please convert this into something readable soon? :)
>>
>> It will be sooner when you send patches ;-)
>> The facility numbers are documented in the POP (chapter 4 last page) in
>> IBM notation (bit0 is the MSB)
>> It probably makes sense to do this for the non-KVM part as well. When you grep
>> for test_facility under arch/s390 there are lots of numerical value.
> 
> These numbers _are_ a wart and were the source of a couple of bugs e.g.
> in our ALS code already.
> However converting these bitfields to something readable doesn't seem
> to be easy, since I'd like to have variable size array initializers which
> set the bits depening on the symbolic name (e.g. set bits 19, 20 and 139
> and automatically choose the correct size of the array):
> ..something like INIT_FACILITY_ARRAY(FAC19, FAC20, FAC139)
> 
> And of course this should work for asm code as well.
> 
>> Hmm, maybe we can find somebody that wants to increase the patch counter?
> 
> If you think this is trivial, please send a patch which does this.
> 

Unfortunately its not.

Well a simple
#define KVM_FAC0 = FAC_N3 | FAC_ZARCH | .....
would probably trivial (but error prone). Doing it for the whole tree (including head.S) will be harder. 
Especially the initial design approach is not trivial (where to put macros, how they look like...). I think we would have to come up with a skeleton and then the replacements itself might be trivial. For KVM we probably want to
defer that until we have Michaels CPU model support ready, though.

Christian

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

* Re: [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next)
  2014-10-01 14:02 [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next) Christian Borntraeger
  2014-10-01 14:02 ` [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit Christian Borntraeger
  2014-10-01 14:02 ` [GIT PULL 2/2] KVM: s390: count vcpu wakeups in stat.halt_wakeup Christian Borntraeger
@ 2014-10-02 11:45 ` Paolo Bonzini
  2 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2014-10-02 11:45 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: KVM, Gleb Natapov, Alexander Graf, Cornelia Huck, Jens Freimann,
	linux-s390

Il 01/10/2014 16:02, Christian Borntraeger ha scritto:
>   git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git  tags/kvm-s390-next-20141001

Pulled, thanks.

Paolo

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

end of thread, other threads:[~2014-10-02 11:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 14:02 [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next) Christian Borntraeger
2014-10-01 14:02 ` [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit Christian Borntraeger
2014-10-01 14:17   ` Alexander Graf
2014-10-01 18:27     ` Christian Borntraeger
2014-10-02  8:22       ` Heiko Carstens
2014-10-02  8:47         ` Christian Borntraeger
2014-10-01 14:02 ` [GIT PULL 2/2] KVM: s390: count vcpu wakeups in stat.halt_wakeup Christian Borntraeger
2014-10-02 11:45 ` [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next) Paolo Bonzini

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.