All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <Andrew.Cooper3@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Jan Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v2 1/3] x86/vmx: implement Bus Lock detection
Date: Mon, 6 Jun 2022 13:27:19 +0000	[thread overview]
Message-ID: <3c8b0b72-0a9a-3dfd-bf5c-b6cc40a4ce3a@citrix.com> (raw)
In-Reply-To: <20220526111157.24479-2-roger.pau@citrix.com>

On 26/05/2022 12:11, Roger Pau Monne wrote:
> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> index f08a00dcbb..476ab72463 100644
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -4065,6 +4065,16 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
>  
>      if ( unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) )
>          return vmx_failed_vmentry(exit_reason, regs);
> +    if ( unlikely(exit_reason & VMX_EXIT_REASONS_BUS_LOCK) )
> +    {
> +        /*
> +         * Delivery of Bus Lock VM exit was pre-empted by a higher priority VM
> +         * exit.
> +         */
> +        exit_reason &= ~VMX_EXIT_REASONS_BUS_LOCK;
> +        if ( exit_reason != EXIT_REASON_BUS_LOCK )
> +            perfc_incr(buslock);
> +    }

I know this post-dates you posting v2, but given the latest update from
Intel, VMX_EXIT_REASONS_BUS_LOCK will be set on all exits.

So the code logic would be simpler as:

if ( exit_reason & VMX_EXIT_REASONS_BUS_LOCK )
{
    perfc_incr(buslock);
    exit_reason &= ~VMX_EXIT_REASONS_BUS_LOCK;
}

and ...

>  
>      if ( v->arch.hvm.vmx.vmx_realmode )
>      {
> @@ -4561,6 +4571,14 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
>          vmx_handle_descriptor_access(exit_reason);
>          break;
>  
> +    case EXIT_REASON_BUS_LOCK:
> +        perfc_incr(buslock);

... dropping this perf counter.

With something along these lines, Reviewed-by: Andrew Cooper
<andrew.cooper3@citrix.com>

  parent reply	other threads:[~2022-06-06 13:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 11:11 [PATCH v2 0/3] x86/vmx: implement Bus Lock and VM Notify Roger Pau Monne
2022-05-26 11:11 ` [PATCH v2 1/3] x86/vmx: implement Bus Lock detection Roger Pau Monne
2022-06-03 12:16   ` Jan Beulich
2022-06-03 14:29     ` Roger Pau Monné
2022-06-07  7:20       ` Jan Beulich
2022-06-06 13:27   ` Andrew Cooper [this message]
2022-06-07  6:54     ` Jan Beulich
2022-06-07 10:03       ` Roger Pau Monné
2022-05-26 11:11 ` [PATCH v2 2/3] x86/vmx: introduce helper to set VMX_INTR_SHADOW_NMI Roger Pau Monne
2022-06-03 12:20   ` Jan Beulich
2022-05-26 11:11 ` [PATCH v2 3/3] x86/vmx: implement Notify VM Exit Roger Pau Monne
2022-06-03 12:49   ` Jan Beulich
2022-06-03 14:46     ` Roger Pau Monné
2022-06-07  7:43       ` Jan Beulich
2022-06-07 10:05         ` Roger Pau Monné
2022-06-08  3:51           ` Tian, Kevin
2022-06-09  7:04   ` Tian, Kevin
2022-06-09  7:39     ` Xiaoyao Li
2022-06-09 10:09       ` Roger Pau Monné
2022-06-16 11:17         ` Roger Pau Monné
2022-06-16 11:57         ` Xiaoyao Li

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=3c8b0b72-0a9a-3dfd-bf5c-b6cc40a4ce3a@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.