From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jane Malalane <jane.malalane@citrix.com>,
LKML <linux-kernel@vger.kernel.org>
Cc: Juergen Gross <jgross@suse.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
Maximilian Heyne <mheyne@amazon.de>,
Jan Beulich <jbeulich@suse.com>,
Colin Ian King <colin.king@intel.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] x86/xen: Add support for HVMOP_set_evtchn_upcall_vector
Date: Tue, 26 Jul 2022 19:31:33 -0400 [thread overview]
Message-ID: <f396712e-f567-f4f9-7b2b-a67b528e1939@oracle.com> (raw)
In-Reply-To: <20220726125657.12151-1-jane.malalane@citrix.com>
On 7/26/22 8:56 AM, Jane Malalane wrote:
>
> +/* Setup per-vCPU vector-type callbacks and trick toolstack to think
> + * we are enlightened. If this setup is unavailable, fallback to the
> + * global vector-type callback. */
Comment style.
> +static __init void xen_init_setup_upcall_vector(void)
> +{
> + unsigned int cpu = 0;
Unnecessary variable.
> +
> + if (!xen_have_vector_callback)
> + return;
> +
> + if ((cpuid_eax(xen_cpuid_base() + 4) & XEN_HVM_CPUID_UPCALL_VECTOR) &&
> + !xen_set_upcall_vector(cpu) && !xen_set_callback_via(1))
> + xen_percpu_upcall = true;
> + else if (xen_feature(XENFEAT_hvm_callback_vector))
> + xen_setup_callback_vector();
> + else
> + xen_have_vector_callback = false;
> +}
> +
> +int xen_set_upcall_vector(unsigned int cpu)
> +{
> + int rc;
> + xen_hvm_evtchn_upcall_vector_t op = {
> + .vector = HYPERVISOR_CALLBACK_VECTOR,
> + .vcpu = per_cpu(xen_vcpu_id, cpu),
> + };
> +
> + rc = HYPERVISOR_hvm_op(HVMOP_set_evtchn_upcall_vector, &op);
> + if (rc)
> + return rc;
> +
> + if (!cpu)
A comment (e.g. "Let toolstack know that we are enlightened." or something along these lines) would be useful here.
-boris
> + rc = xen_set_callback_via(1);
> +
next prev parent reply other threads:[~2022-07-26 23:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-26 12:56 Jane Malalane
2022-07-26 13:23 ` Jane Malalane
2022-07-26 23:31 ` Boris Ostrovsky [this message]
2022-07-27 15:42 ` Jane Malalane
2022-07-27 12:32 ` Julien Grall
2022-07-27 15:43 ` Jane Malalane
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=f396712e-f567-f4f9-7b2b-a67b528e1939@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=colin.king@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jane.malalane@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mheyne@amazon.de \
--cc=mingo@redhat.com \
--cc=oleksandr_tyshchenko@epam.com \
--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
all inboxes | Powered by JetHome®