[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f396712e-f567-f4f9-7b2b-a67b528e1939@oracle.com>
Date: Tue, 26 Jul 2022 19:31:33 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Jane Malalane <jane.malalane@...rix.com>,
LKML <linux-kernel@...r.kernel.org>
Cc: Juergen Gross <jgross@...e.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
Maximilian Heyne <mheyne@...zon.de>,
Jan Beulich <jbeulich@...e.com>,
Colin Ian King <colin.king@...el.com>,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH v2] x86/xen: Add support for
HVMOP_set_evtchn_upcall_vector
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);
> +
Powered by blists - more mailing lists