qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anton Johansson <anjo@rev.ng>, qemu-devel@nongnu.org
Cc: ale@rev.ng, richard.henderson@linaro.org, eduardo@habkost.net,
	philmd@linaro.org, marcel.apfelbaum@gmail.com,
	peter.maydell@linaro.org, wangyanan55@huawei.com
Subject: Re: [PATCH 0/9] Collapse CPUNegativeOffsetState into CPUState
Date: Sat, 1 Jul 2023 11:21:25 +0200	[thread overview]
Message-ID: <6e7f39df-1ad4-d155-6d80-37dd89a28f6a@redhat.com> (raw)
In-Reply-To: <20230630122551.21766-1-anjo@rev.ng>

On 6/30/23 14:25, Anton Johansson via wrote:
> CPUNegativeOffsetState is a struct placed immediately before
> CPUArchState in the ArchCPU struct.  Its purpose is to ensure that
> certain fields (CPUTLBDescFast, IcountDecr) lay within a small negative
> offset of CPUArchState in memory.  This is desired for better
> code-generation on arm[32|64] and riscv hosts which has addressing
> modes with 12- and 11 bits of displacement respectively.

The purpose is also to ensure that general purpose registers stay close 
to the beginning of the CPUArchState and thus can also be accessed with 
a small displacement.

Can you check if this becomes worse for any architecture?  On some 
64-bit targets, 8 bytes * 32 registers is 512 bytes and it's a 
substantial part of the 11 bits that are available.

Paolo



  parent reply	other threads:[~2023-07-01  9:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30 12:25 [PATCH 0/9] Collapse CPUNegativeOffsetState into CPUState Anton Johansson via
2023-06-30 12:25 ` [PATCH 1/9] target/arm: Replace TARGET_PAGE_ENTRY_EXTRA Anton Johansson via
2023-06-30 12:25 ` [PATCH 2/9] include: Move MMUAccessType to tlb-common.h Anton Johansson via
2023-06-30 12:25 ` [PATCH 3/9] include/exec: Move CPUTLB and friends " Anton Johansson via
2023-06-30 12:25 ` [PATCH 4/9] include/hw: introduce CPU_MAX_NEGATIVE_ENV_OFFSET Anton Johansson via
2023-06-30 14:19   ` Richard Henderson
2023-07-04  8:49     ` Anton Johansson via
2023-06-30 12:25 ` [PATCH 5/9] accel: Move CPUTLB to CPUState and assert offset Anton Johansson via
2023-06-30 14:16   ` Richard Henderson
2023-07-04  8:45     ` Anton Johansson via
2023-06-30 12:25 ` [PATCH 6/9] Move IcountDecr " Anton Johansson via
2023-06-30 12:25 ` [PATCH 7/9] include/exec: Remove [cpu|env]_neg() functions Anton Johansson via
2023-06-30 12:25 ` [PATCH 8/9] target: Remove CPUNegativeOffsetState field from ArchCPU Anton Johansson via
2023-06-30 12:25 ` [PATCH 9/9] include/exec: Remove CPUNegativeOffsetState Anton Johansson via
2023-07-01  9:21 ` Paolo Bonzini [this message]
2023-07-04  8:54   ` [PATCH 0/9] Collapse CPUNegativeOffsetState into CPUState Anton Johansson via

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=6e7f39df-1ad4-d155-6d80-37dd89a28f6a@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ale@rev.ng \
    --cc=anjo@rev.ng \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=wangyanan55@huawei.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).