From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web11.19302.1589565366724392788 for ; Fri, 15 May 2020 10:56:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XV1Ykel9; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589565365; 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=632VttdGoJeBXJwlxB+SD9x/FJkglkoGYODbZlkg2EA=; b=XV1Ykel9gNjHjqrDbdW7cxHJR4u/Ec4aWjAPaE4GRCEuUdPeUFu7Ghz4vYMfH3HX35X/4S lpm9DEvjC9hW6IPMUQhNEnRjZnUegFJSIZbzX5t+SpfL8pKUW8zYcveC1jLWa+sGrJ3QVY qmnib/luSrYgeiu3GdzvbrjXGbE1Qa4= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-1NFMrVkTPmOyqpldUEeeNA-1; Fri, 15 May 2020 13:55:59 -0400 X-MC-Unique: 1NFMrVkTPmOyqpldUEeeNA-1 Received: by mail-wr1-f72.google.com with SMTP id u5so1508168wrt.22 for ; Fri, 15 May 2020 10:55:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=632VttdGoJeBXJwlxB+SD9x/FJkglkoGYODbZlkg2EA=; b=GuizaMt3MXChNMRp5ajF5pDMnKLn4CkRHeP5FmLecwzvVJCJKhc7BHF2Ixs/9e+iNZ ik4FaiLZNGl0CjHzuwz8ehjWJJncKg9r2WP6LVNEEXMNhQNveAfQ8LRQutaT9AJvamVO peEfuKE8W8FxSVwA+L4eArgxuwvjQzrk5Eo66KUHXCONdftQ/670n4mYnRqSkKiut53q TSwVQBClsV7RT9ahmZCXPor2las7jpEfjIe3C3ka9ZZRt5v2AmU2sLL8r232iNrOFjOE 9jCwhQlbCSDSLuFBYNUqqPD0cd3SJpBkbnY1rKHb+eZGFo2T2gSyNJoMPxDqvOOekh1b Q2CA== X-Gm-Message-State: AOAM5308U3EijIVsGYFVWYS3AIiwTiJoCwGFtyosyEBuijTKhXyHwmq0 z9FREhliy/hjCynGKo9h3FHsFvh/hI1Amg1YTSbbV9Y91qSa+rFaTI11Iw8XVQ8Ran+u8oVPeGk KGLSu2RX2CjIryw== X-Received: by 2002:adf:a298:: with SMTP id s24mr5421906wra.184.1589565358414; Fri, 15 May 2020 10:55:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2dmNcF5rGfaFrNN8thgddrLbwpfvtuMp372RIk+BEL9b3gw0Sf8X0AxCft8DPwveP7Ke9Bw== X-Received: by 2002:adf:a298:: with SMTP id s24mr5421896wra.184.1589565358224; Fri, 15 May 2020 10:55:58 -0700 (PDT) Return-Path: Received: from [192.168.1.39] (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id 5sm4480032wmz.16.2020.05.15.10.55.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2020 10:55:57 -0700 (PDT) Subject: Re: [PATCH 1/4] OvmfPkg/PlatformPei: don't track BS Code/Data in default MemTypeInfo HOB To: Laszlo Ersek , edk2-devel-groups-io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen References: <20200508121651.16045-1-lersek@redhat.com> <20200508121651.16045-2-lersek@redhat.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <5d8d9b89-eb37-85c9-dfa9-b11923bdf618@redhat.com> Date: Fri, 15 May 2020 19:55:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200508121651.16045-2-lersek@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 5/8/20 2:16 PM, Laszlo Ersek wrote: > In commit d42fdd6f8384 ("OvmfPkg: improve SMM comms security with adaptive > MemoryTypeInformation", 2020-03-12), we enabled the boot-to-boot tracking > of the usages of various UEFI memory types. > > Both whitepapers listed in that commit recommend that BS Code/Data type > memory *not* be tracked. This recommendation was confirmed by Jiewen in > the following two messages as well: > > [1] https://edk2.groups.io/g/devel/message/55741 > http://mid.mail-archive.com/74D8A39837DF1E4DA445A8C0B3885C503F97B579@shsmsx102.ccr.corp.intel.com > > [2] https://edk2.groups.io/g/devel/message/55749 > http://mid.mail-archive.com/74D8A39837DF1E4DA445A8C0B3885C503F97BDC5@shsmsx102.ccr.corp.intel.com > > While tracking BS Code/Data type memory has one benefit (it de-fragments > the UEFI memory map), the downsides outweigh it. Spikes in BS Data type > memory usage are not uncommon in particular, and they may have the > following consequences: > > - such reboots during normal boot that look "spurious" to the end user, > and have no SMM security benefit, > > - a large BS Data record in MemoryTypeInformation may cause issues when > the DXE Core tries to prime the according bin(s), but the system's RAM > size has been reduced meanwhile. > > Removing the BS Code/Data entries from MemoryTypeInformation leads to a > bit more fragmentation in the UEFI memory map, but that should be > harmless. > > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Philippe Mathieu-Daudé > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2706 > Signed-off-by: Laszlo Ersek > --- > OvmfPkg/PlatformPei/MemTypeInfo.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/MemTypeInfo.c > index 863c6f382680..8100a2db7d44 100644 > --- a/OvmfPkg/PlatformPei/MemTypeInfo.c > +++ b/OvmfPkg/PlatformPei/MemTypeInfo.c > @@ -31,8 +31,6 @@ STATIC EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = { > { EfiReservedMemoryType, 0x004 }, > { EfiRuntimeServicesData, 0x024 }, > { EfiRuntimeServicesCode, 0x030 }, > - { EfiBootServicesCode, 0x180 }, > - { EfiBootServicesData, 0xF00 }, > { EfiMaxMemoryType, 0x000 } > }; > > Reviewed-by: Philippe Mathieu-Daude