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

Re: [PATCH v2] x86/xen: Add support for HVMOP_set_evtchn_upcall_vector


  • To: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>
  • From: Jane Malalane <Jane.Malalane@xxxxxxxxxx>
  • Date: Wed, 27 Jul 2022 15:42:46 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tPfBYACwUw/V8DzgjfYnPeUUskCCCURJ9k4kfqMQBFI=; b=dxBasgvD7PlUaCfKLWC+Sth3xIMMZfRiesALxYItE3DC7s4/XdmZx3gusWTJsckDlgerv6dEE0vtwI6gMMYbd7X4ufrIK3NDQFBSdHsWAuPD3PVTf+LvQV296YqEprkaqc3/GYIJEu0A/iO6KeZzmcF/vFJY1arBiSyHT7TH9HeH+dxlj41FiNHC0OB3uMubI96D+Ecb3LjI6pKbUgGxbNaD0aT5vP33a8rX0S6MRuJuw8ZZ7WiwDz39Gveirygom4TM8itTv08TYkm0ARfUl56My0g6j8laHYpP28ITFEUNEX+nV/64X71q2n9yCs0BJ/ZVa4l8poTNx00SaqtlJg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mYyIyqkT3nc3AzJ35YZxKyTRoFGLnmuXK0ak/jMD99iCz4saej1LIme00TjRtS+m56Tb4mItRTsL8yX1TQzufHJ/+EzrwCwALAweaTg2GgfN/tTm7M4ZfCwCpRhy8b+Kf2UlMRwGAhE5ADEdOmRqnJ1LJyWKqRdogpGKcE42asZXtWFw9ZiBzJlmN2GA7TPITzlnXvMN7PlqmXhy6dg+czlG5NfEYdx3sdXAXd93M2v9FERzeL+4GUmHihcut+R6xfvevqt9NmuCymOBv3xWq1Ta2UEHJvEYO7445CuGgXFR7RMqiDMLpp6muW+e8e7gEIkRAPB9ClyaBRKJ12KPKw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Maximilian Heyne <mheyne@xxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Colin Ian King <colin.king@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 27 Jul 2022 15:43:08 +0000
  • Ironport-data: A9a23:ob9V5K4E8W5tVW55mk+PoAxRtBXHchMFZxGqfqrLsTDasY5as4F+v mIdCmjVbPiCM2P9et9xYIW08EIPvsTXm4dnTgM5qn8yHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yM6jclkf5KkYMbcICd9WAR4fykojBNnioYRj5VhxNO0GGthg /uryyHkEALjimUc3l48sfrZ8ksw5quq4Vv0g3RlDRx1lA6G/5UqJMp3yZGZdxPQXoRSF+imc OfPpJnRErTxpkpF5nuNy94XQ2VSKlLgFVHmZkl+AsBOtiNqtC0qupvXAdJHAathZ5dlqPgqo DlFncTYpQ7EpcQgksxFO/VTO3kW0aGrZNY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GCLvHnQcmXGzsQ8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYoO9LZ/coQoD4ekyAV2OZDcw3862RTc+AgAEPVgA=
  • Thread-topic: [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.

 


Rackspace

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