mini-os: remove device specific struct file members
cover mini-os: remove device specific struct file members
This small series is a followup to the series sent recently:
https://lists.xen.org/archives/html/xen-devel/2022-01/threads.html#00110
It contains the last cleanups related to struct file and can only be applied after the Xen libraries have stopped using the related union members.
Juergen Gross (2):
mini-os: remove event channel specific struct file member
mini-os: remove gnttab specific member from struct file
include/lib.h | 13 ------------- 1 file changed, 13 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/2 mini-os: remove event channel specific struct file member
The event channel specific union member in struct file is no longer needed, so remove it together with the associated structure definitions.
--- include/lib.h | 12 ------------ 1 file changed, 12 deletions(-)
include/lib.h +0 -12
@@ -173,15 +173,6 @@ enum fd_type { FTYPE_TPM_TIS, }; -LIST_HEAD (evtchn_port_list, evtchn_port_info); - -struct evtchn_port_info { -LIST_ENTRY (evtchn_port_info) list; -evtchn_port_t port; -unsigned long pending; -int bound; -}; -struct file {enum fd_type type;bool read;/* maybe available for read */
@@ -189,9 +180,6 @@ struct file {union {int fd;/* Any fd from an upper layer. */ void *dev; -struct { -struct evtchn_port_list ports; - } evtchn;struct gntmap gntmap; }; };
Signature · 1 line
2.26.2
PATCH 2/2 mini-os: remove gnttab specific member from struct file
In reply to Juergen GrossThe event channel specific union member in struct file is no longer needed, so remove it
--- include/lib.h | 1 - 1 file changed, 1 deletion(-)
include/lib.h +0 -1
@@ -180,7 +180,6 @@ struct file {union {int fd;/* Any fd from an upper layer. */ void *dev; -struct gntmap gntmap; }; };
Signature · 1 line
2.26.2
Quoted 8 lines · Juergen Gross
This small series is a followup to the series sent recently:
https://lists.xen.org/archives/html/xen-devel/2022-01/threads.html#00110
It contains the last cleanups related to struct file and can only be applied after the Xen libraries have stopped using the related union members.
Quoted 7 lines
Juergen Gross (2):
mini-os: remove event channel specific struct file member
mini-os: remove gnttab specific member from struct fileinclude/lib.h | 13 ------------- 1 file changed, 13 deletions(-)
This all looks fine. Even if we don't want to hide struct file, shouldn't we at least make the files[] array private to the MiniOS core? It's another implementation detail which external users mustn't rely on.
~Andrew
Quoted 13 lines · Andrew Cooper
Quoted 12 lines · Juergen Gross
This small series is a followup to the series sent recently:
https://lists.xen.org/archives/html/xen-devel/2022-01/threads.html#00110
It contains the last cleanups related to struct file and can only be applied after the Xen libraries have stopped using the related union members.
Juergen Gross (2):
mini-os: remove event channel specific struct file member
mini-os: remove gnttab specific member from struct file
Quoted 8 lines
Quoted 3 lines
include/lib.h | 13 ------------- 1 file changed, 13 deletions(-)This all looks fine. Even if we don't want to hide struct file, shouldn't we at least make the files[] array private to the MiniOS core? It's another implementation detail which external users mustn't rely on.
In theory yes.
This will need some more work either by splitting headers or by using get_file_from_fd() everywhere in Mini-OS.
Juergen
Re: [PATCH 1/2] mini-os: remove event channel specific struct file member
In reply to Juergen GrossJuergen Gross, le ven. 07 janv. 2022 11:47:05 +0100, a ecrit:
Quoted 2 lines
The event channel specific union member in struct file is no longer needed,
Doesn't xen/tools/libs/evtchn/minios.c use it?
Quoted 40 lines
so remove it together with the associated structure definitions.
Signed-off-by Juergen Gross <[email protected]>--- include/lib.h | 12 ------------ 1 file changed, 12 deletions(-)include/lib.h +0
-12@@ -173,15 +173,6 @@ enum fd_type { FTYPE_TPM_TIS, }; -LIST_HEAD (evtchn_port_list, evtchn_port_info); - -struct evtchn_port_info { -LIST_ENTRY (evtchn_port_info) list; -evtchn_port_t port; -unsigned long pending; -int bound; -}; -struct file {enum fd_type type;bool read;/* maybe available for read */ @@ -189,9 +180,6 @@ struct file {union {int fd;/* Any fd from an upper layer. */ void *dev; -struct { -struct evtchn_port_list ports; - } evtchn;struct gntmap gntmap; }; };Signature · 1 line
2.26.2
Juergen Gross, le ven. 07 janv. 2022 11:47:04 +0100, a ecrit:
Quoted 2 lines
can only be applied after the Xen libraries have stopped using the related union members.
Ah, ok :) Was that submitted somewhere?
Samuel
Quoted 5 lines · Samuel Thibault
Juergen Gross, le ven. 07 janv. 2022 11:47:04 +0100, a ecrit:
Quoted 2 lines
can only be applied after the Xen libraries have stopped using the related union members.
Ah, ok :) Was that submitted somewhere?
I've sent the patches, but they can be applied only after the first Mini-OS series has been applied and the Xen build is using the updated Mini-OS tree.
Meanwhile I've found a way to decouple Mini-OS and the Xen libs even further. So this series and the Xen one will be updated.
In the end the libs will use dynamic hooks and Mini-OS will no longer need to have a config knob for supporting the libs (other than having libc enabled).
Juergen
Re: [PATCH 1/2] mini-os: remove event channel specific struct file member
In reply to Samuel ThibaultQuoted 5 lines · Samuel Thibault
Juergen Gross, le ven. 07 janv. 2022 11:47:05 +0100, a ecrit:
Quoted 2 lines
The event channel specific union member in struct file is no longer needed,
Doesn't
xen/tools/libs/evtchn/minios.cuse it?
Not after the Xen patches have been applied.
Juergen
Quoted 4 lines · Samuel Thibault
Juergen Gross, le ven. 07 janv. 2022 11:47:04 +0100, a ecrit:
Quoted 2 lines
can only be applied after the Xen libraries have stopped using the related union members.
Ah, ok :) Was that submitted somewhere?
https://lore.kernel.org/xen-devel/[email protected]/T/#u
~Andrew
Andrew Cooper, le lun. 10 janv. 2022 11:35:14 +0000, a ecrit:
Quoted 7 lines · Samuel Thibault
Quoted 4 lines
Juergen Gross, le ven. 07 janv. 2022 11:47:04 +0100, a ecrit:
Quoted 2 lines
can only be applied after the Xen libraries have stopped using the related union members.
Ah, ok :) Was that submitted somewhere?
Ok!
Samuel