From patchwork Tue May 11 01:50:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Xu X-Patchwork-Id: 12249469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 213D1C43460 for ; Tue, 11 May 2021 01:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01B51616E9 for ; Tue, 11 May 2021 01:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbhEKBv3 (ORCPT ); Mon, 10 May 2021 21:51:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbhEKBv3 (ORCPT ); Mon, 10 May 2021 21:51:29 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C551C061574 for ; Mon, 10 May 2021 18:50:24 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id z12-20020a05620a08ccb02902ea1e4a963dso13070046qkz.13 for ; Mon, 10 May 2021 18:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=+e3DQI5+4u8ZvT6ywl9deoyFR4AY5xstyyS/fx3b8IM=; b=RczG1P/vIpzmrCj3j0YYvtcu9W6kjsEkKTq8Pb4I31wjSQ1v4Pz67dRx3iFaFhvakp EHay4Go4+2i3apauSnSjnPuFa/aWas9DDw1b9+6PbeWWEEN9Ak5QP06aZvZb07E4O6xF H6msZm8ox98mqrOOpWBe22pZWuiO8tfVA7kyiCuS5wQQw8N/dq+LzZt9Hu+eWH9yzkqt OEpoijMDZ/3vgw568OSNz9Gx3FrQ9/GK0IAjILSP0SEg4zzvFuAljnD2iTQoAOnsvvvl z4K2O8hJJuhSjxBzbFT+Yvt9DgZurNIxXes3WFplXLWQnETQf64TjA2VTAEecOgRU/qu XDVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=+e3DQI5+4u8ZvT6ywl9deoyFR4AY5xstyyS/fx3b8IM=; b=Ael/adAYiBoQb7NbxmduS4lQGvKrmuUuPt8vfTqIeEHROg9VUhuqJopZ+iCrCzrQc0 sqv/YbifPKyuc3Y2NKJObYSMlZbXpyUnZJnzFwLqFu02/P63RafqvE+olvLBUQohyvMI CsqUqeFiEqJSZJVQNaBKD3FLZBiLz/2F/hDZt1uoNov3WYHqtKJXU23rLfVZplXAkeFO CTvlykemOIqTmdPeRl0+/QsUJEHXbrilRH6QJUfb6xYZ35Wbcro+xzH/8uZtsPS5S+WJ CfDrzxTxBT+bTY+xmQIyakmtaMkdt4bQi9FufBqaSrCtgvi+LSbWRnb4okBAQNAFBEjO 5qjQ== X-Gm-Message-State: AOAM5306dy3USLD/LJnqGr3wr1TbF2UdnllshQETnNOAVsxRe2DDeXvv 2febCNNa/CDuQZCTCB0+UH/Sjz8OA7eS/Q== X-Google-Smtp-Source: ABdhPJwwej8xDubz04rqIuVYEiRjngACgxZhTfMucZvWvP7DaFlGw7voRWy6jiJuz9NfKRq0pwChpF5m33ZY3A== X-Received: from mhmmm.sea.corp.google.com ([2620:15c:100:202:da9d:6257:8f5f:1bcc]) (user=jacobhxu job=sendgmr) by 2002:a0c:ed47:: with SMTP id v7mr26617572qvq.17.1620697823171; Mon, 10 May 2021 18:50:23 -0700 (PDT) Date: Mon, 10 May 2021 18:50:16 -0700 In-Reply-To: <20210511015016.815461-1-jacobhxu@google.com> Message-Id: <20210511015016.815461-2-jacobhxu@google.com> Mime-Version: 1.0 References: <20210511015016.815461-1-jacobhxu@google.com> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog Subject: [kvm-unit-tests PATCH 2/2] x86: remove use of compiler's memset from emulator.c From: Jacob Xu To: Paolo Bonzini , Jim Mattson , Sean Christopherson Cc: kvm@vger.kernel.org, Jacob Xu Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 Signed-off-by: Jacob Xu Reviewed-by: Sean Christopherson --- 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