xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>, xen-devel@lists.xenproject.org
Cc: "Kevin Tian" <kevin.tian@intel.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jun Nakajima" <jun.nakajima@intel.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v4 1/4] x86: stop handling MSR_IA32_BNDCFGS save/restore in implementation code
Date: Tue, 9 Apr 2019 15:38:35 +0100	[thread overview]
Message-ID: <e211a166-d1d7-344f-6f46-22e10c67c63f@citrix.com> (raw)
In-Reply-To: <20190314135125.1958-2-paul.durrant@citrix.com>

On 14/03/2019 13:51, Paul Durrant wrote:
> @@ -1215,8 +1196,11 @@ static bool vmx_set_guest_bndcfgs(struct vcpu *v, u64 val)
>      return true;
>  }
>  
> -static bool vmx_get_guest_bndcfgs(struct vcpu *v, u64 *val)
> +static bool vmx_get_guest_bndcfgs(const struct vcpu *cv, u64 *val)
>  {
> +    /* Get a non-const pointer for vmx_vmcs_enter() */
> +    struct vcpu *v = cv->domain->vcpu[cv->vcpu_id];
> +

I'm sorry not having got around to reviewing this series in a timely
fashion, but I am going to specifically nack de-consting games like
this.  There is now vcpu state corruption when the MSR is accessed
remotely - this hook *must* remain a mutable vcpu pointer.

There are also multiple other functional issues and regressions
introduced by this series.  I'm trying to put together a patch to fix
all of the fallout, but I also might revert the series wholesale
depending on the eventual complexity.

~Andrew

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

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>, <xen-devel@lists.xenproject.org>
Cc: "Kevin Tian" <kevin.tian@intel.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jun Nakajima" <jun.nakajima@intel.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v4 1/4] x86: stop handling MSR_IA32_BNDCFGS save/restore in implementation code
Date: Tue, 9 Apr 2019 15:38:35 +0100	[thread overview]
Message-ID: <e211a166-d1d7-344f-6f46-22e10c67c63f@citrix.com> (raw)
Message-ID: <20190409143835.Mmf1O127hRTlmFb7J1hD_5ebO1rfKNDGRurLMDbXLhY@z> (raw)
In-Reply-To: <20190314135125.1958-2-paul.durrant@citrix.com>

On 14/03/2019 13:51, Paul Durrant wrote:
> @@ -1215,8 +1196,11 @@ static bool vmx_set_guest_bndcfgs(struct vcpu *v, u64 val)
>      return true;
>  }
>  
> -static bool vmx_get_guest_bndcfgs(struct vcpu *v, u64 *val)
> +static bool vmx_get_guest_bndcfgs(const struct vcpu *cv, u64 *val)
>  {
> +    /* Get a non-const pointer for vmx_vmcs_enter() */
> +    struct vcpu *v = cv->domain->vcpu[cv->vcpu_id];
> +

I'm sorry not having got around to reviewing this series in a timely
fashion, but I am going to specifically nack de-consting games like
this.  There is now vcpu state corruption when the MSR is accessed
remotely - this hook *must* remain a mutable vcpu pointer.

There are also multiple other functional issues and regressions
introduced by this series.  I'm trying to put together a patch to fix
all of the fallout, but I also might revert the series wholesale
depending on the eventual complexity.

~Andrew

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

  parent reply	other threads:[~2019-04-09 14:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 13:51 [PATCH v4 0/4] clean up MSR save/restore code Paul Durrant
2019-03-14 13:51 ` [PATCH v4 1/4] x86: stop handling MSR_IA32_BNDCFGS save/restore in implementation code Paul Durrant
2019-03-14 14:23   ` Jan Beulich
2019-04-05 11:29   ` Jan Beulich
2019-04-05 11:29     ` [Xen-devel] " Jan Beulich
2019-04-09  3:10     ` Tian, Kevin
2019-04-09  3:10       ` [Xen-devel] " Tian, Kevin
2019-04-09 14:38   ` Andrew Cooper [this message]
2019-04-09 14:38     ` Andrew Cooper
2019-04-09 15:03     ` Jan Beulich
2019-04-09 15:03       ` [Xen-devel] " Jan Beulich
2019-03-14 13:51 ` [PATCH v4 2/4] x86: move the saved value of MSR_IA32_XSS into struct vcpu_msrs Paul Durrant
2019-03-14 13:51 ` [PATCH v4 3/4] x86: stop handling MSR_IA32_XSS save/restore in implementation code Paul Durrant
2019-03-14 13:51 ` [PATCH v4 4/4] x86: remove defunct init/load/save_msr() hvm_funcs Paul Durrant

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=e211a166-d1d7-344f-6f46-22e10c67c63f@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=paul.durrant@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).