From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [RFC][PATCH] x86: CS limit checks
Date: Thu, 17 Jul 2008 23:25:20 +0200 [thread overview]
Message-ID: <487FB8C0.4030008@web.de> (raw)
In-Reply-To: <487F73AE.50509@siemens.com>
[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]
Jan Kiszka wrote:
> Fabrice Bellard wrote:
>> Jan Kiszka wrote:
>>> Here is a proposal for adding code segment limit checks to x86. This
>>> patch should not need the -seg-checks switch as its tests are mostly
>>> performed during translation time. Moreover, I tried to confine the
>>> small additional overhead in the TB lookup procedure to x86 and Sparc.
>>>
>>> Note that this patch depends on my debugging series, namely [1], as that
>>> one reduces the x86-specific code passages for TB generation. Also note
>>> that this patch is early and only lightly tested so far, not yet
>>> intended for inclusion, but definitely for commenting on!
>> Using more than 32 bits for cs_limit (and cs_base) in the TB is
>> wasteful, so I strongly suggest to use a uint32_t type. In that case,
>> cs_limit must be explicitely ignored in 64 bit code.
>>
>> @@ -172,6 +173,8 @@ static inline TranslationBlock *tb_find_
>> flags = env->hflags;
>> flags |= (env->eflags & (IOPL_MASK | TF_MASK | VM_MASK));
>> cs_base = env->segs[R_CS].base;
>> + if ((env->hflags & (HF_PE_MASK | HF_CS64_MASK)) == HF_PE_MASK)
>> + cs_limit = env->segs[R_CS].limit;
>> pc = cs_base + env->eip;
>>
>> This test should be suppressed for performance reasons.
>
> Yes, the test should be moved to the translator code. This will also
> allow to reduce the width of cs_base/limit.
cs_base must remain target_ulong - sparc relies on it for storing npc.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
prev parent reply other threads:[~2008-07-17 21:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-17 11:57 [Qemu-devel] [RFC][PATCH] x86: CS limit checks Jan Kiszka
2008-07-17 12:17 ` Paul Brook
2008-07-17 13:14 ` Jan Kiszka
2008-07-17 13:37 ` Paul Brook
2008-07-17 16:10 ` Jan Kiszka
2008-07-17 17:45 ` Paul Brook
2008-07-17 19:24 ` Fabrice Bellard
2008-07-17 21:30 ` [Qemu-devel] " Jan Kiszka
2008-07-17 14:06 ` [Qemu-devel] " Fabrice Bellard
2008-07-17 16:30 ` [Qemu-devel] " Jan Kiszka
2008-07-17 19:29 ` Fabrice Bellard
2008-07-17 21:25 ` Jan Kiszka [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=487FB8C0.4030008@web.de \
--to=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.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.