[Qemu-devel] [PATCH] linux-user/mmap.c: Set prot page flags for the correct region in mmap_frag()

2015-12-30 Thread chengang
From: Chen Gang mmap() size in mmap_frag() is qemu_host_page_size, but the outside calls page_set_flags() may be not with qemu_host_page_size. So after mmap(), call page_set_flags() in time. Also let addr increasing step be TARGET_PAGE_SIZE, just like another areas

[Qemu-devel] [PATCH v2] linux-user/mmap.c: Set prot page flags for the correct region in mmap_frag()

2015-12-31 Thread chengang
From: Chen Gang mmap() size in mmap_frag() is qemu_host_page_size, but the outside calls page_set_flags() may be not with qemu_host_page_size. So after mmap(), call page_set_flags() in time. Also let addr increasing step be TARGET_PAGE_SIZE, just like another areas

[Qemu-devel] [PATCH v5 0/5] target-tilegx: Implement floating point instructions

2016-01-02 Thread chengang
From: Chen Gang These patches are the normal floating point implementation, instead of the original temporary one. It passes building, and gcc testsuite. Chen Gang (5): fpu: softfloat: Add normalize_roundpack_float32 function target-tilegx/helper-fshared.h: Add

[Qemu-devel] [PATCH v5 3/5] target-tilegx/helper-fsingle.c: Implement single floating point

2016-01-02 Thread chengang
From: Chen Gang Signed-off-by: Chen Gang --- target-tilegx/helper-fsingle.c | 200 + 1 file changed, 200 insertions(+) create mode 100644 target-tilegx/helper-fsingle.c diff --git

[Qemu-devel] [PATCH v5 4/5] target-tilegx/helper-fdouble.c: Implement double floating point

2016-01-02 Thread chengang
From: Chen Gang Signed-off-by: Chen Gang --- target-tilegx/helper-fdouble.c | 383 + 1 file changed, 384 insertions(+) create mode 100644 target-tilegx/helper-fdouble.c diff --git

[Qemu-devel] [PATCH v5 5/5] target-tilegx: Integrate floating pointer implementation

2016-01-02 Thread chengang
From: Chen Gang It passes normal building, and gcc testsuite. Signed-off-by: Chen Gang --- target-tilegx/Makefile.objs | 3 ++- target-tilegx/helper.h | 12 + target-tilegx/translate.c | 66

[Qemu-devel] [PATCH v5 1/5] fpu: softfloat: Add normalize_roundpack_float32 function

2016-01-02 Thread chengang
From: Chen Gang It is based on (u)int32_to_float32 function to support float32 packing. Signed-off-by: Chen Gang --- fpu/softfloat.c | 55 + include/fpu/softfloat.h | 8 +++ 2

[Qemu-devel] [PATCH v5 2/5] target-tilegx/helper-fshared.h: Add floating point shared function

2016-01-02 Thread chengang
From: Chen Gang It is used by fsingle and fdouble helpers. Signed-off-by: Chen Gang --- target-tilegx/helper-fshared.h | 56 ++ 1 file changed, 56 insertions(+) create mode 100644

[Qemu-devel] [PATCH] linux-user/syscall.c: Add SO_RCVTIMEO and SO_SNDTIMEO for getsockopt

2016-01-07 Thread chengang
From: Chen Gang Just implement them according to the other features implementations. Signed-off-by: Chen Gang --- linux-user/syscall.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH] linux-user: syscall: Add SO_LINGER for setsockopt

2016-01-07 Thread chengang
From: Chen Gang Just implement it according to the other features implementations. Signed-off-by: Chen Gang --- linux-user/syscall.c | 16 +++- linux-user/syscall_defs.h | 5 + 2 files changed, 20 insertions(+), 1

[Qemu-devel] [PATCH] linux-user/mmap.c: Support shared memory mapping in mmap_frag()

