From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EBFE627A916 for ; Sat, 16 May 2026 07:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778917190; cv=none; b=gGwpM22iOTIWbmOLQCMWXL+ZixjfR+ENxaeVRmHB0NOXx8oU2UZvYUeEGK85uXqZkhSk0zy9UKe9Lm1BLpYfzbQpo2z77xbX3aEo3LKVfrq7ph+o5OH9tJLbpdor03nxL5TxxonSzOLs0RFRr4EnOIZ9z+b2zC/3KsNZ9sl4g7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778917190; c=relaxed/simple; bh=9s5hcQU1qJOng7EpP/1GD0C/FrCAs0eJD5DJJG+YdWc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lRQcJQe1oH2OoKsbOtMno3halfwtuYYo+cO/ntmqow3m3HW7077W9NdbppvI8IEzQmzWZnH+cqQ2Od/ua0eI7ATSxc+0LX2u3uPJZuBsf+OtxzL27HiYOZt87p2zIAdOMFT8bvMiP1/2tOSRSdLRBSjydl9XIom9tPani7BVeZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SOcGyOP3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SOcGyOP3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A082C19425; Sat, 16 May 2026 07:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778917189; bh=9s5hcQU1qJOng7EpP/1GD0C/FrCAs0eJD5DJJG+YdWc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SOcGyOP3uRqRREsFCbj4kXH8iRAplLOSa9T+BwriiMyUVZeM+FfujrtfK2JKkSINy SSWvrbC0Kuv8LsFRvtH3OrIRSdrrenlj56oLuZviMLTO009t1uXT54+CY6bj52Q9YJ jX7dJRSJJf1rQuG7sVEFRL7OB4xaE00YsZDR0AnA6/IYwySA04l5XmeVJwOl1FoVVv t9h7//o80okplijw+v2OJpIWSUs7Dql1EmKoqpNNwENUmwpYvMo7qWrvwUTZGRoA07 d0zVHd53GPaaX0UFCr9jMyhqrZ0c8s4B0lgoZp0AV9E5NOayydAJqrTb7zL5lpYaWv J1lUcJCNSx46A== Date: Sat, 16 May 2026 10:39:43 +0300 From: Mike Rapoport To: Samiullah Khawaja Cc: Pasha Tatashin , Pratyush Yadav , Alexander Graf , David Matlack , open list , "open list:KEXEC HANDOVER (KHO)" , "open list:KEXEC HANDOVER (KHO)" Subject: Re: [PATCH 1/3] kho: Add kunit static stubs Message-ID: References: <20260512195135.804833-1-skhawaja@google.com> <20260512195135.804833-2-skhawaja@google.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: <20260512195135.804833-2-skhawaja@google.com> Hi Sami, On Tue, May 12, 2026 at 07:51:33PM +0000, Samiullah Khawaja wrote: > Add kunit stubs in kho_restore_folio() and kho_restore_pages() so the > users can mock these functions in kunit tests. > > Signed-off-by: Samiullah Khawaja > --- > kernel/liveupdate/kexec_handover.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c > index d5718bef6d4d..1375291d9b07 100644 > --- a/kernel/liveupdate/kexec_handover.c > +++ b/kernel/liveupdate/kexec_handover.c > @@ -11,6 +11,7 @@ > #define pr_fmt(fmt) "KHO: " fmt > > #include > +#include Can we include kunit headers before linux headers? > #include > #include > #include > @@ -437,7 +438,11 @@ static struct page *kho_restore_page(phys_addr_t phys, bool is_folio) > */ > struct folio *kho_restore_folio(phys_addr_t phys) > { > - struct page *page = kho_restore_page(phys, true); > + struct page *page; > + > + KUNIT_STATIC_STUB_REDIRECT(kho_restore_folio, phys); > + > + page = kho_restore_page(phys, true); > > return page ? page_folio(page) : NULL; > } > @@ -459,6 +464,8 @@ struct page *kho_restore_pages(phys_addr_t phys, unsigned long nr_pages) > const unsigned long end_pfn = start_pfn + nr_pages; > unsigned long pfn = start_pfn; > > + KUNIT_STATIC_STUB_REDIRECT(kho_restore_pages, phys, nr_pages); > + > while (pfn < end_pfn) { > const unsigned int order = > min(count_trailing_zeros(pfn), ilog2(end_pfn - pfn)); > -- > 2.54.0.563.g4f69b47b94-goog > -- Sincerely yours, Mike.