All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/HVM: memset CPU context save area
@ 2016-01-19 17:42 Roger Pau Monne
  2016-01-19 17:44 ` Roger Pau Monné
  2016-01-19 18:21 ` [PATCH] x86/HVM: memset CPU context save area Andrew Cooper
  0 siblings, 2 replies; 6+ messages in thread
From: Roger Pau Monne @ 2016-01-19 17:42 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Jan Beulich, Roger Pau Monne

In order to prevent leaking data in the padding field. Also remove the
memset done to the fpu_regs in case of no FPU context present, since it's
already taken care by the memset of the whole CPU context structure. The
same applies to setting ctxt.flags to 0 in case there's no FPU context.

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/hvm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8f98956..674feea 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1732,6 +1732,8 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         if ( v->pause_flags & VPF_down )
             continue;
 
+        memset(&ctxt, 0, sizeof(ctxt));
+
         /* Architecture-specific vmcs/vmcb bits */
         hvm_funcs.save_cpu_ctxt(v, &ctxt);
 
@@ -1798,11 +1800,6 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
             memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
             ctxt.flags = XEN_X86_FPU_INITIALISED;
         }
-        else
-        {
-             memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
-             ctxt.flags = 0;
-        }
 
         ctxt.rax = v->arch.user_regs.eax;
         ctxt.rbx = v->arch.user_regs.ebx;
-- 
1.9.5 (Apple Git-50.3)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [xen-unstable-smoke test] 78539: regressions - FAIL
@ 2016-01-19 17:43   ` osstest service owner
  2016-01-19 17:48     ` Roger Pau Monné
  0 siblings, 1 reply; 6+ messages in thread
From: osstest service owner @ 2016-01-19 17:43 UTC (permalink / raw)
  To: xen-devel, osstest-admin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4658 bytes --]

flight 78539 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/78539/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-debianhvm-i386 12 guest-saverestore fail REGR. vs. 78522

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     12 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          12 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          13 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  eb68c40ba5d0212adc176290f09e4ee133c96e83
baseline version:
 xen                  162a81abb1c55ff77a3fcc82c7971a766ca122f6

Last test of basis    78522  2016-01-19 13:01:25 Z    0 days
Testing same since    78539  2016-01-19 16:01:48 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Haozhong Zhang <haozhong.zhang@intel.com>
  Jan Beulich <jbeulich@suse.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Wei Liu <wei.liu2@citrix.com>

jobs:
 build-amd64                                                  pass
 build-armhf                                                  pass
 build-amd64-libvirt                                          pass
 test-armhf-armhf-xl                                          pass
 test-amd64-amd64-xl-qemuu-debianhvm-i386                     fail
 test-amd64-amd64-libvirt                                     pass


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit eb68c40ba5d0212adc176290f09e4ee133c96e83
Author: Roger Pau Monné <roger.pau@citrix.com>
Date:   Tue Jan 19 16:08:39 2016 +0100

    x86/HVM: add padding to struct hvm_hw_cpu

    So that the size of the structure is the same on 32 and 64bit.

    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

commit 805b7484b85e77b15c68e837b3d7b77053182d37
Author: Haozhong Zhang <haozhong.zhang@intel.com>
Date:   Tue Jan 19 16:07:59 2016 +0100

    svm: remove redundant TSC scaling in svm_set_tsc_offset()

    Now every caller passes an already scaled offset to
    svm_set_tsc_offset(), so it's not necessary to recalculate a scaled TSC
    offset in svm_set_tsc_offset().

    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

commit eab8a90be723d742d607aff2005ea0ab521bfd6a
Author: Haozhong Zhang <haozhong.zhang@intel.com>
Date:   Tue Jan 19 16:07:39 2016 +0100

    x86/time: scale host TSC in pvclock properly

    This patch makes the pvclock return the scaled host TSC and
    corresponding scaling parameters to HVM domains if guest TSC is not
    emulated and TSC scaling is enabled.

    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

commit 52fd9a46f6e9eb050a6b402ce3b04fa57907acc5
Author: Haozhong Zhang <haozhong.zhang@intel.com>
Date:   Tue Jan 19 16:07:15 2016 +0100

    x86/hvm: scale host TSC when setting/getting guest TSC

    The existing hvm_[set|get]_guest_tsc_fixed() calculate the guest TSC by
    adding the TSC offset to the host TSC. When the TSC scaling is enabled,
    the host TSC should be scaled first. This patch adds the scaling logic
    to those two functions.

    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

commit c2ba8c24f34426c993afa841bf94d933d2461cd9
Author: Roger Pau Monné <roger.pau@citrix.com>
Date:   Tue Jan 19 16:06:31 2016 +0100

    elfnotes: check phys_entry against UNSET_ADDR32

    And introduce UNSET_ADDR32.

    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
(qemu changes not included)