2015-12-29 Thread chengang
From: Chen Gang It is a temporary fix for i386 target system running Windows. Also remove useless variable 'p'. Signed-off-by: Chen Gang --- linux-user/mmap.c | 22 +++--- 1 files changed, 19 insertions(+), 3 deletions(-)

[Qemu-devel] [PATCH v3] linux-user/mmap.c: Always zero MAP_ANONYMOUS memory in mmap_frag()

2015-12-29 Thread chengang
From: Chen Gang When mapping MAP_ANONYMOUS memory fragments, still need notice about to set it zero, or it will cause issues. Signed-off-by: Chen Gang --- linux-user/mmap.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff

[Qemu-devel] [PATCH] linux-user/syscall.c: Let tilegx support sigaltstack

2016-01-09 Thread chengang
From: Chen Gang Simply enable it, and notice about 80 columns coding styles. Signed-off-by: Chen Gang --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c

[Qemu-devel] [PATCH v2] linux-user/mmap.c: Always zero MAP_ANONYMOUS memory in mmap_frag()

2015-12-20 Thread chengang
From: Chen Gang When mapping MAP_ANONYMOUS memory fragments, still need notice about to set it zero, or it will cause issues. Signed-off-by: Chen Gang --- linux-user/mmap.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff

[Qemu-devel] [PATCH] linux-user/mmap.c: Use end instead of real_end in target_mmap

2015-12-23 Thread chengang
From: Chen Gang In this case, real_end is larger than end, which may cause mmap_frag process the incorrect memory region. Signed-off-by: Chen Gang --- linux-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-devel] [PATCH v4 1/4] target-tilegx: Add floating point shared functions

2015-12-23 Thread chengang
From: Chen Gang They are used by fsingle and fdouble helpers. Signed-off-by: Chen Gang --- target-tilegx/helper-fshared.c | 22 + target-tilegx/helper-fshared.h | 55 ++ 2 files

[Qemu-devel] [PATCH v4 3/4] target-tilegx: Add double floating point implementation

2015-12-23 Thread chengang
From: Chen Gang Signed-off-by: Chen Gang --- target-tilegx/helper-fdouble.c | 382 + 1 file changed, 382 insertions(+) create mode 100644 target-tilegx/helper-fdouble.c diff --git

[Qemu-devel] [PATCH v4 4/4] target-tilegx: Integrate floating pointer implementation

2015-12-23 Thread chengang
From: Chen Gang It passes normal building, and gcc testsuite. Signed-off-by: Chen Gang --- target-tilegx/Makefile.objs | 3 ++- target-tilegx/helper.h | 12 + target-tilegx/translate.c | 66

[Qemu-devel] [PATCH v4 0/4] target-tilegx: Implement floating point instructions

2015-12-23 Thread chengang
From: Chen Gang These patches are the normal floating point implementation, instead of the original temporary one. It passes building, and gcc testsuite. Chen Gang (4): target-tilegx: Add floating point shared functions target-tilegx: Add single floating point

[Qemu-devel] [PATCH v4 2/4] target-tilegx: Add single floating point implementation

2015-12-23 Thread chengang
From: Chen Gang Signed-off-by: Chen Gang --- target-tilegx/helper-fsingle.c | 211 + 1 file changed, 211 insertions(+) create mode 100644 target-tilegx/helper-fsingle.c diff --git

[Qemu-devel] [PATCH v2 1/3] linux-user/mmap.c: Set prot page flags for the correct region in mmap_frag()

2016-01-11 Thread chengang
From: Chen Gang mmap() size in mmap_frag() is qemu_host_page_size, but the outside calls page_set_flags() may be not with qemu_host_page_size. So after mmap(), call page_set_flags() in time. After this fix, for the next call for the same region, prot1 will be

[Qemu-devel] [PATCH v2 3/3] linux-user/mmap.c: Use TARGET_PAGE_SIZE as the increasing step

2016-01-11 Thread chengang
From: Chen Gang Just like another areas have done. --- linux-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 51c381d..86c270b 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -151,7

