From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omr1.cc.ipv6.vt.edu ([2607:b400:92:8300:0:c6:2117:b0e] helo=omr1.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gM6Lu-0003MB-IF for kernelnewbies@kernelnewbies.org; Mon, 12 Nov 2018 02:09:42 -0500 Received: from mr1.cc.vt.edu (smtp.ipv6.vt.edu [IPv6:2607:b400:92:9:0:9d:8fcb:4116]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id wAC79e4W019042 for ; Mon, 12 Nov 2018 02:09:41 -0500 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mr1.cc.vt.edu (8.14.7/8.14.7) with ESMTP id wAC79ZRS005104 for ; Mon, 12 Nov 2018 02:09:40 -0500 Received: by mail-qk1-f200.google.com with SMTP id 92so22020954qkx.19 for ; Sun, 11 Nov 2018 23:09:40 -0800 (PST) From: valdis.kletnieks@vt.edu To: Carter Cheng Subject: Re: function stack frames in the kernel In-Reply-To: References: Mime-Version: 1.0 Date: Mon, 12 Nov 2018 02:09:32 -0500 Message-ID: <96662.1542006572@turing-police.cc.vt.edu> Cc: augustocaringi@gmail.com, kernelnewbies@kernelnewbies.org List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5673125710376936337==" Errors-To: kernelnewbies-bounces@kernelnewbies.org Message-ID: <20181112070932.Pgp6WF1kqq-Vu6mQ74euN1CXy4o64Gg5MnsbMpNn3EU@z> --===============5673125710376936337== Content-Type: multipart/signed; boundary="==_Exmh_1542006572_4054P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1542006572_4054P Content-Type: text/plain; charset=us-ascii 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. --==_Exmh_1542006572_4054P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQEVAwUBW+knK40DS38y7CIcAQLJrAf+Py/d0BHzUtZCuQNIVUp6p380r6HfTuJt YqdlHWm44iyUTetLt96lzeYgy+J2pdOQ4CagunVbZ4/aVEnEfcYCZ1rPivCpX3OE 3Z2ZHhBHS8hWnjUC0MtXezSpQMg63HKjbvy4acvcJqYh3D0c6Cqv1ipJIkeZxtqv SCBqdTt/7b7cbFOLz7EDNo3lSopydLw3udJeD+SfKOH0KXCOb9aAP9irDAEdawKa 7beDt70W7C1xeKQQggcqKbPtavrcAgrZ2Y5PkzNgSSGTkeC63Femy8yL0c5My30B tEi3UlVuHxuNs8uo/cGovOeHeg16Bz4+KgJGNZtxGhXM/UKhHkD/Pg== =/87E -----END PGP SIGNATURE----- --==_Exmh_1542006572_4054P-- --===============5673125710376936337== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============5673125710376936337==--