Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2556362rwb; Mon, 19 Sep 2022 06:51:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5I4eWnvSDIRO5wmqNKZkd80fMsl7iGokgBqreVioxX3ZPM9+rC3JlSO3Fg9hwVtojPXvdu X-Received: by 2002:a05:6402:350b:b0:452:2b68:90db with SMTP id b11-20020a056402350b00b004522b6890dbmr15569202edd.255.1663595478500; Mon, 19 Sep 2022 06:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663595478; cv=none; d=google.com; s=arc-20160816; b=gL9TRPZbNblS9OgVwHSb2eWeF8UwrrHS5IbgSlx9ekKxDwoAatIfKTbuYks7Q5WtqA 0nZGrqSC9FeL6QMrrFPSyI/dS/fmLl7Nf9cUMXJMaNvdANirDfiB9GVjzlWE+EuCfaqR ItODYjIuF3sYiFvDW5dMLWC61AHPHHHVzF0At/hQnWyb5E+p9AxxRlhJlTZvmQ5XfhAw NOYrmfDbSw3Jrht96cVjQowQKcpzBzOpRwyTwemkX5r7BsZQjYT1c5Q53djIoaZjfraC 6JDep8O+9RgSLY6gPZFs8UuxVnjt/90aiC6AK1iQgvfp8JzMXwhDlKR6C+THQXdf88XU VPBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=XAQ4C8p526IwfywWHvDt2bP3t+cfJKiAuugWFxjBeBk=; b=m9vWqBl9qtvXBVgvCKINDAJpwhLw2qarhFrjCQfTrmeKdDmQdAd5Bgi6JvrfKEiV+5 UC4Fue0F71hAv0hpj++DVOdUS0h3u0nd13zu2tguc5stX1RklJIscdO4mGQi2yLY8SmZ Di8/XKd43YOtYo/nL7iO44kKBMOk3XCQ6YubLbr4HN/c8Tty0VbdDwjMoq2gJSxmNhk0 k5brQX0bG1UfikyixIylFb6zRu6qvd/bcPlpb/wOvko7aFCsWvZakdAJwD5kR5FQzvO6 kGK+P1qXeP8RzeA/o9qKUWYkiCZ/WHzksIEizXBs2Z/16PCrY9GsbglgK0+U6CRjx93M pjGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gLWz5xnj; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a170906311500b00730ac298aa9si21532561ejx.783.2022.09.19.06.50.35; Mon, 19 Sep 2022 06:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@redhat.com header.s=mimecast20190719 header.b=gLWz5xnj; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbiISNnU (ORCPT + 99 others); Mon, 19 Sep 2022 09:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230482AbiISNnS (ORCPT ); Mon, 19 Sep 2022 09:43:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C5262229E for ; Mon, 19 Sep 2022 06:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663594995; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XAQ4C8p526IwfywWHvDt2bP3t+cfJKiAuugWFxjBeBk=; b=gLWz5xnjmG3/gwDiTNyn0M2ngQWlwMIkqiti22GwmL0S0qDl9gxLZzUJVUI7jKIBNMiTcq hGnOzkVgWkN2wtpzAOPvLbw5opTJItw5hntTggBzZhGjfE1zSSX+UrKglISia0RFqvwO2D Kl231P5j4kSPLfSyN4wnLLdiVftWtQQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-m7uMEVL3PEO3rwyjHKygLg-1; Mon, 19 Sep 2022 09:43:10 -0400 X-MC-Unique: m7uMEVL3PEO3rwyjHKygLg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DB7301C0BC6D; Mon, 19 Sep 2022 13:43:08 +0000 (UTC) Received: from starship (unknown [10.40.192.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 681AD1121314; Mon, 19 Sep 2022 13:43:02 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 0/5] x86: cpuid: improve support for broken CPUID configurations From: Maxim Levitsky To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Pawan Gupta , Ingo Molnar , Josh Poimboeuf , Namhyung Kim , Tony Luck , Paolo Bonzini , "H. Peter Anvin" , Arnaldo Carvalho de Melo , Thomas Gleixner , Alexander Shishkin , Tim Chen , Borislav Petkov , "David S. Miller" , Dave Hansen , "Chang S. Bae" , Jane Malalane , Kees Cook , Kan Liang , Peter Zijlstra , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Herbert Xu , Jiri Olsa , Mark Rutland , linux-perf-users@vger.kernel.org, "open list:CRYPTO API" Date: Mon, 19 Sep 2022 16:43:00 +0300 In-Reply-To: <4a327f06f6e5da6f3badb5ccf80d22a5c9e18b97.camel@redhat.com> References: <20220718141123.136106-1-mlevitsk@redhat.com> <4a327f06f6e5da6f3badb5ccf80d22a5c9e18b97.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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-crypto@vger.kernel.org On Mon, 2022-08-01 at 19:05 +0300, Maxim Levitsky wrote: > On Thu, 2022-07-28 at 10:30 +0300, Maxim Levitsky wrote: > > On Mon, 2022-07-18 at 17:11 +0300, Maxim Levitsky wrote: > > > This patch series aims to harden the cpuid code against the case when > > > the hypervisor exposes a broken CPUID configuration to the guest, > > > in the form of having a feature disabled but not features that depend on it. > > > > > > This is the more generic way to fix kernel panic in aes-ni kernel driver, > > > which was triggered by CPUID configuration in which AVX is disabled but > > > not AVX2. > > > > > > https://lore.kernel.org/all/20211103145231.GA4485@gondor.apana.org.au/T/ > > > > > > This was tested by booting a guest with AVX disabled and not AVX2, > > > and observing that both a warning is now printed in dmesg, and > > > that avx2 is gone from /proc/cpuinfo. > > > > > > V2: > > > > > > I hopefully addressed all the (very good) review feedback. > > > > > > Best regards, > > > Maxim Levitsky > > > > > > Maxim Levitsky (5): > > > perf/x86/intel/lbr: use setup_clear_cpu_cap instead of clear_cpu_cap > > > x86/cpuid: refactor setup_clear_cpu_cap()/clear_cpu_cap() > > > x86/cpuid: move filter_cpuid_features to cpuid-deps.c > > > x86/cpuid: remove 'warn' parameter from filter_cpuid_features > > > x86/cpuid: check for dependencies violations in CPUID and attempt to > > > fix them > > > > > > arch/x86/events/intel/lbr.c | 2 +- > > > arch/x86/include/asm/cpufeature.h | 1 + > > > arch/x86/kernel/cpu/common.c | 51 +------------------- > > > arch/x86/kernel/cpu/cpuid-deps.c | 80 +++++++++++++++++++++++++++---- > > > 4 files changed, 74 insertions(+), 60 deletions(-) > > > > > > -- > > > 2.34.3 > > > > > > > > A very kind ping on these patches. > > Another kind ping on these patches. Another very gentle ping on these patches. Best regards, Maxim Levitsky > > > Best regards, > Maxim Levitsky > > Best regards, > > Maxim Levitsky