[Qemu-devel] [PATCH v2 2/3] linux-user/mmap.c: Remove useless variable p for mmap_frag

2016-01-11 Thread chengang
From: Chen Gang It is useless. Signed-off-by: Chen Gang --- linux-user/mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 7807ed0..51c381d 100644 ---

[Qemu-devel] [PATCH v2] linux-user/syscall.c: Add SO_RCVTIMEO and SO_SNDTIMEO for getsockopt

2016-01-11 Thread chengang
From: Chen Gang Implement them according to the other features implementations. Signed-off-by: Chen Gang --- linux-user/syscall.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH] linux-user/syscall.c: Use SOL_SOCKET instead of level for setsockopt()

2016-01-10 Thread chengang
From: Chen Gang In this case, level is TARGET_SOL_SOCKET, but we need SOL_SOCKET for setsockopt(). Signed-off-by: Chen Gang --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c

[Qemu-devel] [PATCH v2] linux-user: syscall: Add SO_LINGER for setsockopt

2016-01-10 Thread chengang
From: Chen Gang Just implement it according to the other features implementations. Signed-off-by: Chen Gang --- linux-user/syscall.c | 18 +- linux-user/syscall_defs.h | 5 + 2 files changed, 22 insertions(+), 1

[Qemu-devel] [PATCH] linux-user/syscall.c: Let lv always match val in do_getsockopt()

2016-01-13 Thread chengang
From: Chen Gang After host_to_target_sock_type(), the length of val may be changed, so calculate the related lv, too. Signed-off-by: Chen Gang --- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/syscall.c

[Qemu-devel] [PATCH] translate-all.c: Remove writable protection feature for tb_alloc_page()

2016-01-13 Thread chengang
From: Chen Gang Guest may allocate a readable, writable, and executable page, then write data on the page, and execute data as code on the page too, then write anther data still within the page. So remove this feature from linux-user: it not only consumes a little

[Qemu-devel] [PATCH] linux-user/signal.c: Generate opcode data for restorer in setup_rt_frame

2016-03-14 Thread chengang
From: Chen Gang Original implementation uses do_rt_sigreturn directly in host space, when a guest program is in unwind procedure in guest space, it will get an incorrect restore address, then causes unwind failure. Also cleanup the original incorrect indentation.

[Qemu-devel] [PATCH] target-tilegx: Support dumping working flow instructions and registers

2016-03-19 Thread chengang
From: Chen Gang It is only for debug and analyzing tilegx qemu related issues. Signed-off-by: Chen Gang --- target-tilegx/helper.c| 34 ++ target-tilegx/helper.h| 2 ++ target-tilegx/translate.c | 37

[Qemu-devel] [PATCH v2] Use frame->retcode instead of frame address for alpha target restorer

2016-03-30 Thread chengang
From: Chen Gang The restorer needs the return code address which is frame->retcode, not frame itself. Signed-off-by: Chen Gang --- linux-user/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH v2] linux-user/signal.c: Generate opcode data for restorer in setup_rt_frame

2016-03-29 Thread chengang
From: Chen Gang Original implementation uses do_rt_sigreturn directly in host space, when a guest program is in unwind procedure in guest space, it will get an incorrect restore address, then causes unwind failure. Also cleanup the original incorrect indentation.

[Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer

2016-03-29 Thread chengang
From: Chen Gang The restorer needs the return code address which is frame->retcode, not frame itself. Signed-off-by: Chen Gang --- linux-user/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/signal.c

[Qemu-devel] [PATCH] linux-user/signal.c: Use s390 target space address instead of host space address for restorer

2016-03-29 Thread chengang
From: Chen Gang The return address is in target space, so the restorer address needs to be target space, too. Signed-off-by: Chen Gang --- linux-user/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH] linux-user/signal.c: Use target address instead of host address for microblaze restorer

2016-03-29 Thread chengang
From: Chen Gang The return address is in target space, so the restorer address needs to be target space, too. Signed-off-by: Chen Gang --- linux-user/signal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [PATCH v6 4/5] target-tilegx/helper-fdouble.c: Implement double floating point

