All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4 qemu] GNU/Hurd support
@ 2026-01-30  3:20 Damien Zammit
  2026-01-30  3:20 ` [PATCH v3 1/4 qemu] Include new arbitrary limits if not already defined Damien Zammit
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Damien Zammit @ 2026-01-30  3:20 UTC (permalink / raw)
  To: bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc


Hi all,

This patchset was buried in the mailing list, I have rebased and
addressed all comments in the separated threads relating to this series.

Thanks for reviewing previously, and I hope the original author does not mind I have
picked up this work.

TESTED: It compiles and runs qemu-system-i386 and qemu-system-x86_64 on GNU/Hurd x86_64.

Cheers,
Damien




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3 1/4 qemu] Include new arbitrary limits if not already defined
  2026-01-30  3:20 [PATCH v3 0/4 qemu] GNU/Hurd support Damien Zammit
@ 2026-01-30  3:20 ` Damien Zammit
  2026-01-30  3:20 ` [PATCH v3 2/4 qemu] Add GNU/Hurd host_os=gnu Damien Zammit
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Damien Zammit @ 2026-01-30  3:20 UTC (permalink / raw)
  To: bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc

From: Manolo de Medici <manolodemedici@gmail.com>

Although GNU/Hurd supports unlimited path lengths
only bounded by available memory, for now we can use
an arbitrary limit on PATH_MAX that matches what POSIX requires.
We don't have the bandwith to fix this properly right now.

Author: Manolo de Medici <manolo.demedici@gmail.com>
Signed-off-by: Damien Zammit <damien@zamaudio.com>
---
 include/qemu/osdep.h | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index b384b5b506..2e67d75042 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -385,6 +385,17 @@ void QEMU_ERROR("code path is reachable")
 #define TIME_MAX TYPE_MAXIMUM(time_t)
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+/*
+ * Use the same value as Linux for now.
+ */
+#ifndef IOV_MAX
+#define IOV_MAX 1024
+#endif
+
 /* Mac OSX has a <stdint.h> bug that incorrectly defines SIZE_MAX with
  * the wrong type. Our replacement isn't usable in preprocessor
  * expressions, but it is sufficient for our needs. */
@@ -661,10 +672,6 @@ struct iovec {
     void *iov_base;
     size_t iov_len;
 };
-/*
- * Use the same value as Linux for now.
- */
-#define IOV_MAX 1024
 
 ssize_t readv(int fd, const struct iovec *iov, int iov_cnt);
 ssize_t writev(int fd, const struct iovec *iov, int iov_cnt);
-- 
2.51.0




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 2/4 qemu] Add GNU/Hurd host_os=gnu
  2026-01-30  3:20 [PATCH v3 0/4 qemu] GNU/Hurd support Damien Zammit
  2026-01-30  3:20 ` [PATCH v3 1/4 qemu] Include new arbitrary limits if not already defined Damien Zammit
