From patchwork Thu Mar 1 09:38:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130131 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2580286edc; Thu, 1 Mar 2018 01:39:03 -0800 (PST) X-Google-Smtp-Source: AG47ELt/zIVyMWzS3kYDl1mE8fwIgVmAOH62ivG4Cftpuh2mxoQ9Tps7HTKdmDWNan4f6zp3bhXK X-Received: by 2002:a17:902:7a2:: with SMTP id 31-v6mr1333735plj.313.1519897143260; Thu, 01 Mar 2018 01:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519897143; cv=none; d=google.com; s=arc-20160816; b=hQPPt6AWiTkFOscSBy0Vi2QKYfXOMWVcyhOii2MV2gI6u7GU+HNiEK/Wsewaw6cR31 4LJ2wsVSZNyiH0q5e5IkN00c1wIy+FsfIAYCV/e07v9yhcMBf3zQtpvn8Sx0Lp9siFDr M2IL3NWhV/CzxuONEdcpfpOcKoCPx1pdR+eZAAgeIrdP3t7sxejDHQuFI8WTdOVo9M8C v5PgQI+RzHQMjcvo0HX+FU54iXa+bLbQ9oQNgDCmxLJyss5jLkkmLaE0ydBUyacikxJP YESCLeZUVCrs7x7eXVu8ewPkas8wOqOSjPSJ+oT8hS5Xji3Ax81Pd/y2V8DOWzdj63T9 oV0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=X32vCeUX+p+UTCWUXsfexHgtT7E73ca5ypMgpVCHOQY=; b=Xy7uLzGEFROEMxV4HKCtytXwCcnKw3g9U+71wICnSleMFZaMxVgT2zXP6Mudrf8A1z IV+BgdNti4Dq0JuiXw8SNF5kNN57zVGBCiMu4XxZp9G7haN4mlb6M4aWTss0RkPKDoSn 62f2xSCJFsLjcigZ7jWxLKeldiX4oYotgWmy6G3AtbCSBNhuFPQvupaxnpMsgu9RI4Qd YxvBF+T5lEziYsty7sPyxO3PvwTn3vOgw2GniusLRuXEoRyhPkR5h1/RMKqduXk1mHMp gz8LUrDQjpNTdsUdN3lffgfFe+zXxaXVpBMT/nxrNvVpWTkqDP/qhEPiqF+8SE6Pot0n j3/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z6XRyuKi; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id f59-v6si1041116plf.814.2018.03.01.01.39.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 01:39:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z6XRyuKi; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7138E2235229F; Thu, 1 Mar 2018 01:32:54 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 95B382242384F for ; Thu, 1 Mar 2018 01:32:52 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id q83so10286669wme.5 for ; Thu, 01 Mar 2018 01:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=2wF3sq8n5KeAMJdkynMvPOVR5PY2KxDvQqMBAKuEJmI=; b=Z6XRyuKiesN0xC+ZedQUIVoTr5HbZ9HaguKAmcuxyfrMGp7LvS/8WsRz5f7KLB8OPZ zZw+1DMhigkfRC1QfbZy/mvY1pXBw7QxHNy1Coi5LD7nAra7JILM+gulL6/7JIhsgdVa gCO1cIif4WKnP6EmxhSe4iTOBkFtZaWEHsSfg= 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; bh=2wF3sq8n5KeAMJdkynMvPOVR5PY2KxDvQqMBAKuEJmI=; b=k1PY3Hh/2lKNeTstYa85ABJUU23LzVQuW+MwO3jV+hAmreC0APBsklLJRAB/vVXWnR ueTomF3pdLIT55aVt0M6PCUQYFpGeF/lxQbOwB7VLsBpiQ0StYHQCQeT/EVak5s37Cm8 r1alWuAXc6avQ/WE2Ew6g+pbKdnEQhtWz3OcpuPY95SkuhdYwNcwNySQeYpQLWjcgk1y 6i8hOmlP9GE27ZHXdx2vTb7UZeItqJ0zGDleKvQbpf/s50WtO5hg1FFkhMOZ4xYsZ1P8 lZx/7G36FjcMp26Z6Z2kVpEUBku5koVIqKhqEgrp51QhnMSfIu6K/yrPPHPDbSuLmC5o b7uQ== X-Gm-Message-State: AElRT7F8LlhP9PJtwbE7jqWx2Jr9L95uXyzPjNVSBTcqXacPPyteo7o0 uXpDHyFgCRPpgAixmlBGM9tNN5frbqE= X-Received: by 10.28.51.67 with SMTP id z64mr1091937wmz.59.1519897138757; Thu, 01 Mar 2018 01:38:58 -0800 (PST) Received: from localhost.localdomain ([160.163.57.8]) by smtp.gmail.com with ESMTPSA id v8sm3081873wmh.25.2018.03.01.01.38.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 01:38:57 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Thu, 1 Mar 2018 09:38:47 +0000 Message-Id: <20180301093847.19493-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] ShellPkg/UefiShellDebug1CommandsLib: remove I/O address limit from 'mm' X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ruiyu.ni@intel.com, jaben.carsey@intel.com, heyi.guo@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Neither the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL nor the EFI_CPU_IO2_PROTOCOL impose any restrictions when it comes to the range of valid I/O addresses. Even so, the 'mm' command in -IO mode refuses to perform accesses to addresses >= 0xffff. It is not up to 'mm' to impose this restriction, so remove it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 11 ----------- ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni | 2 -- 2 files changed, 13 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Jaben Carsey diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c index 9f97f1d345f7..d1fd42b1cd4d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c @@ -525,12 +525,6 @@ ShellCommandRunMm ( goto Done; } - if ((AccessType == ShellMmIo) && (Address + Size > MAX_UINT16 + 1)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_IO_ADDRESS_RANGE), gShellDebug1HiiHandle, L"mm"); - ShellStatus = SHELL_INVALID_PARAMETER; - goto Done; - } - // // locate IO protocol interface // @@ -592,11 +586,6 @@ ShellCommandRunMm ( // Complete = FALSE; do { - if ((AccessType == ShellMmIo) && (Address + Size > MAX_UINT16 + 1)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS_RANGE2), gShellDebug1HiiHandle, L"mm"); - break; - } - ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, TRUE, Address, Size, &Buffer); ShellPrintHiiEx (-1, -1, NULL, mShellMmAccessTypeStr[AccessType], gShellDebug1HiiHandle); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS), gShellDebug1HiiHandle, Address); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index b6a133a45444..011a7bfc2db6 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni @@ -128,7 +128,6 @@ #string STR_MM_NOT_ALIGNED #language en-US "%H%s%N: Address parameter %016LX is not aligned.\r\n" #string STR_MM_PCIE_ADDRESS_RANGE #language en-US "%H%s%N: Address parameter %016LX is not a valid PCI/PCIE address.\r\n" -#string STR_MM_IO_ADDRESS_RANGE #language en-US "%H%s%N: IO address out of range 0 - 0xFFFF\r\n" #string STR_MM_MMIO #language en-US "%HMMIO%N" #string STR_MM_IO #language en-US "%HIO%N" #string STR_MM_PCI #language en-US "%HPCI%N" @@ -136,7 +135,6 @@ #string STR_MM_PCIE #language en-US "%HPCIE%N" #string STR_MM_ADDRESS #language en-US " 0x%016lx : " #string STR_MM_BUF #language en-US "0x%0*lx" -#string STR_MM_ADDRESS_RANGE2 #language en-US "%H%s%N: IO address out of range\r\n" #string STR_MM_ERROR #language en-US "%H%s%N: Input had incorrect format\r\n" #string STR_SETVAR_PRINT #language en-US "%g - %s - %04x Bytes\r\n"