Re: [PATCH v2 09/12] mini-os: use file_ops and get_file_from_fd() for console

2022-01-11 Thread Juergen Gross
On 11.01.22 21:35, Samuel Thibault wrote: Juergen Gross, le mar. 11 janv. 2022 16:12:12 +0100, a ecrit: +static int consfront_fstat(int fd, struct stat *buf) +{ +struct file *file = get_file_from_fd(fd); + +buf->st_mode = S_IRUSR | S_IWUSR; +buf->st_mode |= (file->type == FTYPE_CONSO

Re: [PATCH v2 04/12] mini-os: use alloc_file_type() and get_file_from_fd() in tpm_tis

2022-01-11 Thread Juergen Gross
On 11.01.22 21:29, Andrew Cooper wrote: On 11/01/2022 15:12, Juergen Gross wrote: diff --git a/tpm_tis.c b/tpm_tis.c index 477f555..abea7a1 100644 --- a/tpm_tis.c +++ b/tpm_tis.c @@ -1093,6 +1097,23 @@ ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t subcap_id, cap_t *cap, return rc

Re: [PATCH v2 08/12] mini-os: use alloc_file_type() and get_file_from_fd() in fbfront

2022-01-11 Thread Juergen Gross
On 11.01.22 21:26, Samuel Thibault wrote: Juergen Gross, le mar. 11 janv. 2022 16:12:11 +0100, a ecrit: +static struct file_ops fb_ops = { +.name = ".fb", Why a dot? I had spare one lying around... ;-) Thanks for noticing! Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP

Re: [PATCH v2 03/12] mini-os: use alloc_file_type() and get_file_from_fd() in xs

2022-01-11 Thread Juergen Gross
On 11.01.22 21:21, Andrew Cooper wrote: On 11/01/2022 15:12, Juergen Gross wrote: void xs_daemon_close(struct xs_handle *h) { -int fd = _xs_fileno(h); -struct xenbus_event *event, *next; -for (event = files[fd].dev; event; event = next) -{ -next = event->next; -

Re: [PATCH v2 02/12] mini-os: remove gnttab specific member from struct file

2022-01-11 Thread Juergen Gross
On 11.01.22 21:12, Andrew Cooper wrote: On 11/01/2022 15:12, Juergen Gross wrote: The event channel specific union member in struct file is no longer Too much copy&paste from the previous patch? Seems so, yes. :-) Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key O

Re: [XEN PATCH 2/7] xen: introduce _evtchn_alloc_unbound

2022-01-11 Thread Jan Beulich
On 11.01.2022 23:49, Stefano Stabellini wrote: > On Mon, 10 Jan 2022, Jan Beulich wrote: >> On 08.01.2022 01:49, Stefano Stabellini wrote: >>> @@ -284,11 +285,32 @@ void evtchn_free(struct domain *d, struct evtchn *chn) >>> xsm_evtchn_close_post(chn); >>> } >>> >>> -static int evtchn_alloc_

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Juergen Gross
On 11.01.22 21:05, Samuel Thibault wrote: Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit: @@ -370,8 +413,45 @@ int write(int fd, const void *buf, size_t nbytes) return -1; } +off_t lseek_default(int fd, off_t offset, int whence) +{ +switch ( whence ) +{ Is the

Re: [PATCH v2 00/18] mini-os: remove struct file dependency on config

2022-01-11 Thread Juergen Gross
On 11.01.22 20:42, Andrew Cooper wrote: On 11/01/2022 14:57, Juergen Gross wrote: Today the layout of struct file is depending on the Mini-OS configuration. This is especially bad as the layout is exported to external users like the Xen libraries built for Mini-OS, and those are being built only

Re: [PATCH v2 16/18] mini-os: reset file type in close() in one place only

2022-01-11 Thread Juergen Gross
On 11.01.22 20:14, Andrew Cooper wrote: On 11/01/2022 14:58, Juergen Gross wrote: diff --git a/lib/sys.c b/lib/sys.c index 0e6fe5d..323a7cd 100644 --- a/lib/sys.c +++ b/lib/sys.c @@ -424,87 +424,82 @@ int fsync(int fd) { int close(int fd) { +int res = 0; + printk("close(%d)\n",

Re: [PATCH v2 18/18] mini-os: remove file type FTYPE_XC

2022-01-11 Thread Juergen Gross
On 11.01.22 19:19, Andrew Cooper wrote: On 11/01/2022 14:58, Juergen Gross wrote: The only reason for the file type FTYPE_XC has been gone long time ago: it was needed for xc_map_foreign_bulk(), which has been switched to use libxenforeignmemory and doesn't need this special file any more. So r

Re: [PATCH v2 15/18] mini-os: introduce get_file_from_fd()

2022-01-11 Thread Juergen Gross
On 11.01.22 19:17, Andrew Cooper wrote: On 11/01/2022 14:58, Juergen Gross wrote: diff --git a/lib/sys.c b/lib/sys.c index 6f2b026..0e6fe5d 100644 --- a/lib/sys.c +++ b/lib/sys.c @@ -98,6 +98,14 @@ struct file files[NOFILE] = { { .type = FTYPE_CONSOLE }, /* stderr */ }; +struct file *

Re: [PATCH v2 16/18] mini-os: reset file type in close() in one place only

2022-01-11 Thread Juergen Gross
On 11.01.22 19:11, Andrew Cooper wrote: On 11/01/2022 14:58, Juergen Gross wrote: diff --git a/lib/sys.c b/lib/sys.c index 0e6fe5d..323a7cd 100644 --- a/lib/sys.c +++ b/lib/sys.c @@ -424,87 +424,82 @@ int fsync(int fd) { int close(int fd) { +int res = 0; + printk("close(%d)\n",

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Juergen Gross
On 11.01.22 19:08, Andrew Cooper wrote: On 11/01/2022 14:58, Juergen Gross wrote: Introduce file type specific function vectors for all the needed file operations which are file type specific in order to prepare replacing the large switch statements in each generic file function. Add a function

Re: [PATCH v2 2/3] tools/libs/gnttab: decouple more from mini-os

2022-01-11 Thread Juergen Gross
On 11.01.22 21:08, Andrew Cooper wrote: On 11/01/2022 15:03, Juergen Gross wrote: libgnttab is using implementation details of Mini-OS. Change that by letting libgnttab use the new alloc_file_type() and get_file_from_fd() functions and the generic dev pointer of struct file from Mini-OS. Signed

Re: [PATCH v2 1/3] tools/libs/evtchn: decouple more from mini-os

2022-01-11 Thread Juergen Gross
On 11.01.22 20:56, Andrew Cooper wrote: On 11/01/2022 15:03, Juergen Gross wrote: diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c index e5dfdc5ef5..c3a5ce3b98 100644 --- a/tools/libs/evtchn/minios.c +++ b/tools/libs/evtchn/minios.c @@ -38,29 +38,40 @@ #include "private.

[linux-5.4 test] 167663: tolerable FAIL - PUSHED

2022-01-11 Thread osstest service owner
flight 167663 linux-5.4 real [real] flight 167670 linux-5.4 real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/167663/ http://logs.test-lab.xenproject.org/osstest/logs/167670/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-amd6

Re: [patch] genirq/msi: Populate sysfs entry only once

2022-01-11 Thread Kunihiko Hayashi
Hi Thomas, Is this fix the same as below? https://marc.info/?l=linux-kernel&m=164061119923119&w=2 On 2022/01/11 3:12, Thomas Gleixner wrote: The MSI entries for multi-MSI are populated en bloc for the MSI descriptor, but the current code invokes the population inside the per interrupt loop whic

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Samuel Thibault
On second thought: Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit: > +typedef int file_read_func(int fd, void *buf, size_t nbytes); > +typedef int file_write_func(int fd, const void *buf, size_t nbytes); > +typedef off_t file_lseek_func(int fd, off_t offset, int whence); > +typedef i

[linux-linus test] 167662: tolerable FAIL - PUSHED

2022-01-11 Thread osstest service owner
flight 167662 linux-linus real [real] flight 167666 linux-linus real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/167662/ http://logs.test-lab.xenproject.org/osstest/logs/167666/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-armhf-

[xen-unstable test] 167661: tolerable FAIL - PUSHED

2022-01-11 Thread osstest service owner
flight 167661 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/167661/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stopfail like 167654 test-amd64-amd64-qemuu-nested-amd 20

Re: [XEN PATCH 4/7] xen: introduce xen,enhanced dom0less property

2022-01-11 Thread Stefano Stabellini
On Tue, 11 Jan 2022, Volodymyr Babchuk wrote: > Hi Stefano, > > Stefano Stabellini writes: > > > From: Stefano Stabellini > > > > Introduce a new "xen,enhanced" dom0less property to enable/disable PV > > driver interfaces for dom0less guests. Currently only "enabled" and > > "disabled" are supp

Re: [XEN PATCH 1/7] xen: introduce XENFEAT_xenstore_late_init

2022-01-11 Thread Stefano Stabellini
On Tue, 11 Jan 2022, David Vrabel wrote: > On 10/01/2022 22:55, Stefano Stabellini wrote: > > > > I have a patch for Linux that if XENFEAT_xenstore_late_init is present > > makes Linux wait for an event notification before initializing xenstore: > > https://marc.info/?l=xen-devel&m=164160299315589

Re: [XEN PATCH 1/7] xen: introduce XENFEAT_xenstore_late_init

2022-01-11 Thread Stefano Stabellini
On Tue, 11 Jan 2022, Jan Beulich wrote: > On 11.01.2022 00:08, Stefano Stabellini wrote: > > On Mon, 10 Jan 2022, Jan Beulich wrote: > >> On 08.01.2022 01:49, Stefano Stabellini wrote: > >>> Introduce a new feature flag to signal that xenstore will not be > >>> immediately available at boot time. I

Re: [XEN PATCH 2/7] xen: introduce _evtchn_alloc_unbound

2022-01-11 Thread Stefano Stabellini
On Mon, 10 Jan 2022, Jan Beulich wrote: > On 08.01.2022 01:49, Stefano Stabellini wrote: > > @@ -284,11 +285,32 @@ void evtchn_free(struct domain *d, struct evtchn *chn) > > xsm_evtchn_close_post(chn); > > } > > > > -static int evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc) > > +struct

Re: [PATCH] MAINTAINERS: requesting to be txt reviewer

2022-01-11 Thread Stefano Stabellini
On Tue, 11 Jan 2022, Daniel P. Smith wrote: > I would like to submit myself, Daniel P. Smith, as a reviewer of TXT support > in > Xen. > > Signed-off-by: Daniel P. Smith Acked-by: Stefano Stabellini > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/MAINTAINERS b/

Re: [PATCH v2 04/12] mini-os: use alloc_file_type() and get_file_from_fd() in tpm_tis

2022-01-11 Thread Jason Andryuk
On Tue, Jan 11, 2022 at 3:29 PM Andrew Cooper wrote: > > On 11/01/2022 15:12, Juergen Gross wrote: > > diff --git a/tpm_tis.c b/tpm_tis.c > > index 477f555..abea7a1 100644 > > --- a/tpm_tis.c > > +++ b/tpm_tis.c > > @@ -1093,6 +1097,23 @@ ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t > > sub

[qemu-mainline test] 167659: tolerable FAIL - PUSHED

2022-01-11 Thread osstest service owner
flight 167659 qemu-mainline real [real] flight 167664 qemu-mainline real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/167659/ http://logs.test-lab.xenproject.org/osstest/logs/167664/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-ar

Re: [PATCH v2 12/12] mini-os: make files array private to sys.c

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:15 +0100, a ecrit: > There is no user of the files[] array outside of lib/sys.c left, so > it can be made static. Yay! > Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault > --- > include/lib.h | 2 -- > lib/sys.c | 2 +- > 2 files change

Re: [PATCH v2 11/12] mini-os: add struct file_ops for FTYPE_FILE

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:14 +0100, a ecrit: > FTYPE_FILE is the last relevant file type without a struct file_ops. > Add it. > > Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault > --- > lib/sys.c | 19 +-- > 1 file changed, 9 insertions(+), 10 deleti

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Samuel Thibault
Samuel Thibault, le mar. 11 janv. 2022 21:05:47 +0100, a ecrit: > Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit: > > @@ -370,8 +413,45 @@ int write(int fd, const void *buf, size_t nbytes) > > return -1; > > } > > > > +off_t lseek_default(int fd, off_t offset, int whence) > >

Re: [PATCH v2 10/12] mini-os: add struct file_ops for file type socket

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:13 +0100, a ecrit: > +static int socket_fstat(int fd, struct stat *buf) > +{ > +buf->st_mode = S_IFSOCK | S_IRUSR | S_IWUSR; > +buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL); > + > +return 0; > +} Similarly, this seems to be missi

Re: [PATCH v2 09/12] mini-os: use file_ops and get_file_from_fd() for console

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:12 +0100, a ecrit: > +static int consfront_fstat(int fd, struct stat *buf) > +{ > +struct file *file = get_file_from_fd(fd); > + > +buf->st_mode = S_IRUSR | S_IWUSR; > +buf->st_mode |= (file->type == FTYPE_CONSOLE) ? S_IFCHR : S_IFREG; > +b

Re: [PATCH v2 04/12] mini-os: use alloc_file_type() and get_file_from_fd() in tpm_tis

2022-01-11 Thread Andrew Cooper
On 11/01/2022 15:12, Juergen Gross wrote: > diff --git a/tpm_tis.c b/tpm_tis.c > index 477f555..abea7a1 100644 > --- a/tpm_tis.c > +++ b/tpm_tis.c > @@ -1093,6 +1097,23 @@ ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t > subcap_id, cap_t *cap, > return rc; > } > > +static void shut

Re: [PATCH v2 08/12] mini-os: use alloc_file_type() and get_file_from_fd() in fbfront

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:11 +0100, a ecrit: > +static struct file_ops fb_ops = { > +.name = ".fb", Why a dot? Apart from that, and modulo the int fd / file * thing, Reviewed-by: Samuel Thibault

Re: [PATCH v2 07/12] mini-os: use get_file_from_fd() in netfront

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:10 +0100, a ecrit: > Instead of directly accessing the files[] array use get_file_from_fd(). > > Signed-off-by: Juergen Gross modulo the int fd / file * thing, Reviewed-by: Samuel Thibault > --- > include/lib.h | 3 +-- > lib/sys.c | 23 ---

Re: [PATCH v2 03/12] mini-os: use alloc_file_type() and get_file_from_fd() in xs

2022-01-11 Thread Andrew Cooper
On 11/01/2022 15:12, Juergen Gross wrote: > void xs_daemon_close(struct xs_handle *h) > { > -int fd = _xs_fileno(h); > -struct xenbus_event *event, *next; > -for (event = files[fd].dev; event; event = next) > -{ > -next = event->next; > -free(event); > -} > +

Re: [PATCH v2 06/12] mini-os: use alloc_file_type() and get_file_from_fd() in blkfront

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:09 +0100, a ecrit: > Allocate the file type dynamically via alloc_file_type(). > > Instead of directly accessing the files[] array use get_file_from_fd(). > > Signed-off-by: Juergen Gross modulo the int fd / file * thing, Reviewed-by: Samuel Thibault

Re: [PATCH v2 05/12] mini-os: use alloc_file_type() and get_file_from_fd() in tpmfront

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:08 +0100, a ecrit: > Allocate a file type dynamically via alloc_file_type(). > > Instead of directly accessing the files[] array use get_file_from_fd(). > > Signed-off-by: Juergen Gross modulo the int fd / file * thing, Reviewed-by: Samuel Thibault

Re: [PATCH v2 03/12] mini-os: use alloc_file_type() and get_file_from_fd() in xs

2022-01-11 Thread Andrew Cooper
On 11/01/2022 20:11, Samuel Thibault wrote: > Samuel Thibault, le mar. 11 janv. 2022 21:06:15 +0100, a ecrit: >> Juergen Gross, le mar. 11 janv. 2022 16:12:06 +0100, a ecrit: >>> diff --git a/lib/xs.c b/lib/xs.c >>> index 4af0f96..ac830d2 100644 >>> --- a/lib/xs.c >>> +++ b/lib/xs.c >>> @@ -18,23 +

Re: [PATCH v2 04/12] mini-os: use alloc_file_type() and get_file_from_fd() in tpm_tis

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:07 +0100, a ecrit: > Allocate a file type dynamically via alloc_file_type(). > > Instead of directly accessing the files[] array use get_file_from_fd(). > > Make some now local functions static and modify their prototypes to > match the file_ops requirem

Re: [PATCH v2 02/12] mini-os: remove gnttab specific member from struct file

2022-01-11 Thread Andrew Cooper
On 11/01/2022 15:12, Juergen Gross wrote: > The event channel specific union member in struct file is no longer Too much copy&paste from the previous patch? The actual contents look fine. ~Andrew > needed, so remove it. > > The gnttab file type and its associated handling can be removed, too, >

Re: [PATCH v2 03/12] mini-os: use alloc_file_type() and get_file_from_fd() in xs

2022-01-11 Thread Samuel Thibault
Samuel Thibault, le mar. 11 janv. 2022 21:06:15 +0100, a ecrit: > Juergen Gross, le mar. 11 janv. 2022 16:12:06 +0100, a ecrit: > > Allocate the needed file type via alloc_file_type(). > > > > Instead of directly accessing the files[] array use get_file_from_fd(). > > > > Signed-off-by: Juergen G

Re: [PATCH v2 3/3] tools/libs/ctrl: remove file related handling

2022-01-11 Thread Andrew Cooper
On 11/01/2022 15:03, Juergen Gross wrote: > There is no special file handling related to libxenctrl in Mini-OS > any longer, so the close hook can be removed. > > Signed-off-by: Juergen Gross Acked-by: Andrew Cooper > --- > V2: > - new patch > --- > tools/libs/ctrl/xc_minios.c | 9 - >

Re: [PATCH v2 2/3] tools/libs/gnttab: decouple more from mini-os

2022-01-11 Thread Andrew Cooper
On 11/01/2022 15:03, Juergen Gross wrote: > libgnttab is using implementation details of Mini-OS. Change that by > letting libgnttab use the new alloc_file_type() and get_file_from_fd() > functions and the generic dev pointer of struct file from Mini-OS. > > Signed-off-by: Juergen Gross > --- > V2

Re: [PATCH v2 03/12] mini-os: use alloc_file_type() and get_file_from_fd() in xs

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:06 +0100, a ecrit: > Allocate the needed file type via alloc_file_type(). > > Instead of directly accessing the files[] array use get_file_from_fd(). > > Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault > --- > include/lib.h | 3 +-- > l

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit: > @@ -370,8 +413,45 @@ int write(int fd, const void *buf, size_t nbytes) > return -1; > } > > +off_t lseek_default(int fd, off_t offset, int whence) > +{ > +switch ( whence ) > +{ Is there a reason for making this one a

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 15:58:16 +0100, a ecrit: > +for ( i = FTYPE_N; i < ARRAY_SIZE(file_ops) && file_ops[i]; i++ ); For such loops, I'd rather see the ';' on its own line, to make it clear it's an empty loop. Samuel

Re: [PATCH v2 1/3] tools/libs/evtchn: decouple more from mini-os

2022-01-11 Thread Andrew Cooper
On 11/01/2022 15:03, Juergen Gross wrote: > diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c > index e5dfdc5ef5..c3a5ce3b98 100644 > --- a/tools/libs/evtchn/minios.c > +++ b/tools/libs/evtchn/minios.c > @@ -38,29 +38,40 @@ > > #include "private.h" > > -extern void minios_ev

Re: [PATCH v2 02/12] mini-os: remove gnttab specific member from struct file

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:05 +0100, a ecrit: > The event channel specific union member in struct file is no longer > needed, so remove it. > > The gnttab file type and its associated handling can be removed, too, > as libxengnttab is now supplying a struct file_ops via a call of >

Re: [PATCH v2 01/12] mini-os: remove event channel specific struct file definitions

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 16:12:04 +0100, a ecrit: > The event channel specific union member in struct file is no longer > needed, so remove it together with the associated structure > definitions. > > The event channel file type and its associated handling can be removed, > too, as lib

Re: [PATCH v2 00/18] mini-os: remove struct file dependency on config

2022-01-11 Thread Andrew Cooper
On 11/01/2022 14:57, Juergen Gross wrote: > Today the layout of struct file is depending on the Mini-OS > configuration. This is especially bad as the layout is exported to > external users like the Xen libraries built for Mini-OS, and those > are being built only once for multiple stubdom configur

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Samuel Thibault
Andrew Cooper, le mar. 11 janv. 2022 18:08:27 +, a ecrit: > On 11/01/2022 14:58, Juergen Gross wrote: > > +typedef int file_read_func(int fd, void *buf, size_t nbytes); > > +typedef int file_write_func(int fd, const void *buf, size_t nbytes); > > +typedef off_t file_lseek_func(int fd, off_t off

Re: [PATCH v2 16/18] mini-os: reset file type in close() in one place only

2022-01-11 Thread Andrew Cooper
On 11/01/2022 14:58, Juergen Gross wrote: > diff --git a/lib/sys.c b/lib/sys.c > index 0e6fe5d..323a7cd 100644 > --- a/lib/sys.c > +++ b/lib/sys.c > @@ -424,87 +424,82 @@ int fsync(int fd) { > > int close(int fd) > { > +int res = 0; > + > printk("close(%d)\n", fd); > switch (files

Re: [PATCH] MAINTAINERS: requesting to be txt reviewer

2022-01-11 Thread Andrew Cooper
On 11/01/2022 21:21, Daniel P. Smith wrote: > I would like to submit myself, Daniel P. Smith, as a reviewer of TXT support > in > Xen. > > Signed-off-by: Daniel P. Smith Acked-by: Andrew Cooper

Re: [PATCH v2 18/18] mini-os: remove file type FTYPE_XC

2022-01-11 Thread Andrew Cooper
On 11/01/2022 14:58, Juergen Gross wrote: > The only reason for the file type FTYPE_XC has been gone long time > ago: it was needed for xc_map_foreign_bulk(), which has been switched > to use libxenforeignmemory and doesn't need this special file any > more. > > So remove everything related to FTYP

Re: [PATCH v2 15/18] mini-os: introduce get_file_from_fd()

2022-01-11 Thread Andrew Cooper
On 11/01/2022 14:58, Juergen Gross wrote: > diff --git a/lib/sys.c b/lib/sys.c > index 6f2b026..0e6fe5d 100644 > --- a/lib/sys.c > +++ b/lib/sys.c > @@ -98,6 +98,14 @@ struct file files[NOFILE] = { > { .type = FTYPE_CONSOLE }, /* stderr */ > }; > > +struct file *get_file_from_fd(int fd) > +

Re: [PATCH v2 16/18] mini-os: reset file type in close() in one place only

2022-01-11 Thread Andrew Cooper
On 11/01/2022 14:58, Juergen Gross wrote: > diff --git a/lib/sys.c b/lib/sys.c > index 0e6fe5d..323a7cd 100644 > --- a/lib/sys.c > +++ b/lib/sys.c > @@ -424,87 +424,82 @@ int fsync(int fd) { > > int close(int fd) > { > +int res = 0; > + > printk("close(%d)\n", fd); > switch (files

Re: [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Andrew Cooper
On 11/01/2022 14:58, Juergen Gross wrote: > Introduce file type specific function vectors for all the needed file > operations which are file type specific in order to prepare replacing > the large switch statements in each generic file function. > > Add a function to allocate a new file type dynam

[PATCH] MAINTAINERS: requesting to be txt reviewer

2022-01-11 Thread Daniel P. Smith
I would like to submit myself, Daniel P. Smith, as a reviewer of TXT support in Xen. Signed-off-by: Daniel P. Smith --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6e84a05760..4a2884dfa7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -317,6 +317

Re: [PATCH v2 2/2] x86/paging: replace most mfn_valid() in log-dirty handling

2022-01-11 Thread Andrew Cooper
On 06/12/2021 13:25, Jan Beulich wrote: > Top level table and intermediate table entries get explicitly set to > INVALID_MFN when un-allocated. There's therefore no need to use the more > expensive mfn_valid() when checking for that sentinel. > > Suggested-by: Andrew Cooper > Signed-off-by: Jan Be

Re: [PATCH v2 1/2] x86/paging: tidy paging_mfn_is_dirty()

2022-01-11 Thread Andrew Cooper
On 06/12/2021 13:25, Jan Beulich wrote: > The function returning a boolean indicator, make it return bool. Also > constify its struct domain parameter, albeit requiring to also adjust > mm_locked_by_me(). Furthermore the function is used by shadow code only. > > Since mm_locked_by_me() needs touchi

Re: [PATCH v5 04/14] vpci: cancel pending map/unmap on vpci removal

2022-01-11 Thread Roger Pau Monné
On Thu, Nov 25, 2021 at 01:02:41PM +0200, Oleksandr Andrushchenko wrote: > From: Oleksandr Andrushchenko > > When a vPCI is removed for a PCI device it is possible that we have > scheduled a delayed work for map/unmap operations for that device. > For example, the following scenario can illustrat

[PATCH 2/2] tools/libs/gnttab: make mini-os specific callback static

2022-01-11 Thread Juergen Gross
It is possible now to make the callback for Mini-OS static, as it is only referenced via the file_ops vector. Signed-off-by: Juergen Gross --- tools/libs/gnttab/minios.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/libs/gnttab/minios.c b/tools/libs/gnttab/minios.c

[PATCH 0/2] tools/libs: final cleanup making mini-os callbacks static

2022-01-11 Thread Juergen Gross
This is a final patch series making the callbacks static now referenced by the file_ops vector only. Note that this series depends on the related Mini-OS series to have gone in: https://lists.xen.org/archives/html/xen-devel/2022-01/threads.html#00369 Juergen Gross (2): tools/libs/evtchn: make

[PATCH 1/2] tools/libs/evtchn: make mini-os specific callback static

2022-01-11 Thread Juergen Gross
It is possible now to make the callback for Mini-OS static, as it is only referenced via the file_ops vector. Signed-off-by: Juergen Gross --- tools/libs/evtchn/minios.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c

Re: [PATCH v2 16/18] mini-os: reset file type in close() in one place only

2022-01-11 Thread Samuel Thibault
Juergen Gross, le mar. 11 janv. 2022 15:58:15 +0100, a ecrit: > Today the file type in struct file is set to FTYPE_NONE for each > file type individually. Do that at the end of close() handling for > all types. > > While at it wipe the complete struct file, too, in order to avoid > old data creepi

[PATCH v2 08/12] mini-os: use alloc_file_type() and get_file_from_fd() in fbfront

2022-01-11 Thread Juergen Gross
Allocate file types dynamically via alloc_file_type(). Instead of directly accessing the files[] array use get_file_from_fd(). Signed-off-by: Juergen Gross --- fbfront.c | 125 ++ include/lib.h | 4 +- lib/sys.c | 47 ---

[PATCH v2 10/12] mini-os: add struct file_ops for file type socket

2022-01-11 Thread Juergen Gross
Even with some special handling needed in select_poll(), add a struct file_ops for FTYPE_SOCKET. Due to the need of the special handling it isn't possible to use a dynamically allocated file type. Most functions calling the file_ops methods can be simplified a lot now that no file type specific ha

Re: [PATCH v5 03/14] vpci: move lock outside of struct vpci

2022-01-11 Thread Roger Pau Monné
On Thu, Nov 25, 2021 at 01:02:40PM +0200, Oleksandr Andrushchenko wrote: > diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c > index 657697fe3406..ceaac4516ff8 100644 > --- a/xen/drivers/vpci/vpci.c > +++ b/xen/drivers/vpci/vpci.c > @@ -35,12 +35,10 @@ extern vpci_register_init_t *cons

[PATCH v2 12/12] mini-os: make files array private to sys.c

2022-01-11 Thread Juergen Gross
There is no user of the files[] array outside of lib/sys.c left, so it can be made static. Signed-off-by: Juergen Gross --- include/lib.h | 2 -- lib/sys.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/lib.h b/include/lib.h index c171fe8..80e804b 100644 --- a/

[PATCH v2 06/12] mini-os: use alloc_file_type() and get_file_from_fd() in blkfront

2022-01-11 Thread Juergen Gross
Allocate the file type dynamically via alloc_file_type(). Instead of directly accessing the files[] array use get_file_from_fd(). Signed-off-by: Juergen Gross --- blkfront.c | 92 ++ include/blkfront.h | 5 --- include/lib.h | 3 +- lib

[PATCH v2 11/12] mini-os: add struct file_ops for FTYPE_FILE

2022-01-11 Thread Juergen Gross
FTYPE_FILE is the last relevant file type without a struct file_ops. Add it. Signed-off-by: Juergen Gross --- lib/sys.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/sys.c b/lib/sys.c index 12deaed..0f42e97 100644 --- a/lib/sys.c +++ b/lib/sys.c @@

[PATCH v2 09/12] mini-os: use file_ops and get_file_from_fd() for console

2022-01-11 Thread Juergen Gross
Add struct file_ops for the console related file types (FTYPE_CONSOLE and savefile). FTYPE_CONSOLE remains statically defined, as it is used to statically init stdin, stdout and stderr. Instead of directly accessing the files[] array use get_file_from_fd(). With CONSOLE now handled via file_ops t

[PATCH v2 07/12] mini-os: use get_file_from_fd() in netfront

2022-01-11 Thread Juergen Gross
Instead of directly accessing the files[] array use get_file_from_fd(). Signed-off-by: Juergen Gross --- include/lib.h | 3 +-- lib/sys.c | 23 -- netfront.c| 64 --- 3 files changed, 57 insertions(+), 33 deletions(-) diff

[PATCH v2 04/12] mini-os: use alloc_file_type() and get_file_from_fd() in tpm_tis

2022-01-11 Thread Juergen Gross
Allocate a file type dynamically via alloc_file_type(). Instead of directly accessing the files[] array use get_file_from_fd(). Make some now local functions static and modify their prototypes to match the file_ops requirements. Signed-off-by: Juergen Gross --- include/lib.h | 3 +- incl

[PATCH v2 05/12] mini-os: use alloc_file_type() and get_file_from_fd() in tpmfront

2022-01-11 Thread Juergen Gross
Allocate a file type dynamically via alloc_file_type(). Instead of directly accessing the files[] array use get_file_from_fd(). Signed-off-by: Juergen Gross --- include/lib.h | 3 +- include/tpmfront.h | 5 --- lib/sys.c | 23 --- tpmfront.c | 100

[PATCH v2 00/12] mini-os: remove device specific struct file members

2022-01-11 Thread 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#00347 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: https://lists.x

[PATCH v2 03/12] mini-os: use alloc_file_type() and get_file_from_fd() in xs

2022-01-11 Thread Juergen Gross
Allocate the needed file type via alloc_file_type(). Instead of directly accessing the files[] array use get_file_from_fd(). Signed-off-by: Juergen Gross --- include/lib.h | 3 +-- lib/sys.c | 18 -- lib/xs.c| 64 + xe

[PATCH v2 02/12] mini-os: remove gnttab specific member from struct file

2022-01-11 Thread Juergen Gross
The event channel specific union member in struct file is no longer needed, so remove it. The gnttab file type and its associated handling can be removed, too, as libxengnttab is now supplying a struct file_ops via a call of alloc_file_type(). This removes all contents of CONFIG_LIBXENGNTTAB guar

[PATCH v2 01/12] mini-os: remove event channel specific struct file definitions

2022-01-11 Thread Juergen Gross
The event channel specific union member in struct file is no longer needed, so remove it together with the associated structure definitions. The event channel file type and its associated handling can be removed, too, as libxenevtchn is now supplying a struct file_ops via a call of alloc_file_type

[PATCH v2 16/18] mini-os: reset file type in close() in one place only

2022-01-11 Thread Juergen Gross
Today the file type in struct file is set to FTYPE_NONE for each file type individually. Do that at the end of close() handling for all types. While at it wipe the complete struct file, too, in order to avoid old data creeping into a new allocated struct file. Signed-off-by: Juergen Gross --- V2

[PATCH v2 08/18] mini-os: eliminate fbfront union member in struct file

2022-01-11 Thread Juergen Gross
Replace the fbfront specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- fbfront.c | 2 +- include/lib.h | 3 --- lib/sys.c | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fbfront.c b/fbf

[PATCH v2 15/18] mini-os: introduce get_file_from_fd()

2022-01-11 Thread Juergen Gross
Exporting the files[] array especially for components outside the mini-os source tree is limiting the ability to change any file handling in mini-os. Introduce a new function get_file_from_fd() to return the struct file pointer (or NULL) for a given file descriptor. Signed-off-by: Juergen Gross

[PATCH v2 12/18] mini-os: eliminate tpmfront union member in struct file

2022-01-11 Thread Juergen Gross
Replace the tpmfront specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- include/lib.h | 5 - lib/sys.c | 2 +- tpmfront.c| 8 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include

[PATCH v2 13/18] mini-os: eliminate tpmtis union member in struct file

2022-01-11 Thread Juergen Gross
Replace the tpmtis specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- include/lib.h | 5 - lib/sys.c | 2 +- tpm_tis.c | 8 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/l

[PATCH v2 02/18] mini-os: makes file.read bool and move it ahead of device specific part

2022-01-11 Thread Juergen Gross
The read member of struct file should be bool. In order to have the device specific part at the end of the structure move "read" ahead of that. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- blkfront.c | 4 ++-- console/xencons_ring.c | 2 +- fbfront.c

[PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations

2022-01-11 Thread Juergen Gross
Introduce file type specific function vectors for all the needed file operations which are file type specific in order to prepare replacing the large switch statements in each generic file function. Add a function to allocate a new file type dynamically in order to prepare removing direct dependen

[PATCH v2 18/18] mini-os: remove file type FTYPE_XC

2022-01-11 Thread Juergen Gross
The only reason for the file type FTYPE_XC has been gone long time ago: it was needed for xc_map_foreign_bulk(), which has been switched to use libxenforeignmemory and doesn't need this special file any more. So remove everything related to FTYPE_XC. Signed-off-by: Juergen Gross --- V2: - new pa

[PATCH v2 14/18] mini-os: eliminate xenbus union member in struct file

2022-01-11 Thread Juergen Gross
Replace the xenbus specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- include/lib.h | 7 --- lib/sys.c | 2 +- lib/xs.c | 13 +++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a

[PATCH v2 0/3] tools/libs: decouple more from mini-os

2022-01-11 Thread Juergen Gross
This small series removes some hard coupling of the Xen build with some Mini-OS internals, especially the struct file layout and the internal organization of the file handling. This series depends on the Mini-OS series posted recently: https://lists.xen.org/archives/html/xen-devel/2022-01/threads

[PATCH v2 1/3] tools/libs/evtchn: decouple more from mini-os

2022-01-11 Thread Juergen Gross
Mini-OS and libevtchn are using implementation details of each other. Change that by letting libevtchn use the new alloc_file_type() and get_file_from_fd() functions and the generic dev pointer of struct file from Mini-OS. By using private struct declarations Mini-OS will be able to drop the libev

[PATCH v2 2/3] tools/libs/gnttab: decouple more from mini-os

2022-01-11 Thread Juergen Gross
libgnttab is using implementation details of Mini-OS. Change that by letting libgnttab use the new alloc_file_type() and get_file_from_fd() functions and the generic dev pointer of struct file from Mini-OS. Signed-off-by: Juergen Gross --- V2: - add alloc_file_type() support --- tools/libs/gntta

[PATCH v2 3/3] tools/libs/ctrl: remove file related handling

2022-01-11 Thread Juergen Gross
There is no special file handling related to libxenctrl in Mini-OS any longer, so the close hook can be removed. Signed-off-by: Juergen Gross --- V2: - new patch --- tools/libs/ctrl/xc_minios.c | 9 - 1 file changed, 9 deletions(-) diff --git a/tools/libs/ctrl/xc_minios.c b/tools/libs/c

[PATCH v2 10/18] mini-os: eliminate netfront union member in struct file

2022-01-11 Thread Juergen Gross
Replace the netfront specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- include/lib.h | 3 --- lib/sys.c | 6 +++--- netfront.c| 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/lib.

[PATCH v2 04/18] mini-os: replace multiple fd elements in struct file by common one

2022-01-11 Thread Juergen Gross
The type specific union in struct files contains two instances of "int fd". Replace them by a common one. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- include/lib.h | 9 + lib/sys.c | 28 ++-- 2 files changed, 15 insertions(+), 22 deletions(

[PATCH v2 03/18] mini-os: make offset a common struct file member for all types

2022-01-11 Thread Juergen Gross
Currently 4 file types have an offset member in their private struct file part. Make offset a common struct member shared by all file types. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- blkfront.c| 5 ++--- include/lib.h | 5 + lib/sys.c | 14 +- tpm_t

[PATCH v2 09/18] mini-os: eliminate kbdfront union member in struct file

2022-01-11 Thread Juergen Gross
Replace the kbdfront specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- fbfront.c | 2 +- include/lib.h | 3 --- lib/sys.c | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fbfront.c b/fb

[PATCH v2 06/18] mini-os: eliminate blkfront union member in struct file

2022-01-11 Thread Juergen Gross
Replace the blkfront specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- blkfront.c| 6 +++--- include/lib.h | 3 --- lib/sys.c | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/blkfront.c b

[PATCH v2 07/18] mini-os: eliminate consfront union member in struct file

2022-01-11 Thread Juergen Gross
Replace the consfront specific union member in struct file with the common dev pointer. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- include/lib.h | 3 --- lib/sys.c | 31 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/incl

[PATCH v2 05/18] mini-os: introduce a common dev pointer in struct file

2022-01-11 Thread Juergen Gross
There are many dev pointers in a union in struct file. Prepare to switch to a single one by introducing a new common one. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- include/lib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/lib.h b/include/lib.h index dc56f52..

  1   2   >