From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622AbdJHIfs (ORCPT ); Sun, 8 Oct 2017 04:35:48 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43147 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751549AbdJHIfr (ORCPT ); Sun, 8 Oct 2017 04:35:47 -0400 Date: Sun, 8 Oct 2017 10:35:35 +0200 (CEST) From: Thomas Gleixner To: Andi Kleen cc: x86@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen , Jonathan McDowell Subject: Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies In-Reply-To: <20171007000328.12843-3-andi@firstfloor.org> Message-ID: References: <20171007000328.12843-1-andi@firstfloor.org> <20171007000328.12843-3-andi@firstfloor.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 6 Oct 2017, Andi Kleen wrote: > From: Andi Kleen > > Some CPUID features depend on other features. Currently it's > possible to to clear dependent features, but not clear the base features, > which can cause various interesting problems. > > This patch implements a generic table to describe dependencies > between CPUID features, to be used by all code that clears > CPUID. > > Some subsystems (like XSAVE) had an own implementation of this, > but it's better to do it all in a single place for everyone. > > Then clear_cpu_cap and setup_clear_cpu_cap always look up > this table and clear all dependencies too. > > This is intended to be a practical table: only for features > that make sense to clear. If someone for example clears FPU, > or other features that are essentially part of the required > base feature set, not much is going to work. Handling > that is right now out of scope. We're only handling > features which can be usefully cleared. > > v2: Add EXPORT_SYMBOL for clear_cpu_cap for lguest > v3: > Fix handling of depending issues > Fix dups in the table (Jonathan McDowell) > v4: > Remove EXPORT_SYMBOL again as lguest is gone > Restructure dependencies as feature, dependency (Thomas Gleixner) > Move some code from header file to C file and turn macros into inlines (dito) > Simplify if conditions (dito) > Add missing dependency for AVX512F->AVX > v5: > Remove redundant dependency for AVX512F->XSAVE (Thomas Gleixner) > Add missing dependency for XMM->FXSR (Thomas Gleixner) > v6: > Add SHA_NI->XMM and FXSR_OPT->FXSAVE dependencies > Cc: Jonathan McDowell > Signed-off-by: Andi Kleen Reviewed-by: Thomas Gleixner