qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Xin Tong <trent.tong@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] outlined TLB lookup on x86
Date: Wed, 22 Jan 2014 08:34:56 -0800	[thread overview]
Message-ID: <52DFF330.8080905@twiddle.net> (raw)
In-Reply-To: <CA+JLOiuCf9Kip=D-KWoH6sVczvPz1T2BF-SYPOMd4y9yBDUCtw@mail.gmail.com>

On 01/22/2014 07:28 AM, Xin Tong wrote:
> Can you tell me whether ARM is the only architecture that requires
> special treatment for increasing tlb size beyond 256 entries so that i
> can whip up a patch to the QEMU mainline.

The major constraint for the non-arm ports is

    CPU_TLB_ENTRY_SIZE + CPU_TLB_BITS < immediate bit size

I.e.

    (CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS

is representable as an immediate within an AND instruction.

MIPS has a 16-bit unsigned immediate, and as written would generate bad code
for CPU_TLB_BITS > 11.

I386 has a 32-bit signed immediate, and would generate bad code for
CPU_TLB_BITS > 26.  Though I can't imagine you want to make it that big.

SPARC has a 13-bit signed immediate,  But it's written with a routine which
checks the size of the constant and loads it if necessary.  Which is good,
because that's clearly already happening for CPU_TLB_BITS > 7.

AArch64, ia64, ppc, ppc64 all use fully capable extract-bit-field type insns
and could handle any change you make.

S390 is written using generic routines like sparc, so it won't fail with any
change.  It ought to be adjusted to use the extract-bit-field type insns that
exist in the current generation of machines.  The oldest generation of machine
would have reduced performance with CPU_TLB_BITS > 11.

ARM is also a case in which armv6t2 and later could be written with an
extract-bit-field insn, but previous versions would need to use 2 insns to form
the constant.  But at least we'd be able to combine the shift and and insns.


r~

  reply	other threads:[~2014-01-22 16:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27  7:41 [Qemu-devel] outlined TLB lookup on x86 Xin Tong
2013-11-27 13:12 ` Lluís Vilanova
2013-11-28  1:58   ` Xin Tong
2013-11-28 16:12     ` Lluís Vilanova
2013-12-08 10:54       ` Xin Tong
2013-12-17 13:52         ` Xin Tong
2013-12-18  2:22           ` Xin Tong
2014-01-21 14:22             ` Xin Tong
2014-01-21 14:28               ` Peter Maydell
2013-12-09 12:18       ` Xin Tong
2013-12-09 15:31         ` Lluís Vilanova
2013-11-28  2:12 ` Richard Henderson
2013-11-28  3:56   ` Xin Tong
2013-12-08 11:19   ` Avi Kivity
2014-01-22 15:28   ` Xin Tong
2014-01-22 16:34     ` Richard Henderson [this message]
2014-01-22 16:55     ` Peter Maydell
2014-01-22 17:32       ` Richard Henderson
2014-01-22 17:35         ` Peter Maydell
2014-01-22 17:45           ` Richard Henderson
2014-01-22 17:56             ` Xin Tong

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=52DFF330.8080905@twiddle.net \
    --to=rth@twiddle.net \
    --cc=qemu-devel@nongnu.org \
    --cc=trent.tong@gmail.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).