From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 8FD311A1F52 for ; Thu, 8 Sep 2016 01:13:44 -0700 (PDT) Received: by mail-wm0-x22e.google.com with SMTP id w12so73998843wmf.0 for ; Thu, 08 Sep 2016 01:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=rRrsZnt7fxzLOK/FX7oswFCrqJZzNO5gsD6EZiUWwH0=; b=GJAuZqPVdHBcVyaeA1C0PltX3pbdToDdLWjukkdO+3mKB0/CdT36Oc5NwIY5v/Bhu/ 1gnfDvjBNQGISMcfCBry052gFN3bQywIA34wZbtOKGRuc3vGQrCFaDunBBk8xaWVKCFw Sry/KgDyaJnzUkB5ca6cxUijeOeE6XY8IIACk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rRrsZnt7fxzLOK/FX7oswFCrqJZzNO5gsD6EZiUWwH0=; b=FD4UDjb3g5p+7d2uv4MvuNIiRH8d/GkYgXShMUqpxYR0v+8OzcUhMcqzss3yTOY4hZ 5/a3jyceiXduDo5SRnIwUvBYOf+5Iz11g1z053FpgyhovWIXAAFB1G0dzP6US/MxzwpT //cxqgstusd1L/jQnAGYxDe1+qdaYRUWT61bkYOvi507jJ2qrDThNk2vtX6h/wzskUwB QTo8VkbAVFb1QDHgkTXVB2CXVivW0gt53G17iOp+THGmN9q/ENk5GWqNUbiwsN22sD3i 7t3oLZolJj5VdhQB/jA8H/RRbSQM/8gjPTn5fXUUiKL16Tk+IzLmqTVv8QEjIhE43IkX iN6w== X-Gm-Message-State: AE9vXwPRw/gbFzrEDUYy1SZ5ZZH3fPHc2BLAgV1HH8uFPPJ4uPNmJ+jL2dqtUrPmjDdahotD X-Received: by 10.28.210.82 with SMTP id j79mr7428119wmg.10.1473322422980; Thu, 08 Sep 2016 01:13:42 -0700 (PDT) Received: from localhost.localdomain ([197.130.133.164]) by smtp.gmail.com with ESMTPSA id jq5sm42937858wjc.20.2016.09.08.01.13.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Sep 2016 01:13:42 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Cc: Ard Biesheuvel Date: Thu, 8 Sep 2016 09:13:38 +0100 Message-Id: <1473322418-9158-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [PATCH] ArmPlatformPkg: remove EFI_MEMORY_UC attribute from normal memory X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2016 08:13:45 -0000 On ARM systems, mapping normal memory as device memory may have unintended side effects, given that unaligned accesses or loads and stores with special semantics (e.g., load/store exclusive) may fault or may not work as expected. Similarly, DC ZVA instructions are only supported on normal memory, not device memory. So remove the EFI_MEMORY_UC attribute that we set by default on system RAM. If any region requires this attribute, it is up to the driver to set this attribute, and to ensure that no offending operations are performed on it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoMem.c | 1 - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c | 1 - ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 1 - 3 files changed, 3 deletions(-) diff --git a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoMem.c b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoMem.c index 41731c1ebdb8..aa8d7d9c3b0d 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoMem.c +++ b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoMem.c @@ -56,7 +56,6 @@ ArmPlatformGetVirtualMemoryMap ( ResourceAttributes = EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c index c6df2e1b3de4..115df246796d 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c @@ -61,7 +61,6 @@ ArmPlatformGetVirtualMemoryMap ( ResourceAttributes = EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c index 75e6631d7f30..2feb11f21d5d 100644 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c @@ -89,7 +89,6 @@ MemoryPeim ( ResourceAttributes = ( EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | -- 2.7.4