Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Andrey Shinkevich
On 31/07/2019 15:43, Christian Borntraeger wrote: > > > On 31.07.19 14:28, Christian Borntraeger wrote: >> >> >> On 31.07.19 14:04, Andrey Shinkevich wrote: >>> On 31/07/2019 10:24, Christian Borntraeger wrote: On 30.07.19 21:20, Paolo Bonzini wrote: > On 30/07/19 18:01, Andr

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Andrey Shinkevich
On 31/07/2019 15:32, Paolo Bonzini wrote: > On 31/07/19 11:05, Christophe de Dinechin wrote: >> >> Christian Borntraeger writes: >> >>> On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: On 7/30/19 6:01 PM, Andrey Shinkevich wrote: > Not the whole structure is initialized before passing it

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Paolo Bonzini
On 31/07/19 14:43, Christian Borntraeger wrote: >> if (has_xsave) { >> env->xsave_buf = qemu_memalign(4096, sizeof(struct kvm_xsave)); >> +memset(env->xsave_buf, 0, sizeof(struct kvm_xsave)); > This is memsetting 4k? > Yet another variant would be to use the RUN

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christian Borntraeger
On 31.07.19 14:28, Christian Borntraeger wrote: > > > On 31.07.19 14:04, Andrey Shinkevich wrote: >> On 31/07/2019 10:24, Christian Borntraeger wrote: >>> >>> >>> On 30.07.19 21:20, Paolo Bonzini wrote: On 30/07/19 18:01, Andrey Shinkevich wrote: > Not the whole structure is initializ

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Paolo Bonzini
On 31/07/19 11:05, Christophe de Dinechin wrote: > > Christian Borntraeger writes: > >> On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: >>> On 7/30/19 6:01 PM, Andrey Shinkevich wrote: Not the whole structure is initialized before passing it to the KVM. Reduce the number of Valgrind re

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christian Borntraeger
On 31.07.19 14:04, Andrey Shinkevich wrote: > On 31/07/2019 10:24, Christian Borntraeger wrote: >> >> >> On 30.07.19 21:20, Paolo Bonzini wrote: >>> On 30/07/19 18:01, Andrey Shinkevich wrote: Not the whole structure is initialized before passing it to the KVM. Reduce the number of Val

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Andrey Shinkevich
On 31/07/2019 10:24, Christian Borntraeger wrote: > > > On 30.07.19 21:20, Paolo Bonzini wrote: >> On 30/07/19 18:01, Andrey Shinkevich wrote: >>> Not the whole structure is initialized before passing it to the KVM. >>> Reduce the number of Valgrind reports. >>> >>> Signed-off-by: Andrey Shinkevi

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christophe de Dinechin
Christian Borntraeger writes: > On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: >> On 7/30/19 6:01 PM, Andrey Shinkevich wrote: >>> Not the whole structure is initialized before passing it to the KVM. >>> Reduce the number of Valgrind reports. >>> >>> Signed-off-by: Andrey Shinkevich >>> --- >

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christian Borntraeger
On 30.07.19 21:20, Paolo Bonzini wrote: > On 30/07/19 18:01, Andrey Shinkevich wrote: >> Not the whole structure is initialized before passing it to the KVM. >> Reduce the number of Valgrind reports. >> >> Signed-off-by: Andrey Shinkevich > > Christian, is this the right fix? It's not expensi

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Paolo Bonzini
On 30/07/19 18:44, Philippe Mathieu-Daudé wrote: >> +++ b/target/i386/kvm.c >> @@ -190,6 +190,7 @@ static int kvm_get_tsc(CPUState *cs) >> return 0; >> } >> >> +memset(&msr_data, 0, sizeof(msr_data)); > I wonder the overhead of this one... > There is just one MSR in the struct

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Paolo Bonzini
On 30/07/19 18:01, Andrey Shinkevich wrote: > Not the whole structure is initialized before passing it to the KVM. > Reduce the number of Valgrind reports. > > Signed-off-by: Andrey Shinkevich Christian, is this the right fix? It's not expensive so it wouldn't be an issue, just checking if ther

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Christian Borntraeger
On 30.07.19 19:14, Philippe Mathieu-Daudé wrote: > On 7/30/19 7:05 PM, Christian Borntraeger wrote: >> On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: >>> On 7/30/19 6:01 PM, Andrey Shinkevich wrote: Not the whole structure is initialized before passing it to the KVM. Reduce the numbe

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Philippe Mathieu-Daudé
On 7/30/19 7:05 PM, Christian Borntraeger wrote: > On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: >> On 7/30/19 6:01 PM, Andrey Shinkevich wrote: >>> Not the whole structure is initialized before passing it to the KVM. >>> Reduce the number of Valgrind reports. >>> >>> Signed-off-by: Andrey Shink

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Christian Borntraeger
On 30.07.19 18:46, Peter Maydell wrote: > On Tue, 30 Jul 2019 at 17:05, Andrey Shinkevich > wrote: >> >> Not the whole structure is initialized before passing it to the KVM. >> Reduce the number of Valgrind reports. >> >> Signed-off-by: Andrey Shinkevich > > Does it even make sense to try to

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Christian Borntraeger
On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: > On 7/30/19 6:01 PM, Andrey Shinkevich wrote: >> Not the whole structure is initialized before passing it to the KVM. >> Reduce the number of Valgrind reports. >> >> Signed-off-by: Andrey Shinkevich >> --- >> target/i386/kvm.c | 3 +++ >> 1 fil

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Peter Maydell
On Tue, 30 Jul 2019 at 17:05, Andrey Shinkevich wrote: > > Not the whole structure is initialized before passing it to the KVM. > Reduce the number of Valgrind reports. > > Signed-off-by: Andrey Shinkevich Does it even make sense to try to valgrind a KVM-enabled run of QEMU? As soon as we run th

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Philippe Mathieu-Daudé
On 7/30/19 6:01 PM, Andrey Shinkevich wrote: > Not the whole structure is initialized before passing it to the KVM. > Reduce the number of Valgrind reports. > > Signed-off-by: Andrey Shinkevich > --- > target/i386/kvm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/target/i386/kvm

[Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-30 Thread Andrey Shinkevich
Not the whole structure is initialized before passing it to the KVM. Reduce the number of Valgrind reports. Signed-off-by: Andrey Shinkevich --- target/i386/kvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index dbbb137..ed57e31 100644 --- a/targ