From patchwork Fri Feb 4 19:17:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinette Chatre X-Patchwork-Id: 12735479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E512C43217 for ; Fri, 4 Feb 2022 19:18:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B741A6B0072; Fri, 4 Feb 2022 14:18:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B233C6B0073; Fri, 4 Feb 2022 14:18:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C37A6B0074; Fri, 4 Feb 2022 14:18:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id 8A62B6B0072 for ; Fri, 4 Feb 2022 14:18:02 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2C5DA182888A6 for ; Fri, 4 Feb 2022 19:18:02 +0000 (UTC) X-FDA: 79106057604.30.56D7B74 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf27.hostedemail.com (Postfix) with ESMTP id 3654540012 for ; Fri, 4 Feb 2022 19:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644002281; x=1675538281; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=n8C5babs3ZkUMBv/nFFD9Th7rXCW1erD1QQPKYBJ0M4=; b=VTjcnDPea3TAeyRU9YwZ2vC6LdH3DgT4eTBhrHpljXtRwb/e9hLGUnqG jhCeqoveGTx54CogjTQjPqUsXYEXZfDa9p8qFBhByvnq89gme7b7eZO1L Z1xJfVj3KSxBnmB5GBKybPEZMGT919jGD7vEfyDwMneotymCYLIkwZ0Q2 VTuHS4D/8KrLy3tEvMZ5pkTxoLtuwiXLRAMydHTSTomiFCGtWJ0JFyDKd rSxsFcow0kmv7gReOuwxESSLr4+TswFK2t8zg1Wto4H/W3piw5/EDrH1G +aqN3L8g2FIM/vFjMwOXDhAyTJ85NyO6tHLZoam3WiVL3Y28IjkVivhaE w==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="311729088" X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="311729088" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 11:17:59 -0800 X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="524412811" Received: from rchatre-ws.ostc.intel.com ([10.54.69.144]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 11:17:59 -0800 From: Reinette Chatre To: shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Reinette Chatre , Dave Hansen , Ram Pai , Sandipan Das , Florian Weimer , "Desnes A. Nunes do Rosario" , Ingo Molnar , Thiago Jung Bauermann , Michael Ellerman , Michal Suchanek , linux-mm@kvack.org, "Chang S . Bae" , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Andy Lutomirski Subject: [PATCH 0/3] selftests: Remove duplicate CPUID wrappers Date: Fri, 4 Feb 2022 11:17:08 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3654540012 X-Rspam-User: nil Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=VTjcnDPe; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf27.hostedemail.com: domain of reinette.chatre@intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=reinette.chatre@intel.com X-Stat-Signature: nc5dhwzoxoacsnn1q8sb5uch65dkrb7a X-HE-Tag: 1644002280-118439 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: A few tests that require running CPUID do so with a private implementation of a wrapper for CPUID. This duplication of the CPUID wrapper should be avoided but having one is also unnecessary because of the existence of a macro that can be used instead. This series replaces private CPUID wrappers with calls to the __cpuid_count() macro from cpuid.h as made available by gcc and clang/llvm. Cc: Dave Hansen Cc: Ram Pai Cc: Sandipan Das Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: Michael Ellerman Cc: Michal Suchanek Cc: linux-mm@kvack.org Cc: Chang S. Bae Cc: Borislav Petkov Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Andy Lutomirski Reinette Chatre (3): selftests/vm/pkeys: Use existing __cpuid_count() macro selftests/x86/amx: Use existing __cpuid_count() macro selftests/x86/corrupt_xstate_header: Use existing __cpuid_count() macro tools/testing/selftests/vm/pkey-x86.h | 22 +++--------------- tools/testing/selftests/x86/amx.c | 23 +++++-------------- .../selftests/x86/corrupt_xstate_header.c | 17 ++------------ 3 files changed, 11 insertions(+), 51 deletions(-)