All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr <olekstysh@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org,
	"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>, "Wei Liu" <wl@xen.org>,
	"Paul Durrant" <paul@xen.org>,
	"Julien Grall" <julien.grall@arm.com>
Subject: Re: [PATCH V1 13/16] xen/ioreq: Make x86's invalidate qemu mapcache handling common
Date: Fri, 2 Oct 2020 12:55:45 +0300	[thread overview]
Message-ID: <0aa9a225-1231-fa98-f2a1-caf898a3ed86@gmail.com> (raw)
In-Reply-To: <47ecdde7-6575-bee8-7981-7b1a31715a0b@gmail.com>


Hi Jan


On 25.09.20 16:05, Oleksandr wrote:
>
> On 25.09.20 10:03, Jan Beulich wrote:
>
> Hi Jan.
>
>> On 24.09.2020 18:45, Oleksandr wrote:
>>> On 24.09.20 14:16, Jan Beulich wrote:
>>>
>>> Hi Jan
>>>
>>>> On 22.09.2020 21:32, Oleksandr wrote:
>>>>> On 16.09.20 11:50, Jan Beulich wrote:
>>>>>> On 10.09.2020 22:22, Oleksandr Tyshchenko wrote:
>>>>>>> --- a/xen/common/memory.c
>>>>>>> +++ b/xen/common/memory.c
>>>>>>> @@ -1651,6 +1651,11 @@ long do_memory_op(unsigned long cmd, 
>>>>>>> XEN_GUEST_HANDLE_PARAM(void) arg)
>>>>>>>             break;
>>>>>>>         }
>>>>>>>     +#ifdef CONFIG_IOREQ_SERVER
>>>>>>> +    if ( op == XENMEM_decrease_reservation )
>>>>>>> +        curr_d->qemu_mapcache_invalidate = true;
>>>>>>> +#endif
>>>>>> I don't see why you put this right into decrease_reservation(). This
>>>>>> isn't just to avoid the extra conditional, but first and foremost to
>>>>>> avoid bypassing the earlier return from the function (in the case of
>>>>>> preemption). In the context of this I wonder whether the ordering of
>>>>>> operations in hvm_hypercall() is actually correct.
>>>>> Good point, indeed we may return earlier in case of preemption, I 
>>>>> missed
>>>>> that.
>>>>> Will move it to decrease_reservation(). But, we may return even 
>>>>> earlier
>>>>> in case of error...
>>>>> Now I am wondering should we move it to the very beginning of command
>>>>> processing or not?
>>>> In _this_ series I'd strongly recommend you keep things working as
>>>> they are. If independently you think you've found a reason to
>>>> re-order certain operations, then feel free to send a patch with
>>>> suitable justification.
>>> Of course, I will try to retain current behavior.
>>>
>>>
>>>>>> I'm also unconvinced curr_d is the right domain in all cases here;
>>>>>> while this may be a pre-existing issue in principle, I'm afraid it
>>>>>> gets more pronounced by the logic getting moved to common code.
>>>>> Sorry I didn't get your concern here.
>>>> Well, you need to be concerned whose qemu_mapcache_invalidate flag
>>>> you set.
>>> May I ask, in what cases the *curr_d* is the right domain?
>> When a domain does a decrease-reservation on itself. I thought
>> that's obvious. But perhaps your question was rather meant a to
>> whether a->domain ever is _not_ the right one?
> No, my question was about *curr_d*. I saw your answer
> > I'm also unconvinced curr_d is the right domain in all cases here;
> and just wanted to clarify these cases. Sorry if I was unclear.
>
>
>>
>>> We need to make sure that domain is using IOREQ server(s) at least.
>>> Hopefully, we have a helper for this
>>> which is hvm_domain_has_ioreq_server(). Please clarify, anything else I
>>> should taking care of?
>> Nothing I can recall / think of right now, except that the change
>> may want to come under a different title and with a different
>> description.As indicated, I don't think this is correct for PVH
>> Dom0 issuing the request against a HVM DomU, and addressing this
>> will likely want this moved out of hvm_memory_op() anyway. Of
>> course an option is to split this into two patches - the proposed
>> bug fix (perhaps wanting backporting) and then the moving of the
>> field out of arch.hvm. If you feel uneasy about the bug fix part,
>> let me know and I (or maybe Roger) will see to put together a
>> patch.
>
> Thank you for the clarification.
>
> Yes, it would be really nice if you (or maybe Roger) could create a 
> patch for the bug fix part.


