Re: [Qemu-devel] [PATCH 07/17] mm: madvise MADV_USERFAULT: prepare vm_flags to allow more than 32bits

2014-10-07 Thread Kirill A. Shutemov
; /* >* In case if we meet a flag we don't know about. >*/ > - [0 ... (BITS_PER_LONG-1)] = "??", > + [0 ... (BITS_PER_LONG)] = "??", > > [ilog2(VM_READ)]= "rd", > [ilog2(VM_WRITE)] = "wr", -- Kirill A. Shutemov

Re: [Qemu-devel] [PATCH 08/17] mm: madvise MADV_USERFAULT

2014-10-07 Thread Kirill A. Shutemov
ich may or may not trigger an action from kernel side. I don't think an application will behaive reasonably if kernel ignore the *advise* and will not send SIGBUS, but allocate memory. I would suggest to consider to use some other interface for the functionality: a new syscall or, perhaps, mpr

Re: [Qemu-devel] [PATCH 08/17] mm: madvise MADV_USERFAULT

2014-10-07 Thread Kirill A. Shutemov
On Tue, Oct 07, 2014 at 11:46:04AM +0100, Dr. David Alan Gilbert wrote: > * Kirill A. Shutemov (kir...@shutemov.name) wrote: > > On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote: > > > MADV_USERFAULT is a new madvise flag that will set VM_USERFAULT in the > &g

Re: [Qemu-devel] [PATCH 10/17] mm: rmap preparation for remap_anon_pages

2014-10-07 Thread Kirill A. Shutemov
triggering COW instead of adding limitation on pages' mapcount? The limitation looks artificial from interface POV. -- Kirill A. Shutemov

Re: [Qemu-devel] [PATCH 08/17] mm: madvise MADV_USERFAULT

2014-10-07 Thread Kirill A. Shutemov
On Tue, Oct 07, 2014 at 12:01:02PM +0100, Dr. David Alan Gilbert wrote: > * Kirill A. Shutemov (kir...@shutemov.name) wrote: > > On Tue, Oct 07, 2014 at 11:46:04AM +0100, Dr. David Alan Gilbert wrote: > > > * Kirill A. Shutemov (kir...@shutemov.name) wrote: > > > >

Re: [Qemu-devel] [PATCH 08/17] mm: madvise MADV_USERFAULT

2014-10-07 Thread Kirill A. Shutemov
On Tue, Oct 07, 2014 at 03:24:58PM +0200, Andrea Arcangeli wrote: > Hi Kirill, > > On Tue, Oct 07, 2014 at 01:36:45PM +0300, Kirill A. Shutemov wrote: > > On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote: > > > MADV_USERFAULT is a new madvise flag that will

