kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Carter Cheng <cartercheng@gmail.com>
To: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Augusto Caringi <augustocaringi@gmail.com>,
	kernelnewbies@kernelnewbies.org
Subject: Re: function stack frames in the kernel
Date: Tue, 13 Nov 2018 00:43:20 +0800	[thread overview]
Message-ID: <CALS6=qX-X8E3DnnVsxyJXCQ_Mbee1ZTyON-2uJ2_5mvpY93XMg@mail.gmail.com> (raw)
Message-ID: <20181112164320.G9AwUmhLX0PCjARh1VEy5tg68valhqj2ij5UO8jR0ig@z> (raw)
In-Reply-To: <96662.1542006572@turing-police.cc.vt.edu>


[-- Attachment #1.1: Type: text/plain, Size: 1160 bytes --]

Thanks for the clarification.

On Mon, Nov 12, 2018 at 3:09 PM <valdis.kletnieks@vt.edu> wrote:

> On Mon, 12 Nov 2018 02:00:02 +0800, Carter Cheng said:
> > Thanks for the reply but the link doesn't quite answer the question. I am
> > wondering how the pointer is handled so that there is one per thread by
> the
> > compiler. I perhaps was under the perhaps mistaken impression that the
> > stack pointer frame pointer management inside the compiler makes certain
> > assumptions in user space- but i am unsure how this applies to kernel
> space.
>
> For regular function calls, a kernel stack works exactly the same as a
> function
> stack in userspace (remember, it's the same compiler, and other tools like
> the
> linker and gdb need to be able to understand function calls).
>
> Where things are different are what happens if an interrupt or a call to
> schedule() or enter/exit the kernel (or a few other similar situations I
> can't
> remember at 2AM) causes a different thread to start running - for those
> cases,
> there's architecture-dependent shim code (usually involving at least a bit
> of
> assembler) to do the register swapping needed.
>
>

[-- Attachment #1.2: Type: text/html, Size: 1478 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  parent reply	other threads:[~2018-11-12 16:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 17:03 function stack frames in the kernel Carter Cheng
2018-11-11 17:03 ` Carter Cheng
2018-11-11 17:55 ` Augusto Mecking Caringi
2018-11-11 17:55   ` Augusto Mecking Caringi
2018-11-11 18:00   ` Carter Cheng
2018-11-11 18:00     ` Carter Cheng
2018-11-12  7:09     ` valdis.kletnieks at vt.edu
2018-11-12  7:09       ` valdis.kletnieks
2018-11-12 16:43       ` Carter Cheng [this message]
2018-11-12 16:43         ` Carter Cheng

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='CALS6=qX-X8E3DnnVsxyJXCQ_Mbee1ZTyON-2uJ2_5mvpY93XMg@mail.gmail.com' \
    --to=cartercheng@gmail.com \
    --cc=augustocaringi@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=valdis.kletnieks@vt.edu \
    /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).