From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Eddie Dong <eddie.dong@intel.com>,
Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH 3/4] VMX: allow RTM advanced debugging to be used by guests
Date: Tue, 12 Aug 2014 11:08:37 +0100 [thread overview]
Message-ID: <53E9E7A5.6080704@citrix.com> (raw)
In-Reply-To: <53E9F7C6020000780002B740@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 2554 bytes --]
On 12/08/14 10:17, Jan Beulich wrote:
> All that is needed here is allowing the respective DebugCtl MSR bit to
> be set by the guest.
>
> At once - even if PV guests can't currently use it due to missing
> DebugCtl MSR virtualization - make the respective adjustments to
> debugreg.h.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2246,6 +2246,8 @@ static int vmx_msr_write_intercept(unsig
> int i, rc = 0;
> uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
>
> + if ( boot_cpu_has(X86_FEATURE_RTM) )
> + supported |= IA32_DEBUGCTLMSR_RTM;
This supported bitmask is runtime constant. Is it worth precalculating
it, rather than reevaluating each time DEBUGCTL is written to?
~Andrew
> if ( msr_content & ~supported )
> {
> /* Perhaps some other bits are supported in vpmu. */
> --- a/xen/include/asm-x86/debugreg.h
> +++ b/xen/include/asm-x86/debugreg.h
> @@ -20,6 +20,7 @@
> #define DR_TRAP3 (0x8) /* db3 */
> #define DR_STEP (0x4000) /* single-step */
> #define DR_SWITCH (0x8000) /* task switch */
> +#define DR_NOT_RTM (0x10000) /* clear: #BP inside RTM region */
>
> /* Now define a bunch of things for manipulating the control register.
> The top two bytes of the control register consist of 4 fields of 4
> @@ -62,6 +63,7 @@
> #define DR_CONTROL_RESERVED_ONE (0x00000400ul) /* Reserved, read as one */
> #define DR_LOCAL_EXACT_ENABLE (0x00000100ul) /* Local exact enable */
> #define DR_GLOBAL_EXACT_ENABLE (0x00000200ul) /* Global exact enable */
> +#define DR_RTM_ENABLE (0x00000800ul) /* RTM debugging enable */
> #define DR_GENERAL_DETECT (0x00002000ul) /* General detect enable */
>
> #define write_debugreg(reg, val) do { \
> --- a/xen/include/asm-x86/msr-index.h
> +++ b/xen/include/asm-x86/msr-index.h
> @@ -79,6 +79,7 @@
> #define IA32_DEBUGCTLMSR_BTINT (1<<8) /* Branch Trace Interrupt */
> #define IA32_DEBUGCTLMSR_BTS_OFF_OS (1<<9) /* BTS off if CPL 0 */
> #define IA32_DEBUGCTLMSR_BTS_OFF_USR (1<<10) /* BTS off if CPL > 0 */
> +#define IA32_DEBUGCTLMSR_RTM (1<<15) /* RTM debugging enable */
>
> #define MSR_IA32_LASTBRANCHFROMIP 0x000001db
> #define MSR_IA32_LASTBRANCHTOIP 0x000001dc
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 3360 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-08-12 10:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-12 9:08 [PATCH 0/4] VMX: DebugCtl MSR related adjustments Jan Beulich
2014-08-12 9:14 ` [PATCH 1/4] VMX: fix DebugCtl MSR clearing Jan Beulich
2014-08-12 9:37 ` Andrew Cooper
2014-08-13 18:48 ` Tian, Kevin
2014-08-12 9:15 ` [PATCH 2/4] VMX/vPMU: fix DebugCtl MSR handling Jan Beulich
2014-08-12 9:44 ` Andrew Cooper
2014-08-12 9:51 ` Jan Beulich
2014-08-12 17:47 ` Boris Ostrovsky
2014-08-14 17:14 ` Jan Beulich
2014-08-13 18:52 ` Tian, Kevin
2014-08-12 9:17 ` [PATCH 3/4] VMX: allow RTM advanced debugging to be used by guests Jan Beulich
2014-08-12 10:08 ` Andrew Cooper [this message]
2014-08-12 10:40 ` Jan Beulich
2014-08-13 18:52 ` Tian, Kevin
2014-08-12 9:18 ` [PATCH 4/4] VMX/vPMU: reduce core2_vpmu_initialise() verbosity Jan Beulich
2014-08-12 9:29 ` Andrew Cooper
2014-08-13 18:53 ` Tian, Kevin
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=53E9E7A5.6080704@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=eddie.dong@intel.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.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 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.