[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] x86/xen: remove xen_have_vcpu_info_placement flag


  • To: Juergen Gross <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Wed, 22 Sep 2021 17:43:41 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/IBKupBcFxnA99WDInoeyscYGjc3/7VEYIAS9LPOIHg=; b=cZUqQ8aXsQ8oSzCrPsydmaP6aYfLN4Q4dRNLD4X9UmEv2cEjNZbeLm6iC6bFxcYF3WmLH7Hh41KnJNgFfI1crD6/Teu/OsVkzvsxD3Vf5MhwzqT3SbwmweRVRVcWPK+YhYUnEGrHM1k/q5xniB//LsQ9LLAGEdcenVLA/YI4a+tDR1jdkPWxZ9+9UoyWQ99HvhrEkM1kf5miN1NzSYFfjytGFbmdW4MvSrUnHcAPqGZ9JH6q1Yt0SNim5RBTqdM+ZzJM3MYgBqYSHUR6C02zy2U8hOfq7c23gHzDcFetHK03tS0NyNO4U7yRG8chRTfKXlc2ppxoryVjaS4N/Vh96A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mjvgHweuJNeyV6Aeky2/DWzbcg7Vf2BApM+ip7v6Xi9DI4UNAl/WgYeGo1GJK+n0ADOQ9vmV7VmtZtOJINE5EENyD6Vyv2ZCN6d433BaI8R7fzecacbjxCayONfhM3CbKznEcLmewBKCIsg2Z6hRM6ZAoMe+SizQltFHrI43fC112o5sqj1kJQCwuaySjfaBj0l17pVjkoSMcjelzbnMXe4oLsDSgHtlEs6fTlp/q7uFnAYpmfSOpmA+vdya9dRXHC1BBI8IqmzNT3LP8wNWvMXe9kPLxXg11iBzQEwbQBMyO0XNYk0LV2WocLPhfEtFuwpP2dblLDpDrqgwbBbIkw==
  • Authentication-results: zytor.com; dkim=none (message not signed) header.d=none;zytor.com; dmarc=none action=none header.from=oracle.com;
  • Cc: peterz@xxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>
  • Delivery-date: Wed, 22 Sep 2021 21:44:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 9/22/21 6:31 AM, Juergen Gross wrote:
>  
> -     if (xen_have_vcpu_info_placement) {
> -             vcpup = &per_cpu(xen_vcpu_info, cpu);
> -             info.mfn = arbitrary_virt_to_mfn(vcpup);
> -             info.offset = offset_in_page(vcpup);
> +     vcpup = &per_cpu(xen_vcpu_info, cpu);
> +     info.mfn = arbitrary_virt_to_mfn(vcpup);
> +     info.offset = offset_in_page(vcpup);
>  
> -             /*
> -              * Check to see if the hypervisor will put the vcpu_info
> -              * structure where we want it, which allows direct access via
> -              * a percpu-variable.
> -              * N.B. This hypercall can _only_ be called once per CPU.
> -              * Subsequent calls will error out with -EINVAL. This is due to
> -              * the fact that hypervisor has no unregister variant and this
> -              * hypercall does not allow to over-write info.mfn and
> -              * info.offset.
> -              */
> -             err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info,
> -                                      xen_vcpu_nr(cpu), &info);
> -
> -             if (err) {
> -                     pr_warn_once("register_vcpu_info failed: cpu=%d 
> err=%d\n",
> -                                  cpu, err);
> -                     xen_have_vcpu_info_placement = 0;
> -             } else {
> -                     /*
> -                      * This cpu is using the registered vcpu info, even if
> -                      * later ones fail to.
> -                      */
> -                     per_cpu(xen_vcpu, cpu) = vcpup;
> -             }
> -     }
> -
> -     if (!xen_have_vcpu_info_placement)
> -             xen_vcpu_info_reset(cpu);
> +     /*
> +      * N.B. This hypercall can _only_ be called once per CPU.
> +      * Subsequent calls will error out with -EINVAL. This is due to
> +      * the fact that hypervisor has no unregister variant and this
> +      * hypercall does not allow to over-write info.mfn and
> +      * info.offset.
> +      */
> +     err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),
> +                              &info);
> +     if (err)
> +             panic("register_vcpu_info failed: cpu=%d err=%d\n", cpu, err);
>  


This is change in behavior. Before if the hypercall failed we still try to 
boot. I am not sure we need to worry about this (since it's not clear it 
actually works)  but I'd at least mention this in the commit message.


-boris





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.