[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86/HVM: memset CPU context save area
  2016-01-19 17:42 [PATCH] x86/HVM: memset CPU context save area Roger Pau Monne
@ 2016-01-19 17:44 ` Roger Pau Monné
  2016-01-19 17:43   ` [xen-unstable-smoke test] 78539: regressions - FAIL osstest service owner
  2016-01-19 18:21 ` [PATCH] x86/HVM: memset CPU context save area Andrew Cooper
  1 sibling, 1 reply; 6+ messages in thread
From: Roger Pau Monné @ 2016-01-19 17:44 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Jan Beulich

El 19/01/16 a les 18.42, Roger Pau Monne ha escrit:
> In order to prevent leaking data in the padding field. Also remove the
> memset done to the fpu_regs in case of no FPU context present, since it's
> already taken care by the memset of the whole CPU context structure. The
> same applies to setting ctxt.flags to 0 in case there's no FPU context.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Forgot to add:

Reported-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [xen-unstable-smoke test] 78539: regressions - FAIL
  2016-01-19 17:43   ` [xen-unstable-smoke test] 78539: regressions - FAIL osstest service owner
@ 2016-01-19 17:48     ` Roger Pau Monné
  2016-01-19 18:34       ` [xen-unstable-smoke test] 78539: regressions - FAIL [and 3 more messages] Ian Jackson
  0 siblings, 1 reply; 6+ messages in thread
From: Roger Pau Monné @ 2016-01-19 17:48 UTC (permalink / raw)
  To: osstest service owner, xen-devel

El 19/01/16 a les 18.43, osstest service owner ha escrit:
> flight 78539 xen-unstable-smoke real [real]
> http://logs.test-lab.xenproject.org/osstest/logs/78539/
> 
> Regressions :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-amd64-xl-qemuu-debianhvm-i386 12 guest-saverestore fail REGR. vs. 78522

This is my fault:

Jan 19 16:49:13.681214 (XEN) HVM3 restore: CPU 0
Jan 19 16:49:36.461176 (XEN) HVM3 restore: failed to load entry 2/0

It should be fixed by
<1453225373-81485-1-git-send-email-roger.pau@citrix.com>

Roger.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86/HVM: memset CPU context save area
  2016-01-19 17:42 [PATCH] x86/HVM: memset CPU context save area Roger Pau Monne
  2016-01-19 17:44 ` Roger Pau Monné
@ 2016-01-19 18:21 ` Andrew Cooper
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2016-01-19 18:21 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel; +Cc: Jan Beulich

On 19/01/16 17:42, Roger Pau Monne wrote:
> In order to prevent leaking data in the padding field. Also remove the
> memset done to the fpu_regs in case of no FPU context present, since it's
> already taken care by the memset of the whole CPU context structure. The
> same applies to setting ctxt.flags to 0 in case there's no FPU context.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [xen-unstable-smoke test] 78539: regressions - FAIL [and 3 more messages]
  2016-01-19 17:48     ` Roger Pau Monné
@ 2016-01-19 18:34       ` Ian Jackson
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Jackson @ 2016-01-19 18:34 UTC (permalink / raw)
  To: Andrew Cooper, Roger Pau Monne
  Cc: xen-devel, xen-devel, osstest service owner, Jan Beulich

Roger Pau Monne writes ("[Xen-devel] [PATCH] x86/HVM: memset CPU context save area"):
> In order to prevent leaking data in the padding field. Also remove the
> memset done to the fpu_regs in case of no FPU context present, since it's
> already taken care by the memset of the whole CPU context structure. The
> same applies to setting ctxt.flags to 0 in case there's no FPU context.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
...
> Reported-by: Jan Beulich <jbeulich@suse.com>

Andrew Cooper writes ("Re: [Xen-devel] [PATCH] x86/HVM: memset CPU context save area"):
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks, applied.

Roger Pau Monné writes ("Re: [Xen-devel] [xen-unstable-smoke test] 78539: regressions - FAIL"):
> El 19/01/16 a les 18.43, osstest service owner ha escrit:
> > flight 78539 xen-unstable-smoke real [real]
> > http://logs.test-lab.xenproject.org/osstest/logs/78539/
> > 
> > Regressions :-(
> > 
> > Tests which did not succeed and are blocking,
> > including tests which could not be run:
> >  test-amd64-amd64-xl-qemuu-debianhvm-i386 12 guest-saverestore fail REGR. vs. 78522
> 
> This is my fault:
> 
> Jan 19 16:49:13.681214 (XEN) HVM3 restore: CPU 0
> Jan 19 16:49:36.461176 (XEN) HVM3 restore: failed to load entry 2/0
> 
> It should be fixed by
> <1453225373-81485-1-git-send-email-roger.pau@citrix.com>

Thanks for the heads-up.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-19 18:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-19 17:42 [PATCH] x86/HVM: memset CPU context save area Roger Pau Monne
2016-01-19 17:44 ` Roger Pau Monné
2016-01-19 17:43   ` [xen-unstable-smoke test] 78539: regressions - FAIL osstest service owner
2016-01-19 17:48     ` Roger Pau Monné
2016-01-19 18:34       ` [xen-unstable-smoke test] 78539: regressions - FAIL [and 3 more messages] Ian Jackson
2016-01-19 18:21 ` [PATCH] x86/HVM: memset CPU context save area Andrew Cooper

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.