[Qemu-devel] [PATCH] readline: avoid memcpy() of overlapping regions

2013-01-07 Thread Nickolai Zeldovich
memcpy() for overlapping regions is undefined behavior; use memmove() instead in readline_hist_add(). Signed-off-by: Nickolai Zeldovich --- readline.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readline.c b/readline.c index 5fc9643..aeccc7b 100644 --- a

[Qemu-devel] [PATCH v2] linux-user/syscall.c: fix copy_to_user_fdset for fds over 30

2013-01-05 Thread Nickolai Zeldovich
and fixes select for fds above 32 on x86_64. Signed-off-by: Nickolai Zeldovich --- v2 of this patch removes unnecessary parentheses, as suggested by Richard Henderson -- thanks! linux-user/syscall.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/

[Qemu-devel] [PATCH] linux-user/syscall.c: fix copy_to_user_fdset for fds over 30

2013-01-03 Thread Nickolai Zeldovich
and fixes select for fds above 32 on x86_64. Signed-off-by: Nickolai Zeldovich --- linux-user/syscall.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5a81d9f..17c3dd6 100644 --- a/linux-user/syscall.c +++ b/linux-user

[Qemu-devel] [PATCH] linux-user/syscall.c: fix select on x86_64

2013-01-03 Thread Nickolai Zeldovich
Use the correct argument passing convention for select on x86_64. Previously, select worked for i386 but was broken for x86_64 (always returning EINVAL). With this change, select works on both i386 and x86_64. (Other targets untested but should be unaffected.) Signed-off-by: Nickolai Zeldovich

[Qemu-devel] [PATCH v2] slirp: Don't crash on packets from 0.0.0.0/8.

2012-11-12 Thread Nickolai Zeldovich
LWIP can generate packets with a source of 0.0.0.0, which triggers an assertion failure in arp_table_add(). Instead of crashing, simply return to avoid adding an invalid ARP table entry. Signed-off-by: Nickolai Zeldovich --- slirp/arp_table.c |4 +++- 1 file changed, 3 insertions(+), 1

Re: [Qemu-devel] [PATCH] slirp: Don't crash on packets from 0.0.0.0/8.

2012-11-12 Thread Nickolai Zeldovich
On Mon, Nov 12, 2012 at 4:37 AM, Jan Kiszka wrote: > On 2012-11-12 01:59, Nickolai Zeldovich wrote: >> LWIP can generate packets with a source of 0.0.0.0, which triggers an >> assertion failure in arp_table_add(). Instead of crashing, simply return >> to avoid adding an in

[Qemu-devel] [PATCH] slirp: Don't crash on packets from 0.0.0.0/8.

2012-11-11 Thread Nickolai Zeldovich
LWIP can generate packets with a source of 0.0.0.0, which triggers an assertion failure in arp_table_add(). Instead of crashing, simply return to avoid adding an invalid ARP table entry. Signed-off-by: Nickolai Zeldovich --- slirp/arp_table.c |3 ++- 1 file changed, 2 insertions(+), 1

Re: [Qemu-devel] [PATCH] fix exception precision for cmpxchg8b

2007-04-24 Thread Nickolai Zeldovich
Thanks. Looks like inline-generated instructions use cpu_restore_state() to invert the translated PC into the simulated PC. Nickolai.

[Qemu-devel] [PATCH] fix exception precision for cmpxchg8b

2007-04-24 Thread Nickolai Zeldovich
In qemu-0.9.0, an exception in cmpxchg8b (e.g. page fault due to a missing TLB entry) causes the wrong eip value to be pushed onto the exception stack -- it seems to be the eip of the last exception or the start of the translation block, whichever happened last. This makes it impossible to resume

[Qemu-devel] [PATCH] Set SO_REUSEADDR at the right time

2006-03-10 Thread Nickolai Zeldovich
(PST) From: Nickolai Zeldovich <[EMAIL PROTECTED]> To: qemu-devel@nongnu.org Cc: [EMAIL PROTECTED] Subject: Set SO_REUSEADDR at the right time It looks like qemu (at least version 0.7.2, which is what I'm running here) doesn't set SO_REUSEADDR before calling bind(), which makes

[Qemu-devel] Set SO_REUSEADDR at the right time

2006-01-16 Thread Nickolai Zeldovich
It looks like qemu (at least version 0.7.2, which is what I'm running here) doesn't set SO_REUSEADDR before calling bind(), which makes that fairly useless. This obvious patch moves up setting SO_REUSEADDR to the right place, just before bind(). Apologies if this is already fixed in 0.8.0. -- ko