Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13145187rwl; Wed, 4 Jan 2023 04:16:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXsfJ0L1z5JPrPHrCC2EU/B2SAQGGKkI+ZoTmu+LBumWqCT633pX9j0ZApw/3It7ZhKtv9Jp X-Received: by 2002:a17:906:53d3:b0:840:db38:bf2a with SMTP id p19-20020a17090653d300b00840db38bf2amr41875857ejo.46.1672834602478; Wed, 04 Jan 2023 04:16:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672834602; cv=none; d=google.com; s=arc-20160816; b=tAhjQ6cPJUWaQnYYvz7fRxAbIjBBtRmm7yr9558c1efdzIahdN8Wp5GMnGmV/rjQh8 cbDsXJQwvzl1vOqBrSSU3+SrR2weatlDE/rIaGGiQ7uy6JgJGEEi9Vf9kJNje2np1S1F qvx2kPLaK7I9V/KPSk7vCdgf8YyNrch471xLMS3Q9RS1YvUqqCjJEja2NKY3TzTHPlTq iNv6sN+SSPFKkDpD1jNXQ23B3uy0gt43vz5KWLAWpjVhO+V5rq2qUCVAJF3aZxd/pfRr s1fGN3q5PkjU4TPqkI8JsxwxclmW3hHJj6UvqE9xBBEnBS8q0zcoTfMGDth+adT/RSY9 NoUA== 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=UKl/CVF+4GJS0LDdyX728sU1J1aGkocy2OklfcAdRtI=; b=bjO0HeMMpSTvN9R7S3D10qKoRY0qUhkP83Rxc+7BtNNAspWRmbPu38sXr4TYTHiPj7 myxxqSLkMUkqxGjxN0hKuwZlKGfnN1lhFxjoax6Ptsg7XjFq05kzTC9MAV4FGcDbeIoN YsMhJ9Ly89DGZdyOB+ADt3qZ1xaLnArwegmEKfgRfh8noTJtY1pwlqXnv8Dip0h+xGoE uvUL88Wiz6WqdagCOb/d/2nADMwi4V/bZKNgLR4LyRBq8jDvVjvxnZ4gigsby/CxM7s+ lnYQnTqU5hfOtCnx3Kcu1TDJcJ+CUKM0B6sQ+M7fmiggzQBdk0JQsOYn/0yS7ynJCgp2 sJzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=VcttLkPN; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm3-20020a170907948300b007be4dd9ef7csi28660986ejc.402.2023.01.04.04.16.29; Wed, 04 Jan 2023 04:16:42 -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=@alien8.de header.s=dkim header.b=VcttLkPN; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234915AbjADL64 (ORCPT + 57 others); Wed, 4 Jan 2023 06:58:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjADL6y (ORCPT ); Wed, 4 Jan 2023 06:58:54 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 817DE1E7 for ; Wed, 4 Jan 2023 03:58:53 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (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 18EC91EC008F; Wed, 4 Jan 2023 12:58:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1672833532; 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=UKl/CVF+4GJS0LDdyX728sU1J1aGkocy2OklfcAdRtI=; b=VcttLkPNy9K1xNdWfFV7Yz0KEUwXXic9v2XG1jbmKgXxKVSo4wcHOiMPPS/Y09Wr2p5SCF 2pmDtdw/423IjVUdnSQ/yOxlJdQFacJj5lXUfKDExPe/KfWSxHLfgoaUswfq1pSyDkPKwR +8kZx8fwKmnCVLzKEVBMtns1UtQy+9g= Date: Wed, 4 Jan 2023 12:58:48 +0100 From: Borislav Petkov To: Dave Hansen Cc: Ross Philipson , linux-kernel@vger.kernel.org, x86@kernel.org, dpsmith@apertussolutions.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, luto@amacapital.net, dave.hansen@linux.intel.com, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com, jailhouse-dev@googlegroups.com, jan.kiszka@siemens.com, xen-devel@lists.xenproject.org, jgross@suse.com, boris.ostrovsky@oracle.com, andrew.cooper3@citrix.com Subject: Re: [PATCH v2 1/2] x86: Check return values from early_memremap calls Message-ID: References: <20221110154521.613472-1-ross.philipson@oracle.com> <20221110154521.613472-2-ross.philipson@oracle.com> <8e62a029-f2fa-0627-1f71-4850a68ec6b6@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8e62a029-f2fa-0627-1f71-4850a68ec6b6@intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Thu, Nov 10, 2022 at 08:07:53AM -0800, Dave Hansen wrote: > On 11/10/22 07:45, Ross Philipson wrote: > > dt = early_memremap(initial_dtb, map_len); > > + if (!dt) { > > + pr_warn("failed to memremap initial dtb\n"); > > + return; > > + } > > Are all of these new pr_warn/err()'s really adding much value? They all > look pretty generic. It makes me wonder if we should just spit out a > generic message in early_memremap() and save all the callers the trouble. Well, let's see. early_memremap() calls __early_ioremap() and that one already warns befofe each NULL return. So I guess we don't need the error messages as we will know where it starts failing. I guess we still need the error handling though. I.e., this above should be: dt = early_memremap(initial_dtb, map_len); + if (!dt) + return; so that we don't go off into the weeds with a NULL ptr. Or? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette