From patchwork Mon Mar 27 04:15:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1761343 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FMCtvGgO; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PlKJJ5dxYz1yXq for ; Mon, 27 Mar 2023 15:16:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4519586068; Mon, 27 Mar 2023 06:16:30 +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="FMCtvGgO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22D0486071; Mon, 27 Mar 2023 06:16:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 D49368604D for ; Mon, 27 Mar 2023 06:16:24 +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-pl1-x629.google.com with SMTP id c18so7168056ple.11 for ; Sun, 26 Mar 2023 21:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679890583; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QNTiR9vsFgvBRZaRDzCG3IkgO+ZNEkTXX8yO03bzdHE=; b=FMCtvGgO+2oY5RMeHt9hOdaIsWw62P5XOeQlDsClwKxKDa1YdDBLwbOCNY4mZ3Di9Z /LUB6pn++6DzSTDGGKZ1njQNvK04cLeadnrNsx4lpcAvVfTeMQqEX4H9oWHlBaiEpQDu Ybf13L0278TNC7vp2aB/t23UV2XQT1wKEmxhU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679890583; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QNTiR9vsFgvBRZaRDzCG3IkgO+ZNEkTXX8yO03bzdHE=; b=76dbbYbDr/dJRi25s7sMhE73DBUYnAmRJEXUkfIhmsBRNsL1Tx2Bu4Cfo/AFIn64nZ epMKmHKKUqQvcQvrbOQCFK5cq+UR3GJVd/wXlHYDQGXfr/k4lGyDON15tJQyrPy8RSnp UTGYwoKnCDBBogLNM7PCQotbl50e9J88cE960rOTII2HsYEQHPH1qfJjsXjmpMQdMCPA YT0PGrp79hz/G6nFWHiwSO7jtjeDu/nnCE4Y/UF1W9yvXHXiLLV3yJAPYRxamdnUJ3bD NaL4naAFGO7P8QSecPA7cUCu9W3pl27WrZAK5PF7W6H91e0YWq9Qqw0uvy0uk6l1YvgF vo9g== X-Gm-Message-State: AAQBX9cWu2DVM3OMovihsA7EBCO+rupbsUw0tnF81EPDyzByUL+Nf9ap AukJHCq+Ke4osa9lFHtSbEARed5+/IK/ok1VEP0= X-Google-Smtp-Source: AKy350YRjF5jz622kzDOA9ePSZ3tuQNtPSD0iK44X3K8bQ5YgWOksl6k+tF8FqSQZKjauixKkAlSlg== X-Received: by 2002:a17:902:bd05:b0:1a2:4921:f96f with SMTP id p5-20020a170902bd0500b001a24921f96fmr1910262pls.56.1679890582943; Sun, 26 Mar 2023 21:16:22 -0700 (PDT) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id ja13-20020a170902efcd00b001a064282ce5sm17992077plb.294.2023.03.26.21.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 21:16:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v3 01/16] mtrr: Don't show an invalid CPU number Date: Mon, 27 Mar 2023 17:15:35 +1300 Message-Id: <20230327041551.1757316-2-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230327041551.1757316-1-sjg@chromium.org> References: <20230327041551.1757316-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean When U-Boot did not do the MP init, we don't get an actual CPU number here. Skip printing it in that case. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v2) Changes in v2: - Don't show an invalid CPU number on error cmd/x86/mtrr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c index b213a942fde4..ff4be6b7bf5b 100644 --- a/cmd/x86/mtrr.c +++ b/cmd/x86/mtrr.c @@ -145,10 +145,12 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc, for (; i >= 0; i = mp_next_cpu(cpu_select, i)) { if (!first) printf("\n"); - printf("CPU %d:\n", i); + if (i < MP_SELECT_ALL) + printf("CPU %d:\n", i); ret = do_mtrr_list(reg_count, i); if (ret) { - printf("Failed to read CPU %d (err=%d)\n", i, + printf("Failed to read CPU %s (err=%d)\n", + i < MP_SELECT_ALL ? simple_itoa(i) : "", ret); return CMD_RET_FAILURE; }