From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH 3/4] x86/traps: replace plain numbers
Date: Thu, 22 Jan 2015 14:45:48 +0000 [thread overview]
Message-ID: <54C10D1C.5020309@citrix.com> (raw)
In-Reply-To: <54C1107C0200007800058299@mail.emea.novell.com>
On 22/01/15 14:00, Jan Beulich wrote:
> ... making the code better document itself. No functional change
> intended.
>
> Note that for now (as we don't support RTM yet) DR_STATUS_RESERVED_ONE
> and its users don't take DR_NOT_RTM into consideration yet.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -531,9 +531,9 @@ static void instruction_done(
> regs->eflags &= ~X86_EFLAGS_RF;
> if ( bpmatch || (regs->eflags & X86_EFLAGS_TF) )
> {
> - current->arch.debugreg[6] |= bpmatch | 0xffff0ff0;
> + current->arch.debugreg[6] |= bpmatch | DR_STATUS_RESERVED_ONE;
> if ( regs->eflags & X86_EFLAGS_TF )
> - current->arch.debugreg[6] |= 0x4000;
> + current->arch.debugreg[6] |= DR_STEP;
> do_guest_trap(TRAP_debug, regs, 0);
> }
> }
> @@ -3872,8 +3872,8 @@ long set_debugreg(struct vcpu *v, unsign
> * DR6: Bits 4-11,16-31 reserved (set to 1).
> * Bit 12 reserved (set to 0).
> */
> - value &= 0xffffefff; /* reserved bits => 0 */
> - value |= 0xffff0ff0; /* reserved bits => 1 */
> + value &= ~DR_STATUS_RESERVED_ZERO; /* reserved bits => 0 */
> + value |= DR_STATUS_RESERVED_ONE; /* reserved bits => 1 */
> if ( v == curr )
> write_debugreg(6, value);
> break;
> --- a/xen/include/asm-x86/debugreg.h
> +++ b/xen/include/asm-x86/debugreg.h
> @@ -21,6 +21,8 @@
> #define DR_STEP (0x4000) /* single-step */
> #define DR_SWITCH (0x8000) /* task switch */
> #define DR_NOT_RTM (0x10000) /* clear: #BP inside RTM region */
> +#define DR_STATUS_RESERVED_ZERO (~0xffffeffful) /* Reserved, read as zero */
> +#define DR_STATUS_RESERVED_ONE 0xffff0ff0ul /* Reserved, read as one */
>
> /* 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
>
>
>
next prev parent reply other threads:[~2015-01-22 14:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-22 13:53 [PATCH 0/4] x86: replace plain numbers Jan Beulich
2015-01-22 13:57 ` [PATCH 1/4] x86/HVM: replace plain number in hvm_combine_hw_exceptions() Jan Beulich
2015-01-22 14:12 ` Andrew Cooper
2015-01-22 14:36 ` Jan Beulich
2015-01-22 14:42 ` Tim Deegan
2015-01-22 15:12 ` Jan Beulich
2015-01-22 15:27 ` Tim Deegan
2015-01-22 13:57 ` [PATCH 2/4] x86/HVM: replace plain numbers Jan Beulich
2015-01-22 14:41 ` Andrew Cooper
2015-01-22 15:17 ` Jan Beulich
2015-01-23 13:41 ` Andrew Cooper
2015-01-23 13:58 ` Jan Beulich
2015-01-23 13:59 ` Andrew Cooper
2015-01-22 14:00 ` [PATCH 3/4] x86/traps: " Jan Beulich
2015-01-22 14:45 ` Andrew Cooper [this message]
2015-01-22 14:01 ` [PATCH 4/4] VMX: " Jan Beulich
2015-01-22 15:21 ` Andrew Cooper
2015-01-23 6:25 ` 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=54C10D1C.5020309@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@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.