kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>,
	Collin Walling <walling@linux.ibm.com>,
	kvm@vger.kernel.org
Cc: david@redhat.com, thuth@redhat.com, cohuck@redhat.com
Subject: Re: [PATCH v2 1/2] s390/kvm: fix diag318 reset
Date: Fri, 16 Oct 2020 09:44:56 +0200	[thread overview]
Message-ID: <246ad72a-a081-d25a-33fd-843edaeb9248@de.ibm.com> (raw)
In-Reply-To: <eb8dc053-d8e6-7ef4-e722-101ab3135266@linux.ibm.com>



On 16.10.20 09:34, Janosch Frank wrote:
> On 10/15/20 9:59 PM, Collin Walling wrote:
>> The DIAGNOSE 0x0318 instruction must be reset on a normal and clear
>> reset. However, this was missed for the clear reset case.
>>
>> Let's fix this by resetting the information during a normal reset. 
>> Since clear reset is a superset of normal reset, the info will
>> still reset on a clear reset.
> 
> The architecture really confuses me here but I think we don't want this
> in the kernel VCPU reset handlers at all.
> 
> This needs to be reset per VM *NOT* per VCPU.
> Hence the resets are bound to diag308 and not SIGP.
> 
> I.e. we need to clear it in QEMU's VM reset handler.
> It's still early and I have yet to consume my first coffee, am I missing
> something?

I agree with Janosch. architecture indicates that this should only be reset
for VM-wide resets, e.g. sigp orders 11 and 12 are explicitly mentioned
to NOT reset the value.

> 
>>
>> Signed-off-by: Collin Walling <walling@linux.ibm.com>
>> ---
>>  arch/s390/kvm/kvm-s390.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index 6b74b92c1a58..b0cf8367e261 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -3516,6 +3516,7 @@ static void kvm_arch_vcpu_ioctl_normal_reset(struct kvm_vcpu *vcpu)
>>  	vcpu->arch.sie_block->gpsw.mask &= ~PSW_MASK_RI;
>>  	vcpu->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID;
>>  	memset(vcpu->run->s.regs.riccb, 0, sizeof(vcpu->run->s.regs.riccb));
>> +	vcpu->run->s.regs.diag318 = 0;
>>  
>>  	kvm_clear_async_pf_completion_queue(vcpu);
>>  	if (!kvm_s390_user_cpu_state_ctrl(vcpu->kvm))
>> @@ -3582,7 +3583,6 @@ static void kvm_arch_vcpu_ioctl_clear_reset(struct kvm_vcpu *vcpu)
>>  
>>  	regs->etoken = 0;
>>  	regs->etoken_extension = 0;
>> -	regs->diag318 = 0;
>>  }
>>  
>>  int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
>>
> 
> 

  reply	other threads:[~2020-10-16  7:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 19:59 [PATCH v2 0/2] DIAG 318 tests and fix Collin Walling
2020-10-15 19:59 ` [PATCH v2 1/2] s390/kvm: fix diag318 reset Collin Walling
2020-10-16  7:34   ` Janosch Frank
2020-10-16  7:44     ` Christian Borntraeger [this message]
2020-10-22 13:43       ` Collin Walling
2020-10-23  7:25         ` Janosch Frank
2020-10-28  6:06           ` Collin Walling
2020-10-28  8:23             ` Janosch Frank
2020-10-15 19:59 ` [PATCH v2 2/2] self_tests/kvm: sync_regs and reset tests for diag318 Collin Walling

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=246ad72a-a081-d25a-33fd-843edaeb9248@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=thuth@redhat.com \
    --cc=walling@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;
as well as URLs for NNTP newsgroup(s).