Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1238317lfc; Wed, 1 Jun 2022 12:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZMTzrthLYypoJi385tRrMxBHpZpHJFCzh6ixyFPN816EEe5R4VKU65maT7ZwwNvsPqmCv X-Received: by 2002:a17:90b:1d08:b0:1e4:dad9:64e5 with SMTP id on8-20020a17090b1d0800b001e4dad964e5mr5661143pjb.200.1654112557941; Wed, 01 Jun 2022 12:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654112557; cv=none; d=google.com; s=arc-20160816; b=P1ECVx43KgqiTyuqZYlIaX232B1EOfmpznqpD2HfMGdY1LCwvSll8Vm+BXJnF5t4CX 8TcQ/1C/GCK945ChSYI4dK5mzAuyTvEA29lT2vaJwc8O81wHxD8aC/tQiG91RmzoeclN 6OaxkyOXDvDc9GvG0PzEwo9Ue59QfjaTlswBcxWbB47UwUuqUPJSpurCWh1QJ9NSpCJ2 Xpftn+S9ynK+ure3sFNGPbdAkBmVzxA9tBK7BJoZ3EHqGqvOUnjm2U++fcXj/gJOot25 cyNqOKrlPPT2bCBO8bI8K/VDmbao1NKk5ix2NFp1x46XbMvaoVpWKtJJ+DQw+1jT0TFN 2BDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=iSXfdXWQRyUCbk0G9o7KyBhlDTpNCnQev8nhR/I/TdY=; b=uvSbHO3Zq5zx/EM3r52U1zFtI+SxHJdSdHo88qp1J59UviyXgN95yq+8zkJI5MgAuL fjOQNNCnV68TSMbDOift1ENwxyDbRPF3jl/PfJnuGpJcMYzcwlqUUzaB4Yh7csqW410T 30CvkjG+IG0xHerKedvZ0DfkoahGWWs3FRwKc4gIdDob9IpfHwBDH0oFINT8ziwUsGeS r6ATMoZHNc7RpyqrNAymVKNAzHAGq36dk90+BSvM7ZonrBbp3HSs4NOfBY3IirtI6pmv RdI9I/4STLaOgK6sbaa/YWRhrfA6/5w2aNSA9ioBxzivDxkH9k9O4sJs51WtZUqLA3Fi tt8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HsksBcqd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k11-20020a170902c40b00b00164026896c2si3908228plk.212.2022.06.01.12.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:42:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HsksBcqd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC1A31CC623; Wed, 1 Jun 2022 12:08:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348486AbiEaWk3 (ORCPT + 99 others); Tue, 31 May 2022 18:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348490AbiEaWk1 (ORCPT ); Tue, 31 May 2022 18:40:27 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4908E9EB48 for ; Tue, 31 May 2022 15:40:26 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id v106so19376691ybi.0 for ; Tue, 31 May 2022 15:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=iSXfdXWQRyUCbk0G9o7KyBhlDTpNCnQev8nhR/I/TdY=; b=HsksBcqdyPpSCCWP1DiXPiE1a14eVxR7MRHdI7Z5cpzZAy9lO7ruMphxUv9jF2C2sw /pgCZCCeJVk9cxgvTdmK1FsevcWFWH/+i8JgrsxFWUScnpMihGH6PE+aKcXA03iPeJdj dZ4Fy8JMSO77H9VgxNZVjTS2CE7+rjPwOQ1nkywPuJ4OjM7zlIgYglNeD5R5RdHU9TQd ZGEbQvqw79MCww+sZgynuaRCvhUuCusnjWfYIg9yFNCv09hwSDywXkSSafnIp55ACSaP 7kfB7e7yTdJwIGcs5EiZYEHjSftx3J+hMbbAJxZGkLLhtDcVt5vIiRiCUs6uyPTV7LFu JzIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=iSXfdXWQRyUCbk0G9o7KyBhlDTpNCnQev8nhR/I/TdY=; b=Wj3nO1tjVEzRLAfo9lfQj9KDFuofV7VSv4n6EnCN3Dpj4fojUELQardDod+13gT1dw r5xUtFxpfZjoGO8NUn9HGgMTlrEsp4LCrX0WmCqp6dCGgK7/8MkGqDV2X2fxgRitiA67 M92ypgg+1VLHqWrd/qCsGQ0b2T5GaJeszVk8SQ1WtaLKSpKr5Kwzw0rEzeduZ4vkTdSa eKN2h/JNaeJdpiEyL3ftsvh+7pBn/+NCX5yNCyZ6DZjiagCMI5+/sdt/UH46azzrD6O3 9z6VB7w28C5FDrMbjLJvG7tgNQlo1p1u07e995cEURSVx5MO3HRgzrB/MU/UYIKbMfpm gyrg== X-Gm-Message-State: AOAM532sH1v5CxyhGqnknmqyH9OqJXlvEnbouae7aox8TqK+zCROSKwD BMipaXQpkkMEq1pVTLc0Nv4e6GMbG/Jf/txHq94mRg== X-Received: by 2002:a5b:411:0:b0:65c:d336:ddf7 with SMTP id m17-20020a5b0411000000b0065cd336ddf7mr13814723ybp.321.1654036825375; Tue, 31 May 2022 15:40:25 -0700 (PDT) MIME-Version: 1.0 References: <20220425033934.68551-1-kirill.shutemov@linux.intel.com> <20220425033934.68551-7-kirill.shutemov@linux.intel.com> <20220506153013.e6v4q2qhuhqumfiu@box.shutemov.name> <20220513144515.fx2cvo3rjued3vy5@black.fi.intel.com> In-Reply-To: From: Dionna Amalie Glaze Date: Tue, 31 May 2022 15:40:14 -0700 Message-ID: Subject: Re: [PATCHv5 06/12] x86/boot/compressed: Handle unaccepted memory To: "Xu, Min M" Cc: "Kirill A. Shutemov" , Borislav Petkov , "Gao, Jiaqi" , Michael Roth , Borislav Petkov , "Kirill A. Shutemov" , "Lutomirski, Andy" , "Christopherson,, Sean" , Andrew Morton , "Rodel, Jorg" , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , "Hansen, Dave" , Mike Rapoport , David Hildenbrand , "x86@kernel.org" , "linux-mm@kvack.org" , "linux-coco@lists.linux.dev" , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi y'all, I've made minimal changes to OVMF to prevalidate only up to 4GB and leave the rest unaccepted, as Thomas Lendacky recommended https://github.com/AMDESE/ovmf/pull/4#issuecomment-1138606275 and ran a memtouch test to see if this change behaves as expected. One thing that struck me is that an 8GB machine reports 2044MB free with this change (free -k) whereas without it, I see 7089MB free. I think that unaccepted memory should be classified as free in meminfo, no? I'm not familiar enough with that code to say what specific change needs to be made. (resent in text mode) On Sun, May 15, 2022 at 11:47 PM Xu, Min M wrote: > > On May 13, 2022 10:45 PM, Kirill A. Shutemov wrote: > > On Fri, May 13, 2022 at 11:01:43AM +0200, Borislav Petkov wrote: > > > + mroth > > > - brijesh > > > > > > On Thu, May 12, 2022 at 10:34:02PM -0700, Dionna Amalie Glaze wrote: > > > > Kirill, I've been tracking these changes to see if we can handle th= e > > > > unaccepted memory type for SEV-SNP, but testing has been an issue. > > > > The proposed patch in Ovmf to introduce unaccepted memory seems to > > > > have stalled out last September > > > > (https://www.mail-archive.com/devel@edk2.groups.io/msg35842.html) > > > > and is particularly difficult to adapt to SEV-SNP since it doesn't > > > > follow the TDVF way of initializing all memory. Is there a differen= t > > > > development I might have missed so that we might test these cases? > > > > Without the UEFI introducing EFI_UNACCEPTED_MEMORY type, any > > kernel > > > > uses are essentially dead code. > > > > + Min, Jiaqi. > > > > I don't follow firmware development. Min, Jiaqi, could you comment? > > > We have prepared the patch for unaccepted memory and it is now working in= our internal release. > But there is an obstacle to upstream it to edk2 master branch. > The patch-set depends on the definition of UEFI_RESOURCE_MEMORY_UNACCEPTE= D in PI spec. This is proposed in https://github.com/microsoft/mu_basecore/= pull/66/files#diff-b20a11152d1ce9249c691be5690b4baf52069efadf2e2546cdd2eb66= 3d80c9e4R237, according to UEFI-Code-First. The proposal was approved in 20= 21 in UEFI Mantis, and will be added to the new PI.next specification. (Til= l now it has not been added in the latest PI spec.) > So UEFI_RESOURCE_MEMORY_UNACCEPTED cannot be added in MdePkg which make i= t difficult to submit the patch to edk2 community for review. See this link= : https://edk2.groups.io/g/devel/message/87558 > > Please be noted: UEFI_RESOURCE_MEMORY_UNACCEPTED (defined in PI spec) is = different from EFI_UNACCEPTED_MEMORY (defined in UEFI spec) > > I will submit the patch-set once the new definition is added in the new P= I.next spec. > > Thanks > Min --=20 -Dionna Glaze, PhD (she/her)