Thank you for your patch [1].

If I got it correctly there won't be a suitable common place where to 
set qemu_mapcache_invalidate flag anymore
as XENMEM_decrease_reservation is not a single place we need to make a 
decision whether to set it
By principle of analogy, on Arm we probably want to do so in 
guest_physmap_remove_page (or maybe better in p2m_remove_mapping).
Julien, what do you think?


I will modify current patch to not alter the common code.


[1] https://patchwork.kernel.org/patch/11803383/

-- 

Regards,

Oleksandr Tyshchenko



  reply	other threads:[~2020-10-02  9:56 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 20:21 [PATCH V1 00/16] IOREQ feature (+ virtio-mmio) on Arm Oleksandr Tyshchenko
2020-09-10 20:21 ` [PATCH V1 01/16] x86/ioreq: Prepare IOREQ feature for making it common Oleksandr Tyshchenko
2020-09-14 13:52   ` Jan Beulich
2020-09-21 12:22     ` Oleksandr
2020-09-21 12:31       ` Jan Beulich
2020-09-21 12:47         ` Oleksandr
2020-09-21 13:29           ` Jan Beulich
2020-09-21 14:43             ` Oleksandr
2020-09-21 15:28               ` Jan Beulich
2020-09-23 17:22   ` Julien Grall
2020-09-23 18:08     ` Oleksandr
2020-09-10 20:21 ` [PATCH V1 02/16] xen/ioreq: Make x86's IOREQ feature common Oleksandr Tyshchenko
2020-09-14 14:17   ` Jan Beulich
2020-09-21 19:02     ` Oleksandr
2020-09-22  6:33       ` Jan Beulich
2020-09-22  9:58         ` Oleksandr
2020-09-22 10:54           ` Jan Beulich
2020-09-22 15:05             ` Oleksandr
2020-09-22 15:52               ` Jan Beulich
2020-09-23 12:28                 ` Oleksandr
2020-09-24 10:58                   ` Jan Beulich
2020-09-24 15:38                     ` Oleksandr
2020-09-24 15:51                       ` Jan Beulich
2020-09-24 18:01   ` Julien Grall
2020-09-25  8:19     ` Paul Durrant
2020-09-30 13:39       ` Oleksandr
2020-09-30 17:47         ` Julien Grall
2020-10-01  6:59           ` Paul Durrant
2020-10-01  8:49           ` Jan Beulich
2020-10-01  8:50             ` Paul Durrant
2020-09-10 20:21 ` [PATCH V1 03/16] xen/ioreq: Make x86's hvm_ioreq_needs_completion() common Oleksandr Tyshchenko
2020-09-14 14:59   ` Jan Beulich
2020-09-22 16:16     ` Oleksandr
2020-09-23 17:27     ` Julien Grall
2020-09-10 20:21 ` [PATCH V1 04/16] xen/ioreq: Provide alias for the handle_mmio() Oleksandr Tyshchenko
2020-09-14 15:10   ` Jan Beulich
2020-09-22 16:20     ` Oleksandr
2020-09-23 17:28   ` Julien Grall
2020-09-23 18:17     ` Oleksandr
2020-09-10 20:21 ` [PATCH V1 05/16] xen/ioreq: Make x86's hvm_mmio_first(last)_byte() common Oleksandr Tyshchenko
2020-09-14 15:13   ` Jan Beulich
2020-09-22 16:24     ` Oleksandr
2020-09-10 20:22 ` [PATCH V1 06/16] xen/ioreq: Make x86's hvm_ioreq_(page/vcpu/server) structs common Oleksandr Tyshchenko
2020-09-14 15:16   ` Jan Beulich
2020-09-14 15:59     ` Julien Grall
2020-09-22 16:33     ` Oleksandr
2020-09-10 20:22 ` [PATCH V1 07/16] xen/dm: Make x86's DM feature common Oleksandr Tyshchenko
2020-09-14 15:56   ` Jan Beulich
2020-09-22 16:46     ` Oleksandr
2020-09-24 11:03       ` Jan Beulich
2020-09-24 12:47         ` Oleksandr
2020-09-23 17:35   ` Julien Grall
2020-09-23 18:28     ` Oleksandr
2020-09-10 20:22 ` [PATCH V1 08/16] xen/mm: Make x86's XENMEM_resource_ioreq_server handling common Oleksandr Tyshchenko
2020-09-10 20:22 ` [PATCH V1 09/16] arm/ioreq: Introduce arch specific bits for IOREQ/DM features Oleksandr Tyshchenko
2020-09-11 10:14   ` Oleksandr
2020-09-16  7:51   ` Jan Beulich
2020-09-22 17:12     ` Oleksandr
2020-09-23 18:03   ` Julien Grall
2020-09-23 20:16     ` Oleksandr
2020-09-24 11:08       ` Jan Beulich
2020-09-24 16:02         ` Oleksandr
2020-09-24 18:02           ` Oleksandr
2020-09-25  6:51             ` Jan Beulich
2020-09-25  9:47               ` Oleksandr
2020-09-26 13:12             ` Julien Grall
2020-09-26 13:18               ` Oleksandr
2020-09-24 16:51         ` Julien Grall
2020-09-24 17:25       ` Julien Grall
2020-09-24 18:22         ` Oleksandr
2020-09-26 13:21           ` Julien Grall
2020-09-26 14:57             ` Oleksandr
2020-09-10 20:22 ` [PATCH V1 10/16] xen/mm: Handle properly reference in set_foreign_p2m_entry() on Arm Oleksandr Tyshchenko
2020-09-16  7:17   ` Jan Beulich
2020-09-16  8:50     ` Julien Grall
2020-09-16  8:52       ` Jan Beulich
2020-09-16  8:55         ` Julien Grall
2020-09-22 17:30           ` Oleksandr
2020-09-16  8:08   ` Jan Beulich
2020-09-10 20:22 ` [PATCH V1 11/16] xen/ioreq: Introduce hvm_domain_has_ioreq_server() Oleksandr Tyshchenko
2020-09-16  8:04   ` Jan Beulich
2020-09-16  8:13     ` Paul Durrant
2020-09-16  8:39       ` Julien Grall
2020-09-16  8:43         ` Paul Durrant
2020-09-22 18:39           ` Oleksandr
2020-09-22 18:23     ` Oleksandr
2020-09-10 20:22 ` [PATCH V1 12/16] xen/dm: Introduce xendevicemodel_set_irq_level DM op Oleksandr Tyshchenko
2020-09-26 13:50   ` Julien Grall
2020-09-26 14:21     ` Oleksandr
2020-09-10 20:22 ` [PATCH V1 13/16] xen/ioreq: Make x86's invalidate qemu mapcache handling common Oleksandr Tyshchenko
2020-09-16  8:50   ` Jan Beulich
2020-09-22 19:32     ` Oleksandr
2020-09-24 11:16       ` Jan Beulich
2020-09-24 16:45         ` Oleksandr
2020-09-25  7:03           ` Jan Beulich
2020-09-25 13:05             ` Oleksandr
2020-10-02  9:55               ` Oleksandr [this message]
2020-10-07 10:38                 ` Julien Grall
2020-10-07 12:01                   ` Oleksandr
2020-09-10 20:22 ` [PATCH V1 14/16] xen/ioreq: Use guest_cmpxchg64() instead of cmpxchg() Oleksandr Tyshchenko
2020-09-16  9:04   ` Jan Beulich
2020-09-16  9:07     ` Julien Grall
2020-09-16  9:09       ` Paul Durrant
2020-09-16  9:12         ` Julien Grall
2020-09-22 20:05           ` Oleksandr
2020-09-23 18:12             ` Julien Grall
2020-09-23 20:29               ` Oleksandr
2020-09-16  9:07     ` Paul Durrant
2020-09-23 18:05   ` Julien Grall
2020-09-10 20:22 ` [PATCH V1 15/16] libxl: Introduce basic virtio-mmio support on Arm Oleksandr Tyshchenko
2020-09-10 20:22 ` [PATCH V1 16/16] [RFC] libxl: Add support for virtio-disk configuration Oleksandr Tyshchenko

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=0aa9a225-1231-fa98-f2a1-caf898a3ed86@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=julien@xen.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.