From: Yang <teddyyyy123@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: should we use $(__USER_DS) or $(__KERNEL_DS) when entering interrupt handlers?
Date: Thu, 18 Mar 2010 10:38:44 -0700 [thread overview]
Message-ID: <bb057cd21003181038j56992f68p6d72d0058d72f82f@mail.gmail.com> (raw)
in handling an interrupt, kernel first saves all the register contents , in
the SAVE_ALL macro, in the last part of this macro, it adjusts the
data segment selectors for kernel mode.
in kernel 2.4, the __KERNEL_DS segment is loaded into %ds and %es, at line
98 of:
http://lxr.linux.no/#linux-old+v2.4.31/arch/i386/kernel/entry.S
but in kernel 2.6, __USER_DS segment is loaded into %ds and %es, at line
227 of :
http://lxr.linux.no/#linux+v2.6.33/arch/x86/kernel/entry_32.S
I understand that on x86, all the data segment selector contents are
basically the same, but semantically it's better to use the KERNEL_DS
because we are working in kernel mode?
Thanks!
Yang
reply other threads:[~2010-03-18 17:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=bb057cd21003181038j56992f68p6d72d0058d72f82f@mail.gmail.com \
--to=teddyyyy123@gmail.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®