xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: andrew.cooper3@citrix.com, sherry.hurwitz@amd.com,
	Wei Liu <wei.liu2@citrix.com>,
	jbeulich@suse.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] xen/HVM: Add guarding logic for VMX specific code
Date: Mon, 29 Aug 2016 10:36:42 -0400	[thread overview]
Message-ID: <20160829143641.GF27665@char.us.oracle.com> (raw)
In-Reply-To: <1472472083-2300-1-git-send-email-suravee.suthikulpanit@amd.com>

On Mon, Aug 29, 2016 at 07:01:23AM -0500, Suravee Suthikulpanit wrote:
> The struct hvm_domain.vmx is defined in a union along with the svm.
> This can causes issue for SVM since this code is used in the common

You scared me with the 'can causes'!

Digging in the pahole output - it It can't cause any issues right now
as the 'struct svm_domain' is zero size (so no AMD code making changes)
so the value at offset 16 is always zero (alloc_domain_struct clears it).

> scheduling code for x86. The logic must check for cpu_has_vmx before
> accessing the hvm_domain.vmx sturcture.

structure.

> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> ---
> Note: I ran into an issue while working on the upcoming patch series for
> AMD Advance Virtual Interrupt Controller patch series, which will use
> the hvm_domain.svm structure.
> 
>  xen/include/asm-x86/hvm/hvm.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
> index 314881a..5d463e0 100644
> --- a/xen/include/asm-x86/hvm/hvm.h
> +++ b/xen/include/asm-x86/hvm/hvm.h
> @@ -611,7 +611,7 @@ unsigned long hvm_cr4_guest_reserved_bits(const struct vcpu *v, bool_t restore);
>      struct vcpu *v_ = (v);                                      \
>      struct domain *d_ = v_->domain;                             \
>      if ( has_hvm_container_domain(d_) &&                        \
> -         d_->arch.hvm_domain.vmx.vcpu_block )                   \
> +         (cpu_has_vmx && d_->arch.hvm_domain.vmx.vcpu_block) )  \
>          d_->arch.hvm_domain.vmx.vcpu_block(v_);                 \
>  })
>  
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

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

      reply	other threads:[~2016-08-29 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 12:01 [PATCH] xen/HVM: Add guarding logic for VMX specific code Suravee Suthikulpanit
2016-08-29 14:36 ` Konrad Rzeszutek Wilk [this message]

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=20160829143641.GF27665@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=sherry.hurwitz@amd.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=wei.liu2@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).