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

Re: [Xen-devel] [PATCH] xen: handle paged gfn in wrmsr_hypervisor_regs



>>> On 02.05.13 at 18:24, Olaf Hering <olaf@xxxxxxxxx> wrote:
> @@ -1682,14 +1682,15 @@ static int svm_msr_write_intercept(unsig
>          if ( wrmsr_viridian_regs(msr, msr_content) )
>              break;
>  
> -        wrmsr_hypervisor_regs(msr, msr_content);
> +        ret = wrmsr_hypervisor_regs(msr, msr_content);
> +        retry = ret == -EAGAIN;

If you add error handling, don't constrain this to a single error code
please. For the case here, the easiest would appear to be a switch
converting to X86EMUL_OKAY, X86EMUL_RETRY, or
X86EMUL_UNHANDLEABLE. If the function had ways to fail before,
it would have been a bug anyway to not check the return value.

> @@ -2088,7 +2089,9 @@ static int vmx_msr_write_intercept(unsig
>              case HNDL_unhandled:
>                  if ( (vmx_write_guest_msr(msr, msr_content) != 0) &&
>                       !is_last_branch_msr(msr) )
> -                    wrmsr_hypervisor_regs(msr, msr_content);
> +                    ret = wrmsr_hypervisor_regs(msr, msr_content);
> +                    if ( ret == -EAGAIN )
> +                        return X86EMUL_RETRY;

Similarly here, obviously.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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