[3/5] x86/hvm: don't set the BSP as initialised in hvm_vcpu_initialise
diff mbox

Message ID 1452688338-70075-4-git-send-email-roger.pau@citrix.com
State New, archived
Headers show

Commit Message

Roger Pau Monné Jan. 13, 2016, 12:32 p.m. UTC
The BSP will be marked as initialised after hvm_load_cpu_ctxt has loaded the
initial state, which is called from the toolstack during domain creation.

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 | 4 ----
 1 file changed, 4 deletions(-)

Comments

Jan Beulich Jan. 13, 2016, 4:29 p.m. UTC | #1
>>> On 13.01.16 at 13:32, <roger.pau@citrix.com> wrote:
> The BSP will be marked as initialised after hvm_load_cpu_ctxt has loaded the
> initial state, which is called from the toolstack during domain creation.

But the comment that you remove says explicitly that this isn't a
requirement.

Jan

> 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 | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 787b7de..05c3ca1 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -2474,10 +2474,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
>   
>          /* Init guest TSC to start from zero. */
>          hvm_set_guest_tsc(v, 0);
> -
> -        /* Can start up without SIPI-SIPI or setvcpucontext domctl. */
> -        v->is_initialised = 1;
> -        clear_bit(_VPF_down, &v->pause_flags);
>      }
>  
>      return 0;
> -- 
> 1.9.5 (Apple Git-50.3)
Roger Pau Monné Jan. 13, 2016, 5:23 p.m. UTC | #2
El 13/01/16 a les 17.29, Jan Beulich ha escrit:
>>>> On 13.01.16 at 13:32, <roger.pau@citrix.com> wrote:
>> The BSP will be marked as initialised after hvm_load_cpu_ctxt has loaded the
>> initial state, which is called from the toolstack during domain creation.
> 
> But the comment that you remove says explicitly that this isn't a
> requirement.

Previous to my HVMlite series that was true, and HVM guests were started
without setting any explicit CPU state (in fact we placed that horrible
jmp at 0x0, because the IP was by default set to 0x0). This is no longer
true, and now HVM guests require that a proper CPU context is loaded
before starting. I believe this is better, and this change helps enforce
this policy.

Roger.
Jan Beulich Jan. 14, 2016, 9:07 a.m. UTC | #3
>>> On 13.01.16 at 18:23, <roger.pau@citrix.com> wrote:
> El 13/01/16 a les 17.29, Jan Beulich ha escrit:
>>>>> On 13.01.16 at 13:32, <roger.pau@citrix.com> wrote:
>>> The BSP will be marked as initialised after hvm_load_cpu_ctxt has loaded the
>>> initial state, which is called from the toolstack during domain creation.
>> 
>> But the comment that you remove says explicitly that this isn't a
>> requirement.
> 
> Previous to my HVMlite series that was true, and HVM guests were started
> without setting any explicit CPU state (in fact we placed that horrible
> jmp at 0x0, because the IP was by default set to 0x0). This is no longer
> true, and now HVM guests require that a proper CPU context is loaded
> before starting. I believe this is better, and this change helps enforce
> this policy.

Well, that's fine, but the patch description then needs to reflect
this.

Jan

Patch
diff mbox

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 787b7de..05c3ca1 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2474,10 +2474,6 @@  int hvm_vcpu_initialise(struct vcpu *v)
  
         /* Init guest TSC to start from zero. */
         hvm_set_guest_tsc(v, 0);
-
-        /* Can start up without SIPI-SIPI or setvcpucontext domctl. */
-        v->is_initialised = 1;
-        clear_bit(_VPF_down, &v->pause_flags);
     }
 
     return 0;