[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] machdev,pci,rump: Rework bootstrap
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] machdev,pci,rump: Rework bootstrap |
Date: |
Sun, 14 Mar 2021 19:01:40 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
We're getting close!
Damien Zammit, le dim. 14 mars 2021 22:23:25 +1100, a ecrit:
> except for a strange anomaly with:
>
> cat /proc/5/stat /proc/6/stat
Possibly this is a missing proc_child call in startup's
launch_core_servers. I'd say that instead of explicit proc_child calls,
launch_core_servers should just go over the list of essential tasks.
That being said, proc and procfs should be resilient to missing that
proc_child call.
> @@ -278,16 +311,28 @@ trivfs_S_fsys_init (struct trivfs_control *fsys,
> /* Install the bootstrap port on /dev/something so users
> * can still access the bootstrapped device */
> - if (bootstrapped && devnode)
> + if (bootstrapping && devnode)
> {
> right = ports_get_send_right (&control->pi);
> install_as_translator (right);
> control->underlying = underlying;
> + essential_task ();
I'd say split the if: we want to call essential_task even if !devnode.
> int
> machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name,
> const char *path, mach_port_t *bootstrap)
> {
> + mach_port_t mybootstrap = MACH_PORT_NULL;
> + task_t parent_task;
> port_bucket = ports_create_bucket ();
> trivfs_cntl_class = ports_create_class (trivfs_clean_cntl, 0);
> trivfs_protid_class = ports_create_class (trivfs_clean_protid, 0);
> trivfs_create_control (MACH_PORT_NULL, trivfs_cntl_class, port_bucket,
> trivfs_protid_class, 0, &control);
>
> + *bootstrap = MACH_PORT_NULL;
> +
> + task_get_bootstrap_port (mach_task_self (), &mybootstrap);
> + if (mybootstrap)
> + {
> + *bootstrap = mybootstrap;
> + fsys_getpriv (*bootstrap, &_hurd_host_priv, &_hurd_device_master,
> &parent_task);
> + }
> +
> if (bootstrap_resume_task != MACH_PORT_NULL)
> {
> if (path)
> devnode = strdup(path);
> resume_bootstrap_server(bootstrap_resume_task, name);
> - *bootstrap = ports_get_send_right (&control->pi);
> + if (*bootstrap == MACH_PORT_NULL)
> + *bootstrap = ports_get_send_right (&control->pi);
I don't think this makes sense: either we have a NULL bootstrap, or
we have one which is not us, but not this: why a control port on
ourself? Does it actually pose any problem that bootstrap is returned
MACH_PORT_NULL? That'd probably what needs to be fixed rather that
papering over it here.
Samuel