[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 03/18] s390x: protvirt: Support unpack facility
From: |
David Hildenbrand |
Subject: |
Re: [PATCH v6 03/18] s390x: protvirt: Support unpack facility |
Date: |
Thu, 5 Mar 2020 15:23:01 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 05.03.20 15:20, Janosch Frank wrote:
> On 3/5/20 3:15 PM, David Hildenbrand wrote:
>>>>>
>>>>> +static void s390_machine_unprotect(S390CcwMachineState *ms)
>>>>> +{
>>>>> + CPUState *t;
>>>>> +
>>>>> + if (!ms->pv)
>>>>> + return;
>>>>
>>>> How can this ever happen? g_assert(ms->pv) ?
>>>
>>> Currently not, that's only used in the follow up patches with the ballon
>>> and migration blocker
>>
>> Even then, why should we unprotect when not protected. That looks wrong
>> to me and has to be fixed in the other patches,
>
> I fixed it this morning :)
>
>>
>>>
>>>>
>>>> Also, i don't see this function getting called from anywhere else except
>>>> when s390_machine_protect() fails. That looks wrong. This has to be
>>>> called when going out of PV mode.
>>>
>>> Yes, but that's in the diag308 1-4 patch.
>>
>> The way patches were split up is somewhat sub-optimal for review.
>
> Thanks
> I'll try to find a better split up of the code
>
>>
>> [...]
>>
>>>>> + break;
>>>>> + case S390_RESET_PV: /* Subcode 10 */
>>>>> + subsystem_reset();
>>>>> + s390_crypto_reset();
>>>>> +
>>>>> + CPU_FOREACH(t) {
>>>>> + if (t == cs) {
>>>>> + continue;
>>>>> + }
>>>>> + run_on_cpu(t, s390_do_cpu_full_reset, RUN_ON_CPU_NULL);
>>>>> + }
>>>>> + run_on_cpu(cs, s390_do_cpu_reset, RUN_ON_CPU_NULL);
>>>>> +
>>>>> + if (s390_machine_protect(ms)) {
>>>>> + s390_machine_inject_pv_error(cs);
>>>>
>>>> Ah, so it's not an actual exception. BUT: All other guest cpus were
>>>> reset, can the guest deal with that?
>>>
>>> Well, all other CPUs should be stopped for diag308, no?
>>> Also it's done by the bootloader and not a OS which just stops its cpus
>>> and goes into protected mode.
>>>
>>>>
>>>> (run_on_cpu(cs, s390_do_cpu_reset, RUN_ON_CPU_NULL) should go after the
>>>> s390_machine_protect() I assume - the change you had in the other patch)
>>>
>>> That's not a good idea, I want to reset before we automatically call the
>>> UV routines on a reset.
>>
>> But how can s390_machine_inject_pv_error(cs) be any effective if you
>> already reset the CPU?
>>
>
> Because a normal cpu reset does not clear out the registers.
Okay, so a guest (e.g., Linux) can deal with some other things getting
reset I assume?
--
Thanks,
David / dhildenb
Re: [PATCH v6 03/18] s390x: protvirt: Support unpack facility, David Hildenbrand, 2020/03/05
Re: [PATCH v6 03/18] s390x: protvirt: Support unpack facility, Christian Borntraeger, 2020/03/06
[PATCH v6 06/18] s390x: protvirt: Inhibit balloon when switching to protected mode, Janosch Frank, 2020/03/04
[PATCH v6 07/18] s390x: protvirt: KVM intercept changes, Janosch Frank, 2020/03/04
[PATCH v6 05/18] s390x: protvirt: Handle diag 308 subcodes 0,1,3,4, Janosch Frank, 2020/03/04
[PATCH v6 08/18] s390x: Add SIDA memory ops, Janosch Frank, 2020/03/04