All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/2] x86/vmx: Drop enum handler_return
Date: Thu, 07 Dec 2017 03:23:10 -0700	[thread overview]
Message-ID: <5A29249E020000780019568B@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1512590788-16808-2-git-send-email-andrew.cooper3@citrix.com>

>>> On 06.12.17 at 21:06, <andrew.cooper3@citrix.com> wrote:
> @@ -2937,12 +2933,12 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
>              goto done;
>          switch ( long_mode_do_msr_read(msr, msr_content) )
>          {
> -            case HNDL_unhandled:
> -                break;
> -            case HNDL_exception_raised:
> -                return X86EMUL_EXCEPTION;
> -            case HNDL_done:
> -                goto done;
> +        case X86EMUL_UNHANDLEABLE:
> +            break;
> +        case X86EMUL_EXCEPTION:
> +            return X86EMUL_EXCEPTION;
> +        case X86EMUL_OKAY:
> +            goto done;
>          }

This not being an exhaustive enumeration of all X86EMUL_* values
I don't see the point in the X86EMUL_UNHANDLEABLE case label.

> @@ -3161,24 +3157,24 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
>  
>          switch ( long_mode_do_msr_write(msr, msr_content) )
>          {
> -            case HNDL_unhandled:
> -                if ( (vmx_write_guest_msr(msr, msr_content) != 0) &&
> -                     !is_last_branch_msr(msr) )
> -                    switch ( wrmsr_hypervisor_regs(msr, msr_content) )
> -                    {
> -                    case -ERESTART:
> -                        return X86EMUL_RETRY;
> -                    case 0:
> -                    case 1:
> -                        break;
> -                    default:
> -                        goto gp_fault;
> -                    }
> -                break;
> -            case HNDL_exception_raised:
> -                return X86EMUL_EXCEPTION;
> -            case HNDL_done:
> -                break;
> +        case X86EMUL_UNHANDLEABLE:
> +            if ( (vmx_write_guest_msr(msr, msr_content) != 0) &&
> +                 !is_last_branch_msr(msr) )
> +                switch ( wrmsr_hypervisor_regs(msr, msr_content) )
> +                {
> +                case -ERESTART:
> +                    return X86EMUL_RETRY;
> +                case 0:
> +                case 1:
> +                    break;
> +                default:
> +                    goto gp_fault;
> +                }
> +            break;
> +        case X86EMUL_EXCEPTION:
> +            return X86EMUL_EXCEPTION;
> +        case X86EMUL_OKAY:
> +            break;
>          }

Same here for the X86EMUL_OKAY one, except the question is
whether there wouldn't better be a default invoking
ASSERT_UNREACHABLE().

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2017-12-07 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 20:06 [PATCH 1/2] x86/vmx: Don't use hvm_inject_hw_exception() in long_mode_do_msr_write() Andrew Cooper
2017-12-06 20:06 ` [PATCH 2/2] x86/vmx: Drop enum handler_return Andrew Cooper
2017-12-07 10:23   ` Jan Beulich [this message]
2017-12-13  8:09   ` Tian, Kevin
2017-12-07 10:19 ` [PATCH 1/2] x86/vmx: Don't use hvm_inject_hw_exception() in long_mode_do_msr_write() Jan Beulich
2017-12-13  8:08 ` Tian, Kevin

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=5A29249E020000780019568B@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.