Re: [RFC PATCH 0/3] Adding /dev/rtc device (work in progress)

2024-11-01 Thread Sergey Bugaev
On Fri, Nov 1, 2024 at 1:30 PM Zhaoming Luo wrote: > I think it's a good chance to stop > and gather some suggestions and feedback, so I sent a series of RTC patches. Hi Zhaoming, I'm only seeing a single "patch", namely this cover letter. Did you perhaps accidentally run your git send-email on

Re: [RFC PATCH 0/3] Adding /dev/rtc device (work in progress)

2024-11-01 Thread Sergey Bugaev
On Fri, Nov 1, 2024 at 1:46 PM Zhaoming Luo wrote: > Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y > 250 OK > ...propagated at /usr/lib/git-core/git-send-email line 1696, > line 2. Hm, I have no idea about this kind of thing. git-send-email line 1696 in my copy of Git v2.47.0 is just

Re: Qoth Q3 2024 & on aarch64-gnu

2024-09-24 Thread Sergey Bugaev
On Tue, Sep 24, 2024 at 4:53 AM wrote: > I'm game to try! How would I go about setting up a vm AArch64 image that > > runs the Hurd? It's not much different from building a Hurd image for another architecture (i686 or x86_64), other than having to use some unmerged branches. You should start by

[PATCH] hurd: Avoid file_check_access () RPC for access (F_OK)

2024-09-19 Thread Sergey Bugaev
GLib switching to use faccessat (F_OK) to implement g_file_query_exists () for local files. https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4272 Signed-off-by: Sergey Bugaev --- sysdeps/mach/hurd/faccessat.c | 9 + 1 file changed, 9 insertions(+) diff --git a/sysdeps/mach/hurd

Re: [RFC PATCH] Adding RTC device (work in progress)

2024-11-07 Thread Sergey Bugaev
On Wed, Nov 6, 2024 at 4:28 AM Zhaoming Luo wrote: > I think it's worth to put this part into mig documentation website[0], > just like the IRC log pieces we have already had. What do you think? I > can do it. > > [0]: > https://darnassus.sceen.net/~hurd-web/microkernel/mach/mig/documentation/ Su

Re: findutil's gnulib-test's test-sigaction's raise fails with Guix' libc

2024-11-22 Thread Sergey Bugaev
On Fri, Nov 22, 2024 at 1:52 PM wrote: > Hi! Hi Janneke, > I have bisected the problem to be in sigaction.o: when linking with > sigaction.o from Debian's libcrt.a it passes, when using Guix's > sigaction.o it fails. Problem solved, you would say? I assume you mean sigreturn.o, not sigaction.o

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-19 Thread Sergey Bugaev
On Tue, Nov 19, 2024 at 12:08 PM Samuel Thibault wrote: > Ah, yes. Since it's not a performance-critical service, you can as well > use ports_manage_port_operations_one_thread instead, and get done with > it :) This might be an issue once we implement the blocking read/select functionality; don't

Re: [RFC PATCH] Adding RTC device (work in progress)

2024-11-09 Thread Sergey Bugaev
On Fri, Nov 8, 2024 at 3:26 AM Zhaoming Luo wrote: > The rest of the stuff > is mainly about filling codes into the server-side functions; it may > require some time as I haven't had any experience of writing drivers. Me neither :) But, perhaps the following would be somewhat useful. The osdev w

Re: [RFC PATCH v2 4/4] Add rtc server

2024-11-08 Thread Sergey Bugaev
On Fri, Nov 8, 2024 at 4:55 AM Zhaoming Luo wrote: > diff --git a/rtc/main.c b/rtc/main.c > new file mode 100644 > index ..114fb497 > --- /dev/null > +++ b/rtc/main.c > @@ -0,0 +1,88 @@ > + > +#include > + > +#include > +#include > +#include I don't think you need nullauth.h? > +#inc

Re: [RFC PATCH v2 2/4] Add ioctl interface for rtc device

2024-11-08 Thread Sergey Bugaev
Hi Zhaoming, On Fri, Nov 8, 2024 at 11:01 AM Samuel Thibault wrote: > Here as well this breaks the build since at this point of the series you > haven't added rtc.h yet. Better just merge all the patches. To expand on what Samuel says, the point is that the repo is expected to build successfully

Re: x86_64-gnu 14.2.0 cross-compiler -O2 removes THREAD_SETMEM in glibc sigreturn.c

