Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2423116rwd; Fri, 2 Jun 2023 09:10:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ZXmH/iSoyfMXDNPUJcnnYcZ755ncv+9FUhEb3yEvquYMUai0FZc9TlogOIoa2vjut4Egc X-Received: by 2002:a17:902:6b0a:b0:1b0:4b65:7a10 with SMTP id o10-20020a1709026b0a00b001b04b657a10mr360898plk.53.1685722243980; Fri, 02 Jun 2023 09:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685722243; cv=none; d=google.com; s=arc-20160816; b=nPW2/Yu8zZmA4T6MlVE+vZHc7NjdnwJQw1hD4Iv2o/a5dbCnWWxUNLJ5ulLwXbrcUp hpf7PlG390cvbOAjg+e4yhJAN1Fk74EaQ6uUX6BcNN8VjH+ne2xihfPkiy3YHLvAD8KL xDxKhKGvuvpGgaXUVIcNHa2chk7pVKtEcLcgbmOaFTitxUkT0QCRZahgcYoXLp/yr/9g +7M0sdzbDfM2SeN600zvA4/F15G7HayX/klgdfBZ4PP5L7f12pVk5UE6BvtsRRw8WXr3 iOrO4nODmLuhw8l7yZ8F0bINUyLfOEo5HaoU4813Z36TluS9ffQ2xL6VAHD0HOpYE9i7 zvUA== 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=Xu4XCvM1sAiwB/WfAq5MbMKHo8Vx2G01mpn67g5+mLc=; b=Nnd1C3BFUHyYa3X2Kd3MiYCvSntDz4/rA+MSOpTgM5/OaNEEreFPbPYQ1FlWLszFDE XNwm1OsClEL2vA9WzfvoWa1VBfNtZ+VRRZ0C04Sz0zHXPBkpHIstGWEfkLWfDIJtydeL wvamjkpG+hsz5sAKhuzDy/IsHiHlzDMfLD+icC6fEmyZAkR00/KvCSJwSTKqFWIt0l8n d0283ApGwJh7Ui6zG50llozPkMUBUJOCpqepc+5lTORPiP9vKFzJsc+zNfxihXZtWzm6 7E5osUjdDj/dHQmeVNEWqTwhKCFTJNBdnMhSyRwHmMsGnOiIHsa/FFsSYBouoKl1B3ph TGDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@alien8.de header.s=dkim header.b=XNFq0zye; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a8-20020a170902ecc800b001b0732ccd7esi1124228plh.379.2023.06.02.09.10.30; Fri, 02 Jun 2023 09:10:43 -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=temperror (no key for signature) header.i=@alien8.de header.s=dkim header.b=XNFq0zye; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236454AbjFBQJF (ORCPT + 99 others); Fri, 2 Jun 2023 12:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236410AbjFBQJE (ORCPT ); Fri, 2 Jun 2023 12:09:04 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09127BC; Fri, 2 Jun 2023 09:09:03 -0700 (PDT) Received: from zn.tnic (pd9530d32.dip0.t-ipconnect.de [217.83.13.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 092F01EC0333; Fri, 2 Jun 2023 18:09:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1685722141; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Xu4XCvM1sAiwB/WfAq5MbMKHo8Vx2G01mpn67g5+mLc=; b=XNFq0zyeMW0Rzi8qdgeGXSA3AM7MDd19unhJsTI0DQezaVNRgx0+TUvw6/qhFDedLPY4XM wkZnKYWcXoIP+yql921r/5tJ9amPai4rDZiK02xaMyVnjo9hXgW4Dzh/X07T0kNLWVBzXq dH1lwHdt6qW1gzCnVhUSoieE8MKsZ4A= Date: Fri, 2 Jun 2023 18:09:00 +0200 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: Ard Biesheuvel , Andy Lutomirski , Dave Hansen , Sean Christopherson , Andrew Morton , Joerg Roedel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , David Hildenbrand , Mel Gorman , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, aarcange@redhat.com, peterx@redhat.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Liam Merwick Subject: Re: [PATCHv13 4/9] x86/boot/compressed: Handle unaccepted memory Message-ID: <20230602160900.GEZHoUHHpPKMnzV3bs@fat_crate.local> References: <20230601182543.19036-1-kirill.shutemov@linux.intel.com> <20230601182543.19036-5-kirill.shutemov@linux.intel.com> <20230602140641.GKZHn3caQpYveKxFgU@fat_crate.local> <20230602153644.cbdicj2cc6p6goh3@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230602153644.cbdicj2cc6p6goh3@box.shutemov.name> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, Jun 02, 2023 at 06:36:44PM +0300, Kirill A. Shutemov wrote: > I don't see why it is simpler. It looks unnecessary noisy to me. Noisy? I have no clue what you mean. It is regular: if (bla && flu) vs if (bla) return flu(); It is about having regular patterns which can be recognized at a quick glance by those who get to stare at that code constantly. > Configuration table suppose to be present, even if unaccepted memory is > not supported. Something is very wrong if it is missing. I am not sure if it is the decompressor's job to do such validation - I guess this is something the EFI code should do. > I will downgrade it warn(). Yes, or simply return here without accepting memory - plain and simple. > I wanted to keep unaccepted_table private to the libstub/unaccepted_memory.c. > The setter provides a good spot for documentation to guide unaccepted > memory enablers for other archs. > > Still want replace it with direct assignment? No clue. Why would you want to keep a variable in the libstub private which is not even in kernel proper, AFAICT? > Okay, I will make init_unaccepted_memory() return true if unaccepted > memory is present and hide defined it always-false for !UNACCEPTED_MEMORY. > So this hunk will look this way: > > if (init_unaccepted_memory()) { > debug_putstr("Accepting memory... "); > accept_memory(__pa(output), __pa(output) + needed_size); > } Yap, thanks. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette