qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Aleksandar Markovic" <Aleksandar.Markovic@rt-rk.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Petar Jovanovic <petar.jovanovic@imgtec.com>,
	Aleksandar Markovic <aleksandar.markovic@imgtec.com>,
	aleksandar.rikalo@imgtec.com,
	Miodrag Dinic <miodrag.dinic@imgtec.com>,
	Leon Alrae <leon.alrae@imgtec.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Riku Voipio <riku.voipio@iki.fi>
Subject: Re: [Qemu-devel] ?==?utf-8?q? ?==?utf-8?q? [PATCH 3/3]?==?utf-8?q? linux-user: Fix structure target_semid64_ds definition for Mips
Date: Tue, 30 Aug 2016 13:54:33 +0200	[thread overview]
Message-ID: <43ae-57c57400-5-15106ac0@45129296> (raw)
In-Reply-To: <CAFEAcA9Jntpxw8Ew+qR13604WY-_qOCpbshRWQQuYjL4RD2yZw@mail.gmail.com>


-------- Original Message --------
Subject: Re: [Qemu-devel] [PATCH 3/3] linux-user: Fix structure target_semid64_ds definition for Mips
Date: Monday, August 29, 2016 23:41 CEST
From: Peter Maydell <peter.maydell@linaro.org>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
CC: Riku Voipio <riku.voipio@iki.fi>, QEMU Developers <qemu-devel@nongnu.org>, Petar Jovanovic <petar.jovanovic@imgtec.com>, Aleksandar Markovic <aleksandar.markovic@imgtec.com>, aleksandar.rikalo@imgtec.com, Miodrag Dinic <miodrag.dinic@imgtec.com>, Leon Alrae <leon.alrae@imgtec.com>, Aurelien Jarno <aurelien@aurel32.net>
References: <1472504853-42497-1-git-send-email-aleksandar.markovic@rt-rk.com> <1472504853-42497-4-git-send-email-aleksandar.markovic@rt-rk.com>


 On 29 August 2016 at 17:07, Aleksandar Markovic
<aleksandar.markovic@rt-rk.com> wrote:
> From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
>
> This patch corrects target_semid64_ds structure definition for Mips.
>
> See, for example definition of semid64_ds for Mips in Linux kernel:
> arch/mips/include/uapi/asm/sembuf.h#L13.
>
> This patch will also fix certain semaphore-related LTP tests for Mips,
> if they are executed in Qemu user mode for any Mips platform.
>
> Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
> ---
> linux-user/mips/target_structs.h | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/linux-user/mips/target_structs.h b/linux-user/mips/target_structs.h
> index fbd9955..6875506 100644
> --- a/linux-user/mips/target_structs.h
> +++ b/linux-user/mips/target_structs.h
> @@ -45,4 +45,23 @@ struct target_shmid_ds {
> abi_ulong __unused2;
> };
>
> +#define TARGET_SEMID64_DS
> +/*
> + * http://lxr.free-electrons.com/source/arch/mips/include/uapi/asm/sembuf.h#L13
> + *
> + * The semid64_ds structure for the MIPS architecture.
> + * Note extra padding because this structure is passed back and forth
> + * between kernel and user space.
> + *
> + * MIPS uses the same structure layout for both 32bit and 64bit variants.
> + */

Isn't it specifically *not* using the same structure layout for
32 and 64 bit? The struct below uses abi_ulong, which has a
different size for the two cases, so the structure layout will
differ. The 'asm generic' version of the struct (which QEMU defines
in syscall.c) is the one which is the same for both 32 and 64 bit
because it adds the explicit padding for the TARGET_ABI_BITS=32 case.

> +struct target_semid64_ds {
> + struct target_ipc_perm sem_perm;
> + abi_ulong sem_otime;
> + abi_ulong sem_ctime;
> + abi_ulong sem_nsems;
> + abi_ulong __unused3;
> + abi_ulong __unused4;
> +};

This does seem to be what the kernel does, though, so
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
if you clarify the comment.

thanks
-- PMMYes, good point - in v2, I am going to remove that sentence altogether from the comment. I plan to remove also the link from the comment, since it is uncommon to insert links in the comments, and the kernel source location for Mips' semid64_ds is mentioned in the commit message anyway.

Thanks!


 

      reply	other threads:[~2016-08-30 11:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 21:07 [Qemu-devel] [PATCH 0/3] linux-user: Fix miscelaneous Mips-specific issues Aleksandar Markovic
2016-08-29 21:07 ` [Qemu-devel] [PATCH 1/3] linux-user: Fix preprocessor constant TARGET_F_GETOWN for Mips Aleksandar Markovic
2016-08-29 21:07 ` [Qemu-devel] [PATCH 2/3] linux-user: Fix structure target_flock definition " Aleksandar Markovic
2016-08-29 21:07 ` [Qemu-devel] [PATCH 3/3] linux-user: Fix structure target_semid64_ds " Aleksandar Markovic
2016-08-29 21:41   ` Peter Maydell
2016-08-30 11:54     ` Aleksandar Markovic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43ae-57c57400-5-15106ac0@45129296 \
    --to=aleksandar.markovic@rt-rk.com \
    --cc=aleksandar.markovic@imgtec.com \
    --cc=aleksandar.rikalo@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=leon.alrae@imgtec.com \
    --cc=miodrag.dinic@imgtec.com \
    --cc=petar.jovanovic@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).