From: Juergen Gross <jgross@suse.com>
To: Pengpeng Hou <pengpeng.hou@isrc.iscas.ac.cn>,
sstabellini@kernel.org, oleksandr_tyshchenko@epam.com
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
18291782795@163.com
Subject: Re: [PATCH] xen/grant-table: scope gnttab suspend and resume helpers to hibernate callbacks
Date: Mon, 9 Mar 2026 09:46:38 +0100 [thread overview]
Message-ID: <a5bfb790-5776-4235-a986-7fecf302b347@suse.com> (raw)
In-Reply-To: <20260309083622.717803-1-pengpeng.hou@isrc.iscas.ac.cn>
[-- Attachment #1.1.1: Type: text/plain, Size: 2035 bytes --]
On 09.03.26 09:36, Pengpeng Hou wrote:
> From: pengpeng.hou@isrc.iscas.ac.cn
>
> In current linux.git (1954c4f01220), gnttab_suspend() and
> gnttab_resume() are defined and declared unconditionally. However,
> their only in-tree callers reside in drivers/xen/manage.c, which are
> guarded by #ifdef CONFIG_HIBERNATE_CALLBACKS.
>
> Match the helper scope to their callers by wrapping the definitions in
> CONFIG_HIBERNATE_CALLBACKS and providing no-op stubs in the header. This
> fixes the config-scope mismatch and reduces the code footprint when
> hibernation callbacks are disabled.
>
> Signed-off-by: pengpeng.hou@isrc.iscas.ac.cn
> ---
> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> --- a/drivers/xen/grant-table.c
> +++ b/drivers/xen/grant-table.c
> @@
> -int gnttab_resume(void)
> +#ifdef CONFIG_HIBERNATE_CALLBACKS
> +int gnttab_resume(void)
> {
> gnttab_request_version();
> return gnttab_setup();
> @@
> if (xen_pv_domain())
> gnttab_interface->unmap_frames();
> return 0;
> }
> +#endif
>
> static int gnttab_expand(unsigned int req_entries)
> {
> diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
> --- a/include/xen/grant_table.h
> +++ b/include/xen/grant_table.h
> @@
>
> int gnttab_init(void);
> +#ifdef CONFIG_HIBERNATE_CALLBACKS
> int gnttab_suspend(void);
> int gnttab_resume(void);
> +#else
> +static inline int gnttab_suspend(void)
> +{
> + return 0;
> +}
> +
> +static inline int gnttab_resume(void)
> +{
> + return 0;
> +}
> +#endif
>
> int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
> int readonly);
>
>
I do agree on the purpose of the patch, but the patch itself is a little
bit strange. The hunks lack any information about line numbers and hunk
size, and the context is not consistent (0 - 4 lines of unmodified code
around the modified parts).
Please produce the patch with a proper tool, like "git format-patch".
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
prev parent reply other threads:[~2026-03-09 8:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 8:36 Pengpeng Hou
2026-03-09 8:46 ` Juergen Gross [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5bfb790-5776-4235-a986-7fecf302b347@suse.com \
--to=jgross@suse.com \
--cc=18291782795@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksandr_tyshchenko@epam.com \
--cc=pengpeng.hou@isrc.iscas.ac.cn \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®