All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-s390x@nongnu.org
Subject: [PULL 5/6] softmmu/physmem: Remove the ifdef __linux__ around the pagesize functions
Date: Tue, 30 Aug 2022 19:19:46 +0200	[thread overview]
Message-ID: <20220830171947.71464-6-thuth@redhat.com> (raw)
In-Reply-To: <20220830171947.71464-1-thuth@redhat.com>

Now that host_memory_backend_pagesize() is not depending on the hugetlb
memory path handling anymore, we can also remove the #ifdef and the
TOCTTOU comment from the calling functions - the code should now work
equally well on all host architectures.

Message-Id: <20220810125720.3849835-3-thuth@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 softmmu/physmem.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index dc3c3e5f2e..50231bab30 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -1331,13 +1331,6 @@ GString *ram_block_format(void)
     return buf;
 }
 
-#ifdef __linux__
-/*
- * FIXME TOCTTOU: this iterates over memory backends' mem-path, which
- * may or may not name the same files / on the same filesystem now as
- * when we actually open and map them.  Iterate over the file
- * descriptors instead, and use qemu_fd_getpagesize().
- */
 static int find_min_backend_pagesize(Object *obj, void *opaque)
 {
     long *hpsize_min = opaque;
@@ -1391,16 +1384,6 @@ long qemu_maxrampagesize(void)
     object_child_foreach(memdev_root, find_max_backend_pagesize, &pagesize);
     return pagesize;
 }
-#else
-long qemu_minrampagesize(void)
-{
-    return qemu_real_host_page_size();
-}
-long qemu_maxrampagesize(void)
-{
-    return qemu_real_host_page_size();
-}
-#endif
 
 #ifdef CONFIG_POSIX
 static int64_t get_file_size(int fd)
-- 
2.31.1



  parent reply	other threads:[~2022-08-30 17:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 17:19 [PULL 0/6] First s390x updates for QEMU 7.2 Thomas Huth
2022-08-30 17:19 ` [PULL 1/6] hw: Add compat machines for 7.2 Thomas Huth
2022-08-30 17:19 ` [PULL 2/6] s390x/cpumodel: add stfl197 processor-activity-instrumentation extension 1 Thomas Huth
2022-08-30 17:19 ` [PULL 3/6] target/s390x: Fix CLFIT and CLGIT immediate size Thomas Huth
2022-08-30 17:19 ` [PULL 4/6] backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize() Thomas Huth
2022-08-30 17:19 ` Thomas Huth [this message]
2022-08-30 17:19 ` [PULL 6/6] util/mmap-alloc: Remove qemu_mempath_getpagesize() Thomas Huth
2022-08-31 22:16 ` [PULL 0/6] First s390x updates for QEMU 7.2 Stefan Hajnoczi

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=20220830171947.71464-6-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.