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

Re: [Xen-devel] [PATCH 2/2] x86/vmx: Drop enum handler_return



>>> On 06.12.17 at 21:06, <andrew.cooper3@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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