kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Xu <jacobhxu@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jim Mattson <jmattson@google.com>,
	Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, Jacob Xu <jacobhxu@google.com>
Subject: [kvm-unit-tests PATCH 2/2] x86: remove use of compiler's memset from emulator.c
Date: Mon, 10 May 2021 18:50:16 -0700	[thread overview]
Message-ID: <20210511015016.815461-2-jacobhxu@google.com> (raw)
In-Reply-To: <20210511015016.815461-1-jacobhxu@google.com>

Per Sean in discussion of the previous patch, "using the compiler's
memset() in kvm-unit-tests seems inherently dangerous since the tests
are often doing intentionally stupid things."

The string.h memset is already imported through libcflat.h, so let's use
that instead.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Jacob Xu <jacobhxu@google.com>
---
 x86/emulator.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/x86/emulator.c b/x86/emulator.c
index 1d5c172..d6e31bf 100644
--- a/x86/emulator.c
+++ b/x86/emulator.c
@@ -8,7 +8,6 @@
 #include "alloc_page.h"
 #include "usermode.h"
 
-#define memset __builtin_memset
 #define TESTDEV_IO_PORT 0xe0
 
 #define MAGIC_NUM 0xdeadbeefdeadbeefUL
-- 
2.31.1.607.g51e8a6a459-goog


  reply	other threads:[~2021-05-11  1:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11  1:50 [kvm-unit-tests PATCH 1/2] x86: Do not assign values to unaligned pointer to 128 bits Jacob Xu
2021-05-11  1:50 ` Jacob Xu [this message]
2021-05-11 21:13   ` [kvm-unit-tests PATCH 2/2] x86: remove use of compiler's memset from emulator.c Sean Christopherson
2021-06-10 16:14 ` [kvm-unit-tests PATCH 1/2] x86: Do not assign values to unaligned pointer to 128 bits Jacob Xu
2021-06-10 16:55   ` Paolo Bonzini

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=20210511015016.815461-2-jacobhxu@google.com \
    --to=jacobhxu@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --subject='Re: [kvm-unit-tests PATCH 2/2] x86: remove use of compiler'\''s memset from emulator.c' \
    /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

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).