From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E8CECA0EEB for ; Thu, 21 Aug 2025 10:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iHkbj41Kh3yJaLj8nTXZWWFLEJs9EarVkmAtxTUg4F8=; b=m3S19NTQLCK9N3HYfjxzea3O84 DoXK/Vi/Q83yD6uYh2QANQ14VnKX8r73nZZfuQ2rwoYEhRVQ6OjnSy57VHEKmXbA1/gdeG7p5HR+e ZerKtx04y12lkWpPf3RdGZ8/0GnfVcDt4NxL6SrsahdykjIGFGf7cAfvdl9B/x2LSGOA3fzSywM/n bPdAgljssIbuTXy1/qpf8P/onVEx0D/LOi7e61JLPunKTxXnrzlZfyQUtA+5RefILX/zVIiS+S16t QvyHNgiejtS4n/lD6S7GbXxlH3DlHoevVjYhPd4Cp4liKZ6+4KizgYlvC5vIlLWo0z/3XiIDcY47K BIitlbOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1up2Xg-0000000Gc6B-1x9k; Thu, 21 Aug 2025 10:29:12 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1up0jy-0000000GGVB-2gpB for kexec@lists.infradead.org; Thu, 21 Aug 2025 08:33:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755765221; 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: in-reply-to:in-reply-to:references:references; bh=iHkbj41Kh3yJaLj8nTXZWWFLEJs9EarVkmAtxTUg4F8=; b=enVuY8+7GWHqah6VuIrStl6NIETfJNgJg6lk1WLO8mj1BMAS/crPRoOcrd69+QSXHbmbd3 C3sS1cREc7LI9jS3tf799zrrbMt8as4B5muwmD3a2Lr3RrkYQzG26cnUyNwZAC3CwJpR/F JkgEEqGrWn1mGkTa/iIiGSgrlPttd7s= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-156-W112auD0NF6QiV5OPsKlWA-1; Thu, 21 Aug 2025 04:33:37 -0400 X-MC-Unique: W112auD0NF6QiV5OPsKlWA-1 X-Mimecast-MFC-AGG-ID: W112auD0NF6QiV5OPsKlWA_1755765215 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A25D019560B2; Thu, 21 Aug 2025 08:33:34 +0000 (UTC) Received: from localhost (unknown [10.72.112.99]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9E6BE180029D; Thu, 21 Aug 2025 08:33:32 +0000 (UTC) Date: Thu, 21 Aug 2025 16:33:26 +0800 From: Baoquan He To: Andrew Morton , Brian Mak Cc: Dave Young , Alexander Graf , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Rob Herring , Saravana Kannan , x86@kernel.org, kexec@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] kexec: Add KEXEC_FILE_NO_CMA as a legal flag Message-ID: References: <20250805211527.122367-1-makb@juniper.net> <20250805211527.122367-2-makb@juniper.net> <20250820214756.5c7b551e4723d9f0b5dd55e3@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250820214756.5c7b551e4723d9f0b5dd55e3@linux-foundation.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250821_013346_749052_4755723E X-CRM114-Status: GOOD ( 23.64 ) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org On 08/20/25 at 09:47pm, Andrew Morton wrote: > On Tue, 5 Aug 2025 14:15:26 -0700 Brian Mak wrote: > > > Commit 07d24902977e ("kexec: enable CMA based contiguous allocation") > > introduces logic to use CMA-based allocation in kexec by default. As > > part of the changes, it introduces a kexec_file_load flag to disable the > > use of CMA allocations from userspace. However, this flag is broken > > since it is missing from the list of legal flags for kexec_file_load. > > kexec_file_load returns EINVAL when attempting to use the flag. > > > > Fix this by adding the KEXEC_FILE_NO_CMA flag to the list of legal flags > > for kexec_file_load. > > > > Fixes: 07d24902977e ("kexec: enable CMA based contiguous allocation") > > A description of the userspace-visible runtime effects of this bug > would be very helpful, please. A lot more than "is broken"! > > Also, could we please have some reviewer input on this change? I didn't receive this patchset, and kexec mailing list is not in CC. I don't know what happened. > > > > --- a/include/linux/kexec.h > > +++ b/include/linux/kexec.h > > @@ -460,7 +460,8 @@ bool kexec_load_permitted(int kexec_image_type); > > > > /* List of defined/legal kexec file flags */ > > #define KEXEC_FILE_FLAGS (KEXEC_FILE_UNLOAD | KEXEC_FILE_ON_CRASH | \ > > - KEXEC_FILE_NO_INITRAMFS | KEXEC_FILE_DEBUG) > > + KEXEC_FILE_NO_INITRAMFS | KEXEC_FILE_DEBUG | \ > > + KEXEC_FILE_NO_CMA) > > > > /* flag to track if kexec reboot is in progress */ > > extern bool kexec_in_progress; > > -- > > 2.25.1 > > >