From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB4B57A for ; Wed, 15 Jun 2022 15:03:28 +0000 (UTC) Received: by mail-lj1-f172.google.com with SMTP id s10so13559845ljh.12 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=Hy2mlxoE/LpMxPXfX5ui+DSfZsRTM5IHcspYcqsE951eHhAMyBJy5DkoqNESYv4xlH QDvn+DOFJCz5M8dtcndMjjaFcQqIBGZuxZXPCHidu18mu1SN54u9c38S4H0+KuBxUEve mtfjiFkLEsu8+KAddF/luiOhQduPv3ekwzqLDDLNm56EzNUpVfISZ9KwYTCAeCujZmle c48gS+U4VmqJEBXcFYIch3oxhxk/cXGsYwr4Lwv5wlfsCZFv9GOsEJSAV1Z+6szH4QzV E9TSUyJe4TRmFE3IazTpD58qJYMi7mfQdiCJczmehsT7f/P3ELoboBNnXBVYhNi3K+c1 V1cw== X-Gm-Message-State: AJIora/IaSJPELpcVo+o5QI7pePjPByJzdtUlsoSsweC5Q75WarKSFe5 U1+DuLR/yRA+349Gbf8QeDrIAw== X-Google-Smtp-Source: AGRyM1uaqkfz9EUjbtFXt3ETq72/vRGrVuX/XEUXnzqPAo5EoI+iVXmhnWWWeIjIy+Gowg+91p1KrQ== 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> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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