* [Qemu-devel] [PATCH] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop
@ 2012-07-23 18:07 Peter Maydell
2012-08-06 12:57 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2012-07-23 18:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, patches
The code to initialise the target_to_host_errno_table[] array was
accidentally inside the loop through checking and initialising all
the supported ioctls. This was harmless but meant that we reinitialised the
array several hundred times on startup.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
The code seems to have been incorrectly placed like this since it was
first committed...
linux-user/syscall.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 539af3f..9f9ad9a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4594,6 +4594,11 @@ void syscall_init(void)
#undef STRUCT
#undef STRUCT_SPECIAL
+ /* Build target_to_host_errno_table[] table from
+ * host_to_target_errno_table[]. */
+ for (i=0; i < ERRNO_TABLE_SIZE; i++)
+ target_to_host_errno_table[host_to_target_errno_table[i]] = i;
+
/* we patch the ioctl size if necessary. We rely on the fact that
no ioctl has all the bits at '1' in the size field */
ie = ioctl_entries;
@@ -4613,11 +4618,6 @@ void syscall_init(void)
(size << TARGET_IOC_SIZESHIFT);
}
- /* Build target_to_host_errno_table[] table from
- * host_to_target_errno_table[]. */
- for (i=0; i < ERRNO_TABLE_SIZE; i++)
- target_to_host_errno_table[host_to_target_errno_table[i]] = i;
-
/* automatic consistency check if same arch */
#if (defined(__i386__) && defined(TARGET_I386) && defined(TARGET_ABI32)) || \
(defined(__x86_64__) && defined(TARGET_X86_64))
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop
2012-07-23 18:07 [Qemu-devel] [PATCH] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop Peter Maydell
@ 2012-08-06 12:57 ` Peter Maydell
0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2012-08-06 12:57 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, patches
Ping?
Patchwork url: http://patchwork.ozlabs.org/patch/172732/
-- PMM
On 23 July 2012 19:07, Peter Maydell <peter.maydell@linaro.org> wrote:
> The code to initialise the target_to_host_errno_table[] array was
> accidentally inside the loop through checking and initialising all
> the supported ioctls. This was harmless but meant that we reinitialised the
> array several hundred times on startup.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> The code seems to have been incorrectly placed like this since it was
> first committed...
>
> linux-user/syscall.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 539af3f..9f9ad9a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -4594,6 +4594,11 @@ void syscall_init(void)
> #undef STRUCT
> #undef STRUCT_SPECIAL
>
> + /* Build target_to_host_errno_table[] table from
> + * host_to_target_errno_table[]. */
> + for (i=0; i < ERRNO_TABLE_SIZE; i++)
> + target_to_host_errno_table[host_to_target_errno_table[i]] = i;
> +
> /* we patch the ioctl size if necessary. We rely on the fact that
> no ioctl has all the bits at '1' in the size field */
> ie = ioctl_entries;
> @@ -4613,11 +4618,6 @@ void syscall_init(void)
> (size << TARGET_IOC_SIZESHIFT);
> }
>
> - /* Build target_to_host_errno_table[] table from
> - * host_to_target_errno_table[]. */
> - for (i=0; i < ERRNO_TABLE_SIZE; i++)
> - target_to_host_errno_table[host_to_target_errno_table[i]] = i;
> -
> /* automatic consistency check if same arch */
> #if (defined(__i386__) && defined(TARGET_I386) && defined(TARGET_ABI32)) || \
> (defined(__x86_64__) && defined(TARGET_X86_64))
> --
> 1.7.5.4
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-06 12:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-23 18:07 [Qemu-devel] [PATCH] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop Peter Maydell
2012-08-06 12:57 ` 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).