qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
@ 2012-07-23 18:05 Peter Maydell
  2012-07-24 12:02 ` Andreas Färber
  2012-08-06 13:02 ` Peter Maydell
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2012-07-23 18:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Alexander Graf, patches

The definitions for the ioctl numbers TARGET_BLKBSZGET and
TARGET_BLKBSZSET had the wrong size parameters (they are defined
with size_t, not int, even though the ioctl implementations themselves
read and write integers). Since commit 354a0008 we now have an
ioctl wrapper definition for BLKBSZGET and so on an x86-64-to-x86-64
linux-user binary we were triggering the mismatch warning in
syscall_init().

Signed-off-by: Peter Maydell <peter.maydell>
---
 linux-user/syscall_defs.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index a79b67d..0b239c4 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -832,8 +832,8 @@ struct target_pollfd {
 #define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
 #define TARGET_BLKSSZGET  TARGET_IO(0x12,104)/* get block device sector size */
 /* A jump here: 108-111 have been used for various private purposes. */
-#define TARGET_BLKBSZGET  TARGET_IOR(0x12,112,int)
-#define TARGET_BLKBSZSET  TARGET_IOW(0x12,113,int)
+#define TARGET_BLKBSZGET  TARGET_IOR(0x12, 112, abi_ulong)
+#define TARGET_BLKBSZSET  TARGET_IOW(0x12, 113, abi_ulong)
 #define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,abi_ulong)
                                              /* return device size in bytes
                                                 (u64 *arg) */
-- 
1.7.5.4

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

* Re: [Qemu-devel] [PATCH] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
  2012-07-23 18:05 [Qemu-devel] [PATCH] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET Peter Maydell
@ 2012-07-24 12:02 ` Andreas Färber
  2012-07-24 12:24   ` Peter Maydell
  2012-08-06 13:02 ` Peter Maydell
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2012-07-24 12:02 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Blue Swirl, Riku Voipio, qemu-devel, patches, Alexander Graf

Am 23.07.2012 20:05, schrieb Peter Maydell:
> The definitions for the ioctl numbers TARGET_BLKBSZGET and
> TARGET_BLKBSZSET had the wrong size parameters (they are defined
> with size_t, not int, even though the ioctl implementations themselves
> read and write integers). Since commit 354a0008 we now have an
> ioctl wrapper definition for BLKBSZGET and so on an x86-64-to-x86-64
> linux-user binary we were triggering the mismatch warning in
> syscall_init().
> 
> Signed-off-by: Peter Maydell <peter.maydell>

Beep :)

> ---
>  linux-user/syscall_defs.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index a79b67d..0b239c4 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -832,8 +832,8 @@ struct target_pollfd {
>  #define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
>  #define TARGET_BLKSSZGET  TARGET_IO(0x12,104)/* get block device sector size */
>  /* A jump here: 108-111 have been used for various private purposes. */
> -#define TARGET_BLKBSZGET  TARGET_IOR(0x12,112,int)
> -#define TARGET_BLKBSZSET  TARGET_IOW(0x12,113,int)
> +#define TARGET_BLKBSZGET  TARGET_IOR(0x12, 112, abi_ulong)
> +#define TARGET_BLKBSZSET  TARGET_IOW(0x12, 113, abi_ulong)
>  #define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,abi_ulong)
>                                               /* return device size in bytes
>                                                  (u64 *arg) */

For the usual suspects this looks right.
But does abi_ulong correctly handle ppc64abi32 and sparc32plus? Or is
this inside some #ifdef block?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
  2012-07-24 12:02 ` Andreas Färber
@ 2012-07-24 12:24   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2012-07-24 12:24 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Blue Swirl, Riku Voipio, qemu-devel, patches, Alexander Graf

On 24 July 2012 13:02, Andreas Färber <afaerber@suse.de> wrote:
> Am 23.07.2012 20:05, schrieb Peter Maydell:
>> The definitions for the ioctl numbers TARGET_BLKBSZGET and
>> TARGET_BLKBSZSET had the wrong size parameters (they are defined
>> with size_t, not int, even though the ioctl implementations themselves
>> read and write integers). Since commit 354a0008 we now have an
>> ioctl wrapper definition for BLKBSZGET and so on an x86-64-to-x86-64
>> linux-user binary we were triggering the mismatch warning in
>> syscall_init().
>>
>> Signed-off-by: Peter Maydell <peter.maydell>
>
> Beep :)

