kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"berto@igalia.com" <berto@igalia.com>,
	"mdroth@linux.vnet.ibm.com" <mdroth@linux.vnet.ibm.com>,
	"armbru@redhat.com" <armbru@redhat.com>,
	"ehabkost@redhat.com" <ehabkost@redhat.com>,
	"rth@twiddle.net" <rth@twiddle.net>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	Denis Lunev <den@virtuozzo.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Subject: Re: [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call
Date: Wed, 31 Jul 2019 15:03:01 +0200	[thread overview]
Message-ID: <72f0fe91-3ced-ea7c-b675-1f219586213c@redhat.com> (raw)
In-Reply-To: <f9346216-a4e9-4882-4a36-33580529b75e@de.ibm.com>

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 RUNNING_ON_VALGRIND macro from
> valgrind/valgrind.h to only memset for valgrind. But just using MAKE_MEM_DEFINED
> from memcheck.h is simpler. 
> 

Yes, it's 4k but only at initialization time and I actually prefer not
to have potentially uninitialized host data in there.

Paolo

  reply	other threads:[~2019-07-31 13:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 16:01 [PATCH 0/3] Reduce the number of Valgrind reports in unit tests Andrey Shinkevich
2019-07-30 16:01 ` [PATCH 1/3] test-throttle: Fix uninitialized use of burst_length Andrey Shinkevich
2019-08-13 12:19   ` Alberto Garcia
2019-07-30 16:01 ` [PATCH 2/3] tests: Fix uninitialized byte in test_visitor_in_fuzz Andrey Shinkevich
2019-07-30 16:01 ` [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call Andrey Shinkevich
2019-07-30 16:44   ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-30 17:05     ` Christian Borntraeger
2019-07-30 17:14       ` Philippe Mathieu-Daudé
2019-07-30 17:47         ` Christian Borntraeger
2019-07-31  9:05       ` Christophe de Dinechin
2019-07-31 12:32         ` Paolo Bonzini
2019-07-31 14:10           ` Andrey Shinkevich
2019-07-30 19:22     ` Paolo Bonzini
2019-07-30 16:46   ` Peter Maydell
2019-07-30 17:09     ` Christian Borntraeger
2019-07-30 19:20   ` Paolo Bonzini
2019-07-31  7:24     ` Christian Borntraeger
2019-07-31 12:04       ` Andrey Shinkevich
2019-07-31 12:28         ` Christian Borntraeger
2019-07-31 12:43           ` Christian Borntraeger
2019-07-31 13:03             ` Paolo Bonzini [this message]
2019-07-31 14:11             ` Andrey Shinkevich
2019-08-13 12:02 ` [PATCH 0/3] Reduce the number of Valgrind reports in unit tests Andrey Shinkevich
2019-08-13 12:05   ` Paolo Bonzini
2019-08-13 12:08     ` Andrey Shinkevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72f0fe91-3ced-ea7c-b675-1f219586213c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=borntraeger@de.ibm.com \
    --cc=den@virtuozzo.com \
    --cc=ehabkost@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).