From: David Hildenbrand <david@redhat.com>
To: Pierre Morel <pmorel@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
borntraeger@de.ibm.com, frankja@linux.ibm.com, cohuck@redhat.com,
thuth@redhat.com, imbrenda@linux.ibm.com, hca@linux.ibm.com,
gor@linux.ibm.com
Subject: Re: [PATCH v4 1/1] s390x: KVM: accept STSI for CPU topology information
Date: Thu, 16 Sep 2021 16:03:43 +0200 [thread overview]
Message-ID: <eef5ed95-3f54-b709-894d-cdf75bc3180b@redhat.com> (raw)
In-Reply-To: <1631799845-24860-2-git-send-email-pmorel@linux.ibm.com>
> struct kvm_vm_stat {
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 51d1594bd6cd..f3887e13c5db 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -608,6 +608,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> case KVM_CAP_S390_PROTECTED:
> r = is_prot_virt_host();
> break;
> + case KVM_CAP_S390_CPU_TOPOLOGY:
> + r = test_facility(11);
> + break;
> default:
> r = 0;
> }
> @@ -819,6 +822,19 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
> icpt_operexc_on_all_vcpus(kvm);
> r = 0;
> break;
> + case KVM_CAP_S390_CPU_TOPOLOGY:
As given in my example, this should be
r = -EINVAL;
mutex_lock(&kvm->lock);
if (kvm->created_vcpus) {
r = -EBUSY;
} else if (test_facility(11)) {
...
}
Similar to how we handle KVM_CAP_S390_VECTOR_REGISTERS.
[...]
> +
> + /* PTF needs both host and guest facilities to enable interpretation */
> + if (test_kvm_facility(vcpu->kvm, 11) && test_facility(11))
> + vcpu->arch.sie_block->ecb |= ECB_PTF;
This should be simplified to
if (test_kvm_facility(vcpu->kvm, 11))
then. (vsie code below is correct)
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2021-09-16 14:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-16 13:44 [PATCH v4 0/1] s390x: KVM: CPU Topology Pierre Morel
2021-09-16 13:44 ` [PATCH v4 1/1] s390x: KVM: accept STSI for CPU topology information Pierre Morel
2021-09-16 14:03 ` David Hildenbrand [this message]
2021-09-17 8:14 ` Pierre Morel
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=eef5ed95-3f54-b709-894d-cdf75bc3180b@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pmorel@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).