qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Peter Xu <peterx@redhat.com>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH] exec/cpu: Make host pages variables / macros 'target agnostic'
Date: Thu, 20 Jan 2022 14:28:12 +0100	[thread overview]
Message-ID: <b7540c06-50ba-28f0-db3d-ab2fa067b6d9@redhat.com> (raw)
In-Reply-To: <20220120000836.229419-1-f4bug@amsat.org>

On 1/20/22 01:08, Philippe Mathieu-Daudé via wrote:
> "host" pages are related to the *host* not the *target*,
> thus the qemu_host_page_size / qemu_host_page_mask variables
> and the HOST_PAGE_ALIGN() / REAL_HOST_PAGE_ALIGN() macros
> can be moved to "exec/cpu-common.h" which is target agnostic.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Queued, thanks.

Paolo

> ---
>   include/exec/cpu-all.h    | 9 ---------
>   include/exec/cpu-common.h | 9 +++++++++
>   2 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
> index bb37239efa3..84caf5c3d9f 100644
> --- a/include/exec/cpu-all.h
> +++ b/include/exec/cpu-all.h
> @@ -234,15 +234,6 @@ extern const TargetPageBits target_page;
>   
>   #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE)
>   
> -/* Using intptr_t ensures that qemu_*_page_mask is sign-extended even
> - * when intptr_t is 32-bit and we are aligning a long long.
> - */
> -extern uintptr_t qemu_host_page_size;
> -extern intptr_t qemu_host_page_mask;
> -
> -#define HOST_PAGE_ALIGN(addr) ROUND_UP((addr), qemu_host_page_size)
> -#define REAL_HOST_PAGE_ALIGN(addr) ROUND_UP((addr), qemu_real_host_page_size)
> -
>   /* same as PROT_xxx */
>   #define PAGE_READ      0x0001
>   #define PAGE_WRITE     0x0002
> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
> index 039d422bf4c..de5f444b193 100644
> --- a/include/exec/cpu-common.h
> +++ b/include/exec/cpu-common.h
> @@ -7,6 +7,15 @@
>   #include "exec/hwaddr.h"
>   #endif
>   
> +/* Using intptr_t ensures that qemu_*_page_mask is sign-extended even
> + * when intptr_t is 32-bit and we are aligning a long long.
> + */
> +extern uintptr_t qemu_host_page_size;
> +extern intptr_t qemu_host_page_mask;
> +
> +#define HOST_PAGE_ALIGN(addr) ROUND_UP((addr), qemu_host_page_size)
> +#define REAL_HOST_PAGE_ALIGN(addr) ROUND_UP((addr), qemu_real_host_page_size)
> +
>   /* The CPU list lock nests outside page_(un)lock or mmap_(un)lock */
>   void qemu_init_cpu_list(void);
>   void cpu_list_lock(void);



      parent reply	other threads:[~2022-01-20 20:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20  0:08 [PATCH] exec/cpu: Make host pages variables / macros 'target agnostic' Philippe Mathieu-Daudé via
2022-01-20 10:18 ` David Hildenbrand
2022-01-20 13:28 ` Paolo Bonzini [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=b7540c06-50ba-28f0-db3d-ab2fa067b6d9@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=david@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).