Mailing List Archive

[PATCH] Fix vcpu restore path.
The runstate of vcpu should be restored for all possible cpus, as well as the
vcpu info placement.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
arch/x86/xen/enlighten.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index ff962d4..bc893e7 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -178,10 +178,11 @@ void xen_vcpu_restore(void)
{
int cpu;

- for_each_online_cpu(cpu) {
+ for_each_possible_cpu(cpu) {
bool other_cpu = (cpu != smp_processor_id());
+ bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL);

- if (other_cpu &&
+ if (other_cpu && is_up &&
HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
BUG();

@@ -190,7 +191,7 @@ void xen_vcpu_restore(void)
if (have_vcpu_info_placement)
xen_vcpu_setup(cpu);

- if (other_cpu &&
+ if (other_cpu && is_up &&
HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
BUG();
}
--
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH] Fix vcpu restore path. [ In reply to ]
>>> On 13.12.12 at 16:33, Wei Liu <wei.liu2@citrix.com> wrote:
> The runstate of vcpu should be restored for all possible cpus, as well as the
> vcpu info placement.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

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

> ---
> arch/x86/xen/enlighten.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index ff962d4..bc893e7 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -178,10 +178,11 @@ void xen_vcpu_restore(void)
> {
> int cpu;
>
> - for_each_online_cpu(cpu) {
> + for_each_possible_cpu(cpu) {
> bool other_cpu = (cpu != smp_processor_id());
> + bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL);
>
> - if (other_cpu &&
> + if (other_cpu && is_up &&
> HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
> BUG();
>
> @@ -190,7 +191,7 @@ void xen_vcpu_restore(void)
> if (have_vcpu_info_placement)
> xen_vcpu_setup(cpu);
>
> - if (other_cpu &&
> + if (other_cpu && is_up &&
> HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
> BUG();
> }
> --
> 1.7.10.4
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel




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