Hrm, how did that happen?

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

>>  linux-user/syscall_defs.h |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
>> index a79b67d..0b239c4 100644
>> --- a/linux-user/syscall_defs.h
>> +++ b/linux-user/syscall_defs.h
>> @@ -832,8 +832,8 @@ struct target_pollfd {
>>  #define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
>>  #define TARGET_BLKSSZGET  TARGET_IO(0x12,104)/* get block device sector size */
>>  /* A jump here: 108-111 have been used for various private purposes. */
>> -#define TARGET_BLKBSZGET  TARGET_IOR(0x12,112,int)
>> -#define TARGET_BLKBSZSET  TARGET_IOW(0x12,113,int)
>> +#define TARGET_BLKBSZGET  TARGET_IOR(0x12, 112, abi_ulong)
>> +#define TARGET_BLKBSZSET  TARGET_IOW(0x12, 113, abi_ulong)
>>  #define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,abi_ulong)
>>                                               /* return device size in bytes
>>                                                  (u64 *arg) */
>
> For the usual suspects this looks right.
> But does abi_ulong correctly handle ppc64abi32 and sparc32plus?

abi_ulong is always the size of a target's 'unsigned long'.
In this case the actual type used in the kernel's definition
of this ioctl number is 'size_t', but I believe that for
all our architectures (including the TARGET_ABI32 ones you
list) this is the same width as 'unsigned long' (though
not necessarily actually 'unsigned long'...)

-- PMM

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

* Re: [Qemu-devel] [PATCH] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
  2012-07-23 18:05 [Qemu-devel] [PATCH] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET Peter Maydell
  2012-07-24 12:02 ` Andreas Färber
@ 2012-08-06 13:02 ` Peter Maydell
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2012-08-06 13:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Alexander Graf, patches

Ping? Patchwork URL: http://patchwork.ozlabs.org/patch/172730/

let me know if you want a v2 patch rather than just hand-fixing
the signed-off-by line snafu.

thanks
-- PMM

On 23 July 2012 19:05, Peter Maydell <peter.maydell@linaro.org> wrote:
> The definitions for the ioctl numbers TARGET_BLKBSZGET and
> TARGET_BLKBSZSET had the wrong size parameters (they are defined
> with size_t, not int, even though the ioctl implementations themselves
> read and write integers). Since commit 354a0008 we now have an
> ioctl wrapper definition for BLKBSZGET and so on an x86-64-to-x86-64
> linux-user binary we were triggering the mismatch warning in
> syscall_init().
>
> Signed-off-by: Peter Maydell <peter.maydell>
> ---
>  linux-user/syscall_defs.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index a79b67d..0b239c4 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -832,8 +832,8 @@ struct target_pollfd {
>  #define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
>  #define TARGET_BLKSSZGET  TARGET_IO(0x12,104)/* get block device sector size */
>  /* A jump here: 108-111 have been used for various private purposes. */
> -#define TARGET_BLKBSZGET  TARGET_IOR(0x12,112,int)
> -#define TARGET_BLKBSZSET  TARGET_IOW(0x12,113,int)
> +#define TARGET_BLKBSZGET  TARGET_IOR(0x12, 112, abi_ulong)
> +#define TARGET_BLKBSZSET  TARGET_IOW(0x12, 113, abi_ulong)
>  #define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,abi_ulong)
>                                               /* return device size in bytes
>                                                  (u64 *arg) */
> --
> 1.7.5.4
>
>

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

end of thread, other threads:[~2012-08-06 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-23 18:05 [Qemu-devel] [PATCH] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET Peter Maydell
2012-07-24 12:02 ` Andreas Färber
2012-07-24 12:24   ` Peter Maydell
2012-08-06 13:02 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).