Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp346595rwe; Fri, 14 Apr 2023 03:56:28 -0700 (PDT) X-Google-Smtp-Source: AKy350a2KanQy6HpGFZ0afV7GyGD97TH94SNzgTVZiuKMOG+g5TOgfWzLlxL3dYARR3jr06kTK0U X-Received: by 2002:aa7:88ca:0:b0:63b:6727:eda0 with SMTP id k10-20020aa788ca000000b0063b6727eda0mr2383161pff.26.1681469788204; Fri, 14 Apr 2023 03:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681469788; cv=none; d=google.com; s=arc-20160816; b=h6rZx4hhCNDQ0HIUEH0eQErdK4y2lbwGhcNjstfSflpYcNbA4CyZ7Yn6pcgr2vHhk4 Gjsiw4R3y6T9NzHTHxMnrmEOsJRcI0Zi+vk94rB6eDaPDp2fn/eI2b5OhQmpcDRwd/x7 ibDhbZknq4X5k9dNsR5NnaAw3Dhz+w2XepvgKW3vONwylkjxl+MWCKVtQvTrAi1/yQfk eS0uaETo+WEpD9JNqy4TQ2TVO0jFZXy8Wp1RcbyNOV6faWG+VSSyv64osXrcdxbzVKhu PRnPWuinIe76n0hdrKIz491bIsli0O6A4Sv/5fjCng9hxInvnph+WH+Cv6DAstfQnHcA ND4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3TWGLxyxOgYeVK6FexCzZr9UcM0G4Qqyy7muYzctMI4=; b=JoZtXOAmem+WuYzwsXmguT0fVqzEu9AiafBjBGwdFQAIBV+KycpoYeR7NKnL9C3qkb ibIrCU0GNncOO2FcctR3TpwKkLYy+/2JTJtbl/bcUTlG6rUJkQg9xgCf65O5x53bYlyR 8O3swxvzaEY3LpS9QjJvC8l8gUuTSo/cdaxyKl+8hTpQmzGKi0GQKmfmROXSaKGUOv+j IuHKO3Qf2V3fZpds3h4CUP9tPhpu3Kvehh5Wnst2Tth8sGvfdCuBtP53oD5ks1ohzKMP OcJOFBrmpfxTHVyealcrgzIpfYOUUtfEiXBdQR5YkpUsGyRNHQfl9Z9qgdizgkGfL1Dl QoOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=izVvOO9K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a621a15000000b0063aea82b7b9si3723530pfa.405.2023.04.14.03.56.13; Fri, 14 Apr 2023 03:56:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=izVvOO9K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230305AbjDNKsh (ORCPT + 99 others); Fri, 14 Apr 2023 06:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbjDNKse (ORCPT ); Fri, 14 Apr 2023 06:48:34 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8145359EA for ; Fri, 14 Apr 2023 03:48:33 -0700 (PDT) Received: from zn.tnic (p5de8e687.dip0.t-ipconnect.de [93.232.230.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id ED0691EC0691; Fri, 14 Apr 2023 12:48:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1681469293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=3TWGLxyxOgYeVK6FexCzZr9UcM0G4Qqyy7muYzctMI4=; b=izVvOO9KW1Sq3Fupbi7J9BC4amlGE3IkcVZ/oWDx/YQqyIa3IkX6ttctXqsh+vRAFIQWcD lXDPoXdHoC2L0ru9GKSOrxlPTzCYIREzqAaDmEiPBtJ3c0GRQMFIN358G3Bfe9lpjLAM5d 2bGtFrPON/pf5DSIdr0m+uDaD7TnPUo= Date: Fri, 14 Apr 2023 12:48:08 +0200 From: Borislav Petkov To: Tony W Wang-oc Cc: tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, seanjc@google.com, pbonzini@redhat.com, kim.phillips@amd.com, babu.moger@amd.com, pawan.kumar.gupta@linux.intel.com, sandipan.das@amd.com, CobeChen@zhaoxin.com, TimGuo@zhaoxin.com, LeoLiu-oc@zhaoxin.com Subject: Re: [PATCH] x86/cpufeatures: extend CPUID leaf 0xc0000001 support for Zhaoxin Message-ID: <20230414104808.GBZDkvaJechZSM+SI9@fat_crate.local> References: <20230414095334.8743-1-TonyWWang-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230414095334.8743-1-TonyWWang-oc@zhaoxin.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 14, 2023 at 05:53:34PM +0800, Tony W Wang-oc wrote: > Extend CPUID leaf 0xc0000001 to support SM2, SM3, SM4, PARALLAX, TM3, > RNG2, PHE2, RSA. > > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 0] SM2 > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 1] SM2_EN > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 4] SM3 SM4 > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 5] SM3_EN SM4_EN > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 16] PARALLAX > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 17] PARALLAX_EN > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 20] TM3 > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 21] TM3_EN > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 22] RNG2 > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 23] RNG2_EN > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 25] PHE2 > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 26] PHE2_EN > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 27] RSA > CPUID.(EAX=0xc0000001,ECX=0):EDX[bit 28] RSA_EN None of those flags are used in code, why do we need this patch? If you want to dump them on the hardware to know what's set or not, there's tools/arch/x86/kcpuid/ for that. > SM2/SM3/SM4 imply the instructions support for Chinese cipher security > algorithm generations 2/3/4. > PARALLAX is the feature of Zhaoxin CPU that automatically adjusts > processors's voltage as a function of temperature. > TM3 is the abbreviation of Thermal Monitor version 3. > RNG2 is the abbreviation of Random Number Generation version 2. > PHE2 is the abbreviation of Padlock Hash Engine version 2. > RSA implies Zhaoxin hardware support for RSA algorithm. > > All these features have two relative CPUID bits, one bit implies the > existence of the feature and the other bit with postfix "EN" implies > the availability of this feature. That's a lot of waste of CPUID bits but that's your decision. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette