Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp223838rdb; Mon, 22 Jan 2024 18:43:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvObMmxReB3sVlQNgyD7dkco7PW4Qs8JrRvUYTsIRgqNT53DvXCX1BwFmuFCt2sNSJBe4x X-Received: by 2002:a0c:e14a:0:b0:685:20a1:9e25 with SMTP id c10-20020a0ce14a000000b0068520a19e25mr198849qvl.53.1705977803801; Mon, 22 Jan 2024 18:43:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705977803; cv=pass; d=google.com; s=arc-20160816; b=XBrGMeN5ODsSy3JlLaUmfA4hoWwl0lRNEr8XGKncPuDwYJr8SJlE3HQt+BaF75bUC5 qbPiZfkCWck9h2hCqRHu2M+Np3nnzbHV8Y3YsPX/bOYdQ4aPKZ0sWjQU6w4mqBK8rjq9 tSUY0llJQKIYaD3wxdYTEPOQ3OgU3ThU3pdrC5YnEA084p6ocw54lOWVhGZxby57D9HF 8VObRMZeQrLC1P4XTwJHeyDPIM1FVT6sYfC+dR2/jzYXx2u8ZVAQ8+9wWuW6xgsJ3ouR Y5ilSzU3QqH3hXdd+xvPH3vqITlJEGJojwDnH8bWkxj9QoTrsvD1+LLXH5nayEsHxEMl Wjbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ono919sSTcuiadRICThKvzsg+i+paDfgdVAMwyW4l+U=; fh=yMYn5hXX5rf03P9T0ztrpP9dXlJ2aHKtm4twulcMDMw=; b=qKBQB+aFUwHHpVSruPBra79ARBDDGNU08go3dzIKs0KoFPMEDCV5jz6FE2wqznQdsS rpRMjCuc+x4T0emHJbqvFndKje2luurxacFPfTxfMXnzeMeayHvgrlhqg8B7ktqJqlHR YdGZyxiQZztSveLxUQmEkwZRiZFJ4B84eA4mdnztp3i59Rv4nXId9fz1o6twVmzlIqGE zbsTYzvH8dNQY+rIHP8mO9PxYEYEC8GgkWSkLWFZol9ed0fGzo7+hpKKn81QsQ8Z0lxS +OZQBXH1MSiTscu5l70oJaBsqOCKaQB7ATz+rB1a6lUo3aB7YdWeCiQPrFUqMBVvCQZe wpQg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=zhaoxin.com); spf=pass (google.com: domain of linux-kernel+bounces-34639-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34639-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a20-20020a0ce394000000b0068178e865a6si6805577qvl.218.2024.01.22.18.43.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 18:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34639-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=zhaoxin.com); spf=pass (google.com: domain of linux-kernel+bounces-34639-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34639-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 910A51C2A7C5 for ; Tue, 23 Jan 2024 02:43:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BCEA4F218; Tue, 23 Jan 2024 02:29:11 +0000 (UTC) Received: from mx1.zhaoxin.com (MX1.ZHAOXIN.COM [210.0.225.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A376B4EB21 for ; Tue, 23 Jan 2024 02:29:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.0.225.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705976951; cv=none; b=YBe53Yp3C27bO3KaN3wCShVVf8ugITAW+fRhML2MhGMnjm9BNaVuJ2A5T8DC6T4maNoHQMrVRFR+MUuBMQDJCEd0ndjfyrlRQY09nQSr4B+AR3o3GBgESTA2H/d/nCcg4JnwbKxLfrvtapsMdhtF81SVwDRZyjd0KPOGzNP8HAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705976951; c=relaxed/simple; bh=BNwz8nogyl4n1yMnhodPp9Q+F0gYYUhsajY5U+RhqWE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SQRyAHpCpDcm3TZGwiU18bK4m3VxTBu6NdbPVrjNZ9sxPLUyssXUQv+AfQcDDURJnI15mAZQG9loMy2wyqLz5HYuG/Ljmqq6fVFjAweqkgcrgk6OQc4lJFqp0e6AU+aq+N2sh0H9wqvLKtxjIIbpYfYQFcny945/KS5Baf0PxKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zhaoxin.com; spf=pass smtp.mailfrom=zhaoxin.com; arc=none smtp.client-ip=210.0.225.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zhaoxin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zhaoxin.com X-ASG-Debug-ID: 1705976939-086e230f26288d0001-xx1T2L Received: from ZXSHMBX2.zhaoxin.com (ZXSHMBX2.zhaoxin.com [10.28.252.164]) by mx1.zhaoxin.com with ESMTP id cdEzdbBKdWckdm3l (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 23 Jan 2024 10:28:59 +0800 (CST) X-Barracuda-Envelope-From: TonyWWang-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHMBX2.zhaoxin.com (10.28.252.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 23 Jan 2024 10:28:58 +0800 Received: from localhost.localdomain (10.32.65.162) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 23 Jan 2024 10:28:56 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 From: Tony W Wang-oc X-Barracuda-RBL-Trusted-Forwarder: 10.29.252.163 To: , , , , , , , , , , , , , , , , , , , CC: , , , Subject: [PATCH v2 2/3] x86/cpufeatures: Add CPU feature flags for Zhaoxin Hash Engine Date: Tue, 23 Jan 2024 10:28:51 +0800 X-ASG-Orig-Subj: [PATCH v2 2/3] x86/cpufeatures: Add CPU feature flags for Zhaoxin Hash Engine Message-ID: <20240123022852.2475-3-TonyWWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240123022852.2475-1-TonyWWang-oc@zhaoxin.com> References: <20240123022852.2475-1-TonyWWang-oc@zhaoxin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Barracuda-Connect: ZXSHMBX2.zhaoxin.com[10.28.252.164] X-Barracuda-Start-Time: 1705976939 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.28.252.35:4443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at zhaoxin.com X-Barracuda-Scan-Msg-Size: 2994 X-Barracuda-BRTS-Status: 0 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.119808 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Zhaoxin CPUs have implemented the SHA(Secure Hash Algorithm) as its instrucions. Add two CPU feature flags indicated by CPUID.(EAX=C0000001,ECX=0):EDX bit 25/26 which will be used by Zhaoxin SHA driver. Signed-off-by: Tony W Wang-oc --- arch/x86/include/asm/cpufeatures.h | 4 +++- tools/arch/x86/include/asm/cpufeatures.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 29cb275a219d..28b0e62dbdf5 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -145,7 +145,7 @@ #define X86_FEATURE_RDRAND ( 4*32+30) /* RDRAND instruction */ #define X86_FEATURE_HYPERVISOR ( 4*32+31) /* Running on a hypervisor */ -/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ +/* VIA/Cyrix/Centaur/Zhaoxin-defined CPU features, CPUID level 0xC0000001, word 5 */ #define X86_FEATURE_XSTORE ( 5*32+ 2) /* "rng" RNG present (xstore) */ #define X86_FEATURE_XSTORE_EN ( 5*32+ 3) /* "rng_en" RNG enabled */ #define X86_FEATURE_XCRYPT ( 5*32+ 6) /* "ace" on-CPU crypto (xcrypt) */ @@ -156,6 +156,8 @@ #define X86_FEATURE_PHE_EN ( 5*32+11) /* PHE enabled */ #define X86_FEATURE_PMM ( 5*32+12) /* PadLock Montgomery Multiplier */ #define X86_FEATURE_PMM_EN ( 5*32+13) /* PMM enabled */ +#define X86_FEATURE_PHE2 ( 5*32+25) /* "phe2" Zhaoxin Hash Engine */ +#define X86_FEATURE_PHE2_EN ( 5*32+26) /* "phe2_en" PHE2 enabled */ /* More extended AMD flags: CPUID level 0x80000001, ECX, word 6 */ #define X86_FEATURE_LAHF_LM ( 6*32+ 0) /* LAHF/SAHF in long mode */ diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h index f4542d2718f4..21caba9d070b 100644 --- a/tools/arch/x86/include/asm/cpufeatures.h +++ b/tools/arch/x86/include/asm/cpufeatures.h @@ -145,7 +145,7 @@ #define X86_FEATURE_RDRAND ( 4*32+30) /* RDRAND instruction */ #define X86_FEATURE_HYPERVISOR ( 4*32+31) /* Running on a hypervisor */ -/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ +/* VIA/Cyrix/Centaur/Zhaoxin-defined CPU features, CPUID level 0xC0000001, word 5 */ #define X86_FEATURE_XSTORE ( 5*32+ 2) /* "rng" RNG present (xstore) */ #define X86_FEATURE_XSTORE_EN ( 5*32+ 3) /* "rng_en" RNG enabled */ #define X86_FEATURE_XCRYPT ( 5*32+ 6) /* "ace" on-CPU crypto (xcrypt) */ @@ -156,6 +156,8 @@ #define X86_FEATURE_PHE_EN ( 5*32+11) /* PHE enabled */ #define X86_FEATURE_PMM ( 5*32+12) /* PadLock Montgomery Multiplier */ #define X86_FEATURE_PMM_EN ( 5*32+13) /* PMM enabled */ +#define X86_FEATURE_PHE2 ( 5*32+25) /* "phe2" Zhaoxin Hash Engine */ +#define X86_FEATURE_PHE2_EN ( 5*32+26) /* "phe2_en" PHE2 enabled */ /* More extended AMD flags: CPUID level 0x80000001, ECX, word 6 */ #define X86_FEATURE_LAHF_LM ( 6*32+ 0) /* LAHF/SAHF in long mode */ -- 2.25.1