qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Halil Pasic <pasic@linux.vnet.ibm.com>,
	jjherne@linux.vnet.ibm.com,
	Marc Hartmayer <mhartmay@linux.vnet.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: libvir-list@redhat.com, Jiri Denemark <jdenemar@redhat.com>,
	Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org,
	Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH/QEMU] s390x/kvm: use cpu_model_available for guarded storage on compat machines
Date: Fri, 27 Oct 2017 14:42:57 +0200	[thread overview]
Message-ID: <b76b2832-8e14-43fe-ea9b-23e6bf330bf6@de.ibm.com> (raw)
In-Reply-To: <b40f75d4-2280-fc66-b92f-34717b51ed47@linux.vnet.ibm.com>



On 10/27/2017 02:31 PM, Halil Pasic wrote:
> 
> 
> On 10/25/2017 08:13 PM, Jason J. Herne wrote:
>> On 10/20/2017 10:54 AM, Christian Borntraeger wrote:
>>> Starting a guest with
>>>     <os>
>>>      <type arch='s390x' machine='s390-ccw-virtio-2.9'>hvm</type>
>>>    </os>
>>>    <cpu mode='host-model'/>
>>>
>>> on an IBM z14 results in
>>>
>>> "qemu-system-s390x: Some features requested in the CPU model are not
>>> available in the configuration: gs"
>>>
>>> This is because guarded storage is fenced for compat machines that did not have
>>> guarded storage support, but libvirt expands the cpu model according to the
>>> latest available machine.
>>>
>>> While this prevents future migration abort (by not starting the guest at all),
>>> not being able to start a "host-model" guest is very much unexpected.  As it
>>> turns out, even if we would modify libvirt to not expand the cpu model to
>>> contain "gs" for compat machines, it cannot guarantee that a migration will
>>> succeed. For example if the kernel changes its features (or the user has
>>> nested=1 on one host but not on the other) the migration will fail
>>> nevertheless.  So instead of fencing "gs" for machines <= 2.9 lets allow it for
>>> all machine types that support the CPU model. This will make "host-model"
>>> runnable all the time, while relying on the CPU model to reject invalid
>>> migration attempts.
>> ...
>>> -    if (gs_allowed()) {
>>> +    if (cpu_model_allowed()) {
>>>           if (kvm_vm_enable_cap(s, KVM_CAP_S390_GS, 0) == 0) {
>>>               cap_gs = 1;
> 
> 
> @Jason
> 
> Hi Jason,
> 
> I don't have access to a z14 at the moment, and since you do, I would
> like to try out something.
> 
> I will first describe my concern, and then the test scenario.
> 
> The last line above, cap_gs = 1, has the side effect of returning
> true ever after.
> 
> int kvm_s390_get_gs(void)                                                       
> {                                                                               
>     return cap_gs;                                                              
> }  
> 
> Now considering
> static bool gscb_needed(void *opaque)
> {
>     return kvm_s390_get_gs();
> }

Yes, we should also replace that with

 return s390_has_feat(S390_FEAT_GUARDED_STORAGE)

I can fixup my patch or provide a 2nd one.

  reply	other threads:[~2017-10-27 12:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 14:54 [Qemu-devel] [PATCH/QEMU] s390x/kvm: use cpu_model_available for guarded storage on compat machines Christian Borntraeger
2017-10-20 15:30 ` Christian Borntraeger
2017-10-25 10:18 ` Christian Borntraeger
2017-10-25 10:23   ` David Hildenbrand
2017-10-25 15:09     ` Boris Fiuczynski
2017-10-25 15:30       ` David Hildenbrand
2017-10-25 15:50       ` David Hildenbrand
2017-10-25 16:45         ` Marc Hartmayer
2017-10-26  8:09           ` David Hildenbrand
2017-10-27 10:16             ` Jiri Denemark
2017-10-25 18:13 ` Jason J. Herne
2017-10-27 12:31   ` Halil Pasic
2017-10-27 12:42     ` Christian Borntraeger [this message]
2017-10-27 13:31       ` Cornelia Huck
2017-10-27 13:47         ` Halil Pasic
2017-10-27 12:45     ` [Qemu-devel] [libvirt] " Christian Borntraeger
2017-10-27 12:57       ` Christian Borntraeger
2017-10-27 13:40         ` Halil Pasic
2017-10-27 14:06           ` Christian Borntraeger
2017-10-27 15:18             ` Halil Pasic
2017-10-27 17:12               ` Jiri Denemark
2017-10-27 18:01                 ` Halil Pasic
2017-10-25 23:35 ` [Qemu-devel] " Halil Pasic
2017-10-26  8:13   ` Christian Borntraeger
2017-10-26 10:43     ` Halil Pasic
2017-10-26  8:17 ` 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=b76b2832-8e14-43fe-ea9b-23e6bf330bf6@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=fiuczy@linux.vnet.ibm.com \
    --cc=jdenemar@redhat.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=libvir-list@redhat.com \
    --cc=mhartmay@linux.vnet.ibm.com \
    --cc=mihajlov@linux.vnet.ibm.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).