[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a8f0c2f2-6e4c-3a06-0f89-aea3fcc0b985@linux.ibm.com>
Date: Thu, 9 Aug 2018 09:33:06 +0200
From: Pierre Morel <pmorel@...ux.ibm.com>
To: Janosch Frank <frankja@...ux.ibm.com>,
Tony Krowiak <akrowiak@...ux.vnet.ibm.com>,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: freude@...ibm.com, schwidefsky@...ibm.com,
heiko.carstens@...ibm.com, borntraeger@...ibm.com,
cohuck@...hat.com, kwankhede@...dia.com,
bjsdjshi@...ux.vnet.ibm.com, pbonzini@...hat.com,
alex.williamson@...hat.com, pmorel@...ux.vnet.ibm.com,
alifm@...ux.vnet.ibm.com, mjrosato@...ux.vnet.ibm.com,
jjherne@...ux.vnet.ibm.com, thuth@...hat.com,
pasic@...ux.vnet.ibm.com, berrange@...hat.com,
fiuczy@...ux.vnet.ibm.com, buendgen@...ibm.com
Subject: Re: [PATCH v8 20/22] KVM: s390: Handling of Cypto control block in
VSIE
On 09/08/2018 08:20, Janosch Frank wrote:
> On 08.08.2018 16:44, Tony Krowiak wrote:
>> From: Pierre Morel <pmorel@...ux.ibm.com>
>> +#define ECA_APIE 0x00000008
> That shouldn't be necessary, it's defined in kvm_host.h which vsie.c
> includes. Or is it not?
This was forgotten here for a long long time!
You are right I remove it.
>
>> +static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
>> +{
>> + struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
>> + struct kvm_s390_sie_block *scb_o = vsie_page->scb_o;
>> + const uint32_t crycbd_o = READ_ONCE(scb_o->crycbd);
>> + const u32 crycb_addr = crycbd_o & 0x7ffffff8U;
>> + int g2_fmt = vcpu->arch.sie_block->crycbd & CRYCB_FORMAT_MASK;
>> + int g3_fmt = crycbd_o & CRYCB_FORMAT_MASK;
>> + int g2_apie, g2_msa3, g3_apie, g3_msa3;
>> + int size, ret;
>> +
>> + /* crycb should not cross a page boundary */
>> + size = (g3_fmt == CRYCB_FORMAT2) ? 0x100 : 0x80;
>> + if ((crycb_addr & PAGE_MASK) != ((crycb_addr + size) & PAGE_MASK))
>> + return set_validity_icpt(scb_s, 0x003CU);
>> +
>> + g2_apie = vcpu->arch.sie_block->eca & ECA_APIE;
>> + g3_apie = scb_o->eca & g2_apie;
>> +
>> + g2_msa3 = test_kvm_facility(vcpu->kvm, 76);
>> + g3_msa3 = (g3_fmt != CRYCB_FORMAT0) & g2_msa3;
>> +
>> + scb_s->crycbd = 0;
>> + /* If no AP instructions and no keys we just set crycbd to 0 */
>> + if (!(g3_apie || g3_msa3))
>> + return 0;
>> +
>> + if (!crycb_addr)
>> + return set_validity_icpt(scb_s, 0x0039U);
>> +
>> + if (g3_apie) {
>> + ret = copy_apcb(vcpu, vsie_page, g2_fmt, g3_fmt);
>> + if (ret)
>> + goto out;
> s/goto out;/return ret;/
better
Thanks
Pierre
--
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
Powered by blists - more mailing lists