All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>, KVM <kvm@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	"Jason J. Herne" <jjherne@linux.vnet.ibm.com>
Subject: Re: [PATCH 05/11] KVM: s390: Support Configuration z/Architecture Mode
Date: Mon, 28 Aug 2017 16:24:05 +0200	[thread overview]
Message-ID: <c71d559e-a304-c6cd-3bbf-30fb7851d681@de.ibm.com> (raw)
In-Reply-To: <a73ff132-288f-3acc-3b4c-3369145b48cf@redhat.com>



On 08/28/2017 04:06 PM, David Hildenbrand wrote:
> On 28.08.2017 10:07, Christian Borntraeger wrote:
>> From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
>>
>> kvm has always supported the concept of starting in z/Arch mode so let's
>> reflect the feature bit to the guest.
>>
>> Also, we change sigp set architecture to reject any request to change
>> architecture modes.
> 
> Hm ... this seems to imply that CZAM is always set, but what about
> running on old user space (possibly on old hw)? Old QEMU will not enable
> CZAM.

3 cases.
1. very old QEMU without user sigp
2. old QEMU with user sigp/without CPU model
3. new QEMU with user sigp/cpu model

I think we agree that cases 2 and 3 should not matter at all for this kernel patch
as the sigp is handled by QEMU. 



This is case 1:
> And especially old user space will rely on SET ARCHITECTURE being
> handled in the kernel.


Yes, and it continues to be handled in the kernel. It is just that the guest
will now see a different sigp return code. Before, our sigp implementation lied
to the guest in a way that worked for Linux (we lied by saying "yes, we switched"). 
We now say "sorry, we are already in zarch mode, sigp ignored" which also works
perfectly fine for Linux. And IMHO it is even the better choice even without 
STFLE.138 being set as it matches what an old hardware would do when in zarch mode.


> 
> I agree, that for QEMU we can always do that change (as we control which
> features are indicated to the guest). But I am wondering if we would
> have to stick to existing behavior unless test_kvm_facility(vcpu->kvm, 138).
> 
>>
>> Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
>> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  arch/s390/kvm/sigp.c             | 36 +++++++++++++++++-------------------
>>  arch/s390/tools/gen_facilities.c |  1 +
>>  2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
>> index 1a252f5..11d3845 100644
>> --- a/arch/s390/kvm/sigp.c
>> +++ b/arch/s390/kvm/sigp.c
>> @@ -155,29 +155,26 @@ static int __sigp_stop_and_store_status(struct kvm_vcpu *vcpu,
>>  	return rc;
>>  }
>>  
> [...]
> 
>>  	}
>> -	return rc;
>> +
>> +	*status_reg &= 0xffffffff00000000ULL;
> 
> s/ULL/UL/


Right, will fix.

  reply	other threads:[~2017-08-28 14:24 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  8:07 [PATCH 00/11] KVM: s390: Fixes and features for 4.14 Christian Borntraeger
2017-08-28  8:07 ` [PATCH 05/11] KVM: s390: Support Configuration z/Architecture Mode Christian Borntraeger
2017-08-28  9:07   ` Cornelia Huck
2017-08-28  9:11     ` Christian Borntraeger
2017-08-28  9:14       ` Christian Borntraeger
2017-08-28 11:33       ` Cornelia Huck
2017-08-28 11:35   ` Cornelia Huck
2017-08-28 14:06   ` David Hildenbrand
2017-08-28 14:24     ` Christian Borntraeger [this message]
2017-08-28 14:38       ` David Hildenbrand
2017-08-28 14:42         ` Christian Borntraeger
2017-08-28 19:27   ` David Hildenbrand
2017-08-28 19:35     ` Christian Borntraeger
2017-08-28 19:38       ` Christian Borntraeger
2017-08-28 19:42         ` David Hildenbrand
2017-08-29  7:18           ` Christian Borntraeger
2017-08-29 12:08             ` David Hildenbrand
2017-08-29 12:21               ` Christian Borntraeger
2017-08-29 12:24                 ` David Hildenbrand
2017-08-29 14:31                 ` [PATCH] KVM: s390: we are always in czam mode David Hildenbrand
2017-08-29 14:40                   ` Cornelia Huck
2017-08-29 14:48                   ` Christian Borntraeger
2017-08-28 19:41       ` [PATCH 05/11] KVM: s390: Support Configuration z/Architecture Mode David Hildenbrand
2017-08-28  8:07 ` [PATCH 06/11] KVM: s390: Multiple Epoch Facility support Christian Borntraeger
2017-08-28 11:21   ` Cornelia Huck
2017-08-28 11:36     ` Christian Borntraeger
2017-08-28 11:45       ` Cornelia Huck
2017-08-29 12:24   ` David Hildenbrand
2017-08-29 12:46     ` Christian Borntraeger
2017-08-29 12:54       ` David Hildenbrand
2017-08-29 12:59       ` Christian Borntraeger
2017-08-28  8:07 ` [PATCH 10/11] KVM: s390: sthyi: remove invalid guest write access Christian Borntraeger
2017-08-28 11:39   ` Cornelia Huck
2017-08-28  8:07 ` [PATCH 11/11] KVM: s390: expose no-DAT to guest and migration support Christian Borntraeger
2017-08-28 12:12   ` Cornelia Huck
2017-08-28 12:17 ` [PATCH 00/11] KVM: s390: Fixes and features for 4.14 Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c71d559e-a304-c6cd-3bbf-30fb7851d681@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.