[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/hvm: Propagate real error information up through hvm_load()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 19 Jul 2021 13:56:16 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5TQcZZGfdxXFd9mUeIoVz1FJtc3s6ePMUdIdij2JFNI=; b=A7C642ey9FSsabWQz8OAQdSdcJ1cmJC2njljiyHIizds90so6bkna8Tr0v79rqo9qqn19U1r/SMuXAXQbYVgUCojc1oSTcCW0FZhwD7bjnbK1978MbykbYomo/Tkw4ivsNPsjdtuJjCNdyyfhn5VKVwcsdzWvbbYsCCP3ofDzSdkZHPqD/i0xCf0pbpDyxI326B9fmWmRvj0zGVDLD6CVYA4vwO72WoV8JKuOWJ9POSoJT1x+0H8g3rRm9k0B9aygr3AEm43RXvzcWjvZC3NRH92b77vDz0D7u1D1v+UwaV36WeusFKjFqdr7ETo7jev2XHKE0sfCSBjEl9QzbM8UQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+CdO/L8cSytjH4qFGmo4+LStJxpj4yx5YYKhEhKHcHs37q0Xx9H5Kk0F2pNCch+t+qj7thZaHWOhfumKtdt8EwZtVz7laxRzQyWqhz8Ix31L2vkyTPLueY64NLayJ2N4P0LJYbLt9QzClsSzj6nLolGA31Gp27JO4YedErQEakedykKbGMEtl+Uq9n3rmKnLn/NF9mpGMAd4Yu0GJ7gYS/ZeyE93nZeSydaAukWcuwAlkG5D09Ojl3U8h97Bc8v+cascMmNP4l4rvwgItXKRlc/RSpRFOqTG+Wky7VD8l17ZuBGIVYx8oGzRmRZM3BXJ5e5U5EBNqB2W91GnqF2rA==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 20 Jul 2021 14:48:18 +0000
  • Ironport-hdrordr: A9a23:Kg2Z4qysbBU631mKmGNTKrPxrOskLtp133Aq2lEZdPULSKKlfp GV88jziyWZtN9wYhEdcdDpAtjmfZquz+8K3WB3B8bcYOCGghrVEGgG1+rfKlLbalbDH4JmpN 5dmu1FeaDN5DtB/LXHCWuDYq4dKbC8mcjC74qurAYOPHRXguNbnmFE426gYz1LrWJ9dP8E/f Snl656TnabCA4qhpPRPAh1YwGPnayEqLvWJTo9QzI34giHij2lrJb8Dhijxx8bFxdC260r/2 TpmxHwovzLiYD69jbsk0voq7hGktrozdVOQOSKl8guMz3pziKlfp5oVbGutC085Muv9FEput /RpApIBbUz11rhOkWO5Tf90Qjp1zgjr1fk1F+jmHPm5ff0QTorYvAxyL5xQ1/80Q4Nrdt82K VE0yayrJxMFy7Nmyz7+pzhSwxqvlDcmwtmrccjy1hkFacOYr5YqoISuGlPFo0bIS784Ic7VM FzEcDn4upMe1/yVQGagoBW+q3qYp0PJGbBfqBb0fbligS+3UoJjHfw/fZv2kvpr/kGOsF5D4 2uCNUbqFlMJvVmJ56VSt1xGvdepwT2MFvx2VmpUCPa/Zc8SjnwQq7MkcEIDd6RCeo1JbsJ6d j8uQBjxCEPk3yHM7zH4HQMyGGWfFmA
  • Ironport-sdr: Bfnqmtyzjrs7Z/2J6HdqBso8JYnmcqv1yIuBmc+YyiDw6UY7fLGinNNMp0Emw993Eg0sG6k4PG BMKEZo6CJY9jqwHy+BcFdaetlr3GZApUlb6mzP5EqzwUB0+Kcg3rN+Eqbx460Jmg9k+iYCkLU1 TvIUXmchR/maSnKhBW+fcB0AT8QW2U4/KAnk55X1AtegLLdRP1uWXCKIXCkOFOY7tw78jp8F4O 2AHS4cUaclAgx9LHdkXNOPsTpGN8Ax17miIO9DudTCnAtUhyJK16SaRgBrlc0xFT9QoQ5asnOx z5bKTPCt3L6nh4uOJpR20lA0
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/07/2021 13:46, Jan Beulich wrote:
> On 19.07.2021 13:14, Andrew Cooper wrote:
>> hvm_load() is currently a mix of -errno and -1 style error handling, which
>> aliases -EPERM.  This leads to the following confusing diagnostics:
>>
>> From userspace:
>>   xc: info: Restoring domain
>>   xc: error: Unable to restore HVM context (1 = Operation not permitted): 
>> Internal error
>>   xc: error: Restore failed (1 = Operation not permitted): Internal error
>>   xc_domain_restore: [1] Restore failed (1 = Operation not permitted)
>>
>> From Xen:
>>   (XEN) HVM10.0 restore: inconsistent xsave state (feat=0x2ff accum=0x21f 
>> xcr0=0x7 bv=0x3 err=-22)
>>   (XEN) HVM10 restore: failed to load entry 16/0
>>
>> The actual error was a bad backport, but the -EINVAL got converted to -EPERM
>> on the way out of the hypercall.
>>
>> The overwhelming majority of *_load() handlers already use -errno 
>> consistenty.
>> Fix up the rest to be consistent, and fix a few other errors noticed along 
>> the
>> way.
>>
>>  * Failures of hvm_load_entry() indicate a truncated record or other bad data
>>    size.  Use -ENODATA.
> But then ...
>
>> @@ -421,8 +421,8 @@ static int pit_load(struct domain *d, 
>> hvm_domain_context_t *h)
>>  
>>      if ( hvm_load_entry(PIT, h, &pit->hw) )
>>      {
>> -        spin_unlock(&pit->lock);
>> -        return 1;
>> +        rc = -ENODEV;
>> +        goto out;
>>      }
> ... use -ENODATA here as well?

Hmm - that was intended to be ENODATA.  Will fix.

>  Preferably with the adjustment
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks,

> I'll pick this up for backporting once I see it in the tree.

I don't know how much the call tree has changed over time.  Every
handler will need a quick check on each release.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.