From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 218731632D9 for ; Wed, 8 Jan 2025 11:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736336380; cv=none; b=nPjTZGAf4V9aeLXOhub8U8DSWY4s5/tGFrkoSo01g3CqRR5L7qFNglSVv7zNyaPPNn3xZJ1ERuMrI6qnIVrD+pfdYtWOh5F0e3BABOECUWwbo4fcLIgBJp5Io0KXSgVzZ8bPx+Ynxv73KKW5lprnPLjkq0JFfrQuLhcWB1XBsLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736336380; c=relaxed/simple; bh=0WPUPlP24csFN3yG5ownXP0xhJLNmNv7vuguTATIGkE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DBK4kluvgd1YtUvOd4YMaqMTRZ8a11+k7wMnsvmoLHm/nnFy24j96+bO90r1q7Pt3Pi23niM3wdF+wXRt0nfMulHW6gM+0gATR77HeXys+qknqSjNnIVcIi0JZoJMj3+4Oresv7W0RSmneivyHMdHjAMQN//PlKF+G6rtfyE2/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Fp1EQrVS; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Fp1EQrVS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736336378; 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=uA4of6RlcxZAbgA2Z8vduXo/qnfVApJjLKxtUFTyI38=; b=Fp1EQrVSW4EiLSeUY0LdgFd/c2FuWPq452ak0RRWC836W3RqXsHWRuq+gGEyon6VKf/OWu qLR60EZbCcIALtf9aFiBYHcA63hHHh9XZXRRk+n6+uCHceDZpIrD37GGjE4THYkojhEUNW ial8Bzh3GuKsB0wZMENjZ/5qezPjDcw= Received: from mx-prod-mc-04.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-686-iWpE5GpyP-m3fwd1BjczMg-1; Wed, 08 Jan 2025 06:39:32 -0500 X-MC-Unique: iWpE5GpyP-m3fwd1BjczMg-1 X-Mimecast-MFC-AGG-ID: iWpE5GpyP-m3fwd1BjczMg Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ACDA719560B4; Wed, 8 Jan 2025 11:39:30 +0000 (UTC) Received: from localhost (unknown [10.72.112.99]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4F4E419560AA; Wed, 8 Jan 2025 11:39:11 +0000 (UTC) Date: Wed, 8 Jan 2025 19:38:13 +0800 From: Baoquan he To: Sourabh Jain Cc: linuxppc-dev@lists.ozlabs.org, Andrew Morton , Hari Bathini , Madhavan Srinivasan , Michael Ellerman , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND v1 5/5] crash: option to let arch decide mem range is usable Message-ID: References: <20250108101458.406806-1-sourabhjain@linux.ibm.com> <20250108101458.406806-6-sourabhjain@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250108101458.406806-6-sourabhjain@linux.ibm.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 01/08/25 at 03:44pm, Sourabh Jain wrote: ...snip... > diff --git a/include/linux/kexec.h b/include/linux/kexec.h > index f0e9f8eda7a3..407f8b0346aa 100644 > --- a/include/linux/kexec.h > +++ b/include/linux/kexec.h > @@ -205,6 +205,15 @@ static inline int arch_kimage_file_post_load_cleanup(struct kimage *image) > } > #endif > > +#ifndef arch_check_excluded_range > +static inline int arch_check_excluded_range(struct kimage *image, > + unsigned long start, > + unsigned long end) > +{ > + return 0; > +} > +#endif > + > #ifdef CONFIG_KEXEC_SIG > #ifdef CONFIG_SIGNED_PE_FILE_VERIFICATION > int kexec_kernel_verify_pe_sig(const char *kernel, unsigned long kernel_len); > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > index 3eedb8c226ad..52e1480dbfa1 100644 > --- a/kernel/kexec_file.c > +++ b/kernel/kexec_file.c > @@ -464,6 +464,12 @@ static int locate_mem_hole_top_down(unsigned long start, unsigned long end, > continue; > } > > + /* Make sure this does not conflict exclude range */ ^ Make sure this doesn't conflict with excluded range? > + if (arch_check_excluded_range(image, temp_start, temp_end)) { > + temp_start = temp_start - PAGE_SIZE; > + continue; > + } > + > /* We found a suitable memory range */ > break; > } while (1); > @@ -498,6 +504,12 @@ static int locate_mem_hole_bottom_up(unsigned long start, unsigned long end, > continue; > } > > + /* Make sure this does not conflict exclude range */ ^ Ditto. > + if (arch_check_excluded_range(image, temp_start, temp_end)) { > + temp_start = temp_start + PAGE_SIZE; > + continue; > + } > + > /* We found a suitable memory range */ > break; > } while (1); > -- > 2.47.1 >