Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp601799iog; Wed, 15 Jun 2022 08:29:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uzPTOHsmE2BfSpp75tebtrpjUvJCZgnr5ZSPtxv+h+xIKOiXI1FJTgspAvgcIgPzGlUZma X-Received: by 2002:a17:906:9493:b0:70c:4ddf:5d5d with SMTP id t19-20020a170906949300b0070c4ddf5d5dmr305357ejx.73.1655306975416; Wed, 15 Jun 2022 08:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655306975; cv=none; d=google.com; s=arc-20160816; b=xW7NXMXFiK98P0PSZMlmaxyK12nJGAYlKLRE4wunjBRlEOZELhujnwVI35kc8aiIgb Og/JHiNfoLbulXcnpC50WDkZKfi7B22j/nT7mfwGp3gjcEBGEjXxukgykHzH/GX97qje +/AwYVyfchGiaNbgDSWIkDy1TwmJbxgIFSDEFvgl4h/LqG9OsYv//9o/xmlRRYJQz+gq UYzpCyc2XUO0AXQADAYGN45DNxl2l21+wJ1+fOGBVaaU9dc1xwpCk1ZFFSsAJ+sOD5gB XZ6jHyOzgggWsqaK8q0cO1FJzDaJVlT3jKtvIVR3fgTOqbsCaYAZ+arbyefLK/Tpx0Yx 6O1Q== 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=+ZUiH7xUjYjG63QUOQNlcHltjn5KoG/fwg1/o9vk8ew=; b=YYy1HkRXa/YYGNz4KcQundLLyxNxLV5Y7AkxxzQEijYX2OGOR69I7H/GHfXpSkPtu8 mk96Xsx37HhKBJc0BioDZNJFHyymDrdG4iWMZAC5Hgewnitj4Muit3i+8S5l13ZYZXsr Dh6XKAfKuj4XyyyzcXY5F33BZFggK7y848ZqlN2e9RcqUfmpeSRVOfqAk9WBQE7go8Yy +Rbn4k155LC2GWXZeENPsezmrt5z6o3fnacg6/gyRXj/ahLv+OXZdZu7dVikY1e2giVi mkruHi/XqKGOVPabmKx7aG0agguXOKfMk/Fs8icrQ8hQUZ4mkjNP/Opsrtiz8qCPoZsj 9O+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=gmM5PYGK; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020aa7d993000000b0042ab868c6fesi16013786eds.74.2022.06.15.08.29.09; Wed, 15 Jun 2022 08:29:35 -0700 (PDT) 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=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=gmM5PYGK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345017AbiFOPDk (ORCPT + 99 others); Wed, 15 Jun 2022 11:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234402AbiFOPDg (ORCPT ); Wed, 15 Jun 2022 11:03:36 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F26B3190B for ; Wed, 15 Jun 2022 08:03:28 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id h23so13605520ljl.3 for ; Wed, 15 Jun 2022 08:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+ZUiH7xUjYjG63QUOQNlcHltjn5KoG/fwg1/o9vk8ew=; b=gmM5PYGKhtiKN/GQbdXDENmVjVligh9DIPiQkG8g9EDUaaAsjjHXs85qVkWWbbgi+B nszrQbXgZRqTwAgSVchLmIr1m8NPS9bv1EsKB+/xz7kNOjgnEcOt3TRr3ysREOzDAeRh bEnhDJ1ESjIS6/vP+qs+svbNVimu+a8X1ilLtTXxAt2+7vonJ+je4mAzwOZe0I5DBayV LaifTuCEM8AsEcmaD0lCMRhjg/POC/AoBLOb1N+6qWIrQl+g55UKPUvA0EgFMmu7yl4S ygVcSI0g+8rzQy4hxPbmjMblUCycMgOwWgGfW7dOebiG5auWZDOu0mAq02s1hm6IBcs3 ipIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+ZUiH7xUjYjG63QUOQNlcHltjn5KoG/fwg1/o9vk8ew=; b=3azCEnq367rtRmyfMaHIzyfGSpKwdbjTQxnkpY17wJilooF5KVnbYOKq0Y4YeOWAou Mg7GLFcovSuZe72i+Ev+wPBtGLrBaJGxTSLycEFzhAQyn5fkhm82YIYGc0zWxQW2qdR0 RJPhbRzKz7wt3HWhvgtWuCMmt1JkkLxj523SaizF1PL9mkfLBbPhh8zZfqnGcJW+Ur/5 oXb6qaREtZ1WjUvd6FGzsPg1/2FjbS9UFEDugF07soxKwRrWZCA/RXp+pz4tbQb/hPIU JeK+ibTuQepNctaeDspW07ctxZnvsr1deRO37CighFM2hYE2ANiUrVirD6lt+zM401JY tGLw== X-Gm-Message-State: AJIora/7I9Tv7wTAlXatdcyJFqukEEgW8s7HQMWffoMHQ4LMHuUPj2El QL4EjuhQaYLhQT9kiYtQ/7R9vQ== X-Received: by 2002:a2e:22c6:0:b0:258:fd28:b253 with SMTP id i189-20020a2e22c6000000b00258fd28b253mr85119lji.418.1655305406697; Wed, 15 Jun 2022 08:03:26 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id k13-20020a2e92cd000000b002556e77236dsm1670253ljh.62.2022.06.15.08.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 08:03:25 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id EFD7A103B9F; Wed, 15 Jun 2022 18:05:34 +0300 (+03) Date: Wed, 15 Jun 2022 18:05:34 +0300 From: "Kirill A. Shutemov" To: Peter Zijlstra Cc: "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , Dave Hansen , Mike Rapoport , David Hildenbrand , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv7 05/14] x86/boot: Add infrastructure required for unaccepted memory support Message-ID: <20220615150534.ylkref3runa4kmyj@box.shutemov.name> References: <20220614120231.48165-1-kirill.shutemov@linux.intel.com> <20220614120231.48165-6-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Wed, Jun 15, 2022 at 12:19:45PM +0200, Peter Zijlstra wrote: > On Tue, Jun 14, 2022 at 03:02:22PM +0300, Kirill A. Shutemov wrote: > > Pull functionality from the main kernel headers and lib/ that is > > required for unaccepted memory support. > > > > This is preparatory patch. The users for the functionality will come in > > following patches. > > > > Signed-off-by: Kirill A. Shutemov > > --- > > arch/x86/boot/bitops.h | 40 ++++++++++++ > > arch/x86/boot/compressed/align.h | 14 +++++ > > arch/x86/boot/compressed/bitmap.c | 43 +++++++++++++ > > arch/x86/boot/compressed/bitmap.h | 49 +++++++++++++++ > > arch/x86/boot/compressed/bits.h | 36 +++++++++++ > > arch/x86/boot/compressed/compiler.h | 9 +++ > > arch/x86/boot/compressed/find.c | 54 ++++++++++++++++ > > arch/x86/boot/compressed/find.h | 80 ++++++++++++++++++++++++ > > arch/x86/boot/compressed/math.h | 37 +++++++++++ > > arch/x86/boot/compressed/minmax.h | 61 ++++++++++++++++++ > > arch/x86/boot/compressed/pgtable_types.h | 25 ++++++++ > > That's quite a lot of duplicated code; is there really no way so share > this? Code duplication also make me uncomfortable. But that what Borislav wanted to see. efi.h in the boot stub which copies bulk of also sets the trend in the direction. Alternative is creating a subset of headers that can be used in both in main kernel and boot stub. It is more complex and doesn't allow for short cuts that can be made on copy if you know the context it is used in. It also sounds painfully similar to uapi/ project. I'm not sure we want to go this path. -- Kirill A. Shutemov