qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Matthew Rosato <mjrosato@linux.ibm.com>, qemu-s390x@nongnu.org
Cc: alex.williamson@redhat.com, schnelle@linux.ibm.com,
	cohuck@redhat.com, thuth@redhat.com, farman@linux.ibm.com,
	pmorel@linux.ibm.com, richard.henderson@linaro.org,
	pasic@linux.ibm.com, borntraeger@linux.ibm.com, mst@redhat.com,
	pbonzini@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [PATCH v6 2/8] target/s390x: add zpci-interp to cpu models
Date: Thu, 2 Jun 2022 10:58:18 +0200	[thread overview]
Message-ID: <0fec9818-bce1-936c-3f6d-488715d9df8c@redhat.com> (raw)
In-Reply-To: <535b79a5-372d-9bca-d7c7-bac263277230@linux.ibm.com>

>> That's exactly my point:
>>
>> sigpif and pfmfi are actually vsie features. I'd have expected that
>> zpcii would be a vsie feature as well.
>>
>> If interpretation is really more an implementation detail in the
>> hypervisor to implement zpci, than an actual guest feature (meaning, the
>> guest is able to observe it as if it were a real CPU feature), then we
>> most probably want some other way to toggle it (maybe via the machine?).
>>
>> Example: KVM uses SIGP interpretation based on availability. However, we
>> don't toggle it via sigpif. sigpif actually tells the guest that it can
>> use the SIGP interpretation facility along with vsie.
>>
>> You mention "CLP instructions will look different", I'm not sure if that
>> should actually be handled via the CPU model. From my gut feeling, zpcii
>> should actually be the vsie zpcii support to be implemented in the future.
>>
> 
> Well, what I meant was that the CLP response data looks different, 
> primarily because when interpretation is enabled the guest would get 
> passthrough of the function handle (which in turn has bits turned off 
> that force hypervisor intercepts) rather than one that QEMU fabricated.

Okay, so more some kind of "the device behaves seems to behave slightly
different".

> 
> As far as a machine option, well we still need a mechanism by which 
> userspace can decide whether it's OK to enable interpretation in the 
> first place.  I guess we can take advantage of the fact that the 
> capability associated with the ioctl interface can indicate both that 
> the kernel interface is available + all of the necessary hardware 
> facilities are available to that host kernel.

Yes.

> 
> So I guess we could use that to make a decision to default a machine 
> setting based upon that (yes if everything is available, no if not).

Right, in theory we could enable interpretation whenever possible
(kernel indicates support, including HW support).

In practice, it would be nice to be able to disable zpci interpretation
for debugging purposes.

One option is to simply glue it to compat machines. So selecting an
older compat machine will disable it.

Another option is a e.g., machine property, which can be used to
force-disable it (e.g., zpcii-disabled) and let the property always
default to false.

Third option would simply combine both, making compat machines make
zpcii-disable result in "true".

> 
>>
>> So I wonder if we could simply always enable zPCI interpretation if
>> HW+kernel support is around and we're on a new compat machine? I there
>> is a way that migration could break (from old kernel to new kernel),
>> we'd have to think about alternatives.
> 
> zpci devices are currently marked unmigratable, so if you want to 
> migrate you need to detach all of them first anyway today.

Okay. So it might be reasonable in the future to simply check on source
and migration if zpcii is in the same state if zpci devices are attached
to the VM. If not, simply fail migration -- in sane enironments, we'd
never get a mismatch.

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2022-06-02  9:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 19:02 [PATCH v6 0/8] s390x/pci: zPCI interpretation support Matthew Rosato
2022-05-24 19:02 ` [PATCH v6 1/8] Update linux headers Matthew Rosato
2022-05-24 19:02 ` [PATCH v6 2/8] target/s390x: add zpci-interp to cpu models Matthew Rosato
2022-06-01  9:52   ` David Hildenbrand
2022-06-01 13:48     ` Matthew Rosato
2022-06-01 14:10       ` David Hildenbrand
2022-06-01 15:11         ` Matthew Rosato
2022-06-02  8:58           ` David Hildenbrand [this message]
2022-05-24 19:03 ` [PATCH v6 3/8] s390x/pci: add routine to get host function handle from CLP info Matthew Rosato
2022-05-24 19:03 ` [PATCH v6 4/8] s390x/pci: enable for load/store intepretation Matthew Rosato
2022-05-24 19:03 ` [PATCH v6 5/8] s390x/pci: don't fence interpreted devices without MSI-X Matthew Rosato
2022-05-24 19:03 ` [PATCH v6 6/8] s390x/pci: enable adapter event notification for interpreted devices Matthew Rosato
2022-05-24 19:03 ` [PATCH v6 7/8] s390x/pci: let intercept devices have separate PCI groups Matthew Rosato
2022-05-24 19:03 ` [PATCH v6 8/8] s390x/pci: reflect proper maxstbl for groups of interpreted devices Matthew Rosato

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=0fec9818-bce1-936c-3f6d-488715d9df8c@redhat.com \
    --to=david@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=schnelle@linux.ibm.com \
    --cc=thuth@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 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).