From patchwork Mon Jan 25 09:06:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 12045179 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 700BFC433DB for ; Tue, 26 Jan 2021 03:16:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3973622583 for ; Tue, 26 Jan 2021 03:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbhAYJ0g (ORCPT ); Mon, 25 Jan 2021 04:26:36 -0500 Received: from mga14.intel.com ([192.55.52.115]:22894 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726498AbhAYJYu (ORCPT ); Mon, 25 Jan 2021 04:24:50 -0500 IronPort-SDR: DFIi6KXTtVCca3G9b3CbSjhbZmPOiRGrI7YMGo9Y8MAhiQg0YAoMEXd8XEYi50AEKO+Hwrpx/0 U/eOfGg3vFGw== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="178915773" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="178915773" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 01:07:02 -0800 IronPort-SDR: tIJOBhYPaik+XgVUZGNBW0F+itKgGuPAGyUFDby4gueIDHXxaZcmLvdbQ28i0SUvGx7p4dDaP/ O/HvOMTaZezg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="402223803" Received: from sqa-gate.sh.intel.com (HELO robert-ivt.tsp.org) ([10.239.48.212]) by fmsmga004.fm.intel.com with ESMTP; 25 Jan 2021 01:07:00 -0800 From: Robert Hoo To: pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org Cc: chang.seok.bae@intel.com, kvm@vger.kernel.org, robert.hu@intel.com, Robert Hoo Subject: [RFC PATCH 01/12] x86/keylocker: Move LOADIWKEY opcode definition from keylocker.c to keylocker.h Date: Mon, 25 Jan 2021 17:06:09 +0800 Message-Id: <1611565580-47718-2-git-send-email-robert.hu@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1611565580-47718-1-git-send-email-robert.hu@linux.intel.com> References: <1611565580-47718-1-git-send-email-robert.hu@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org For later kvm part code easy referrence. Signed-off-by: Robert Hoo --- arch/x86/include/asm/keylocker.h | 2 ++ arch/x86/kernel/keylocker.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/keylocker.h b/arch/x86/include/asm/keylocker.h index a6774ce..8c0792f 100644 --- a/arch/x86/include/asm/keylocker.h +++ b/arch/x86/include/asm/keylocker.h @@ -8,6 +8,8 @@ #include #include +#define LOADIWKEY ".byte 0xf3,0x0f,0x38,0xdc,0xd1" + #define KEYLOCKER_CPUID 0x019 #define KEYLOCKER_CPUID_EAX_SUPERVISOR BIT(0) #define KEYLOCKER_CPUID_EBX_AESKLE BIT(0) diff --git a/arch/x86/kernel/keylocker.c b/arch/x86/kernel/keylocker.c index e77e4c3..06a30f0 100644 --- a/arch/x86/kernel/keylocker.c +++ b/arch/x86/kernel/keylocker.c @@ -40,7 +40,6 @@ bool check_keylocker_readiness(void) } /* Load Internal (Wrapping) Key */ -#define LOADIWKEY ".byte 0xf3,0x0f,0x38,0xdc,0xd1" #define LOADIWKEY_NUM_OPERANDS 3 #define LOADIWKEY_HWRAND_RETRY 10