From: Pierre Morel <pmorel@linux.ibm.com>
To: Janis Schoetterl-Glausch <scgl@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,
david@redhat.com, thuth@redhat.com, imbrenda@linux.ibm.com,
hca@linux.ibm.com, gor@linux.ibm.com, wintera@linux.ibm.com,
seiden@linux.ibm.com, nrb@linux.ibm.com
Subject: Re: [PATCH v11 2/3] KVM: s390: guest support for topology function
Date: Mon, 4 Jul 2022 15:54:10 +0200 [thread overview]
Message-ID: <cb9f48e6-172b-4498-4595-940c26e36f48@linux.ibm.com> (raw)
In-Reply-To: <038d7c59-0c9a-7667-cf74-83009e186b42@linux.ibm.com>
On 7/4/22 13:02, Pierre Morel wrote:
>
>
> On 7/4/22 11:08, Janis Schoetterl-Glausch wrote:
>> On 7/1/22 18:25, Pierre Morel wrote:
...
>>> + if (test_kvm_facility(vcpu->kvm, 11))
>>> + vcpu->arch.sie_block->ecb |= ECB_PTF;
>>> if (test_kvm_facility(vcpu->kvm, 73))
>>> vcpu->arch.sie_block->ecb |= ECB_TE;
>>> if (!kvm_is_ucontrol(vcpu->kvm))
>>> @@ -3403,6 +3437,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
>>> rc = kvm_s390_vcpu_setup(vcpu);
>>> if (rc)
>>> goto out_ucontrol_uninit;
>>> +
>>> + kvm_s390_update_topology_change_report(vcpu->kvm, 1);
>>> return 0;
>>> out_ucontrol_uninit:
>>> diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
>>> index 12c464c7cddf..046afee1be94 100644
>>> --- a/arch/s390/kvm/priv.c
>>> +++ b/arch/s390/kvm/priv.c
>>> @@ -873,10 +873,13 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
>>> if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
>>> return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
>>> - if (fc > 3) {
>>> - kvm_s390_set_psw_cc(vcpu, 3);
>>> - return 0;
>>> - }
>>> + /* Bailout forbidden function codes */
>>> + if (fc > 3 && (fc != 15 || kvm_s390_pv_cpu_is_protected(vcpu)))
>>> + goto out_no_data;
>>> +
>>> + /* fc 15 is provided with PTF/CPU topology support */
>>> + if (fc == 15 && !test_kvm_facility(vcpu->kvm, 11))
>>> + goto out_no_data;
>>> if (vcpu->run->s.regs.gprs[0] & 0x0fffff00
>>> || vcpu->run->s.regs.gprs[1] & 0xffff0000)
>>> @@ -910,6 +913,11 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
>>> goto out_no_data;
>>> handle_stsi_3_2_2(vcpu, (void *) mem);
>>> break;
>>> + case 15: /* fc 15 is fully handled in userspace */
>>> + if (vcpu->kvm->arch.user_stsi)
>>> + insert_stsi_usr_data(vcpu, operand2, ar, fc, sel1, sel2);
>>> + trace_kvm_s390_handle_stsi(vcpu, fc, sel1, sel2, operand2);
>>> + return -EREMOTE;
>>
>> This doesn't look right to me, you still return -EREMOTE if user_stsi
>> is false.
>> The way I read the PoP here is that it is ok to set condition code 3
>> for the else case
>
> Yes it is what I wanted to do.
> I do not understand what I did here is stupid.
I thought again on this as I explain in another thread, I do not think
we need to check on user_stsi here.
>
>
--
Pierre Morel
IBM Lab Boeblingen
next prev parent reply other threads:[~2022-07-04 13:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 16:25 [PATCH v11 0/3] s390x: KVM: CPU Topology Pierre Morel
2022-07-01 16:25 ` [PATCH v11 1/3] KVM: s390: Cleanup ipte lock access and SIIF facility checks Pierre Morel
2022-07-01 16:25 ` [PATCH v11 2/3] KVM: s390: guest support for topology function Pierre Morel
2022-07-04 8:46 ` Janosch Frank
2022-07-04 9:08 ` Janis Schoetterl-Glausch
2022-07-04 9:14 ` Janis Schoetterl-Glausch
2022-07-04 11:02 ` Pierre Morel
2022-07-04 11:17 ` Janosch Frank
2022-07-04 13:51 ` Pierre Morel
2022-07-04 13:54 ` Pierre Morel [this message]
2022-07-01 16:25 ` [PATCH v11 3/3] KVM: s390: resetting the Topology-Change-Report Pierre Morel
2022-07-04 9:35 ` Janis Schoetterl-Glausch
2022-07-04 13:56 ` Pierre Morel
2022-07-05 8:09 ` Janis Schoetterl-Glausch
2022-07-05 12:38 ` 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=cb9f48e6-172b-4498-4595-940c26e36f48@linux.ibm.com \
--to=pmorel@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@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=nrb@linux.ibm.com \
--cc=scgl@linux.ibm.com \
--cc=seiden@linux.ibm.com \
--cc=thuth@redhat.com \
--cc=wintera@linux.ibm.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