Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1029773rwl; Fri, 31 Mar 2023 05:59:38 -0700 (PDT) X-Google-Smtp-Source: AKy350bEUnv9Naz9MdM0c4NcRRgAhe375GCkmYllD3zu7ikadks7ZYvUkLEb/bL2pEf9xyVzWdDm X-Received: by 2002:a05:6402:524e:b0:500:3fd0:25a8 with SMTP id t14-20020a056402524e00b005003fd025a8mr5597763edd.0.1680267577903; Fri, 31 Mar 2023 05:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680267577; cv=none; d=google.com; s=arc-20160816; b=Tfn6BWuUZSkvKp5zKiRZbkROKBf4qzvZ/lPA8YjDOr2UMGPPH5rnwFOxgR7I8g+qZA spD6EhUFlmqClXJ3dMwlqoFTGRObiTCB1WsAD5zmkmpQkdA3K9rXyrWSbK425P4zq6EC 1xK3n0qtlr5uKEcrSMSFm4QMHDtUNxCs/A2V8A9bJnuEqucRzBFFZxo7eKmEeanav4hN zLTRLLQAWms4IHLBX76Q/ye0eUyAmprzt/1SDZMP1qsRr0RRzF6Dm4vM3QBThwssclhP 3Tcic/vMGCUMjG6WI74c6VLIyJiPNnFCxX9cGO9FO7oA9HymKayyiL1QIL29pGzUyMvJ EsPA== 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=uPa2/Ud1iB+5P4b9t4uXV+laCBDJ/WtIqvondW19vOs=; b=xExNhhYyMLEL6if3HLRZ8ytZIeV19+0PowazpA38PTamIMboz/Zxg7ACspi2IuPpOF VlCIJoW4kOCSWGKvQINMKwLkVImAr2iU1ND0YRsEgoeYAzwOclS9nBwnPE/IqzvsXSZE e3Ca5RmyJjqMPbHG6q0Q1YD/Hh+FyKy5CfnsvqFb53QSeS06fELwaUV8f4KItLPlv2a2 DcEKzWQM7VZKivGscHEBotOJFQqIN7g7x7kR9b12XUB32m258VoDYSBSXA3i7vk/1SaZ 2HnHCo83I8MJua3dfV/rOGgmJK8ULxY5lbzfLwXAL1J8km2leTkwYDxgQDxHiWxpQ27T KnlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=eU471Cjt; 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 l14-20020a056402344e00b004bf2b13c5acsi1946529edc.607.2023.03.31.05.59.12; Fri, 31 Mar 2023 05:59:37 -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=eU471Cjt; 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 S232204AbjCaMzu (ORCPT + 99 others); Fri, 31 Mar 2023 08:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230356AbjCaMzs (ORCPT ); Fri, 31 Mar 2023 08:55:48 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC1D2199 for ; Fri, 31 Mar 2023 05:55:45 -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 3FB2C1EC063A; Fri, 31 Mar 2023 14:55:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1680267344; 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=uPa2/Ud1iB+5P4b9t4uXV+laCBDJ/WtIqvondW19vOs=; b=eU471Cjt5jAD35CbsemfxcfNE9JqnLXRIwADatzZYPkhFt7GISj5W9KG28DmREHkvJuG4m gXqRMRYIqOTyPi8htZiIuBB59yCVsGIHzixqeZWvD1+dyzq9PDD5bICHuCrlp+c/hHtBbP 3TCu/SdhFYQYjXT7cts2EHo8SpM1TKM= Date: Fri, 31 Mar 2023 14:55:38 +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 09/12] x86/mtrr: construct a memory map with cache modes Message-ID: <20230331125538.GBZCbYSqr8kMP4bpwS@fat_crate.local> References: <20230306163425.8324-1-jgross@suse.com> <20230306163425.8324-10-jgross@suse.com> <20230329125128.GAZCQ0UJUj48VKdG//@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org On Wed, Mar 29, 2023 at 03:39:35PM +0200, Juergen Gross wrote: > No. :-) Because? > The final form of the code is the result of an iterative process. :-) I have a similar iterative process: until it hasn't been reviewed and explained properly, this is not going anywhere. So however you wanna do it, fine by me. > I've reused the wording from cleanup.c (just above amd_special_default_mtrr()). That got added with K8. K8 is ancient history so nothing magic about that anymore. It is basically a bit in the SYSCFG MSR which says that [4G ... TOP_MEM2] is WB. > > Why not in mtrr_bp_init()? That is the first CPU. > > Yeah, but generic_set_mtrr() can be called after boot, too. That function sets a single MTRR register so you'd have to merge the ranges, AFAICT. Not rebuild the whole map... > Umm, not really. I want to do the copy even in the Xen PV case. How about some comments? Or you're expecting me to be able to read your mind?! ;-\ -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette