public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org
Cc: heyi.guo@linaro.org, ruiyu.ni@intel.com, jaben.carsey@intel.com,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH] ShellPkg/UefiShellDebug1CommandsLib: remove I/O address limit from 'mm'
Date: Thu,  1 Mar 2018 09:38:47 +0000	[thread overview]
Message-ID: <20180301093847.19493-1-ard.biesheuvel@linaro.org> (raw)

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 <ard.biesheuvel@linaro.org>
---
 ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c                           | 11 -----------
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |  2 --
 2 files changed, 13 deletions(-)

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"
-- 
2.11.0



             reply	other threads:[~2018-03-01  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  9:38 Ard Biesheuvel [this message]
2018-03-01 15:09 ` [PATCH] ShellPkg/UefiShellDebug1CommandsLib: remove I/O address limit from 'mm' Carsey, Jaben
2018-03-01 17:02   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180301093847.19493-1-ard.biesheuvel@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox