diff mbox

[1/2] x86/hvm: fix arch_set_info_hvm_guest SEG macro

Message ID 20170809101821.50836-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monne Aug. 9, 2017, 10:18 a.m. UTC
Commit 6c9abf modified the SEG macro in arch_set_info_hvm_guest and
inverted the limit and base fields. Restore the correct order.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Cooper Aug. 9, 2017, 10:19 a.m. UTC | #1
On 09/08/17 11:18, Roger Pau Monne wrote:
> Commit 6c9abf modified the SEG macro in arch_set_info_hvm_guest and
> inverted the limit and base fields. Restore the correct order.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Sorry for breaking things!

> ---
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>  xen/arch/x86/hvm/domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
> index 7e11541089..60474649de 100644
> --- a/xen/arch/x86/hvm/domain.c
> +++ b/xen/arch/x86/hvm/domain.c
> @@ -137,7 +137,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
>  
>  #define SEG(s, r) ({                                                        \
>      s = (struct segment_register)                                           \
> -        { 0, { (r)->s ## _ar }, (r)->s ## _base, (r)->s ## _limit };        \
> +        { 0, { (r)->s ## _ar }, (r)->s ## _limit, (r)->s ## _base };        \
>      /* Set accessed / busy bit for present segments. */                     \
>      if ( s.p )                                                              \
>          s.type |= (x86_seg_##s != x86_seg_tr ? 1 : 2);                      \
diff mbox

Patch

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 7e11541089..60474649de 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -137,7 +137,7 @@  int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
 
 #define SEG(s, r) ({                                                        \
     s = (struct segment_register)                                           \
-        { 0, { (r)->s ## _ar }, (r)->s ## _base, (r)->s ## _limit };        \
+        { 0, { (r)->s ## _ar }, (r)->s ## _limit, (r)->s ## _base };        \
     /* Set accessed / busy bit for present segments. */                     \
     if ( s.p )                                                              \
         s.type |= (x86_seg_##s != x86_seg_tr ? 1 : 2);                      \