2024-11-24 Thread Sergey Bugaev
Reduced further: --8<-- struct hurd_sigstate; typedef struct { void *tcb; union dtv *dtv; unsigned int self_do_no_use; int __glibc_padding1; int multiple_threads; int gscope_flag; unsigned long sysinfo; unsigned long stack_guard; unsigned long pointer_guard; long __glibc_p

Re: x86_64-gnu 14.2.0 cross-compiler -O2 removes THREAD_SETMEM in glibc sigreturn.c

2024-11-24 Thread Sergey Bugaev
On Sun, Nov 24, 2024 at 3:58 PM Andreas Schwab wrote: > > https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Goto-Labels > > > > “ > > GCC assumes that asm execution falls through to the next statement (if > > this is not the case, consider using the __builtin_unreachable intrinsic > > after the

Re: [PATCH hurd] sutils: Add smp tool for running a process on slave processors

2024-11-26 Thread Sergey Bugaev
Hi, a quick review: On Tue, Nov 26, 2024 at 10:43 AM Damien Zammit via Bug reports for the GNU Hurd wrote: > +static void > +smp(char * const argv[]) Style nitpick: space before the paren. > +{ > + int err; error_t rather > + unsigned int pset_count; mach_msg_type_number_t rather (it's lik

Re: libzstd :: non-regular file test failure

2024-12-04 Thread Sergey Bugaev
On Wed, Dec 4, 2024 at 11:26 AM Samuel Thibault wrote: > It's probably worth checking other _write methods in libstore/ That, and also glibc should make more efforts to be resilient against servers returning bogus read/write amounts, whether by mistake like here or maliciously. If we don't saniti

[PATCH] hurd: Protect against servers returning bogus read/write lengths

2024-12-04 Thread Sergey Bugaev
n the size actually submitted to it, which is a separate bug to be fixed on the Hurd side. With this patch, EGRATUITOUS is now propagated to the caller. Reported-by: Diego Nieto Cid Signed-off-by: Sergey Bugaev --- hurd/fd-read.c | 12 +++- hurd/fd-write.c | 10 +++--- 2 files c

[PATCH] libstore: Fix zero store writes

2024-12-04 Thread Sergey Bugaev
We discard any written data, but we still need to set *amount. Not doing that is undefined behavior, and causes the write to appear to fail. This is the cause of a libzstd test failure on GNU/Hurd in particular. Reported-by: Diego Nieto Cid Signed-off-by: Sergey Bugaev --- Note: not tested

Re: [PATCH Hurd] lwip: Properly handle errors during initialization

2024-12-08 Thread Sergey Bugaev
On Sun, Dec 8, 2024 at 11:54 AM Zhaoming Luo wrote: > > Reviewed-by: Sergey Bugaev > > > Thanks for the review. > > (...but I don't know exactly what you're supposed to do with that R-b > > line. I asked on libc-alpha last year [0], and didn't get

Re: [PATCH Hurd] lwip: Properly handle errors during initialization

2024-12-08 Thread Sergey Bugaev
On Sun, Dec 8, 2024 at 7:53 AM Zhaoming Luo wrote: > lwip/main.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) Makes sense to me, thanks! Reviewed-by: Sergey Bugaev (...but I don't know exactly what you're supposed to do with that R-b line. I asked on

Re: [RFC PATCH glic] hurd: Add CLOCK_MONOTONIC case in clock_gettime()

2025-01-02 Thread Sergey Bugaev
On Fri, Jan 3, 2025 at 5:32 AM Zhaoming Luo wrote: > > in the latter case, you should get MIG_BAD_ID from the kernel, so you > > can detect that. > What's the best way to handle the MIG_BAD_ID case. I tried perror(NULL) > but it gave my output '(ipc/mig) bad request message ID'. To be honest I > d

Re: [PATCH gnumach v2] Implement per task virtual memory limit

2024-12-30 Thread Sergey Bugaev
On Tue, Dec 31, 2024 at 1:30 AM Diego Nieto Cid wrote: > On Mon, Dec 30, 2024 at 07:08:55PM +0100, Samuel Thibault wrote: > > You also need to take into account the case where > > current->max_protection was NONE and new_prot is not NONE, you then have > > to decrease size_none. > Ah right, the &

Re: [PATCH gnumach v1] Implement per task virtual memory limit

2024-12-24 Thread Sergey Bugaev
Getting really close :) On Mon, Dec 23, 2024 at 10:07 PM wrote: > + > +/* > + * Set a task virtual memory limit parameters > + */ > +routine vm_set_size_limit( > + host_port : mach_port_t; > + map : vm_task_t; > + current_limit : vm_size_t; > + max_limit

Re: [hurd-amd64] ibus test failures

2024-12-30 Thread Sergey Bugaev
Hello, On Mon, Dec 30, 2024 at 3:36 AM Diego Nieto Cid wrote: > > On Sun, Dec 29, 2024 at 11:33:47PM +0100, Samuel Thibault wrote: > > Hello, > > > > Diego Nieto Cid, le dim. 29 déc. 2024 22:14:40 +, a ecrit: > > > (ibus-daemon:17123): GLib-GIO-WARNING **: 20:49:29.230: Expected a > > >

Re: [PATCH hurd] pci-arbiter: Fix long standing bug with PCI access

2024-12-27 Thread Sergey Bugaev
On Sat, Dec 28, 2024 at 9:38 AM Damien Zammit via Bug reports for the GNU Hurd wrote: > > Proxied memory was not rounded up to page size, causing > error with vm_map'ing the underlying memory. > > WARNING: Could be security risk if assumption is incorrect: > Assumes start of all pci memory resour

Re: Should hurd_select returns directly when nfds == 0?

2025-02-07 Thread Sergey Bugaev
On Fri, Feb 7, 2025 at 2:36 PM Zhaoming Luo wrote: > Hi, Hi, > Thread 4 hit Breakpoint 1, __GI___select (nfds=0, readfds=0x103cc20, > writefds=0x103cc40, exceptfds=0x103cc60, timeout=0x103cc84) > at ../sysdeps/mach/hurd/select.c:31 > ``` > > When I continue, it hangs at mach_msg[0]: > > gdb

Re: [PATCH 5/6] GNU/Hurd: disable symbolize.

2025-02-07 Thread Sergey Bugaev
On Fri, Feb 7, 2025 at 6:51 PM Samuel Thibault wrote: > Yuqian Yang, le ven. 07 févr. 2025 23:27:01 +0800, a ecrit: > > I know this is due to the way of our kernel to handle file and memory. > > Do we have a good way to fix this, > > Not a trivial way. It'd need adding names to the kernel map entr

Re: [PATCH 3/3] intr: Protect internals with a lock

2024-12-10 Thread Sergey Bugaev
On Tue, Dec 10, 2024 at 3:19 PM Samuel Thibault wrote: > Sergey Bugaev, le mar. 10 déc. 2024 14:57:05 +0300, a ecrit: > > @@ -103,11 +105,15 @@ queue_intr (struct irqdev *dev, int id, user_intr_t > > *e) > > * disabled. Level-triggered interrupts would k

Re: [PATCH 6/6 gnumach] i386/apic: Fix condition on non-BSP

2024-12-10 Thread Sergey Bugaev
On Tue, Dec 10, 2024 at 12:40 AM Samuel Thibault wrote: > Applied, thanks! FWIW, I noticed that the last few commits from Damien have "Damien Zammit via Bug reports for the GNU Hurd " listed as the Git commit author. Sergey

[PATCH 1/3] Fix various function pointer types

2024-12-10 Thread Sergey Bugaev
Fixes Wincompatible-pointer-types errors on GCC 15. Signed-off-by: Sergey Bugaev --- ddb/db_variables.h | 2 +- i386/i386/trap.c | 2 +- vm/vm_fault.c | 4 ++-- vm/vm_map.c| 2 +- vm/vm_map.h| 8 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ddb

[PATCH 3/3] intr: Protect internals with a lock

2024-12-10 Thread Sergey Bugaev
ternals of device/intr with a simple_lock_irq. Reported-by: Damien Zammit Signed-off-by: Sergey Bugaev --- With this, Damien's latest patchset, and "smp: Create AP processor set and put all APs inside it" reverted, a complete Debian GNU/Hurd system boots for me in QEMU with -smp

[PATCH 2/3] linux: Fix building with C23

2024-12-10 Thread Sergey Bugaev
7;true' and 'false' being valid values of the type. Signed-off-by: Sergey Bugaev --- Only compile-tested. linux/src/drivers/scsi/BusLogic.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux/src/drivers/scsi/BusLogic.h b/linux/src/drivers/scsi/BusLogic.h

Re: [PATCH 1/1 Web] Add microkernel/mach/mig/documentation/mig-mutate page

2024-12-12 Thread Sergey Bugaev
On Wed, Dec 11, 2024 at 11:58 PM Samuel Thibault wrote: > jbra...@dismail.de, le mer. 11 déc. 2024 20:46:54 +, a ecrit: > > Sergey, are you ok with "assigning copyright" to the FSF for this document? > > Sergey has already assigned copyright for all past&future hurd > contributions. Uh. I ass

Re: [PATCH 1/1 Web] Add microkernel/mach/mig/documentation/mig-mutate page

2024-12-13 Thread Sergey Bugaev
On Thu, Dec 12, 2024 at 6:14 PM wrote: > #stillFriendsRight? Totally! I'm just hoping I didn't offend you or something. And please keep up the good work on docs, just... not that way :) Sergey

Re: [RFC] Implementing RLIMIT_AS

2024-12-20 Thread Sergey Bugaev
On Thu, Dec 19, 2024 at 6:56 PM Diego Nieto Cid wrote: > Hello, Hi, a few pointers from me: > I started with hard limit beacause I still need to research how > soft limits work. So, for now, it's a plain rejection with ENOMEM. > > 2. At vm_map_setup, initialize the `hard_limit` fiel

Re: findutil's gnulib-test's test-sigaction's raise fails with Guix' libc

2024-11-22 Thread Sergey Bugaev
On Fri, Nov 22, 2024 at 4:28 PM wrote: > using the (amazing) command-line that glibc creates > > --8<---cut here---start->8--- > $ x86_64-pc-gnu-gcc ../sysdeps/mach/hurd/x86_64/sigreturn.c -c -std=gnu11 > -fgnu89-inline -g -O2 -Wall -Wwrite-strings -Wundef -fm

Re: findutil's gnulib-test's test-sigaction's raise fails with Guix' libc

2024-11-22 Thread Sergey Bugaev
On Fri, Nov 22, 2024 at 5:11 PM wrote: > Sounds awfully familiar...so is this a compiler bug? What, did you think if was *my* code that's broken? :D :D :D > How should I go > forward here? Most importantly, please report this to GCC developers. You could use the preprocessed source so they don

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-17 Thread Sergey Bugaev
On Sun, Nov 17, 2024 at 3:34 PM Zhaoming Luo wrote: > Hi, Hi, looks nice to me overall, thanks for working on this! I cannot judge the actual driver part, so here are some nitpicks about not following the GNU code style :D I will try to build and test it later. By the way: apparently gnumach al

Re: libzstd :: non-regular file test failure

2024-12-03 Thread Sergey Bugaev
On Wed, Dec 4, 2024 at 12:11 AM Diego Nieto Cid wrote: > 52<--47(pid1044)->io_write_request ("Hello World!\n" -1) = 0 15 On Wed, Dec 4, 2024 at 4:50 AM Diego Nieto Cid wrote: > I traced it to the function `io_write` from `libhurduser.so.3` which > is returning 1. On Wed, Dec 4, 2024 at 6:09

Re: [util-linux PATCH] Support hwclock for GNU Hurd

2024-12-05 Thread Sergey Bugaev
On Thu, Dec 5, 2024 at 3:39 PM Zhaoming Luo wrote: > - rtc_dev_fd = open(rtc_dev_name, O_RDONLY); > + rtc_dev_fd = open(rtc_dev_name, O_RDONLY | O_WRONLY); It's called "xxx-only" for a reason :) On standard Unix, you should use O_RDWR for this. Now, on the Hurd, these

Re: [RFC] Implementing RLIMIT_AS

2024-12-22 Thread Sergey Bugaev
On Sun, Dec 22, 2024 at 1:45 PM Samuel Thibault wrote: > > FWIW, this means that the caller would be potentially sending the host > > priv port to someone who's not necessarily the kernel. That's fine if > > we're acting on mach_task_self (since if someone is interposing our > > task port, we can

Re: [RFC] Implementing RLIMIT_AS

2024-12-21 Thread Sergey Bugaev
On Fri, Dec 20, 2024 at 5:17 PM Diego Nieto Cid wrote: > >Also make sure to avoid limiting the kernel's own maps. > > Oh right, I need to check for the kernel map, even though the default > means no limit it may be nice to check at the enforcing point whether > the allocation happens against the k

Re: [PATCH hurd v1] Add partial /proc/cpuinfo implementation

2025-01-26 Thread Sergey Bugaev
On Mon, Jan 27, 2025 at 12:18 AM Samuel Thibault wrote: > > + err = aarch64_get_hwcaps(mach_host_self(), &caps, &mdir, &revdir); > > + if (err) > > +goto out; > > + > > + implementer = (mdir & 0xff00) >> 24; > > + variant = (mdir & 0x00f0) >> 20; > > + architecture = (mdir &

Re: abseil port: strerror_r behaviour differs from Debian/Linux

2025-01-25 Thread Sergey Bugaev
On Sun, Jan 26, 2025 at 12:06 AM Diego Nieto Cid wrote: > Hello, Hello, > However, when running in GNU/Hurd, the output is a bit different: > > strerror_r: Error in unknown error system: So for some background: on the Hurd, Unix errors are unified with Mach error codes (see gnumach

Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation

2025-01-13 Thread Sergey Bugaev
On Sun, Jan 12, 2025 at 10:48 PM Samuel Thibault wrote: > Does the posted patch look fine to you? It does, so: Acked-by: Sergey Bugaev I'll test it some time later when I get around to doing more aarch64-gnu hacking :| Sergey

Re: [RFC PATCH glibc v2 1/1] hurd: Add CLOCK_MONOTONIC case in clock_gettime()

2025-01-03 Thread Sergey Bugaev
On Fri, Jan 3, 2025 at 1:42 PM Zhaoming Luo wrote: > hurd: Add CLOCK_MONOTONIC case in clock_gettime() Nitpick: the prefix should be "mach:" instead of "hurd:". In theory, there could be other targets that also run on Mach, and sysdeps/mach/clock_gettime.c is only Mach-specific, not Hurd-specifi

Re: [RFC PATCH glic] hurd: Add CLOCK_MONOTONIC case in clock_gettime()

2025-01-01 Thread Sergey Bugaev
Happy New Year! On Wed, Jan 1, 2025 at 12:25 PM Zhaoming Luo wrote: > > --- > sysdeps/mach/clock_gettime.c | 12 > 1 file changed, 12 insertions(+) > > diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c > index 6fffad39f5..22faf85730 100644 > --- a/sysdeps/mach

Re: [RFC] Implementing RLIMIT_AS

2024-12-21 Thread Sergey Bugaev
On Sun, Dec 22, 2024 at 6:11 AM Diego Nieto Cid wrote: > I just didn't understand the hard/soft limits. It's better described > by the structure members and not the comments: > > struct rlimit { > rlim_t rlim_cur; /* Soft limit */ > rlim_t rlim_max; /* Hard limit (ceiling for

Re: [PATCH gnumach v1] Implement per task virtual memory limit

2024-12-25 Thread Sergey Bugaev
Merry Christmas :) On Tue, Dec 24, 2024 at 8:11 PM Diego Nieto Cid wrote: > * HOST_PORT must be the privileged host control port > * if the caller desires to increase the current max limit. > * > * On the other hand, if the max limit is being decreased, the >

Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation

2025-01-09 Thread Sergey Bugaev
Hi, On Thu, Jan 9, 2025 at 1:42 AM Luca wrote: > >> maybe this can be already made arch-specific. > >> > > > > Hmm, maybe. As is it only makes sense for x86 based architectures. > > There was some work from Sergey towards porting to aarch64, I guess > currently the hurd should compile there, and

Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation

2025-01-09 Thread Sergey Bugaev
On Thu, Jan 9, 2025 at 6:18 PM Jessica Clarke wrote: > On 9 Jan 2025, at 15:12, Diego Nieto Cid wrote: > > Looking at the types.h header, I see there are HWCAP2_* definitions for > > bits above 32. Since hwcaps_t is an uint32_t and the defs file claims to > > return two values (I assume the first

Re: [RFC PATCH Hurd] Add a libstore library without libparted

2025-01-09 Thread Sergey Bugaev
On Thu, Jan 9, 2025 at 4:09 PM Samuel Thibault wrote: > > make libstore-noparted > > ``` > > > > This file is the same as libstore/Makefile except a few modifications so > > it can use the source files from libstore/ and build a libstore with > > libparted module. > > Thanks for working on it. AIU

<    4   5   6   7   8   9