public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kyle Moffett <mrmacman_g4@mac.com>
To: Takashi Ikebe <ikebe.takashi@lab.ntt.co.jp>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@muc.de>
Subject: Re: [PATCH x86_64] Live Patching Function on 2.6.11.7
Date: Sun, 24 Apr 2005 22:48:15 -0400	[thread overview]
Message-ID: <e83d0cb60cb50a56b38294e9160d7712@mac.com> (raw)
In-Reply-To: <426C51C4.9040902@lab.ntt.co.jp>

If you want that exact functionality, do this:

At program start, spawn a new thread:
	1) Open a UNIX socket (/var/run/someapp_live_patch.sock)
	2) poll() that socket for a connection.
	3) When you get a connection, do your own security checks
	4) If it's ok, then map the specified file into memory
	5) Read a table of crap to patch from the file
	6) Do the patching, being careful to avoid the millions of
	   races involved for each CPU, *especially* regarding the
	   separate icache and dcache on CPUs like PPC and such.
	7) Go back to step 2

If you want equivalent functionality but much safer and not CPU
dependent and full of hand-coded assembly:

1) open(), mmap(), and mlock() the file (/var/lib/someapp/data)
2) Spawn normal operation threads
3) Spawn a new hot-patch thread:
	1) Open a UNIX socket (/var/run/someapp_live_patch.sock)
	2) poll() that socket for a connection.
	3) When you get one, coordinate with the new process as it
	   attaches itself to /var/lib/someapp/data
	4) Handle shared locking of parts of /var/lib/someapp/data
	5) Send it your listen() file-descriptors over the socket.
	6) Wait for the other process to signal it's ready.
	7) Stop accepting new connections on the socket.
	8) Send file-descriptors for current connections
	9) Cleanup and quit

When live-patching:
1)  connect to the socket /var/run/someapp_live_patch.sock
2)  open(), mmap() and mlock() /var/lib/someapp/data
3)  Coordinate with the other process via the socket
4)  Receive the listen() file-descriptors over the socket.
5)  Set up the shared data locking
6)  Spawn normal operation threads
7)  Signal readiness
8)  Receive file-descriptors for current connections
9)  Spawn threads for them too.
10) Spawn a new hot-patch thread as above

Cheers,
Kyle Moffett

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+
PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r  
!y?(-)
------END GEEK CODE BLOCK------



  reply	other threads:[~2005-04-25  2:50 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18  3:19 [PATCH x86_64] Live Patching Function on 2.6.11.7 Takashi Ikebe
2005-04-18  4:07 ` Chris Wedgwood
2005-04-18  4:19   ` Takashi Ikebe
2005-04-18  4:42     ` Daniel Jacobowitz
2005-04-18  4:55       ` Nicholas Miell
2005-04-18  5:01         ` Davide Libenzi
2005-04-18  5:41           ` Takashi Ikebe
2005-07-11  7:18           ` [PATCH] eventpoll : Suppress a short lived lock from struct file Eric Dumazet
2005-07-11  8:34             ` Peter Zijlstra
2005-07-11  9:29               ` Eric Dumazet
2005-07-11 14:00                 ` Davide Libenzi
2005-07-11 15:20                   ` Eric Dumazet
2005-04-18  5:00       ` [PATCH x86_64] Live Patching Function on 2.6.11.7 David S. Miller
2005-04-18  6:12     ` Chris Wedgwood
2005-04-18  6:35       ` Chris Friesen
2005-04-18  6:48         ` Chris Wedgwood
2005-04-18 10:03         ` James Courtier-Dutton
2005-04-18  9:10           ` Chris Wedgwood
2005-04-18  7:32       ` Takashi Ikebe
2005-04-18  7:56         ` Chris Wedgwood
2005-04-18  8:37           ` Takashi Ikebe
2005-04-18  8:59             ` Chris Wedgwood
2005-04-18  9:16           ` Paul Jackson
2005-04-18  9:25             ` Chris Wedgwood
2005-04-18 11:30               ` Rik van Riel
2005-04-18 12:52                 ` Takashi Ikebe
2005-04-18 14:06                   ` Rik van Riel
2005-04-19  2:14                     ` Takashi Ikebe
2005-04-19  4:27                       ` Chris Wedgwood
2005-04-19  5:19                         ` Takashi Ikebe
2005-04-19  5:52                           ` Chris Wedgwood
2005-04-20  4:18                             ` Takashi Ikebe
2005-04-20  5:43                               ` Chris Wedgwood
2005-04-20  7:35                                 ` Takashi Ikebe
2005-04-20  7:50                                   ` Chris Wedgwood
2005-04-20  7:57                                     ` Takashi Ikebe
2005-04-20  8:26                                       ` Chris Wedgwood
2005-04-20  8:45                                         ` Takashi Ikebe
2005-04-20  8:51                                           ` Chris Wedgwood
2005-04-20 11:19                                           ` Rik van Riel
2005-04-20 15:06                                             ` Chris Friesen
2005-04-20  8:34                                       ` Miquel van Smoorenburg
2005-04-19  5:57                           ` Takashi Ikebe
2005-04-18 14:28               ` Paul Jackson
2005-04-20 13:10               ` Ralf Baechle
2005-04-20 15:08                 ` Chris Friesen
2005-04-23 16:17 ` Andi Kleen
2005-04-25  2:11   ` Takashi Ikebe
2005-04-25  2:48     ` Kyle Moffett [this message]
2005-04-25 10:39       ` Takashi Ikebe
2005-04-25 11:15         ` Kyle Moffett
2005-04-25 15:09         ` Pavel Machek
2005-04-25 15:54         ` Andi Kleen
2005-04-25 16:36         ` Valdis.Kletnieks
2005-04-26  1:34           ` Takashi Ikebe
2005-04-26  2:15             ` Kyle Moffett
2005-04-26  9:36             ` Pavel Machek
2005-04-26 13:05             ` Andi Kleen
     [not found] <3Uv7B-5lv-7@gated-at.bofh.it>
     [not found] ` <3UvKd-5RT-1@gated-at.bofh.it>
     [not found]   ` <3Uw3y-65a-1@gated-at.bofh.it>
     [not found]     ` <3UwmX-6gm-5@gated-at.bofh.it>
     [not found]       ` <3UwwG-6lY-7@gated-at.bofh.it>
     [not found]         ` <3UwGk-6Cv-9@gated-at.bofh.it>
     [not found]           ` <3Uxj2-6YL-1@gated-at.bofh.it>
2005-04-18 10:59             ` Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>

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=e83d0cb60cb50a56b38294e9160d7712@mac.com \
    --to=mrmacman_g4@mac.com \
    --cc=ak@muc.de \
    --cc=ikebe.takashi@lab.ntt.co.jp \
    --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