linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: jeffxu@chromium.org
Cc: akpm@linux-foundation.org, vbabka@suse.cz,
	lorenzo.stoakes@oracle.com, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org, linux-mm@kvack.org,
	jorgelo@chromium.org, keescook@chromium.org,
	pedro.falcato@gmail.com, rdunlap@infradead.org
Subject: Re: [PATCH v1] mseal: move can_do_mseal to mseal.c
Date: Thu, 5 Dec 2024 23:25:43 -0500	[thread overview]
Message-ID: <2m3zmlehfigs5r7rptwcoft3j4fipfkgfxmdrdttpf76hwhwae@vclfa5ulcmv2> (raw)
In-Reply-To: <20241206013934.2782793-1-jeffxu@google.com>

* jeffxu@chromium.org <jeffxu@chromium.org> [241205 20:39]:
> From: Jeff Xu <jeffxu@chromium.org>
> 
> No code logic change.
> 
> can_do_mseal is called exclusively by mseal.c,
> and mseal.c is compiled only when CONFIG_64BIT flag is
> set in makefile. Therefore, it is unnecessary to have
> 32 bit stub function in the header file.

There is no reason to keep this function at all; it is used in one
place, and that place uses three lines of code as well.

In fact, having it separate from the comment about flags being reserved
makes the function very puzzling.

> 
> Signed-off-by: Jeff Xu <jeffxu@chromium.org>
> ---
>  mm/internal.h | 16 ----------------
>  mm/mseal.c    |  8 ++++++++
>  2 files changed, 8 insertions(+), 16 deletions(-)
> 
> diff --git a/mm/internal.h b/mm/internal.h
> index 74dc1c48fa31..5e4ef5ce9c0a 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1457,22 +1457,6 @@ void __meminit __init_single_page(struct page *page, unsigned long pfn,
>  unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
>  			  int priority);
>  
> -#ifdef CONFIG_64BIT
> -static inline int can_do_mseal(unsigned long flags)
> -{
> -	if (flags)
> -		return -EINVAL;
> -
> -	return 0;
> -}
> -
> -#else
> -static inline int can_do_mseal(unsigned long flags)
> -{
> -	return -EPERM;
> -}
> -#endif
> -
>  #ifdef CONFIG_SHRINKER_DEBUG
>  static inline __printf(2, 0) int shrinker_debugfs_name_alloc(
>  			struct shrinker *shrinker, const char *fmt, va_list ap)
> diff --git a/mm/mseal.c b/mm/mseal.c
> index 81d6e980e8a9..e167220a0bf0 100644
> --- a/mm/mseal.c
> +++ b/mm/mseal.c
> @@ -158,6 +158,14 @@ static int apply_mm_seal(unsigned long start, unsigned long end)
>  	return 0;
>  }
>  
> +static inline int can_do_mseal(unsigned long flags)
> +{
> +	if (flags)
> +		return -EINVAL;
> +
> +	return 0;
> +}
> +
>  /*
>   * mseal(2) seals the VM's meta data from
>   * selected syscalls.
> -- 
> 2.47.0.338.g60cca15819-goog
> 


  reply	other threads:[~2024-12-06  4:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06  1:39 jeffxu
2024-12-06  4:25 ` Liam R. Howlett [this message]
2024-12-06  9:12   ` Lorenzo Stoakes
2024-12-06 16:17     ` Jeff Xu
2024-12-06 17:04       ` Lorenzo Stoakes
2024-12-11  2:38         ` Jeff Xu
2024-12-11  8:35           ` Lorenzo Stoakes
2024-12-06 16:11   ` Jeff Xu
2024-12-06 19:33     ` [PATCH] mseal: remove can_do_mseal jeffxu
2024-12-06 19:37       ` Jeff Xu
2024-12-06 19:39       ` Lorenzo Stoakes
2024-12-06 19:53         ` Jeff Xu

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=2m3zmlehfigs5r7rptwcoft3j4fipfkgfxmdrdttpf76hwhwae@vclfa5ulcmv2 \
    --to=liam.howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jeffxu@chromium.org \
    --cc=jorgelo@chromium.org \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=pedro.falcato@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=vbabka@suse.cz \
    /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