[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31a17555-5890-9c8f-bd3a-371815453a6c@citrix.com>
Date: Wed, 27 Jul 2022 15:42:46 +0000
From: Jane Malalane <Jane.Malalane@...rix.com>
To: Boris Ostrovsky <boris.ostrovsky@...cle.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" <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" <xen-devel@...ts.xenproject.org>
Subject: Re: [PATCH v2] x86/xen: Add support for
HVMOP_set_evtchn_upcall_vector
On 27/07/2022 00:31, Boris Ostrovsky wrote:
> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open
> attachments unless you have verified the sender and know the content is
> safe.
>
> 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.
>Thanks, will include all these changes in a v3.
Jane.
Powered by blists - more mailing lists