Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3107937rwb; Mon, 16 Jan 2023 03:57:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdKleUEutmVAExfP0Lshnd92slnHqoqsCCSIhvWaH+qoi+hRhWBj3pF+HOuBVbYdYA8zAZ X-Received: by 2002:a17:907:8d09:b0:867:ef3f:dd85 with SMTP id tc9-20020a1709078d0900b00867ef3fdd85mr13857308ejc.56.1673870234237; Mon, 16 Jan 2023 03:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673870234; cv=none; d=google.com; s=arc-20160816; b=N8xriybuTyJpYsfJ/m9mKgDnz5R8OdENc5+MXy4Ck1+p1zB+z7T3I+L40D74pWVb18 w2ARPTfCNhroQWLiMWlUCG10rojHi1pYm39dqrB9uM0eV2e3jlTyhIpWK7b5xjTQaQSr h0qNzZR6Ezl3furLT+ZHRqtB9rUG0w6oVWgLoBj8e+XZ1DxIucwYR3z6ZX1NDt1xfK/w 5+IOJH9ZV9FDgeoRLIfeNMoNHxxDnPPI9uvMXpPhLEdmeAn1A9oFe9T2hO2TLrWaJkFG IuP+QOD3+SFq6glW6fUL735aYb1kcuevVrRz+9BNIhZDn/HzSyg7tSyauHjmOx7BdOxm xLNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dMSn7PTMEvVVrQFt74Q3u3R9ASe6C2Dbwlt9UzpnyIA=; b=bixG6p+n3ZkO521Hb5l7pErZVyTO2Mv7Sxhb9IqHIrXimqKf4Mm66NkHzonB2vwxVW Chyt2lR9Q/xUrgBccpoguvYOTaWN17TyU5VKAh2KiloARGzCciyRxhY2pEd7NiSJ2kyT PNS+4BoYtFV1/3fNlFU9D4aJQBKbwy4rHm8I1b3HQZIqeEUfyMyCI4PfdSTU8DKCWntv h5ArZjGDuxU/vhIv8B14dA7HnEZ6GGIOum3vUdN7W0KiTHdF4OrQbeQg0yPIwHTwO7Qm 1RvqRbQayxvbRloLFu3qB+PCpzJE1h/QrlXinZ4CKe6czjLIWXXI3nJJ9bzKWK0uqupH aYSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E4iGXnR9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww2-20020a170907084200b0084cbde35b49si5551664ejb.990.2023.01.16.03.57.01; Mon, 16 Jan 2023 03:57:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E4iGXnR9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230517AbjAPK55 (ORCPT + 51 others); Mon, 16 Jan 2023 05:57:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbjAPK5h (ORCPT ); Mon, 16 Jan 2023 05:57:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B9AB59EB for ; Mon, 16 Jan 2023 02:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673866614; 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: in-reply-to:in-reply-to:references:references; bh=dMSn7PTMEvVVrQFt74Q3u3R9ASe6C2Dbwlt9UzpnyIA=; b=E4iGXnR9nhkj1uoUO0Koi77Rlmn5o5/uJZy8HOnAPGwO9Jtm1Dcgb7dl5RIkbIxCTMcxI0 KAh0JBIjmx+gGqo8Xrd46YkA+29mx0A8h+uEgI1LjpQRqnZ4121D2vSZbYjj7OWFgfajBE dwykXVj9KngpXGnCk/1MHNzK4NyfLJM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-131-Xw_dsNCgOiuaYGOnxBKnEQ-1; Mon, 16 Jan 2023 05:56:51 -0500 X-MC-Unique: Xw_dsNCgOiuaYGOnxBKnEQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 600553814944; Mon, 16 Jan 2023 10:56:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BEAE651FF; Mon, 16 Jan 2023 10:56:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6ABEB18017F5; Mon, 16 Jan 2023 11:56:48 +0100 (CET) Date: Mon, 16 Jan 2023 11:56:48 +0100 From: Gerd Hoffmann To: "Kirill A. Shutemov" Cc: Dionna Glaze , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, x86@kernel.org, jiewen.yao@intel.com, devel@edk2.groups.io, Ard Biescheuvel , "Min M. Xu" , James Bottomley , Tom Lendacky , Erdem Aktas , Dave Hansen Subject: Re: [PATCH v2] x86/efi: Safely enable unaccepted memory in UEFI Message-ID: <20230116105648.63hsxnmj2juwudmu@sirius.home.kraxel.org> References: <20230113212926.2904735-1-dionnaglaze@google.com> <20230113222024.rp2erl54vx3grdbd@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113222024.rp2erl54vx3grdbd@box.shutemov.name> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 On Sat, Jan 14, 2023 at 01:20:24AM +0300, Kirill A. Shutemov wrote: > On Fri, Jan 13, 2023 at 09:29:26PM +0000, Dionna Glaze wrote: > > This patch depends on Kirill A. Shutemov's series > > > > [PATCHv8 00/14] mm, x86/cc: Implement support for unaccepted memory > > > > The UEFI v2.9 specification includes a new memory type to be used in > > environments where the OS must accept memory that is provided from its > > host. Before the introduction of this memory type, all memory was > > accepted eagerly in the firmware. In order for the firmware to safely > > stop accepting memory on the OS's behalf, the OS must affirmatively > > indicate support to the firmware. > > I think it is a bad idea. > > This approach breaks use case with a bootloader between BIOS and OS. > As the bootloader does ExitBootServices() it has to make the call on > behalf of OS when it has no idea if the OS supports unaccepted. Nothing breaks, it'll error on the safe side. If the protocol callback is not called the firmware will simply accept all memory. The guest OS will only see unaccepted memory if it explicitly asked for it (assuming the firmware wants know to support both cases, of course the firmware could also enforce the one or the other and just not offer the protocol). > Note that kexec is such use-case: original kernel has to make a > decision on whether it is okay to leave some memory unaccepted for the > new kernel. Not sure what you are trying to tell. The kexec case doesn't go through the efi stub anyway. > And we add this protocol to address very temporary problem: once > unaccepted memory support get upstream it is just a dead weight. Maybe, maybe not. unaccepted memory support has a Kconfig switch after all. If we figure in 3-5 years that all distros have enabled it anyway we can drop it again. For the transition period it will surely be useful. take care, Gerd