From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Juergen Gross <jgross@suse.com>,
xen-devel@lists.xenproject.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, Stefano Stabellini <sstabellini@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH v2 1/2] x86/xen: remove xen_have_vcpu_info_placement flag
Date: Wed, 22 Sep 2021 17:43:41 -0400 [thread overview]
Message-ID: <212d31cd-650d-27c6-b523-fd4f686872d1@oracle.com> (raw)
In-Reply-To: <20210922103102.3589-2-jgross@suse.com>
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
next prev parent reply other threads:[~2021-09-22 21:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 10:31 [PATCH v2 0/2] x86/xen: simplify irq pvops Juergen Gross
2021-09-22 10:31 ` [PATCH v2 1/2] x86/xen: remove xen_have_vcpu_info_placement flag Juergen Gross
2021-09-22 21:43 ` Boris Ostrovsky [this message]
2021-09-23 4:44 ` Juergen Gross
2021-09-23 14:09 ` Boris Ostrovsky
2021-09-22 10:31 ` [PATCH v2 2/2] x86/xen: switch initial pvops IRQ functions to dummy ones Juergen Gross
2021-09-22 21:49 ` Boris Ostrovsky
2021-09-23 4:45 ` Juergen Gross
2021-09-22 12:46 ` [PATCH v2 0/2] x86/xen: simplify irq pvops Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=212d31cd-650d-27c6-b523-fd4f686872d1@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).