2016-05-14 Thread chengang
From: Chen Gang Signed-off-by: Chen Gang --- target-tilegx/helper-fdouble.c | 365 + 1 file changed, 365 insertions(+) create mode 100644 target-tilegx/helper-fdouble.c diff --git

[Qemu-devel] [PATCH v6 0/5] target-tilegx: Implement floating point instructions

2016-05-14 Thread chengang
From: Chen Gang These patches are the normal floating point implementation, instead of the original temporary one. It passes building, and gcc testsuite. Chen Gang (5): fpu: softfloat: Add normalize_roundpack_float[32|64] functions

[Qemu-devel] [PATCH v6 3/5] target-tilegx/helper-fsingle.c: Implement single floating point

2016-05-14 Thread chengang
From: Chen Gang Signed-off-by: Chen Gang --- target-tilegx/helper-fsingle.c | 201 + 1 file changed, 201 insertions(+) create mode 100644 target-tilegx/helper-fsingle.c diff --git

[Qemu-devel] [PATCH v6 5/5] target-tilegx: Integrate floating pointer implementation

2016-05-14 Thread chengang
From: Chen Gang It passes normal building, and related test. Signed-off-by: Chen Gang --- target-tilegx/Makefile.objs | 3 ++- target-tilegx/helper.h | 12 + target-tilegx/translate.c | 66

[Qemu-devel] [PATCH v6 1/5] fpu: softfloat: Add normalize_roundpack_float[32|64] functions

2016-05-14 Thread chengang
From: Chen Gang normalize_roundpack_float32 is based on (u)int32_to_float32 function to support float32 packing. normalize_roundpack_float64 is the special case of roundAndPackFloat64. Signed-off-by: Chen Gang --- fpu/softfloat.c |

[Qemu-devel] [PATCH v6 2/5] target-tilegx/helper-fshared.h: Add floating point shared function

2016-05-14 Thread chengang
From: Chen Gang It is used by fsingle and fdouble helpers. Signed-off-by: Chen Gang --- target-tilegx/helper-fshared.h | 56 ++ 1 file changed, 56 insertions(+) create mode 100644

[PATCH] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

2020-02-26 Thread chengang
From: Chen Gang The other DRM_IOCTL_* commands will be done later. Signed-off-by: Chen Gang --- linux-user/ioctls.h| 3 + linux-user/syscall.c | 134 + linux-user/syscall_defs.h | 16 + linux-user/syscall_types.h | 12 4 files

[PATCH] target: i386: Check float overflow about register stack

2020-02-20 Thread chengang
From: Chen Gang The fxam instruction also checks the register stack overflow, which can be get by the following fstsw instruction. The related code is below, it works well under real x86_64 hardware, but can not work under qemu-i386. 0006b63c <_CIsqrt>: 6b63c: 55

[PATCH v2] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

2020-03-15 Thread chengang
From: Chen Gang Another DRM_IOCTL_* commands will be done later. Signed-off-by: Chen Gang --- linux-user/ioctls.h| 2 ++ linux-user/syscall.c | 62 ++ linux-user/syscall_defs.h | 15 + linux-user/syscall_types.h | 11 +++ 4 files

[PATCH] linux-user: main: Let each env have its own gdt table

2020-03-31 Thread chengang
From: Chen Gang It is a temporary fix for thread LTS which need switch the ldt related index in gdt table for stable-4.1 branch. Welcome anyone providing the complete fix. Signed-off-by: Chen Gang --- linux-user/main.c | 5 + 1 file changed, 5 insertions(+) diff --git

[PATCH v3] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

2020-05-23 Thread chengang
From: Chen Gang Another DRM_IOCTL_* commands will be done later. Signed-off-by: Chen Gang --- configure | 18 +++ linux-user/ioctls.h| 3 ++ linux-user/syscall.c | 61 ++ linux-user/syscall_defs.h | 15 ++

