qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1
@ 2015-03-23 13:54 riku.voipio
  2015-03-23 13:54 ` [Qemu-devel] [PULL 1/3] linux-user/main.c: Remove redundant end_exclusive() in arm_kernel_cmpxchg64_helper() riku.voipio
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: riku.voipio @ 2015-03-23 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@linaro.org>

The following changes since commit 3c6c9fe034c0c07b77f272e4a53d7735220a16a4:

  Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging (2015-03-20 12:26:09 +0000)

are available in the git repository at:

  git://git.linaro.org/people/riku.voipio/qemu.git tags/pull-linux-user-20150323

for you to fetch changes up to 61c7480fa36775cc2baa2f8141f0c64a15f827b5:

  linux-user: fix broken cpu_copy() (2015-03-23 15:26:42 +0200)

----------------------------------------------------------------
linux-user patches for 2.3-rc1

----------------------------------------------------------------

Andreas Schwab (1):
  linux-user: fix emulation of splice syscall

Chen Gang S (1):
  linux-user/main.c: Remove redundant end_exclusive() in
    arm_kernel_cmpxchg64_helper()

Leon Alrae (1):
  linux-user: fix broken cpu_copy()

 linux-user/main.c    |  4 +---
 linux-user/syscall.c | 22 ++++++++++++++++++----
 2 files changed, 19 insertions(+), 7 deletions(-)

-- 
2.1.4

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

* [Qemu-devel] [PULL 1/3] linux-user/main.c: Remove redundant end_exclusive() in arm_kernel_cmpxchg64_helper()
  2015-03-23 13:54 [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 riku.voipio
@ 2015-03-23 13:54 ` riku.voipio
  2015-03-23 13:54 ` [Qemu-devel] [PULL 2/3] linux-user: fix emulation of splice syscall riku.voipio
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2015-03-23 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Chen Gang S

From: Chen Gang S <gang.chen@sunrus.com.cn>

start/end_exclusive() need be pairs, except the start_exclusive() in
stop_all_tasks() which is only used by force_sig(), which will be abort.
So at present, start_exclusive() in stop_all_task() need not be paired.

queue_signal() may call force_sig(), or return after kill pid (or queue
signal). If could return from queue_signal(), stop_all_task() would not
be called in time, the next end_exclusive() would be issue.

So in arm_kernel_cmpxchg64_helper() for ARM, need remove end_exclusive()
after queue_signal(). The related commit: "97cc756 linux-user: Implement
new ARM 64 bit cmpxchg kernel helper".

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 6e446de..31eb60f 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -525,8 +525,6 @@ segv:
     info.si_code = TARGET_SEGV_MAPERR;
     info._sifields._sigfault._addr = env->exception.vaddress;
     queue_signal(env, info.si_signo, &info);
-
-    end_exclusive();
 }
 
 /* Handle a jump to the kernel code page.  */
-- 
2.1.4

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

* [Qemu-devel] [PULL 2/3] linux-user: fix emulation of splice syscall
  2015-03-23 13:54 [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 riku.voipio
  2015-03-23 13:54 ` [Qemu-devel] [PULL 1/3] linux-user/main.c: Remove redundant end_exclusive() in arm_kernel_cmpxchg64_helper() riku.voipio
@ 2015-03-23 13:54 ` riku.voipio
  2015-03-23 13:54 ` [Qemu-devel] [PULL 3/3] linux-user: fix broken cpu_copy() riku.voipio
  2015-03-23 17:01 ` [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2015-03-23 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Schwab

From: Andreas Schwab <schwab@suse.de>

The second and fourth argument are in/out parameters, store them back
after the syscall.  Also, the fourth argument was mishandled, and EFAULT
handling was missing.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/syscall.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5720195..4bd9543 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9351,15 +9351,29 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         {
             loff_t loff_in, loff_out;
             loff_t *ploff_in = NULL, *ploff_out = NULL;
-            if(arg2) {
-                get_user_u64(loff_in, arg2);
+            if (arg2) {
+                if (get_user_u64(loff_in, arg2)) {
+                    goto efault;
+                }
                 ploff_in = &loff_in;
             }
-            if(arg4) {
-                get_user_u64(loff_out, arg2);
+            if (arg4) {
+                if (get_user_u64(loff_out, arg4)) {
+                    goto efault;
+                }
                 ploff_out = &loff_out;
             }
             ret = get_errno(splice(arg1, ploff_in, arg3, ploff_out, arg5, arg6));
+            if (arg2) {
+                if (put_user_u64(loff_in, arg2)) {
+                    goto efault;
+                }
+            }
+            if (arg4) {
+                if (put_user_u64(loff_out, arg4)) {
+                    goto efault;
+                }
+            }
         }
         break;
 #endif
-- 
2.1.4

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

* [Qemu-devel] [PULL 3/3] linux-user: fix broken cpu_copy()
  2015-03-23 13:54 [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 riku.voipio
  2015-03-23 13:54 ` [Qemu-devel] [PULL 1/3] linux-user/main.c: Remove redundant end_exclusive() in arm_kernel_cmpxchg64_helper() riku.voipio
  2015-03-23 13:54 ` [Qemu-devel] [PULL 2/3] linux-user: fix emulation of splice syscall riku.voipio
@ 2015-03-23 13:54 ` riku.voipio
  2015-03-23 17:01 ` [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2015-03-23 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Leon Alrae

From: Leon Alrae <leon.alrae@imgtec.com>

New threads always point at the same env which is incorrect and usually
leads to a crash.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 31eb60f..a8adb04 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3451,7 +3451,7 @@ CPUArchState *cpu_copy(CPUArchState *env)
 {
     CPUState *cpu = ENV_GET_CPU(env);
     CPUState *new_cpu = cpu_init(cpu_model);
-    CPUArchState *new_env = cpu->env_ptr;
+    CPUArchState *new_env = new_cpu->env_ptr;
     CPUBreakpoint *bp;
     CPUWatchpoint *wp;
 
-- 
2.1.4

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

* Re: [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1
  2015-03-23 13:54 [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 riku.voipio
                   ` (2 preceding siblings ...)
  2015-03-23 13:54 ` [Qemu-devel] [PULL 3/3] linux-user: fix broken cpu_copy() riku.voipio
@ 2015-03-23 17:01 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2015-03-23 17:01 UTC (permalink / raw)
  To: Riku Voipio; +Cc: QEMU Developers

On 23 March 2015 at 13:54,  <riku.voipio@linaro.org> wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
>
> The following changes since commit 3c6c9fe034c0c07b77f272e4a53d7735220a16a4:
>
>   Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging (2015-03-20 12:26:09 +0000)
>
> are available in the git repository at:
>
>   git://git.linaro.org/people/riku.voipio/qemu.git tags/pull-linux-user-20150323
>
> for you to fetch changes up to 61c7480fa36775cc2baa2f8141f0c64a15f827b5:
>
>   linux-user: fix broken cpu_copy() (2015-03-23 15:26:42 +0200)
>
> ----------------------------------------------------------------
> linux-user patches for 2.3-rc1
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2015-03-23 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 13:54 [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 riku.voipio
2015-03-23 13:54 ` [Qemu-devel] [PULL 1/3] linux-user/main.c: Remove redundant end_exclusive() in arm_kernel_cmpxchg64_helper() riku.voipio
2015-03-23 13:54 ` [Qemu-devel] [PULL 2/3] linux-user: fix emulation of splice syscall riku.voipio
2015-03-23 13:54 ` [Qemu-devel] [PULL 3/3] linux-user: fix broken cpu_copy() riku.voipio
2015-03-23 17:01 ` [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 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).