From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web12.7328.1583931766713321542 for ; Wed, 11 Mar 2020 06:02:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UPE3Rn8q; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583931765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nFeAHfTxuKR+6n6fcQLDPxK6NiGosXhSx0LY1DdEEC8=; b=UPE3Rn8qaGlqf1YLrEfreiMkq+PYJOsW3Bl10TlpJHyRuashgm2PwS0SjA41b7nIoxoZC8 87HFiEdx/BEQEImdYLI+I4LtbE6LJQWD0EOB4RXQ6gyHRDD//XvhMwRR7JwURRVXZ6ftxH TdIdAWfZyAglPiGwgv8m3DuDkK78pLo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-Uwv8SC64O16W51zdrC0TOg-1; Wed, 11 Mar 2020 09:02:42 -0400 X-MC-Unique: Uwv8SC64O16W51zdrC0TOg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 96A9E10883B3; Wed, 11 Mar 2020 13:02:41 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.119.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD9218F36D; Wed, 11 Mar 2020 13:02:40 +0000 (UTC) Subject: Re: WSMT bits To: "Yao, Jiewen" Cc: edk2-devel-groups-io , "Ni, Ray" References: <3c32815c-3ee9-261a-b473-1be341bdfb0c@redhat.com> <74D8A39837DF1E4DA445A8C0B3885C503F97B579@shsmsx102.ccr.corp.intel.com> <85cca7fb-ee64-317a-24b1-2a43e512b42d@redhat.com> <74D8A39837DF1E4DA445A8C0B3885C503F97BDC5@shsmsx102.ccr.corp.intel.com> From: "Laszlo Ersek" Message-ID: <9ec35b01-86cc-c68b-3615-9d29585cdbdc@redhat.com> Date: Wed, 11 Mar 2020 14:02:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503F97BDC5@shsmsx102.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 03/11/20 13:00, Yao, Jiewen wrote: > Great question on ACPIReclaim! > Yes, it is the confusing part. > > 1) Per ACPI specification, ACPI reclaim is the memory to hold the ACPI table. > It *may* be reclaimed by OS as OS memory, after OS copied the ACPI table to its own local space. > As such, we need make sure it is treated as *OS usable* memory. So we do not allow SMM driver to touch it. > > 2) Per our experience, ACPI reclaim *may* be treated as reserved memory by some OS. > OS just does not use it. > As such, we need group them in the BIN to not leave too many holes for OS. So we need track it in MemoryTypeInfo. > > > You may refer to https://github.com/tianocore/edk2-platforms/blob/master/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c > Below is our platform template. > GLOBAL_REMOVE_IF_UNREFERENCED EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = { > { EfiACPIReclaimMemory, FixedPcdGet32 (PcdPlatformEfiAcpiReclaimMemorySize) }, // ASL > { EfiACPIMemoryNVS, FixedPcdGet32 (PcdPlatformEfiAcpiNvsMemorySize) }, // ACPI NVS (including S3 related) > { EfiReservedMemoryType, FixedPcdGet32 (PcdPlatformEfiReservedMemorySize) }, // BIOS Reserved (including S3 related) > { EfiRuntimeServicesData, FixedPcdGet32 (PcdPlatformEfiRtDataMemorySize) }, // Runtime Service Data > { EfiRuntimeServicesCode, FixedPcdGet32 (PcdPlatformEfiRtCodeMemorySize) }, // Runtime Service Code > { EfiMaxMemoryType, 0 } > }; Very tricky indeed. Thanks for the explanation! Now I know what to do. Cheers! Laszlo