[PATCH] linux-user: signal: Support TARGET_SS_AUTODISARM

2020-10-07 Thread chengang
From: Chen Gang Microsoft sqlserver 2017 x86_64 uses it. The implementation references from the linux kernel. Signed-off-by: Chen Gang --- linux-user/generic/signal.h | 6 ++ linux-user/signal.c | 23 ++- 2 files changed, 24 insertions(+), 5 deletions(-) diff

[PATCH] linux-user: target: signal: Support TARGET_SS_AUTODISARM

2020-10-07 Thread chengang
From: Chen Gang Add definitions to pass building. Signed-off-by: Chen Gang --- linux-user/alpha/target_signal.h | 6 ++ linux-user/hppa/target_signal.h | 5 + linux-user/mips/target_signal.h | 6 ++ linux-user/mips64/target_signal.h | 5 + linux-user/sparc/target_signal.h

[PATCH] linux-user: i386: Use trapnr which returns from cpu_exec() instead of exception_index

2020-09-26 Thread chengang
From: Chen Gang After return from cpu_exec(), the exception_index is already set 0 in cpu_handle_exception(), so we need the trapnr which returns from cpu_exec() for trapno of target sigcontext. Signed-off-by: Chen Gang --- include/hw/core/cpu.h | 2 ++ linux-user/i386/cpu_loop.c | 15

[PATCH v4] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

2020-06-02 Thread chengang
From: Chen Gang Another DRM_IOCTL_* commands will be done later. Signed-off-by: Chen Gang --- configure | 10 ++ linux-user/ioctls.h| 5 +++ linux-user/syscall.c | 67 ++ linux-user/syscall_defs.h | 15 +

[PATCH v2] linux-user: syscall: ioctls: support DRM_IOCTL_I915_GETPARAM

2020-08-02 Thread chengang
From: Chen Gang Another DRM_IOCTL_I915 patches will be sent next. Signed-off-by: Chen Gang --- linux-user/ioctls.h| 3 +++ linux-user/syscall.c | 35 +++ linux-user/syscall_defs.h | 8 linux-user/syscall_types.h | 4 4 files

[PATCH] target: i386: mem_helper: Fix ldaxr instruction 64 bit alignment issue temporarily for stable-4.1

2020-07-11 Thread chengang
From: Chen Gang This fix does not consider about the lock feature which may cause another issues, but excuse me, I don't know how to fix it. At present, the fix runs OK for my case in windows oledb32.dll in wine. Welcome anyone to fix it, thanks. Signed-off-by: Chen Gang ---

[PATCH] linux-user: syscall: ioctls: support DRM_IOCTL_I915_GETPARAM

2020-07-11 Thread chengang
From: Chen Gang It is for i915 drm command, and next, I shall send another i915 commands implementations. Signed-off-by: Chen Gang --- linux-user/ioctls.h| 3 +++ linux-user/syscall.c | 39 ++ linux-user/syscall_defs.h | 9 +

[PATCH v7] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

2020-06-04 Thread chengang
From: Chen Gang Another DRM_IOCTL_* commands will be done later. Signed-off-by: Chen Gang --- configure | 10 linux-user/ioctls.h| 5 ++ linux-user/syscall.c | 98 ++ linux-user/syscall_defs.h | 15 ++

[PATCH v5] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

2020-06-02 Thread chengang
From: Chen Gang Another DRM_IOCTL_* commands will be done later. Signed-off-by: Chen Gang --- configure | 10 linux-user/ioctls.h| 5 ++ linux-user/syscall.c | 117 + linux-user/syscall_defs.h | 15 +

[PATCH] [PATCH v6] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

2020-06-03 Thread chengang
From: Chen Gang Another DRM_IOCTL_* commands will be done later. Signed-off-by: Chen Gang --- configure | 10 linux-user/ioctls.h| 5 ++ linux-user/syscall.c | 95 ++ linux-user/syscall_defs.h | 15 ++