* [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
@ 2019-08-01 14:10 Oleksandr
2019-08-01 14:14 ` Roger Pau Monné
0 siblings, 1 reply; 9+ messages in thread
From: Oleksandr @ 2019-08-01 14:10 UTC (permalink / raw)
To: xen-devel
Hello all.
What is the proper location to place Linux error code (-EPROBE_DEFER) in
Xen?
https://elixir.bootlin.com/linux/v5.3-rc2/source/include/linux/errno.h#L19
...
Although that error is going to be used by Arm code the first, I feel it
should be somewhere in common place as it is not Arm specific.
I was thinking to place it to xen/include/public/errno.h and guard with
#ifdef __XEN__ to hide from userspace, but not sure it is a good idea,
since it looks like not a POSIX one to be in that header...
--
Regards,
Oleksandr Tyshchenko
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 14:10 [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen Oleksandr
@ 2019-08-01 14:14 ` Roger Pau Monné
2019-08-01 14:31 ` Oleksandr
0 siblings, 1 reply; 9+ messages in thread
From: Roger Pau Monné @ 2019-08-01 14:14 UTC (permalink / raw)
To: Oleksandr; +Cc: xen-devel
On Thu, Aug 01, 2019 at 05:10:08PM +0300, Oleksandr wrote:
> Hello all.
>
> What is the proper location to place Linux error code (-EPROBE_DEFER) in
> Xen?
> https://elixir.bootlin.com/linux/v5.3-rc2/source/include/linux/errno.h#L19
>
> ...
> Although that error is going to be used by Arm code the first, I feel it
> should be somewhere in common place as it is not Arm specific.
> I was thinking to place it to xen/include/public/errno.h and guard with
> #ifdef __XEN__ to hide from userspace, but not sure it is a good idea, since
> it looks like not a POSIX one to be in that header...
Hello,
I think it would help if you describe why such error code is needed by
Xen and how it would be used.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 14:14 ` Roger Pau Monné
@ 2019-08-01 14:31 ` Oleksandr
2019-08-01 14:34 ` Jan Beulich
2019-08-01 14:35 ` Oleksandr
0 siblings, 2 replies; 9+ messages in thread
From: Oleksandr @ 2019-08-01 14:31 UTC (permalink / raw)
To: Roger Pau Monné; +Cc: xen-devel
> Hello,
Hi, Roger
> I think it would help if you describe why such error code is needed by
> Xen and how it would be used.
This is needed for the upcoming V2 of the IPMMU driver (ARM) [1] which
may request
deferred probing (returns -EPROBE_DEFER) depending on what device will
be probed the first
(Root device must be registered before Cache devices. If not the case,
driver will deny further Cache device probes until Root device is
registered).
As we can't guarantee a fixed pre-defined order for the device nodes in
DT, we need to be ready for the situation where devices being probed
in "any" order. So, framework (drivers/passthrough/arm/iommu.c) will be
modified a bit to be able to handle -EPROBE_DEFER returning by driver.
[1]
https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg02679.html
--
Regards,
Oleksandr Tyshchenko
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 14:31 ` Oleksandr
@ 2019-08-01 14:34 ` Jan Beulich
2019-08-01 14:54 ` Oleksandr
2019-08-01 14:35 ` Oleksandr
1 sibling, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2019-08-01 14:34 UTC (permalink / raw)
To: Oleksandr; +Cc: xen-devel, Roger Pau Monné
On 01.08.2019 16:31, Oleksandr wrote:
> This is needed for the upcoming V2 of the IPMMU driver (ARM) [1] which may request
> deferred probing (returns -EPROBE_DEFER) depending on what device will be probed the first
> (Root device must be registered before Cache devices. If not the case,
> driver will deny further Cache device probes until Root device is registered).
>
> As we can't guarantee a fixed pre-defined order for the device nodes in DT, we need to be ready for the situation where devices being probed
> in "any" order. So, framework (drivers/passthrough/arm/iommu.c) will be modified a bit to be able to handle -EPROBE_DEFER returning by driver.
I'm sure this can be had without introducing a new error code.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 14:31 ` Oleksandr
2019-08-01 14:34 ` Jan Beulich
@ 2019-08-01 14:35 ` Oleksandr
1 sibling, 0 replies; 9+ messages in thread
From: Oleksandr @ 2019-08-01 14:35 UTC (permalink / raw)
To: Roger Pau Monné; +Cc: xen-devel
On 01.08.19 17:31, Oleksandr wrote:
>
>> Hello,
>
> Hi, Roger
>
>
>> I think it would help if you describe why such error code is needed by
>> Xen and how it would be used.
>
> This is needed for the upcoming V2 of the IPMMU driver (ARM) [1]
> which may request
> deferred probing (returns -EPROBE_DEFER) depending on what device
> will be probed the first
> (Root device must be registered before Cache devices. If not the case,
> driver will deny further Cache device probes until Root device is
> registered).
>
> As we can't guarantee a fixed pre-defined order for the device nodes
> in DT, we need to be ready for the situation where devices being probed
> in "any" order. So, framework (drivers/passthrough/arm/iommu.c) will
> be modified a bit to be able to handle -EPROBE_DEFER returning by driver.
>
> [1]
> https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg02679.html
Sorry, I provided wrong link.
The correct link should be:
https://patchew.org/Xen/1561545009-17493-2-git-send-email-olekstysh@gmail.com/
>
>
>
--
Regards,
Oleksandr Tyshchenko
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 14:34 ` Jan Beulich
@ 2019-08-01 14:54 ` Oleksandr
2019-08-01 15:46 ` Jan Beulich
0 siblings, 1 reply; 9+ messages in thread
From: Oleksandr @ 2019-08-01 14:54 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel, Roger Pau Monné
On 01.08.19 17:34, Jan Beulich wrote:
Hi Jan
> On 01.08.2019 16:31, Oleksandr wrote:
>> This is needed for the upcoming V2 of the IPMMU driver (ARM) [1] which may request
>> deferred probing (returns -EPROBE_DEFER) depending on what device will be probed the first
>> (Root device must be registered before Cache devices. If not the case,
>> driver will deny further Cache device probes until Root device is registered).
>>
>> As we can't guarantee a fixed pre-defined order for the device nodes in DT, we need to be ready for the situation where devices being probed
>> in "any" order. So, framework (drivers/passthrough/arm/iommu.c) will be modified a bit to be able to handle -EPROBE_DEFER returning by driver.
> I'm sure this can be had without introducing a new error code.
By reusing existing one (EAGAIN comes to mind)?
>
> Jan
--
Regards,
Oleksandr Tyshchenko
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 14:54 ` Oleksandr
@ 2019-08-01 15:46 ` Jan Beulich
2019-08-01 18:40 ` Oleksandr
0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2019-08-01 15:46 UTC (permalink / raw)
To: Oleksandr; +Cc: xen-devel, Roger Pau Monné
On 01.08.2019 16:54, Oleksandr wrote:
> On 01.08.19 17:34, Jan Beulich wrote:
>> On 01.08.2019 16:31, Oleksandr wrote:
>>> This is needed for the upcoming V2 of the IPMMU driver (ARM) [1] which may request
>>> deferred probing (returns -EPROBE_DEFER) depending on what device will be probed the first
>>> (Root device must be registered before Cache devices. If not the case,
>>> driver will deny further Cache device probes until Root device is registered).
>>>
>>> As we can't guarantee a fixed pre-defined order for the device nodes in DT, we need to be ready for the situation where devices being probed
>>> in "any" order. So, framework (drivers/passthrough/arm/iommu.c) will be modified a bit to be able to handle -EPROBE_DEFER returning by driver.
>> I'm sure this can be had without introducing a new error code.
>
> By reusing existing one (EAGAIN comes to mind)?
For example. Or by using some positive value instead of the (negative)
errno.h ones.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 15:46 ` Jan Beulich
@ 2019-08-01 18:40 ` Oleksandr
2019-08-02 9:31 ` Julien Grall
0 siblings, 1 reply; 9+ messages in thread
From: Oleksandr @ 2019-08-01 18:40 UTC (permalink / raw)
To: Julien Grall; +Cc: xen-devel, Jan Beulich
On 01.08.19 18:46, Jan Beulich wrote:
> On 01.08.2019 16:54, Oleksandr wrote:
>> On 01.08.19 17:34, Jan Beulich wrote:
>>> On 01.08.2019 16:31, Oleksandr wrote:
>>>> This is needed for the upcoming V2 of the IPMMU driver (ARM) [1] which may request
>>>> deferred probing (returns -EPROBE_DEFER) depending on what device will be probed the first
>>>> (Root device must be registered before Cache devices. If not the case,
>>>> driver will deny further Cache device probes until Root device is registered).
>>>>
>>>> As we can't guarantee a fixed pre-defined order for the device nodes in DT, we need to be ready for the situation where devices being probed
>>>> in "any" order. So, framework (drivers/passthrough/arm/iommu.c) will be modified a bit to be able to handle -EPROBE_DEFER returning by driver.
>>> I'm sure this can be had without introducing a new error code.
>> By reusing existing one (EAGAIN comes to mind)?
> For example. Or by using some positive value instead of the (negative)
> errno.h ones.
Actually, why not? Thank you.
We could find common ground on what driver's init callback should return
if driver wants to request deferred probing and document this behavior
in device_init usage.
I would use EAGAIN, but I am open to other options here.
Julien, what do you think?
--
Regards,
Oleksandr Tyshchenko
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen
2019-08-01 18:40 ` Oleksandr
@ 2019-08-02 9:31 ` Julien Grall
0 siblings, 0 replies; 9+ messages in thread
From: Julien Grall @ 2019-08-02 9:31 UTC (permalink / raw)
To: Oleksandr; +Cc: xen-devel, Jan Beulich
Hi Oleksandr,
On 01/08/2019 19:40, Oleksandr wrote:
>
> On 01.08.19 18:46, Jan Beulich wrote:
>> On 01.08.2019 16:54, Oleksandr wrote:
>>> On 01.08.19 17:34, Jan Beulich wrote:
>>>> On 01.08.2019 16:31, Oleksandr wrote:
>>>>> This is needed for the upcoming V2 of the IPMMU driver (ARM) [1] which
>>>>> may request
>>>>> deferred probing (returns -EPROBE_DEFER) depending on what device will
>>>>> be probed the first
>>>>> (Root device must be registered before Cache devices. If not the case,
>>>>> driver will deny further Cache device probes until Root device is
>>>>> registered).
>>>>>
>>>>> As we can't guarantee a fixed pre-defined order for the device nodes in DT,
>>>>> we need to be ready for the situation where devices being probed
>>>>> in "any" order. So, framework (drivers/passthrough/arm/iommu.c) will be
>>>>> modified a bit to be able to handle -EPROBE_DEFER returning by driver.
>>>> I'm sure this can be had without introducing a new error code.
>>> By reusing existing one (EAGAIN comes to mind)?
>> For example. Or by using some positive value instead of the (negative)
>> errno.h ones.
>
> Actually, why not? Thank you.
>
> We could find common ground on what driver's init callback should return if
> driver wants to request deferred probing and document this behavior in
> device_init usage.
> I would use EAGAIN, but I am open to other options here.
>
> Julien, what do you think?
I don't have any particular opinion as long as the errno cannot be used for
something else in that code path.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-08-02 9:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01 14:10 [Xen-devel] [Question] Proper location for Linux error code (-EPROBE_DEFER) in Xen Oleksandr
2019-08-01 14:14 ` Roger Pau Monné
2019-08-01 14:31 ` Oleksandr
2019-08-01 14:34 ` Jan Beulich
2019-08-01 14:54 ` Oleksandr
2019-08-01 15:46 ` Jan Beulich
2019-08-01 18:40 ` Oleksandr
2019-08-02 9:31 ` Julien Grall
2019-08-01 14:35 ` Oleksandr
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.