Re: [Qemu-devel] [RESEND-try-2][PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-12-23 Thread Kirill A. Shutemov
Aneesh Kumar K.V wrote: > "Kirill A. Shutemov" writes: > > > Kirill A. Shutemov wrote: > >> Currently we have few issues with P9_STATS_GEN: > >> > >> - We don't try to read st_gen anything except files or directories, but > >>

[Qemu-devel] [PATCH] [RESEND-try-3] hw/9pfs: fix P9_STATS_GEN handling

2014-01-28 Thread Kirill A. Shutemov
issues and cleanup code a bit. Signed-off-by: Kirill A. Shutemov Reviewed-by: Daniel P. Berrange Reviewed-by: Aneesh Kumar K.V --- hw/9pfs/cofile.c | 4 hw/9pfs/virtio-9p-handle.c | 8 +++- hw/9pfs/virtio-9p-local.c | 10 ++ hw/9pfs/virtio-9p-proxy.c | 3 ++- hw/9pfs/v

Re: [Qemu-devel] [PATCH] [RESEND-try-3] hw/9pfs: fix P9_STATS_GEN handling

2014-01-28 Thread Kirill A. Shutemov
Michael S. Tsirkin wrote: > On Tue, Jan 28, 2014 at 12:55:51PM +0200, Kirill A. Shutemov wrote: > > Currently we have few issues with P9_STATS_GEN: > > > > - We don't try to read st_gen anything except files or directories, but > >still set P9_STATS_GEN bit i

[Qemu-devel] [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_getversion()

2014-01-28 Thread Kirill A. Shutemov
v9fs_co_st_gen() expects to see error code in errno, not in return code. Let's fix this. Signed-off-by: Kirill A. Shutemov --- hw/9pfs/virtio-9p-local.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c

[Qemu-devel] [PATCH 2/4] hw/9pfs: handle undefined FS_IOC_GETVERSION case in handle_ioc_getversion()

2014-01-28 Thread Kirill A. Shutemov
All get_st_gen() implementations except handle_ioc_getversion() have guard for undefined FS_IOC_GETVERSION. Let's add it there too. Signed-off-by: Kirill A. Shutemov --- hw/9pfs/virtio-9p-handle.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/9pfs/virtio-9p-handle.c b/hw

[Qemu-devel] [PATCH 4/4] hw/9pfs: fix P9_STATS_GEN handling

2014-01-28 Thread Kirill A. Shutemov
The solution is to make P9_STATS_GEN failure non-fatal for getattr request. Just don't set P9_STATS_GEN flag in result mask on failure. Signed-off-by: Kirill A. Shutemov --- hw/9pfs/cofile.c| 4 hw/9pfs/virtio-9p.c | 12 ++-- 2 files changed, 10 insertions(+), 6 deletions

[Qemu-devel] [PATCH 3/4] hw/9pfs: make get_st_gen() return ENOTTY error on special files

2014-01-28 Thread Kirill A. Shutemov
Currently we silently ignore getversion requests for anything except file or directory. Let's instead return ENOTTY error to indicate that getversion is not supported. It makes implementation consistent on all not-supported cases. Signed-off-by: Kirill A. Shutemov --- hw/9pfs/virtio-9p-han

Re: [Qemu-devel] [RESEND-try-2][PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-12-09 Thread Kirill A. Shutemov
Kirill A. Shutemov wrote: > Currently we have few issues with P9_STATS_GEN: > > - We don't try to read st_gen anything except files or directories, but >still set P9_STATS_GEN bit in st_result_mask. It may mislead client: >we present garbage as valid st_gen. > &

Re: [Qemu-devel] [RESEND] [PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-11-06 Thread Kirill A. Shutemov
On Wed, Nov 06, 2013 at 09:41:47PM +0530, Aneesh Kumar K.V wrote: > "Kirill A. Shutemov" writes: > > > From: "Kirill A. Shutemov" > > > > Currently we have few issues with P9_STATS_GEN: > > > > - We don't try to read st_g

[Qemu-devel] [RESEND-try-2][PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-11-29 Thread Kirill A. Shutemov
issues and cleanup code a bit. Signed-off-by: Kirill A. Shutemov Reviewed-by: Daniel P. Berrange Reviewed-by: Aneesh Kumar K.V --- hw/9pfs/cofile.c | 4 hw/9pfs/virtio-9p-handle.c | 8 +++- hw/9pfs/virtio-9p-local.c | 10 ++ hw/9pfs/virtio-9p-proxy.c | 3 ++- hw/9pfs/v

[Qemu-devel] [PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-10-26 Thread Kirill A. Shutemov
From: "Kirill A. Shutemov" Currently we have few issues with P9_STATS_GEN: - We don't try to read st_gen anything except files or directories, but still set P9_STATS_GEN bit in st_result_mask. It may mislead client: we present garbage as valid st_gen. - If we failed to g

[Qemu-devel] [PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-10-26 Thread Kirill A. Shutemov
issues and cleanup code a bit. Signed-off-by: Kirill A. Shutemov --- hw/9pfs/cofile.c | 4 hw/9pfs/virtio-9p-handle.c | 8 +++- hw/9pfs/virtio-9p-local.c | 10 ++ hw/9pfs/virtio-9p-proxy.c | 3 ++- hw/9pfs/virtio-9p.c| 12 ++-- 5 files changed, 25 inserti

Re: [Qemu-devel] [PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-10-30 Thread Kirill A. Shutemov
On Sun, Oct 27, 2013 at 03:41:34AM +0300, Kirill A. Shutemov wrote: > From: "Kirill A. Shutemov" > > Currently we have few issues with P9_STATS_GEN: > > - We don't try to read st_gen anything except files or directories, but >still set P9_STATS_GEN bit

[Qemu-devel] [RESEND] [PATCH] hw/9pfs: fix P9_STATS_GEN handling

2013-11-04 Thread Kirill A. Shutemov
From: "Kirill A. Shutemov" Currently we have few issues with P9_STATS_GEN: - We don't try to read st_gen anything except files or directories, but still set P9_STATS_GEN bit in st_result_mask. It may mislead client: we present garbage as valid st_gen. - If we failed to g

Re: [Qemu-devel] post-copy is broken?

2016-04-15 Thread Kirill A. Shutemov
e improved too, so there is a > simpler way to reproduce than running precopy before postcopy in qemu. I've tested current Linus' tree and v4.5 using qemu postcopy test case for both x86-64 and i386 and it never failed for me: /x86_64/postcopy: first_byte = 7e last_byte = 7d hit_edge = 1 OK OK /i386/postcopy: first_byte = f6 last_byte = f5 hit_edge = 1 OK OK I've run it directly, setting relevant QTEST_QEMU_BINARY. -- Kirill A. Shutemov

Re: [Qemu-devel] post-copy is broken?

2016-04-15 Thread Kirill A. Shutemov
On Fri, Apr 15, 2016 at 02:42:33PM +0100, Dr. David Alan Gilbert wrote: > * Kirill A. Shutemov (kir...@shutemov.name) wrote: > > On Thu, Apr 14, 2016 at 12:22:30PM -0400, Andrea Arcangeli wrote: > > > Adding linux-mm too, > > > > > > On Thu, Apr 14, 2016

Re: [Qemu-devel] [PATCH 1/1] mm: thp: kvm: fix memory corruption in KVM with THP enabled

2016-04-27 Thread Kirill A. Shutemov
cific, doesn't it? > +static inline int PageTransCompoundMap(struct page *page) > +{ > + return PageTransCompound(page) && atomic_read(&page->_mapcount) < 0; > +} > + > +/* > * PageTransTail returns true for both transparent huge pages > * and hugetlbfs pages, so it should only be called when it's known > * that hugetlbfs pages aren't involved. > @@ -559,6 +580,7 @@ static inline int TestClearPageDoubleMap(struct page > *page) > #else > TESTPAGEFLAG_FALSE(TransHuge) > TESTPAGEFLAG_FALSE(TransCompound) > +TESTPAGEFLAG_FALSE(TransCompoundMap) > TESTPAGEFLAG_FALSE(TransTail) > TESTPAGEFLAG_FALSE(DoubleMap) > TESTSETFLAG_FALSE(DoubleMap) -- Kirill A. Shutemov

Re: [Qemu-devel] [PATCH 1/1] mm: thp: kvm: fix memory corruption in KVM with THP enabled

2016-04-27 Thread Kirill A. Shutemov
On Wed, Apr 27, 2016 at 04:59:57PM +0200, Andrea Arcangeli wrote: > On Wed, Apr 27, 2016 at 04:50:30PM +0300, Kirill A. Shutemov wrote: > > I know nothing about kvm. How do you protect against pmd splitting between > > get_user_pages() and the check? > > get_user_pages_fast(

[Qemu-devel] [PATCH] Fix TEXTREL in user targets when compiled with --enable-user-pie

2009-12-14 Thread Kirill A. Shutemov
We really need compile _all_ sources for user target with -fpie when use --enable-user-pie. It's regression introduced by commit add16157d72454. Please, do not break it any more. Signed-off-by: Kirill A. Shutemov Cc: Blue Swirl --- Makefile.user |4 ++-- configure |1 + 2

[Qemu-devel] Re: [PATCH] Fix TEXTREL in user targets when compiled with --enable-user-pie

2009-12-15 Thread Kirill A. Shutemov
Please, apply it. On Tue, Dec 15, 2009 at 3:10 AM, Kirill A. Shutemov wrote: > We really need compile _all_ sources for user target with -fpie when > use --enable-user-pie. > > It's regression introduced by commit add16157d72454. > Please, do not break it any more. > &g

[Qemu-devel] Re: [PATCH] Fix TEXTREL in user targets when compiled with --enable-user-pie

2009-12-16 Thread Kirill A. Shutemov
On Tue, Dec 15, 2009 at 10:55 PM, Juan Quintela wrote: > "Kirill A. Shutemov" wrote: >> Please, apply it. >> >> On Tue, Dec 15, 2009 at 3:10 AM, Kirill A. Shutemov >> wrote: >>> We really need compile _all_ sources for user target with -fpi

Re: [Qemu-devel] Re: [PATCH] Fix TEXTREL in user targets when compiled with --enable-user-pie

2009-12-16 Thread Kirill A. Shutemov
On Wed, Dec 16, 2009 at 11:15 AM, Paolo Bonzini wrote: > On 12/16/2009 09:45 AM, Kirill A. Shutemov wrote: >>>>> >>>>> >>>  -VPATH=$(SRC_PATH) >>>>> >>>  +vpath %.c $(SRC_PATH) >>> >>> > >>> >  T

[Qemu-devel] [PATCH] user_only: compile everything with -fpie

2009-12-16 Thread Kirill A. Shutemov
We really need compile _all_ sources for user target with -fpie when use --enable-user-pie. It's regression introduced by commit add16157d72454. Signed-off-by: Kirill A. Shutemov Cc: Blue Swirl Signed-off-by: Juan Quintela --- Makefile.user |7 ++- configure |3 +++ 2

[Qemu-devel] Re: [PATCH] user_only: compile everything with -fpie

2009-12-18 Thread Kirill A. Shutemov
ping? On Wed, Dec 16, 2009 at 4:20 PM, Kirill A. Shutemov wrote: > We really need compile _all_ sources for user target with -fpie when > use --enable-user-pie. > > It's regression introduced by commit add16157d72454. > > Signed-off-by: Kirill A. Shutemov > Cc: Blue Sw

[Qemu-devel] [PATCH 01/18] Do not disable _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
Let's fix code instead! Signed-off-by: Kirill A. Shutemov --- configure |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/configure b/configure index d815c7a..17f3d42 100755 --- a/configure +++ b/configure @@ -97,7 +97,6 @@ CFLAGS="-g $CFLAGS" QEMU_CFLAGS

[Qemu-devel] [PATCH 02/18] block.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
CCblock.o cc1: warnings being treated as errors block.c: In function 'bdrv_open2': block.c:400: error: ignoring return value of 'realpath', declared with attribute warn_unused_result Signed-off-by: Kirill A. Shutemov --- block.c |4 ++-- 1 files changed, 2 insert

[Qemu-devel] [PATCH 03/18] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
CCposix-aio-compat.o cc1: warnings being treated as errors posix-aio-compat.c: In function 'aio_signal_handler': posix-aio-compat.c:505: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [posix-aio-compat.o] Error 1 Sig

[Qemu-devel] [PATCH 05/18] block/qcow.c: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
x27;, declared with attribute warn_unused_result block/qcow.c:811: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [block/qcow.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/qcow.c | 26 ++ 1 files changed, 22 ins

[Qemu-devel] [PATCH 04/18] block/cow.c: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
x27;, declared with attribute warn_unused_result make: *** [block/cow.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/cow.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/block/cow.c b/block/cow.c index a70854e..1132614 100644 --- a/block/cow.c +++

[Qemu-devel] [PATCH 06/18] block/vmdk.o: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
n value of 'write', declared with attribute warn_unused_result make: *** [block/vmdk.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/vmdk.c | 50 -- 1 files changed, 40 insertions(+), 10 deletions(-) diff --git a/block/vmdk.c b/

[Qemu-devel] [PATCH 08/18] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
068: /usr/include/bits/stdio2.h:65: error: call to __builtin___snprintf_chk will always overflow destination buffer make: *** [block/vvfat.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/vvfat.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c

[Qemu-devel] [PATCH 07/18] block/bochs.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
CCblock/bochs.o cc1: warnings being treated as errors block/bochs.c: In function 'seek_to_sector': block/bochs.c:202: error: ignoring return value of 'read', declared with attribute warn_unused_result make: *** [block/bochs.o] Error 1 Signed-off-by: Kirill A. Shutemov

[Qemu-devel] [PATCH 09/18] block/qcow2.c: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
ute warn_unused_result block/qcow2.c:855: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [block/qcow2.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/qcow2.c | 54 -- 1 files changed, 4

[Qemu-devel] [PATCH 10/18] net/slirp.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
CCnet/slirp.o cc1: warnings being treated as errors net/slirp.c: In function 'slirp_smb_cleanup': net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_result make: *** [net/slirp.o] Error 1 Signed-off-by: Kirill A. Shutemov ---

[Qemu-devel] [PATCH 11/18] usb-linux.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
CCusb-linux.o cc1: warnings being treated as errors usb-linux.c: In function 'usb_host_read_file': usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_result make: *** [usb-linux.o] Error 1 Signed-off-by: Kirill A. Shutem

[Qemu-devel] [PATCH 12/18] savevm.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
CCsavevm.o cc1: warnings being treated as errors savevm.c: In function 'file_put_buffer': savevm.c:342: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result make: *** [savevm.o] Error 1 Signed-off-by: Kirill A. Shutemov --- savevm.c

[Qemu-devel] [PATCH 13/18] slirp/misc.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
CCslirp/misc.o cc1: warnings being treated as errors slirp/misc.c: In function 'fork_exec': slirp/misc.c:209: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [slirp/misc.o] Error 1 Signed-off-by: Kirill A. Shutemov ---

[Qemu-devel] [PATCH 14/18] vl.c: fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
th attribute warn_unused_result /usr/src/RPM/BUILD/qemu-0.11.92/vl.c:6083: error: ignoring return value of 'chdir', declared with attribute warn_unused_result make[1]: *** [vl.o] Error 1 Signed-off-by: Kirill A. Shutemov --- vl.c | 15 +++ 1 files changed, 11 insertion

[Qemu-devel] [PATCH 15/18] monitor.c: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
t /usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_physical_memory_save': /usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1345: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result make[1]: *** [monitor.o] Error 1 Signed-off-by: K

[Qemu-devel] [PATCH 16/18] hw/pc.c: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
declared with attribute warn_unused_result make[1]: *** [pc.o] Error 1 Signed-off-by: Kirill A. Shutemov --- hw/pc.c | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index db7d58e..83f8dd0 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -613,7

[Qemu-devel] [PATCH 17/18] path.c fix warning with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
Error 1 Signed-off-by: Kirill A. Shutemov --- path.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/path.c b/path.c index cc9e007..0d2bf14 100644 --- a/path.c +++ b/path.c @@ -46,7 +46,10 @@ static struct pathelem *new_entry(const char *root, { struct pa

[Qemu-devel] [PATCH 18/18] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE

2009-12-19 Thread Kirill A. Shutemov
_result /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap': /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result make[1]: *** [mmap.o] Error 1 Signed-off-by: Kirill A.

[Qemu-devel] [PATCH 01/14] Introduce qemu_write_full()

2009-12-30 Thread Kirill A. Shutemov
A variant of write(2) which handles partial write. Signed-off-by: Kirill A. Shutemov --- osdep.c | 27 +++ qemu-common.h |1 + 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/osdep.c b/osdep.c index e4836e7..d2406f2 100644 --- a/osdep.c +++ b

[Qemu-devel] [PATCH 02/14] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
CCposix-aio-compat.o cc1: warnings being treated as errors posix-aio-compat.c: In function 'aio_signal_handler': posix-aio-compat.c:505: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [posix-aio-compat.o] Error 1 Sig

[Qemu-devel] [PATCH 03/14] block/cow.c: fix warnings with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
x27;, declared with attribute warn_unused_result make: *** [block/cow.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/cow.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/block/cow.c b/block/cow.c index a70854e..ba07b97 100644 --- a/block/cow.c +++

[Qemu-devel] [PATCH 04/14] block/qcow.c: fix warnings with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
x27;, declared with attribute warn_unused_result block/qcow.c:811: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [block/qcow.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/qcow.c | 26 ++ 1 files changed, 22 ins

[Qemu-devel] [PATCH 05/14] block/vmdk.o: fix warnings with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
n value of 'write', declared with attribute warn_unused_result make: *** [block/vmdk.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/vmdk.c | 50 -- 1 files changed, 40 insertions(+), 10 deletions(-) diff --git a/block/vmdk.c b/

[Qemu-devel] [PATCH 06/14] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
068: /usr/include/bits/stdio2.h:65: error: call to __builtin___snprintf_chk will always overflow destination buffer make: *** [block/vvfat.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/vvfat.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c

[Qemu-devel] [PATCH 07/14] block/qcow2.c: fix warnings with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
ute warn_unused_result block/qcow2.c:855: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [block/qcow2.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/qcow2.c | 55 +-- 1 files changed, 4

[Qemu-devel] [PATCH 09/14] usb-linux.c: fix warning with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
CCusb-linux.o cc1: warnings being treated as errors usb-linux.c: In function 'usb_host_read_file': usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_result make: *** [usb-linux.o] Error 1 Signed-off-by: Kirill A. Shutem

[Qemu-devel] [PATCH 08/14] net/slirp.c: fix warning with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
CCnet/slirp.o cc1: warnings being treated as errors net/slirp.c: In function 'slirp_smb_cleanup': net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_result make: *** [net/slirp.o] Error 1 Signed-off-by: Kirill A. Shutemov ---

[Qemu-devel] [PATCH 10/14] vl.c: fix warning with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
th attribute warn_unused_result /usr/src/RPM/BUILD/qemu-0.11.92/vl.c:6083: error: ignoring return value of 'chdir', declared with attribute warn_unused_result make[1]: *** [vl.o] Error 1 Signed-off-by: Kirill A. Shutemov --- vl.c | 23 +++ 1 files changed, 19 i

[Qemu-devel] [PATCH 11/14] monitor.c: fix warnings with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
t /usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_physical_memory_save': /usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1345: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result make[1]: *** [monitor.o] Error 1 Signed-off-by: K

[Qemu-devel] [PATCH 12/14] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE

2009-12-30 Thread Kirill A. Shutemov
_result /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap': /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result make[1]: *** [mmap.o] Error 1 Signed-off-by: Kirill A.

[Qemu-devel] [PATCH 13/14] Enable _FORTIFY_SOURCE=2

2009-12-30 Thread Kirill A. Shutemov
_FORTIFY_SOURCE is a Glibc feature which adds memory and string function protection. Signed-off-by: Kirill A. Shutemov --- configure |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 18aed43..0cdcdb3 100755 --- a/configure +++ b/configure

[Qemu-devel] [PATCH 14/14] Add -fstack-protector-all to CFLAGS

2009-12-30 Thread Kirill A. Shutemov
-fstack-protector-all emit extra code to check for buffer overflows, such as stack smashing attacks. This is done by adding a guard variable to functions with vulnerable objects. Signed-off-by: Kirill A. Shutemov --- configure |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff

Re: [Qemu-devel] [PATCH 01/14] Introduce qemu_write_full()

2009-12-30 Thread Kirill A. Shutemov
On Thu, Dec 31, 2009 at 4:00 AM, malc wrote: > On Thu, 31 Dec 2009, Kirill A. Shutemov wrote: > >> A variant of write(2) which handles partial write. >> >> Signed-off-by: Kirill A. Shutemov >> --- >>  osdep.c       |   27 +++ >>  

Re: [Qemu-devel] [PATCH 01/14] Introduce qemu_write_full()

2009-12-31 Thread Kirill A. Shutemov
2009/12/31 malc : > On Thu, 31 Dec 2009, Kirill A. Shutemov wrote: > >> On Thu, Dec 31, 2009 at 4:00 AM, malc wrote: >> > On Thu, 31 Dec 2009, Kirill A. Shutemov wrote: >> > >> >> A variant of write(2) which handles partial write. >

Re: [Qemu-devel] [PATCH 14/14] Add -fstack-protector-all to CFLAGS

2010-01-01 Thread Kirill A. Shutemov
On Thu, Dec 31, 2009 at 12:58 PM, Arnaud Patard wrote: > "Kirill A. Shutemov" writes: > Hi, > >> -fstack-protector-all emit extra code to check for buffer overflows, >> such as stack smashing attacks.  This is done by adding a guard >> variable to functions

Re: [Qemu-devel] [PATCH 12/14] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
On Thu, Dec 31, 2009 at 12:50 PM, Arnaud Patard wrote: > "Kirill A. Shutemov" writes: > > Hi, > >>   CC    i386-linux-user/mmap.o >> cc1: warnings being treated as errors >> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'mmap_frag&#x

[Qemu-devel] [PATCH 01/15] Introduce qemu_write_full()

2010-01-01 Thread Kirill A. Shutemov
A variant of write(2) which handles partial write. Signed-off-by: Kirill A. Shutemov --- osdep.c | 27 +++ qemu-common.h |2 ++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/osdep.c b/osdep.c index e4836e7..8ae48fe 100644 --- a/osdep.c +++ b

[Qemu-devel] [PATCH 02/15] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
CCposix-aio-compat.o cc1: warnings being treated as errors posix-aio-compat.c: In function 'aio_signal_handler': posix-aio-compat.c:505: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [posix-aio-compat.o] Error 1 Sig

[Qemu-devel] [PATCH 03/15] block/cow.c: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
x27;, declared with attribute warn_unused_result make: *** [block/cow.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/cow.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/block/cow.c b/block/cow.c index a70854e..ba07b97 100644 --- a/block/cow.c +++

[Qemu-devel] [PATCH 04/15] block/qcow.c: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
x27;, declared with attribute warn_unused_result block/qcow.c:811: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [block/qcow.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/qcow.c | 25 + 1 files changed, 21 ins

[Qemu-devel] [PATCH 05/15] block/vmdk.o: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
n value of 'write', declared with attribute warn_unused_result make: *** [block/vmdk.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/vmdk.c | 50 -- 1 files changed, 40 insertions(+), 10 deletions(-) diff --git a/block/vmdk.c b/

[Qemu-devel] [PATCH 06/15] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
068: /usr/include/bits/stdio2.h:65: error: call to __builtin___snprintf_chk will always overflow destination buffer make: *** [block/vvfat.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/vvfat.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c

[Qemu-devel] [PATCH 07/15] block/qcow2.c: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
ute warn_unused_result block/qcow2.c:855: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [block/qcow2.o] Error 1 Signed-off-by: Kirill A. Shutemov --- block/qcow2.c | 55 +-- 1 files changed, 4

[Qemu-devel] [PATCH 08/15] net/slirp.c: fix warning with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
CCnet/slirp.o cc1: warnings being treated as errors net/slirp.c: In function 'slirp_smb_cleanup': net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_result make: *** [net/slirp.o] Error 1 Signed-off-by: Kirill A. Shutemov ---

[Qemu-devel] [PATCH 09/15] usb-linux.c: fix warning with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
CCusb-linux.o cc1: warnings being treated as errors usb-linux.c: In function 'usb_host_read_file': usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_result make: *** [usb-linux.o] Error 1 Signed-off-by: Kirill A. Shutem

[Qemu-devel] [PATCH 11/15] monitor.c: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
t /usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_physical_memory_save': /usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1345: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result make[1]: *** [monitor.o] Error 1 Signed-off-by: K

[Qemu-devel] [PATCH 10/15] vl.c: fix warning with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
th attribute warn_unused_result /usr/src/RPM/BUILD/qemu-0.11.92/vl.c:6083: error: ignoring return value of 'chdir', declared with attribute warn_unused_result make[1]: *** [vl.o] Error 1 Signed-off-by: Kirill A. Shutemov --- vl.c | 33 + 1 files cha

[Qemu-devel] [PATCH 12/15] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE

2010-01-01 Thread Kirill A. Shutemov
_result /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap': /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result make[1]: *** [mmap.o] Error 1 Signed-off-by: Kirill A

[Qemu-devel] [PATCH 13/15] Enable _FORTIFY_SOURCE=2

2010-01-01 Thread Kirill A. Shutemov
_FORTIFY_SOURCE is a Glibc feature which adds memory and string function protection. Signed-off-by: Kirill A. Shutemov --- configure |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 18aed43..0cdcdb3 100755 --- a/configure +++ b/configure

[Qemu-devel] [PATCH 14/15] Add -fstack-protector-all to CFLAGS

2010-01-01 Thread Kirill A. Shutemov
-fstack-protector-all emit extra code to check for buffer overflows, such as stack smashing attacks. This is done by adding a guard variable to functions with vulnerable objects. Signed-off-by: Kirill A. Shutemov --- configure |8 1 files changed, 8 insertions(+), 0 deletions

[Qemu-devel] [PATCH 15/15] linux-user: fix return value of mmap_frag()

2010-01-01 Thread Kirill A. Shutemov
mmap_frag() returns -1 on error and set errno. Signed-off-by: Kirill A. Shutemov --- linux-user/mmap.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index c1c7e48..47bc339 100644 --- a/linux-user/mmap.c +++ b/linux-user

[Qemu-devel] Re: [PATCH 09/15] usb-linux.c: fix warning with _FORTIFY_SOURCE

2010-01-05 Thread Kirill A. Shutemov
On Tue, Jan 5, 2010 at 4:42 PM, Juan Quintela wrote: > "Kirill A. Shutemov" wrote: >>   CC    usb-linux.o >> cc1: warnings being treated as errors >> usb-linux.c: In function 'usb_host_read_file': >> usb-linux.c:1204: error: ignoring retur

[Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()

2010-01-19 Thread Kirill A. Shutemov
On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela wrote: > "Kirill A. Shutemov" wrote: >> A variant of write(2) which handles partial write. >> >> Signed-off-by: Kirill A. Shutemov > > Hi > > Have you updated this series?  Is there any reason that you kno

[Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2010-01-19 Thread Kirill A. Shutemov
On Wed, Jan 20, 2010 at 1:56 AM, Juan Quintela wrote: > From: Kirill A. Shutemov > > CC    block/vvfat.o > cc1: warnings being treated as errors > block/vvfat.c: In function 'commit_one_file': > block/vvfat.c:2259: error: ignoring return value of 'ftrun

Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2010-01-20 Thread Kirill A. Shutemov
On Wed, Jan 20, 2010 at 12:33 PM, Daniel P. Berrange wrote: > On Wed, Jan 20, 2010 at 08:19:26AM +0200, Kirill A. Shutemov wrote: >> On Wed, Jan 20, 2010 at 1:56 AM, Juan Quintela wrote: >> > From: Kirill A. Shutemov >> > >> > CC    block/vvfat.o >&g

Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2010-01-20 Thread Kirill A. Shutemov
On Wed, Jan 20, 2010 at 2:15 PM, Markus Armbruster wrote: > Kevin Wolf writes: > >> Am 20.01.2010 12:09, schrieb Kirill A. Shutemov: >>> On Wed, Jan 20, 2010 at 12:33 PM, Daniel P. Berrange >>> wrote: >>>> On Wed, Jan 20, 2010 at 08:19:26AM +0200, Kiri

Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2010-01-20 Thread Kirill A. Shutemov
On Wed, Jan 20, 2010 at 3:03 PM, Markus Armbruster wrote: > "Kirill A. Shutemov" writes: >> No, compiler can't add anything between. 'char' is always byte-aligned. > > You got some reading to do then. Do you want to say that it's not true? Could

Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE

2010-01-20 Thread Kirill A. Shutemov
2010/1/20 Gleb Natapov : > On Wed, Jan 20, 2010 at 02:03:04PM +0100, Markus Armbruster wrote: >> "Kirill A. Shutemov" writes: >> > No, compiler can't add anything between. 'char' is always byte-aligned. >> >> You got some reading to do then

[Qemu-devel] [PATCH] Fix lock_iovec

2008-01-30 Thread Kirill A. Shutemov
].iov_base) + if (!vec[i].iov_base && vec[i].iov_len) goto fail; } unlock_user (target_vec, target_addr, 0); -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys Ltd, http://www.velesys.com/ + ALT Linux Team, http://www.altlinux.com/ signature.asc Des

Re: [Qemu-devel] [PATCH] Fix lock_iovec

2008-01-30 Thread Kirill A. Shutemov
On [Wed, 30.01.2008 19:56], Mulyadi Santosa wrote: > Hi... > > On Jan 29, 2008 11:59 PM, Kirill A. Shutemov <[EMAIL PROTECTED]> wrote: > > Do not stop iovec conversion on iov_base == NULL if iov_len is 0 > "is 0" or "is not 0"? For now, iovec conve

Re: [Qemu-devel] Fix writev syscall emulation

2008-02-04 Thread Kirill A. Shutemov
c[i].iov_base = lock_user(type, base, vec[i].iov_len, copy); > - if (!vec[i].iov_base) > + if (!vec[i].iov_base && vec[i].iov_len) > goto fail; > } > unlock_user (target_vec, target_addr, 0); I have post similar patch some days ago. -- Regard

Re: [Qemu-devel] [PATCH] linux-user, fix getgroups/getgroups32 when both args are zero.

2008-02-22 Thread Kirill A. Shutemov
} It makes getgroups much faster in some cases. -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys Ltd, http://www.velesys.com/ + ALT Linux Team, http://www.altlinux.com/ signature.asc Description: Digital signature

Re: [Qemu-devel] [PATCH] linux-user, fix getgroups/getgroups32 when both args are zero.

2008-02-26 Thread Kirill A. Shutemov
On [Sat, 23.02.2008 09:25], Kirill A. Shutemov wrote: > On [Sat, 23.02.2008 12:00], Takashi Yoshii wrote: > > getgroups() and getgroups32() returns NGROUPS_MAX when both its two args are > > zero. But because we pass a ptr to allocated space as 2nd arg, this function > > are

[Qemu-devel] sizeof(target_int)

2007-04-16 Thread Kirill A. Shutemov
Is it possible to get size of target int? Why is only TARGET_LONG_BITS defined? I have need of size of target int for correct define fsid_t for linux user mode. fsid_t is struct { int val[2]; } for linux. -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys LLC, http://www.velesys.com

[Qemu-devel] QEMU Various Vulnerabilities

2007-05-02 Thread Kirill A. Shutemov
http://secunia.com/advisories/25073/ Any comments ? -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys LLC, http://www.velesys.com/ + ALT Linux Team, http://www.altlinux.com/ signature.asc Description: Digital signature

Re: [Qemu-devel] QEMU Various Vulnerabilities

2007-05-03 Thread Kirill A. Shutemov
On [Wed, 02.05.2007 18:21], malc wrote: > On Wed, 2 May 2007, Kirill A. Shutemov wrote: > > >http://secunia.com/advisories/25073/ > > > >Any comments ? > > AAM - http://lists.gnu.org/archive/html/qemu-devel/2007-04/msg00650.html > SB16/DMA - in attachme

Re: [Qemu-devel] [PATCH][UPDATED] Fix path mangling in linux-user/path.c

2007-05-21 Thread Kirill A. Shutemov
system /usr hierarchy in a recursive loop. > > Compared to the previous version of this patch, fixes an issue with > attempting to free() a pointer returned by GNU basename(). My patch to solve same problems attached -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys LLC, h

Re: [Qemu-devel] qemu-user mmap not thread-safe?

2007-06-20 Thread Kirill A. Shutemov
th the > threading itself, because it works fine on other platforms. On x86_64 mmap() sometimes return address above 4G. It is problem if target system is 32-bit. I use attached patch to solve it. -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys LLC, http://www.velesys.com/ + ALT

[Qemu-devel] [PATCH] syscall getgroups() optimization

2007-06-25 Thread Kirill A. Shutemov
On success, getgroups() returns the number of supplementary group IDs. So, we can swap real number group IDs. Patch in the attachment. -- Regards, Kirill A. Shutemov + Belarus, Minsk + Velesys LLC, http://www.velesys.com/ + ALT Linux Team, http://www.altlinux.com/ --- qemu/linux-user

Re: [Qemu-devel] [PATCH] syscall getgroups() optimization

2007-06-29 Thread Kirill A. Shutemov
On [Tue, 26.06.2007 00:04], Kirill A. Shutemov wrote: > On success, getgroups() returns the number of supplementary group IDs. So, > we can swap real number group IDs. > > Patch in the attachment. It's trivial. Can anybody commit? -- Regards, Kirill A. Shutemov + Belarus,

  1   2   3   >