Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp344049iog; Wed, 15 Jun 2022 03:30:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uLr1rZt3HP1JcxtmcpMvLJwN5z0Ef+CiSABsk1LKH9W79QFKvCeg1L+LjovgFa1SmFNyNH X-Received: by 2002:a17:902:d48b:b0:167:770b:67d with SMTP id c11-20020a170902d48b00b00167770b067dmr8596652plg.162.1655289019185; Wed, 15 Jun 2022 03:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655289019; cv=none; d=google.com; s=arc-20160816; b=hMtpeMsMgw7WjrOhM3jLmPpvzx7w1e5a8LOLKgNP5rKTvuS9nQKxEDYqBBru4ylhxv 3fftFaqDrXH8raiDqyxsiKgtAdrLM2kw6d6rL0qIJ7H0jGI764ltMOXkmpPxIxL07i/V NIrU+HR+NS5eEnscVMJJboDB7TKgyhevUj8F2doY/2WM3zarfZmzWpC08C5JenXISMAk /vHc/rELCXwJ5/XU771rcD6bn+jbAGJgjpqHrsz+ZHK9ciA4A0DvQs6PWiD5XLHBmG9O QqHNbPokby2OTz0EioQypisooizMoC/ni3pmLUXC1L9ZeRDYzz2nn7J5A/D7gcuvhMZb 4+Ww== 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=OTj5z30HkEHTzFiSxL8zrtVzrsYfnlyDuMzdm361bU0=; b=HjGHB595322bsqoWdXSMLuVwpg07ZUBaOGWa4Yi/v8Kh59BYrL70txOojIOvtGomvL pOFZ+8Al0esKwdQw4tUWgKRsadZk9HNeINAQy2wD3XN+N36arIrxc+P2Eof881Xzo6OR h6yimobDSi1lnvdktg512PQZqmAYUWzaiQy86qUZuLWv9/OeJLaKOmXG9FKA+X3VWawh uql4C3xrzEWzyN4fi+Do048/kvj9gVLVI3BDVUehZ7M4/TmI3gLkYBfWmTNfJAkRmYg3 sTDjuwV6OPq4ef7BtGIY7fbSQfPATTLhigiNMRSrIGOPXrMZmqD+ySbcWQOSQyScGMeG 3D5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=HCUls9Lz; 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 h70-20020a636c49000000b004051797ce4asi16602597pgc.654.2022.06.15.03.30.06; Wed, 15 Jun 2022 03:30:19 -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=@infradead.org header.s=casper.20170209 header.b=HCUls9Lz; 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 S1347677AbiFOKVh (ORCPT + 99 others); Wed, 15 Jun 2022 06:21:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347946AbiFOKUs (ORCPT ); Wed, 15 Jun 2022 06:20:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F7464E397; Wed, 15 Jun 2022 03:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OTj5z30HkEHTzFiSxL8zrtVzrsYfnlyDuMzdm361bU0=; b=HCUls9LzF3Ps7n0VKUrnzevomJ ia+L7aZ6++crtm+I+wasUYBWPh4AONMp82XIzv46xzbr01uby2v9ZiREiWfuzUzGt3xvdb+xXDpTx Ys5ExBktr3NiVd3FTPKxiQFYFafBmQzU4CmKSgypkau70lUhzVwL4xFYfp13PoBtiK60KPa2492ik EWetzqpBqWUpLY9Rd0yKtpw/HIuYRRbaE11vYU5KnLQVEh6T62LQ0SJ8Saj/n4m0NN/8Rb1trWyy8 ujTRzVQCCrKXBehhcJBgGpLLblOsGcwZPb8tcKk5+Lnp+vGBLVChofkwqzoA6VvFvPZEmEY5SC/7Y XIDLNMTA==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1Q7n-000yG9-2r; Wed, 15 Jun 2022 10:19:47 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E9F553007C6; Wed, 15 Jun 2022 12:19:45 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D38BF201A4F6D; Wed, 15 Jun 2022 12:19:45 +0200 (CEST) Date: Wed, 15 Jun 2022 12:19:45 +0200 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: 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: 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: <20220614120231.48165-6-kirill.shutemov@linux.intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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?