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

Re: [PATCH v2 11/11] xen/arm: Process pending vPCI map/unmap operations


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Mon, 27 Sep 2021 08:39:17 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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; bh=Q2aDLSpXQzKyLXfEm9nl2qdd4wWIywY4rPfbjIgqjlY=; b=bH6nj78xW+ki0GtcHpmEzibT0kf9RjLg+o/3wV9zVmt/cSf7JWultHzdXf0g6Q8JyncHdZOMbYmLQIYkYsrkrYsMUh52eTI1zwFTbW5O2FujWyeHZsCb2eF0btYzLHKYaBqlIHhHTnyk7T1yIAAjV7KxxxEbcrKumbyxPKwr41HEl3QUS4XoGD84f6Wv09fQE0nsB9L0M7f/r2wA3+xE9Jh/DLhWFK0f3Ju55NS/sgV5IpLXvu0/4bBE9sq5sanUijx9qUppftkXX2b07Be0WZ3NehboVHbXJ+suwNroujTsiIUvsXM1lM+183SGYFpsgrL6FcaKDaWT5C2UezIamQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jYLMIC8fIB43CNcb7j9RRgSXPUdRliVyrM6hyWSxqKR+21nF7NZA6IbzS1KJoHsuvkk+Sey2OuH5Uw0BVhyPILB31Y6H1dk7pIjKnofZHIEsHsWSC2WLA3K+AL3bPYLLDRiLfrc9bjn+VIaDyEOUcdOXxCtifuh6TifDoCgTpKeoC8CJduzRky8vUi0DmEKFrhs4R5hYiiVvLRj9AzD08WszZaxBXNAnRw8N0JMcND9YhPXwFxzjE2mKCRPQkN4CAk+L8I0fo3vmLiit2t43sXrzj4qXqB4XTuxEdKOKbV6jMLjM4YXda6rlSLycocecLxsHO7qUGVBMHCqbBZFkoA==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=epam.com;
  • Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 27 Sep 2021 08:39:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXsHo2LHAX3buXA02kyLB7DlUL6au3jCIAgAAJOQA=
  • Thread-topic: [PATCH v2 11/11] xen/arm: Process pending vPCI map/unmap operations

On 27.09.21 11:06, Jan Beulich wrote:
> + Paul (retaining full context for this reason)
>
> On 23.09.2021 14:54, Oleksandr Andrushchenko wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>
>> vPCI may map and unmap PCI device memory (BARs) being passed through which
>> may take a lot of time. For this those operations may be deferred to be
>> performed later, so that they can be safely preempted.
>> Run the corresponding vPCI code while switching a vCPU.
>>
>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>
>> ---
>> Since v1:
>>   - Moved the check for pending vpci work from the common IOREQ code
>>     to hvm_do_resume on x86
> While perhaps obvious for Arm folks, I'd like to see the reason for this
> spelled out in the description.

I will add:

IOREQ is not enabled for Arm by default, so pending vPCI work has

no chance to be executed if the processing is left as is in the common IOREQ

code only. For that reason Arm processes that in arch specific code which 
results

in that the processing happens twice for Arm when IOREQ is enabled.

For x86, processing of vPCI in IOREQ code also doesn't seem to be the right

place, so move that to hvm_do_resume.

>
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -549,6 +549,12 @@ void hvm_do_resume(struct vcpu *v)
>>       if ( !vcpu_ioreq_handle_completion(v) )
>>           return;
>>   
>> +    if ( has_vpci(v->domain) && vpci_process_pending(v) )
>> +    {
>> +        raise_softirq(SCHEDULE_SOFTIRQ);
>> +        return;
>> +    }
> Note that you're altering behavior here: Originally this was done ...
>
>> @@ -212,19 +210,12 @@ static bool wait_for_io(struct ioreq_vcpu *sv, ioreq_t 
>> *p)
>>   
>>   bool vcpu_ioreq_handle_completion(struct vcpu *v)
>>   {
>> -    struct domain *d = v->domain;
>>       struct vcpu_io *vio = &v->io;
>>       struct ioreq_server *s;
>>       struct ioreq_vcpu *sv;
>>       enum vio_completion completion;
>>       bool res = true;
>>   
>> -    if ( has_vpci(d) && vpci_process_pending(v) )
>> -    {
>> -        raise_softirq(SCHEDULE_SOFTIRQ);
>> -        return false;
>> -    }
> ... first thing. And I think it wants (perhaps even needs) to remain
> that way;
Will make it the first operation
>   otherwise you'll need to explain why not, and why the change
> is correct / safe.
>
> Jan
>
Thank you,

Oleksandr

 


Rackspace

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