From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22f; helo=mail-io0-x22f.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (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 2C4F1202E5E7A for ; Fri, 3 Nov 2017 02:50:59 -0700 (PDT) Received: by mail-io0-x22f.google.com with SMTP id 134so5079238ioo.0 for ; Fri, 03 Nov 2017 02:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Te5UojfATgnuKZuGYebCFPtrM6RqFnKCW+V3YziBCbU=; b=j0Xwu01BLD8HZzis1mgACiWEeu20hpPaKspmSn2KA9FWLx6SrzU58/vRdPbkbVjFyk DKmUtvQKirHLPZEzinb9ov8a0pwykJn4DturFPKDgVBUW1B36kZftAgSEIk1ZgoBV0Xb d3sevtbR0Z07q/n9R+BIyC0sAUH5HT+ewVoeE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Te5UojfATgnuKZuGYebCFPtrM6RqFnKCW+V3YziBCbU=; b=fV8ENaludK+qdgI4Ujv5b1uPmudxTUvc64+hnl48tyWcqH7YjdxHQHLergeY1CaSv/ AJXEpvVZ0zgnfnvpJqfneAytVueOLIiLsi29d5ByAAyYTZMrjY1XhL1qmih0sCA3px2u xpT5zYSO7/3dBa6QXF0WL8kP2B7FOOhsROab7p5ZJh+85t8doWhDpa0eA+jbnD3+8zgx CYrk6g7SW7BVEsDzmEeV0Ms8vO+VH/24yLgPuM1KGBgIk2jlN9Mp1JYBYfG3xuEMXU4G DCpouD1xSVdZ5JDzbUhSJmRv6yVt9d6B0LSJRsEK28xOUcOaNOA4BZb8nueyos75wbe5 zBvA== X-Gm-Message-State: AMCzsaW6PySnlmED7Yix4kVv+yrVHVdR9VRETu8sJzcZIa7RFrgpywKt teelABuundzfNTiTQAZfH9h3VbyCV4mN8qMoMwnuxQ== X-Google-Smtp-Source: ABhQp+Rt+oZUSSaxS17jBvM4QcfEnyzn0dl6ZbNq26Pdv/TKOR4lqOpYtp9IVQMFfnjxv+uTlozz900mKSZVuCoevmc= X-Received: by 10.107.142.208 with SMTP id q199mr8215758iod.186.1509702893563; Fri, 03 Nov 2017 02:54:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Fri, 3 Nov 2017 02:54:53 -0700 (PDT) In-Reply-To: References: <20171101101316.59648-1-ruiyu.ni@intel.com> From: Ard Biesheuvel Date: Fri, 3 Nov 2017 09:54:53 +0000 Message-ID: To: "Carsey, Jaben" Cc: "Ni, Ruiyu" , "edk2-devel@lists.01.org" Subject: Re: [PATCH] ShellPkg/hexeditor: Use CpuIo for memory access X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2017 09:50:59 -0000 Content-Type: text/plain; charset="UTF-8" On 1 November 2017 at 18:15, Carsey, Jaben wrote: > Reviewed-by: Jaben Carsey > >> -----Original Message----- >> From: Ni, Ruiyu >> Sent: Wednesday, November 01, 2017 3:13 AM >> To: edk2-devel@lists.01.org >> Cc: Carsey, Jaben >> Subject: [PATCH] ShellPkg/hexeditor: Use CpuIo for memory access >> Importance: High >> >> The original code uses PciRootBridgeIo for memory access. >> It worked before MdeModulePkg/PciHostBridgeDxe driver was checked in. >> But MdeModulePkg/PciHostBridgeDxe adds checks to ensure the MMIO >> access request is in the scope of the current RootBridgeIo instance. >> It causes "hexeditor -m 0 2" reports error because memory address 0 >> surely is not in the scope of any RootBridgeIo instance. >> In fact only accessing the MMIO space occupied by the RootBridgeIo >> can work. >> >> The patch changes hexeditor to use CpuIo for memory access. >> This patch breaks the build on Clang. ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c>:142:35: error: implicit conversion from enumeration type 'EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH' to different enumeration type 'EFI_CPU_IO_PROTOCOL_WIDTH' [-Werror,-Wenum-conversion] EfiPciWidthUint8, ^~~~~~~~~~~~~~~~ ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c>:265:35: error: implicit conversion from enumeration type 'EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH' to different enumeration type 'EFI_CPU_IO_PROTOCOL_WIDTH' [-Werror,-Wenum-conversion] EfiPciWidthUint8, ^~~~~~~~~~~~~~~~ 2 errors generated.