From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF655C48BC2 for ; Sun, 27 Jun 2021 23:52:25 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 580E661C32 for ; Sun, 27 Jun 2021 23:52:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 580E661C32 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 66A7282D84; Mon, 28 Jun 2021 01:51:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="HSToTUU1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF03882D7A; Mon, 28 Jun 2021 01:51:31 +0200 (CEST) Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C47A682D1B for ; Mon, 28 Jun 2021 01:51:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x32c.google.com with SMTP id n99-20020a9d206c0000b029045d4f996e62so16786950ota.4 for ; Sun, 27 Jun 2021 16:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n9449ijIh3vh5GRKpIl3kvwTkgP9SKLlc99KQ2vGpSM=; b=HSToTUU1Hm3BgNS2Okfo/E/Qqx6WKUxXLOEsbhylT8ZKzVt2AsgH3aGOXkYi6od2qL XbY1TrkkvY4Sd/4eT8mcio0PjW1l1CPFNzQWF/XIHAgXNJNlx2dlDVllP1oBbkbv708s qh9RCfpV0/bt1VwoaSp//e6aIphb5Zpxv0jNY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n9449ijIh3vh5GRKpIl3kvwTkgP9SKLlc99KQ2vGpSM=; b=igyTrhJNQB9mjuTY9aN9EGrLv2h8rZk9vlY+8wctivzmy6TECSeHpfjrQlmkExxBdz nnF1eHGp75kVXnBewuuAIFodvYrQS/u6wwFrIt3bUkBblNu3efqJeSiu15IVYqukFwLg 25Pqg6qYRoOQ6VRkqk4Z6M0w3uuSURBnOMoxqmKO0pjjpAOJ6NWvS90NVjoaOyColtx0 05OL24NhKQcFp6/Cu43H4/M618Ethozvfk77ww9fqBd1MPf0ZoxdosEJzl/LmyteiBY7 M89ACQgV/TQJsDJEDuTO5WHZpf1o2efZhYzdj0gTEkzqt7K4j2NYk4YUsb/+2ZcsFs3r xRYw== X-Gm-Message-State: AOAM531u//UvYcUBXtfwNHf6sJs2CHi4TlTqUY92c6n7aJAdRX5YY1hz j7SqxCIZMRUKp/NLXkbor4rnCXvxwHJAv6RA X-Google-Smtp-Source: ABdhPJzUmf4nkCgDafHK4oJRXgZd9jp+U2HNKr7hwtcBx/x5NbdBxlcG01iw9HL4yXofqnUUoci9bQ== X-Received: by 2002:a9d:6c83:: with SMTP id c3mr2239705otr.372.1624837885232; Sun, 27 Jun 2021 16:51:25 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id bb34sm1297928oob.39.2021.06.27.16.51.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 16:51:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH v3 06/16] x86: Don't set up MTRRs if previously done Date: Sun, 27 Jun 2021 17:51:01 -0600 Message-Id: <20210627235111.485507-6-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210627235111.485507-1-sjg@chromium.org> References: <20210627235111.485507-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean When starting U-Boot from a previous-stage bootloader we presumably don't need to set up the variable MTRRs. In fact this could be harmful if the existing settings are not what U-Boot uses. Skip that step in this case. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/cpu/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c index e59215cc20e..c7f6c5a013e 100644 --- a/arch/x86/cpu/i386/cpu.c +++ b/arch/x86/cpu/i386/cpu.c @@ -423,7 +423,7 @@ static void setup_mtrr(void) u64 mtrr_cap; /* Configure fixed range MTRRs for some legacy regions */ - if (!gd->arch.has_mtrr) + if (!gd->arch.has_mtrr || !ll_boot_init()) return; mtrr_cap = native_read_msr(MTRR_CAP_MSR); -- 2.32.0.93.g670b81a890-goog