Re: [PATCH 1/2] s390x: uv: Add destroy page call

Janosch Frank
2020-09-04T11:39:01Z

[-- Attachment #1.1: Type: text/plain, Size: 1315 bytes --]

On 9/4/20 12:39 PM, Heiko Carstens wrote:
> On Thu, Sep 03, 2020 at 09:14:34AM -0400, Janosch Frank wrote:
>> +int uv_destroy_page(unsigned long paddr)
>> +{
>> + struct uv_cb_cfs uvcb = {
>> + .header.cmd = UVC_CMD_DESTR_SEC_STOR,
>> + .header.len = sizeof(uvcb),
>> + .paddr = paddr
>> + };
>> +
>> + if (uv_call(0, (u64)&uvcb))
>> + return -EINVAL;
>> + return 0;
>> +}
>> +
>> +

I need to remove one of those \n

>> /*
>> * Requests the Ultravisor to encrypt a guest page and make it
>> * accessible to the host for paging (export).
>> diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
>> index 373542ca1113..cfb0017f33a7 100644
>> --- a/arch/s390/mm/gmap.c
>> +++ b/arch/s390/mm/gmap.c
>> @@ -2679,7 +2679,7 @@ static int __s390_reset_acc(pte_t *ptep, unsigned long addr,
>> pte_t pte = READ_ONCE(*ptep);
>>
>> if (pte_present(pte))
>> - WARN_ON_ONCE(uv_convert_from_secure(pte_val(pte) & PAGE_MASK));
>> + WARN_ON_ONCE(uv_destroy_page(pte_val(pte) & PAGE_MASK));
>
> Why not put the WARN_ON_ONCE() into uv_destroy_page() and make that
> function return void?
>
If you prefer that, I'll change the patch.

I think we'd need a proper print of the return codes of the UVC anyway,
the warn isn't very helpful if you want to debug after the fact.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]