xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Igor Druzhinin" <igor.druzhinin@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/hvm: Propagate real error information up through hvm_load()
Date: Mon, 19 Jul 2021 14:46:54 +0200	[thread overview]
Message-ID: <2b12abb9-4fde-f21a-e763-38de14847e3b@suse.com> (raw)
In-Reply-To: <20210719111449.21337-1-andrew.cooper3@citrix.com>

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@suse.com>

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

Jan



  reply	other threads:[~2021-07-19 12:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 11:14 [PATCH] x86/hvm: Propagate real error information up through hvm_load() Andrew Cooper
2021-07-19 12:46 ` Jan Beulich [this message]
2021-07-19 12:56   ` Andrew Cooper
2021-07-19 13:22   ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b12abb9-4fde-f21a-e763-38de14847e3b@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=igor.druzhinin@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).