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: 540224 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6DECC433F5 for ; Fri, 4 Feb 2022 19:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232185AbiBDTSB (ORCPT ); Fri, 4 Feb 2022 14:18:01 -0500 Received: from mga11.intel.com ([192.55.52.93]:61194 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231728AbiBDTSA (ORCPT ); Fri, 4 Feb 2022 14:18:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644002280; x=1675538280; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=n8C5babs3ZkUMBv/nFFD9Th7rXCW1erD1QQPKYBJ0M4=; b=ZhvrEyrdhxUzGgdKhWpdRWKC9Zak42FFay9JzQQ7VYhxjxLQOf+1bXRt 71qO7Us2A2SWCetd97zw/V39SrVwd3tZgIeGbnb4KvZvUuYZc3M1lkjlx qC1uiQWYiDQIjOvL9HPqwmXrGBTabUG+H4zGNaQ7ktBWs1xtqfgzS3QMQ 6mychpwHabOv92UKYCtqQ3ZbvPSn+R1kEOFwJ3flu9BzPRysK3rVeaj5w ndRXekg9RnqmhZejeU1xmdKSzB5s/kiq/B3n+6TIaRZ4rRAWgFk7uOwo6 rcItNkSKi0I9z5VjnM2029m9aYD6v1H96svHDsUjIQrKxQ1CDpVR3dylW g==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="246017063" X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="246017063" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 11:18:00 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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(-)