[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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 19 Jul 2021 14:46:54 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=yejCnSlCvMuRZqL24NmBaM2ZtEnrJ3V7NRIpXFIVvFM=; b=e4TTIOVAtPmw2WE0ocs6r8OmNuqSTFkrN7eDJZF53215bXcyCkBw8gAW/Q050OVAQ/GyIq4NyaRNNTeLez7p0+CB54RP7TDgl+ngX1Qg0VSlMxoRf2hmsJMPJxJ8wkl82I/QvMNscTbTffF398r3qvtpi1Khqauw3NWwUFXWzyuhasvIxhc/yItjSctivSYe4Mj4eVBMCJsbnRXwTcrzbY9nVmsXohnLfITvQ8nxgj0l9O8iXnHDk8nF2nUBUs+R0d3WRgCYKdsqA8V2PQ366qB9QCxxNr5Dvnw8lwrYF5MRZ+OexUJ8ZxdsjcSiV3alx6l6n++Kc8F23r/oEVxSqw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rcj9tPcXcuBDJ8bu1uvXvN58t76haV64wjqicereqgugfpHWZf+LfMg80eWaZ1cWFpyFPMcqv014jqXQ6401DtAsmZCEiopRt5A7td9Ubo5iTnIM6qvIgHQrWhI9MrczF7s0Ye1divLXAMZhtvXuT7XTsE87z1z5UdR+NXwf1zaeTrjUie6a4o3nNYkJraTc6wWAkT02TBaMx8epdVYJZujw59JHg5q/U8tCXNHjxli4uAqrOwdOv6wKNHZ9X50Gh0jIj3Rv/e1VMwJf1Phrwh3Eq1FnWfU4q5VXW+9Tshsy/aLyKMvJAbuFymV5ZPJO87/JPChPmdkoenQaiyTdOg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 19 Jul 2021 12:47:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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? Preferably with the adjustment
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

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

Jan




 


Rackspace

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