Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp415243rwi; Wed, 26 Oct 2022 02:35:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4dhULcWGLD9wQ2/Kpeoz1wELUPfZH08EPDb1S8l0FpbqLsZJc25HlS5gIdwKhGG/H3n/C9 X-Received: by 2002:a17:903:24f:b0:178:bf4f:fc7c with SMTP id j15-20020a170903024f00b00178bf4ffc7cmr2101731plh.124.1666776904695; Wed, 26 Oct 2022 02:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666776904; cv=none; d=google.com; s=arc-20160816; b=tU2E0YVjj3S81RItpiiJf4ku9x7Jo/lBQoq59/9zUBia4Kcg5Nkqa/43OraLG1ZQKi XaO0mhajW/gSVUKiUexh1BWQQ9A3ioJkubqL6Hiv8eFDQ5RmBZWpQb/OgQFPgnFoeMSr MT7EpHpcQlKlzWRR+obuI6Pl/Pm0zK0cpe1lL/84KcOzZK64SEdsa9twjIfda3Q8M/eH GBYxFE9THCuFb0unJEPyU0iXfXCsfLwet7KOGQNFHI84MH6JKMwJngSOpIeucf+cqiiW uo85Gk+Q36DvyrvcjSorxFJSDIBhaywVZ9mDWuhBt1dn7avOutMQlxIU1NfsTvAwZavE jXHA== 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=uZok860yPzg2HSkFXYHJ/wRjPzyzd3KTktgEJeYsqRY=; b=rhhJAGXft7pU4YceRSJ19WEJ0F+T542oBCXUIknYfOTG3zUaIgaTf0WlkIc0o4x+SG ndClSQh8KjOzzCitODb/O9Dn15WjDjcp9x73eGs41JxRIEhWjTkNAzEQs2UPTfN42YGJ npSiICW7ch1Gy/ZemW85jjt5xKWfDLW7dedDztGdxUSkanBp7BJhDxTuEYFg6nu2XEnK 9wX5D1uHA9eodoYA2pwg+f6JZQoZHxQeQ0BeXLUa/+VlNngt+2Jwzo/iQwHkzyjWHL2C hvuqb8Mf28FWHDgFZuH0N7L8ss4C9HoBgX3CF5XWM8pfA9B1/VJk2N7cK1+UCkx1lrov rq/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="EW8aND/2"; 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 v16-20020a634810000000b0046ed15a820esi6056777pga.385.2022.10.26.02.34.51; Wed, 26 Oct 2022 02:35:04 -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="EW8aND/2"; 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 S233126AbiJZJZF (ORCPT + 99 others); Wed, 26 Oct 2022 05:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233387AbiJZJYu (ORCPT ); Wed, 26 Oct 2022 05:24:50 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7862D3FD63 for ; Wed, 26 Oct 2022 02:24:48 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7b8329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7b8:329c:23ff:fea6:a903]) (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 381161EC064E; Wed, 26 Oct 2022 11:24:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666776287; 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=uZok860yPzg2HSkFXYHJ/wRjPzyzd3KTktgEJeYsqRY=; b=EW8aND/2FfWr5evU4I55E/F43rrzXt4ayM8e3QikewJgE+LdWkOl7U8OR0DAjpUxWLG7g5 p/gGBQm+7VT4yTIgH0dolQQlu94/TbEFHxQ42fgPrQBXDVGcXlmCxNlmhcah12hU+YoAdM TDn/t9Q8rOCZqFEHuEWAA85aIUqLiSw= Date: Wed, 26 Oct 2022 11:24:41 +0200 From: Borislav Petkov To: Juergen Gross Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" Subject: Re: [PATCH v4 05/16] x86/mtrr: split MTRR specific handling from cache dis/enabling Message-ID: References: <20221004081023.32402-1-jgross@suse.com> <20221004081023.32402-6-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221004081023.32402-6-jgross@suse.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, URIBL_BLOCKED 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 Tue, Oct 04, 2022 at 10:10:12AM +0200, Juergen Gross wrote: > @@ -764,11 +779,8 @@ void cache_disable(void) __acquires(cache_disable_lock) > count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); > flush_tlb_local(); > > - /* Save MTRR state */ > - rdmsr(MSR_MTRRdefType, deftype_lo, deftype_hi); > - > - /* Disable MTRRs, and set the default type to uncached */ > - mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi); > + if (boot_cpu_has(X86_FEATURE_MTRR)) check_for_deprecated_apis: Warning: arch/x86/kernel/cpu/mtrr/generic.c:782: Do not use boot_cpu_has() - use cpu_feature_enabled() instead. > + mtrr_disable(); > > /* Again, only flush caches if we have to. */ > if (!static_cpu_has(X86_FEATURE_SELFSNOOP)) > @@ -781,8 +793,8 @@ void cache_enable(void) __releases(cache_disable_lock) > count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); > flush_tlb_local(); > > - /* Intel (P6) standard MTRRs */ > - mtrr_wrmsr(MSR_MTRRdefType, deftype_lo, deftype_hi); > + if (boot_cpu_has(X86_FEATURE_MTRR)) Ditto. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette