On 17/09/2019 07:15, Jan Beulich wrote:
> While bits 11 and below are, if not used for other purposes, reserved
> but ignored, bits beyond physical address width are supposed to raise
> exceptions (at least in the non-nested case; I'm not convinced the
> current nested SVM/VMX behavior of raising #GP(0) here is correct, but
> that's not the subject of this change).
>
> Introduce currd as a local variable, and replace other v->domain
> instances at the same time.
>
> Signed-off-by: Jan Beulich <jbeul...@suse.com>
> Reviewed-by: Roger Pau Monné <roger....@citrix.com>
> ---
> v2: Simplify the expressions used for the reserved bit checks.
>
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1004,6 +1004,13 @@ static int hvm_load_cpu_ctxt(struct doma
>          return -EINVAL;
>      }
>  
> +    if ( ctxt.cr3 >> d->arch.cpuid->extd.maxphysaddr )
> +    {
> +        printk(XENLOG_G_ERR "HVM%d restore: bad CR3 %#" PRIx64 "\n",
> +               d->domain_id, ctxt.cr3);
> +        return X86EMUL_EXCEPTION;

-EINVAL, surely?

Everything else LGTM (although I guess it depends on the previous
patch?) so with this fixed, Reviewed-by: Andrew Cooper
<andrew.coop...@citrix.com>

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

Reply via email to