From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-x22d.google.com (mail-yb0-x22d.google.com [IPv6:2607:f8b0:4002:c09::22d]) (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 3D8F021A134AE for ; Wed, 10 May 2017 11:08:42 -0700 (PDT) Received: by mail-yb0-x22d.google.com with SMTP id s22so910553ybe.3 for ; Wed, 10 May 2017 11:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:mime-version:thread-index:date:message-id:subject:to; bh=Aok/EJk+hQHRzIa0nCtb0ALnrsUTGseEWJhxJbUzJMg=; b=TbqYSW2l1rxtYEWSoI+W6CL/2L8To9cj2NBGx7Ax97Lo8rdXRPFWfBcu3jYLyt0vn7 7MSSMWFcsLQKGcEQW+3VxWPakXgjjmpVCXJ29NJ6eU5kNHMt9mNDnRVuJ/3q3ftK8tz9 lyt8uZM5cIqttnolsvc4IN1JbpNEzRoduH0/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:thread-index:date:message-id :subject:to; bh=Aok/EJk+hQHRzIa0nCtb0ALnrsUTGseEWJhxJbUzJMg=; b=raIZL3qoifgr1gf7nJSnce4O7PodyoZ0mtzLd0X6DUkl7jlwVD6SSzc9sY+Rp3q7Cd ujTwcRdkhLh0On3VxTLhPP/fVytMf7WEiqK25lwGTINGcltjxaXEEnjYR2mUY2sLuTu9 /DgfrF6q/8BbgUlpTWlgD1mpaoj0ZhYRkkzZFJEXlG9413J1fRevHckFsAkczkkGZjTM 8/keNsLsND80HUIsYv5ISWZH3xt4FN/EokA0n7cmSvk7Rb3vVf/f7ZBJp7eKX+Y5HqKk P3m+uWoqAEh/oA+VYYSRtwr21zlH1pKNy+l+K/ObTGLkdlA4NJJKZsUyiskKi0y4ftxI ZnAg== X-Gm-Message-State: AODbwcDoxNTzQo87ynYkzvgQnK3xHoGr/6XnP4m2Fbx/RXLBC+8Nni1u CFMarEzMpCsLUUBRqd1HZ+RXJu3mmjGN X-Received: by 10.37.110.198 with SMTP id j189mr6088380ybc.123.1494439721162; Wed, 10 May 2017 11:08:41 -0700 (PDT) From: Vladimir Olovyannikov MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdLJuHGbm3mwdS3RS9q9AKHmjx1XJg== Date: Wed, 10 May 2017 11:08:38 -0700 Message-ID: <844bc68624ecf4bf1fc456189efbeb1f@mail.gmail.com> To: edk2-devel@lists.01.org Subject: Creating of a memory hole in System memory 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: Wed, 10 May 2017 18:08:42 -0000 Content-Type: text/plain; charset=UTF-8 Hello, I need to reserve an area in the System memory, which should be write-protected, so that neither UEFI nor Linux could write anything into it. If it matters, the platform is ARMv8 64-bit. I have DDR RAM starting from 0x80000000 with size 0x80000000, and need to carve out an area of 0x100000 at address 0x8f000000 which UEFI should not touch. What is the proper way of doing that? I tried creating of a reserved memory HOB using this: BuildResourceDescriptorHob ( MemType, ResourceAttributes, Address, MemSize); Where ResourceAttributes are EFI_RESOURCE_ATTRIBUTE_PRESENT | \ EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \ EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | \ EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE | \ EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED | \ EFI_RESOURCE_ATTRIBUTE_TESTED Before that, I declared System memory 0x80000000 with size 0x80000000 with DDR_ATTRIBUTES_CACHED for ARM Virtual memory map. MemoryInitPei (ArmPlatformPkg) builds a Memory HOB for region 0x80000000, with size 0x80000000. Eventually in the DxeCore in CoreInitializeGcdService() I run into an ASSERT: ASSERT [DxeCore] /uefi/MdeModulePkg/Core/Dxe/Gcd/Gcd.c(2467): (Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) || (Descriptor.GcdMemoryType == EfiGcdMemoryTypeMoreReliable) ASSERT ((Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) || (Descriptor.GcdMemoryType == EfiGcdMemoryTypeMoreReliable)); with GcdMemoryType EfiGcdMemoryTypeNonExistent for Descriptor (BaseAddress: 0x8f100000, length 0x7f0f00000). Please help me to figure out what I am doing wrong. Thank you, Vladimir