From: Jiang Jilin <freephp@gmail.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: Hui Zhu <teawater@gmail.com>,
gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Save CS segment register for ljmp instruction
Date: Tue, 13 Oct 2009 08:46:00 -0000 [thread overview]
Message-ID: <7d77a27d0910130146o18c1edafy5d30530bf42a3ac@mail.gmail.com> (raw)
In-Reply-To: <4AD34D1B.6030609@vmware.com>
On Mon, Oct 12, 2009 at 11:36 PM, Michael Snyder <msnyder@vmware.com> wrote:
> Could one of you write an assembly language testcase?
I paste the code from Linux kernel(2.6.24
arch/x86/kernel/head_32.S:278) as follows:
---- BEGIN
/*
* Enable paging
*/
movl $swapper_pg_dir-__PAGE_OFFSET,%eax
movl %eax,%cr3 /* set the page table pointer.. */
movl %cr0,%eax
orl $0x80000000,%eax
movl %eax,%cr0 /* ..and set paging (PG) bit */
ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */
1:
/* Set up the stack pointer */
lss stack_start,%esp
---END
the CS changed in the code above, but I'm not sure the example is enough to
assure my patch's correctness.
Thank you!
>
> Hui Zhu wrote:
>>
>> Could you post some code to test the ljmp and cs? I am not sure about cs
>> part.
>>
>> Thanks,
>> Hui
>>
>> On Mon, Oct 12, 2009 at 10:24, Jiang Jilin <freephp@gmail.com> wrote:
>>>
>>> Hi Hui,
>>>
>>> I think CS register should be stored for ljmp instruction, but I'm
>>> not pretty sure, please help me confirm it.
>>>
>>> Thanks!
>>>
>>> 2009-10-12 Jiang Jilin <freephp@gmail.com>
>>>
>>> * i386-tdep.c (i386_process_record): Save CS segment register
>>> for ljmp instruction
>>> ---
>>> gdb/i386-tdep.c | 3 +++
>>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
>>> index b4dc646..0145008 100644
>>> --- a/gdb/i386-tdep.c
>>> +++ b/gdb/i386-tdep.c
>>> @@ -3606,8 +3606,11 @@ reswitch:
>>> break;
>>> /* jmp */
>>> case 4:
>>> + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_EFLAGS_REGNUM);
>>> + break;
>>> /* ljmp */
>>> case 5:
>>> + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_CS_REGNUM);
>>> I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_EFLAGS_REGNUM);
>>> break;
>>> /* push */
>>> --
>>> 1.5.4.3
>>>
>>>
>
>
--
Jiang
prev parent reply other threads:[~2009-10-13 8:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 2:24 Jiang Jilin
2009-10-12 7:54 ` Hui Zhu
2009-10-12 8:35 ` Jiang Jilin
2009-10-12 15:41 ` Michael Snyder
2009-10-13 8:46 ` Jiang Jilin [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=7d77a27d0910130146o18c1edafy5d30530bf42a3ac@mail.gmail.com \
--to=freephp@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=teawater@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