@ 2026-01-30  3:20 ` Damien Zammit
  2026-01-30  3:20 ` [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd Damien Zammit
  2026-01-30  3:20 ` [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd Damien Zammit
  3 siblings, 0 replies; 12+ messages in thread
From: Damien Zammit @ 2026-01-30  3:20 UTC (permalink / raw)
  To: bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc

Use same value for host_os as meson for GNU/Hurd.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
---
 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 4b61fd3bbf..fae4d06352 100755
--- a/configure
+++ b/configure
@@ -372,6 +372,8 @@ elif check_define __APPLE__; then
 elif check_define EMSCRIPTEN ; then
   host_os=emscripten
   cross_compile="yes"
+elif check_define __GNU__; then
+  host_os=gnu
 else
   # This is a fatal error, but don't report it yet, because we
   # might be going to just print the --help text, or it might
-- 
2.51.0




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd
  2026-01-30  3:20 [PATCH v3 0/4 qemu] GNU/Hurd support Damien Zammit
  2026-01-30  3:20 ` [PATCH v3 1/4 qemu] Include new arbitrary limits if not already defined Damien Zammit
  2026-01-30  3:20 ` [PATCH v3 2/4 qemu] Add GNU/Hurd host_os=gnu Damien Zammit
@ 2026-01-30  3:20 ` Damien Zammit
  2026-01-30  8:27   ` Paolo Bonzini
  2026-01-30  3:20 ` [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd Damien Zammit
  3 siblings, 1 reply; 12+ messages in thread
From: Damien Zammit @ 2026-01-30  3:20 UTC (permalink / raw)
  To: bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc

From: Manolo de Medici <manolodemedici@gmail.com>

The Hurd currently doesn't have any TPM driver, compilation fails
for missing symbols unless these are left undefined.

Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
---
 backends/tpm/tpm_ioctl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
index ee2dd15d35..e466311455 100644
--- a/backends/tpm/tpm_ioctl.h
+++ b/backends/tpm/tpm_ioctl.h
@@ -285,7 +285,7 @@ typedef struct ptm_lockstorage ptm_lockstorage;
 #define PTM_CAP_SEND_COMMAND_HEADER (1 << 15)
 #define PTM_CAP_LOCK_STORAGE       (1 << 16)
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__GNU__)
 enum {
     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
     PTM_INIT               = _IOWR('P', 1, ptm_init),
-- 
2.51.0




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd
  2026-01-30  3:20 [PATCH v3 0/4 qemu] GNU/Hurd support Damien Zammit
                   ` (2 preceding siblings ...)
  2026-01-30  3:20 ` [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd Damien Zammit
@ 2026-01-30  3:20 ` Damien Zammit
  2026-01-30  8:30   ` Paolo Bonzini
  2026-01-30  8:32   ` Paolo Bonzini
  3 siblings, 2 replies; 12+ messages in thread
From: Damien Zammit @ 2026-01-30  3:20 UTC (permalink / raw)
  To: bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc

glibc already has this as non-static on __GNU__ systems.
Also, add the missing sys/ioctl.h header for the same platform.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
---
 block/file-posix.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 6265d2e248..5e4fdba49b 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -116,6 +116,10 @@
 #include <sys/ioctl.h>
 #endif
 
+#ifdef __GNU__
+#include <sys/ioctl.h>
+#endif
+
 /* OS X does not have O_DSYNC */
 #ifndef O_DSYNC
 #ifdef O_SYNC
@@ -2113,7 +2117,7 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
 }
 
 #ifndef HAVE_COPY_FILE_RANGE
-#ifndef EMSCRIPTEN
+#if !defined(EMSCRIPTEN) && !defined(__GNU__)
 static
 #endif
 ssize_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
-- 
2.51.0




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd
  2026-01-30  3:20 ` [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd Damien Zammit
@ 2026-01-30  8:27   ` Paolo Bonzini
  2026-02-03 15:21     ` Stefan Berger
  0 siblings, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2026-01-30  8:27 UTC (permalink / raw)
  To: Damien Zammit, bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc

On 1/30/26 04:20, Damien Zammit wrote:
> From: Manolo de Medici <manolodemedici@gmail.com>
> 
> The Hurd currently doesn't have any TPM driver, compilation fails
> for missing symbols unless these are left undefined.

This is due to the missing _IO* symbols, not the TPM driver.

Fortunately, these are unused and the whole enum can be removed.  Please 
check if it's also possible to remove

#ifndef _WIN32
#include <sys/uio.h>
#include <sys/ioctl.h>
#endif

#ifdef HAVE_SYS_IOCCOM_H
#include <sys/ioccom.h>
#endif

at the top of the file.

Paolo

> Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
>   backends/tpm/tpm_ioctl.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
> index ee2dd15d35..e466311455 100644
> --- a/backends/tpm/tpm_ioctl.h
> +++ b/backends/tpm/tpm_ioctl.h
> @@ -285,7 +285,7 @@ typedef struct ptm_lockstorage ptm_lockstorage;
>   #define PTM_CAP_SEND_COMMAND_HEADER (1 << 15)
>   #define PTM_CAP_LOCK_STORAGE       (1 << 16)
>   
> -#ifndef _WIN32
> +#if !defined(_WIN32) && !defined(__GNU__)
>   enum {
>       PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
>       PTM_INIT               = _IOWR('P', 1, ptm_init),



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd
  2026-01-30  3:20 ` [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd Damien Zammit
@ 2026-01-30  8:30   ` Paolo Bonzini
  2026-01-30  8:32   ` Paolo Bonzini
  1 sibling, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2026-01-30  8:30 UTC (permalink / raw)
  To: Damien Zammit, bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc

On 1/30/26 04:20, Damien Zammit wrote:
> glibc already has this as non-static on __GNU__ systems.
> Also, add the missing sys/ioctl.h header for the same platform.

Please just move the inclusion of sys/ioctl.h outside all #ifdefs, i.e.

...
#include <sys/ioctl.h>

#if defined(__APPLE__) && (__MACH__)
#if defined(HAVE_HOST_BLOCK_DEVICE)
#include <paths.h>
#include <sys/param.h>
...

and remove all the #includes for it after the first.

Thanks,

Paolo

> Signed-off-by: Damien Zammit <damien@zamaudio.com>
> ---
>   block/file-posix.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/block/file-posix.c b/block/file-posix.c
> index 6265d2e248..5e4fdba49b 100644
> --- a/block/file-posix.c
> +++ b/block/file-posix.c
> @@ -116,6 +116,10 @@
>   #include <sys/ioctl.h>
>   #endif
>   
> +#ifdef __GNU__
> +#include <sys/ioctl.h>
> +#endif
> +
>   /* OS X does not have O_DSYNC */
>   #ifndef O_DSYNC
>   #ifdef O_SYNC
> @@ -2113,7 +2117,7 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
>   }
>   
>   #ifndef HAVE_COPY_FILE_RANGE
> -#ifndef EMSCRIPTEN
> +#if !defined(EMSCRIPTEN) && !defined(__GNU__)
>   static
>   #endif
>   ssize_t copy_file_range(int in_fd, off_t *in_off, int out_fd,



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd
  2026-01-30  3:20 ` [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd Damien Zammit
  2026-01-30  8:30   ` Paolo Bonzini
@ 2026-01-30  8:32   ` Paolo Bonzini
  1 sibling, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2026-01-30  8:32 UTC (permalink / raw)
  To: Damien Zammit, bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, stefanb, peter.maydell,
	kwolf, berrange, eblake, bugaevc

On 1/30/26 04:20, Damien Zammit wrote:
> glibc already has this as non-static on __GNU__ systems.
>
>  #ifndef HAVE_COPY_FILE_RANGE
> -#ifndef EMSCRIPTEN
> +#if !defined(EMSCRIPTEN) && !defined(__GNU__)
>   static
>   #endif
>   ssize_t copy_file_range(int in_fd, off_t *in_off, int out_fd,

Do I understand it correctly that it has the prototype but not the function?

Thanks,

Paolo



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd
  2026-01-30  8:27   ` Paolo Bonzini
@ 2026-02-03 15:21     ` Stefan Berger
  2026-02-08  4:03       ` Damien Zammit
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Berger @ 2026-02-03 15:21 UTC (permalink / raw)
  To: Paolo Bonzini, Damien Zammit, bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, peter.maydell, kwolf,
	berrange, eblake, bugaevc



On 1/30/26 3:27 AM, Paolo Bonzini wrote:
> On 1/30/26 04:20, Damien Zammit wrote:
>> From: Manolo de Medici <manolodemedici@gmail.com>
>>
>> The Hurd currently doesn't have any TPM driver, compilation fails
>> for missing symbols unless these are left undefined.
> 
> This is due to the missing _IO* symbols, not the TPM driver.
> 
> Fortunately, these are unused and the whole enum can be removed.  Please 
> check if it's also possible to remove
> 
> #ifndef _WIN32
> #include <sys/uio.h>
> #include <sys/ioctl.h>
> #endif
> 
> #ifdef HAVE_SYS_IOCCOM_H
> #include <sys/ioccom.h>
> #endif

So this file comes originally from swtpm here: 
https://github.com/stefanberger/swtpm/blob/master/include/swtpm/tpm_ioctl.h

To keep them in sync as much as possible -- would this here work?

#ifndef _WIN32
#include <sys/uio.h>
#include <sys/ioctl.h>
#endif

#ifdef HAVE_SYS_IOCCOM_H
#include <sys/ioccom.h>
#endif

#ifdef __gnu_hurd__
#include <mach/x86_64/ioccom.h>
#endif

and then keep this as-is?

#if !defined(_WIN32)
enum {
     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
     PTM_INIT               = _IOWR('P', 1, ptm_init),
     PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),



> 
> at the top of the file.
> 
> Paolo
> 
>> Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
>> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
>> ---
>>   backends/tpm/tpm_ioctl.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
>> index ee2dd15d35..e466311455 100644
>> --- a/backends/tpm/tpm_ioctl.h
>> +++ b/backends/tpm/tpm_ioctl.h
>> @@ -285,7 +285,7 @@ typedef struct ptm_lockstorage ptm_lockstorage;
>>   #define PTM_CAP_SEND_COMMAND_HEADER (1 << 15)
>>   #define PTM_CAP_LOCK_STORAGE       (1 << 16)
>> -#ifndef _WIN32
>> +#if !defined(_WIN32) && !defined(__GNU__)
>>   enum {
>>       PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
>>       PTM_INIT               = _IOWR('P', 1, ptm_init),
> 
> 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd
  2026-02-03 15:21     ` Stefan Berger
@ 2026-02-08  4:03       ` Damien Zammit
  2026-02-10 17:58         ` Stefan Berger
  0 siblings, 1 reply; 12+ messages in thread
From: Damien Zammit @ 2026-02-08  4:03 UTC (permalink / raw)
  To: Stefan Berger, Paolo Bonzini, bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, peter.maydell, kwolf,
	berrange, eblake, bugaevc

Hi Stefan,

On 2/4/26 2:21 AM, Stefan Berger wrote:
> So this file comes originally from swtpm here:
> https://github.com/stefanberger/swtpm/blob/master/include/swtpm/tpm_ioctl.h
>
> To keep them in sync as much as possible -- would this here work?
>
> #ifndef _WIN32
> #include <sys/uio.h>
> #include <sys/ioctl.h>
> #endif
>
> #ifdef HAVE_SYS_IOCCOM_H
> #include <sys/ioccom.h>
> #endif
>
> #ifdef __gnu_hurd__
> #include <mach/x86_64/ioccom.h>
> #endif
>
> and then keep this as-is?
>
> #if !defined(_WIN32)
> enum {
>       PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
>       PTM_INIT               = _IOWR('P', 1, ptm_init),
>       PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),

No, this wont work because the _IOT__IOTBASE_* symbols are missing for 
the tpm structs on GNU platform:

In file included from /usr/include/x86_64-gnu/sys/ioctl.h:26,
                  from ../backends/tpm/tpm_ioctl.h:17,
                  from ../backends/tpm/tpm_emulator.c:39:
../backends/tpm/tpm_ioctl.h:290:30: error: ‘_IOT__IOTBASE_ptm_cap’ 
undeclared here (not in a function)
   290 |     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
       |                              ^~~~
../backends/tpm/tpm_ioctl.h:291:30: error: ‘_IOT__IOTBASE_ptm_init’ 
undeclared here (not in a function)
   291 |     PTM_INIT               = _IOWR('P', 1, ptm_init),
       |                              ^~~~~
../backends/tpm/tpm_ioctl.h:292:30: error: ‘_IOT__IOTBASE_ptm_res’ 
undeclared here (not in a function)
   292 |     PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),
       |                              ^~~~
../backends/tpm/tpm_ioctl.h:293:30: error: ‘_IOT__IOTBASE_ptm_est’ 
undeclared here (not in a function)
   293 |     PTM_GET_TPMESTABLISHED = _IOR('P', 3, ptm_est),
       |                              ^~~~
../backends/tpm/tpm_ioctl.h:294:30: error: ‘_IOT__IOTBASE_ptm_loc’ 
undeclared here (not in a function)
   294 |     PTM_SET_LOCALITY       = _IOWR('P', 4, ptm_loc),
       |                              ^~~~~
../backends/tpm/tpm_ioctl.h:296:30: error: ‘_IOT__IOTBASE_ptm_hdata’ 
undeclared here (not in a function)
   296 |     PTM_HASH_DATA          = _IOWR('P', 6, ptm_hdata),
       |                              ^~~~~
../backends/tpm/tpm_ioctl.h:300:32: error: ‘_IOT__IOTBASE_ptm_reset_est’ 
undeclared here (not in a function)
   300 |     PTM_RESET_TPMESTABLISHED = _IOWR('P', 10, ptm_reset_est),
       |                                ^~~~~
../backends/tpm/tpm_ioctl.h:301:30: error: ‘_IOT__IOTBASE_ptm_getstate’ 
undeclared here (not in a function)
   301 |     PTM_GET_STATEBLOB      = _IOWR('P', 11, ptm_getstate),
       |                              ^~~~~
../backends/tpm/tpm_ioctl.h:302:30: error: ‘_IOT__IOTBASE_ptm_setstate’ 
undeclared here (not in a function)
   302 |     PTM_SET_STATEBLOB      = _IOWR('P', 12, ptm_setstate),
       |                              ^~~~~
../backends/tpm/tpm_ioctl.h:304:30: error: ‘_IOT__IOTBASE_ptm_getconfig’ 
undeclared here (not in a function)
   304 |     PTM_GET_CONFIG         = _IOR('P', 14, ptm_getconfig),
       |                              ^~~~
../backends/tpm/tpm_ioctl.h:306:30: error: 
‘_IOT__IOTBASE_ptm_setbuffersize’ undeclared here (not in a function)
   306 |     PTM_SET_BUFFERSIZE     = _IOWR('P', 16, ptm_setbuffersize),
       |                              ^~~~~
../backends/tpm/tpm_ioctl.h:307:30: error: ‘_IOT__IOTBASE_ptm_getinfo’ 
undeclared here (not in a function)
   307 |     PTM_GET_INFO           = _IOWR('P', 17, ptm_getinfo),
       |                              ^~~~~
../backends/tpm/tpm_ioctl.h:308:30: error: 
‘_IOT__IOTBASE_ptm_lockstorage’ undeclared here (not in a function)
   308 |     PTM_LOCK_STORAGE       = _IOWR('P', 18, ptm_lockstorage),

If you want to preserve the enum, I am happy to put an ifdef instead of 
removing it.

That would be exactly what we had in v3 3/4.

Damien




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd
  2026-02-08  4:03       ` Damien Zammit
@ 2026-02-10 17:58         ` Stefan Berger
  2026-02-10 18:19           ` Samuel Thibault
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Berger @ 2026-02-10 17:58 UTC (permalink / raw)
  To: Damien Zammit, Paolo Bonzini, bug-hurd
  Cc: qemu-devel, qemu-block, manolodemedici, peter.maydell, kwolf,
	berrange, eblake, bugaevc



On 2/7/26 11:03 PM, Damien Zammit wrote:
> Hi Stefan,
> 
> On 2/4/26 2:21 AM, Stefan Berger wrote:
>> So this file comes originally from swtpm here:
>> https://github.com/stefanberger/swtpm/blob/master/include/swtpm/tpm_ioctl.h
>>
>> To keep them in sync as much as possible -- would this here work?
>>
>> #ifndef _WIN32
>> #include <sys/uio.h>
>> #include <sys/ioctl.h>
>> #endif
>>
>> #ifdef HAVE_SYS_IOCCOM_H
>> #include <sys/ioccom.h>
>> #endif
>>
>> #ifdef __gnu_hurd__
>> #include <mach/x86_64/ioccom.h>
>> #endif
>>
>> and then keep this as-is?
>>
>> #if !defined(_WIN32)
>> enum {
>>        PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
>>        PTM_INIT               = _IOWR('P', 1, ptm_init),
>>        PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),
> 
> No, this wont work because the _IOT__IOTBASE_* symbols are missing for
> the tpm structs on GNU platform:

> 
> In file included from /usr/include/x86_64-gnu/sys/ioctl.h:26,
>                    from ../backends/tpm/tpm_ioctl.h:17,
>                    from ../backends/tpm/tpm_emulator.c:39:
> ../backends/tpm/tpm_ioctl.h:290:30: error: ‘_IOT__IOTBASE_ptm_cap’
> undeclared here (not in a function)
>     290 |     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
>         |                              ^~~~

I have it compile because I added this here (above):

#ifdef __gnu_hurd__
#include <mach/x86_64/ioccom.h>
#endif

Without this header I do see these errors as well. Either way, am fine 
with your suggestion in v5.

  Stefan




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd
  2026-02-10 17:58         ` Stefan Berger
@ 2026-02-10 18:19           ` Samuel Thibault
  0 siblings, 0 replies; 12+ messages in thread
From: Samuel Thibault @ 2026-02-10 18:19 UTC (permalink / raw)
  To: Stefan Berger
  Cc: Damien Zammit, Paolo Bonzini, bug-hurd, qemu-devel, qemu-block,
	manolodemedici, peter.maydell, kwolf, berrange, eblake, bugaevc

Hello,

Stefan Berger, le mar. 10 févr. 2026 12:58:24 -0500, a ecrit:
> On 2/7/26 11:03 PM, Damien Zammit wrote:
> > On 2/4/26 2:21 AM, Stefan Berger wrote:
> > > enum {
> > >        PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
> > >        PTM_INIT               = _IOWR('P', 1, ptm_init),
> > >        PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),
> > 
> > No, this wont work because the _IOT__IOTBASE_* symbols are missing for
> > the tpm structs on GNU platform:
> 
> > 
> > In file included from /usr/include/x86_64-gnu/sys/ioctl.h:26,
> >                    from ../backends/tpm/tpm_ioctl.h:17,
> >                    from ../backends/tpm/tpm_emulator.c:39:
> > ../backends/tpm/tpm_ioctl.h:290:30: error: ‘_IOT__IOTBASE_ptm_cap’
> > undeclared here (not in a function)
> >     290 |     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
> >         |                              ^~~~
> 
> I have it compile because I added this here (above):
> 
> #ifdef __gnu_hurd__
> #include <mach/x86_64/ioccom.h>
> #endif

This mach-ish ioccom.h is not the way ioctls are defined in the Hurd. I
have actually even dropped it from gnumach, since we don't actually use
this way of defining ioctls any more. _IOT macros for ptm_capt/init/res
really need to be defined for _IOR/WR to be usable.

Samuel


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-02-10 18:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-30  3:20 [PATCH v3 0/4 qemu] GNU/Hurd support Damien Zammit
2026-01-30  3:20 ` [PATCH v3 1/4 qemu] Include new arbitrary limits if not already defined Damien Zammit
2026-01-30  3:20 ` [PATCH v3 2/4 qemu] Add GNU/Hurd host_os=gnu Damien Zammit
2026-01-30  3:20 ` [PATCH v3 3/4 qemu] Exclude TPM ioctls definitions for the GNU/Hurd Damien Zammit
2026-01-30  8:27   ` Paolo Bonzini
2026-02-03 15:21     ` Stefan Berger
2026-02-08  4:03       ` Damien Zammit
2026-02-10 17:58         ` Stefan Berger
2026-02-10 18:19           ` Samuel Thibault
2026-01-30  3:20 ` [PATCH v3 4/4 qemu] Avoid static definition of copy_file_range on GNU/Hurd Damien Zammit
2026-01-30  8:30   ` Paolo Bonzini
2026-01-30  8:32   ` Paolo Bonzini

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.