On 12/10/18 16:27, Sergey Dyasli wrote:
> diff --git a/xen/include/asm-x86/hvm/nestedhvm.h
> b/xen/include/asm-x86/hvm/nestedhvm.h
> index 9d1c2742b5..e09fa9d47d 100644
> --- a/xen/include/asm-x86/hvm/nestedhvm.h
> +++ b/xen/include/asm-x86/hvm/nestedhvm.h
> @@ -92,4 +92,9 @@ static inline void nestedhvm_set_cr(struct vcpu *v,
> unsigned int cr,
> v->arch.hvm.nvcpu.guest_cr[cr] = value;
> }
>
> +static inline bool vvmcx_valid(const struct vcpu *v)
> +{
> + return vcpu_nestedhvm(v).nv_vvmcxaddr != INVALID_PADDR;
> +}
> +
Now that XSA-278 is public, I can explain why this predicate is a little
broken.
nv_vvmcxaddr doesn't get initialised until HVM_PARAM_NESTED_VIRT is set
to 1.
As with c/s 18cef4df8, please adjust the vcpu construction path to make
this predicate unconditionally safe to use.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel