Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933337AbdGTEaP (ORCPT ); Thu, 20 Jul 2017 00:30:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55856 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682AbdGTEaO (ORCPT ); Thu, 20 Jul 2017 00:30:14 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D14E161BA1 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D14E161BA1 Date: Wed, 19 Jul 2017 23:30:01 -0500 From: Josh Poimboeuf To: Petr Mladek Cc: Joe Lawrence , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu , Jiri Kosina , Miroslav Benes , Chris J Arges Subject: Re: [PATCH] livepatch: add (un)patch hooks Message-ID: <20170720043001.u6m2b73zl22ujeqs@treble> References: <1499868600-10176-1-git-send-email-joe.lawrence@redhat.com> <1499868600-10176-2-git-send-email-joe.lawrence@redhat.com> <20170717155144.GF32632@pathway.suse.cz> <20170719204952.4fyhtig3rbw7z4w4@treble> <20170720041723.35r6qk2fia7xix3t@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170720041723.35r6qk2fia7xix3t@treble> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 20 Jul 2017 04:30:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 838 Lines: 21 On Wed, Jul 19, 2017 at 11:17:23PM -0500, Josh Poimboeuf wrote: > This one was interesting: > > 6f442be2fb22 ("x86_64, traps: Stop using IST for #SS") > > A livepatch patch for it is below. We had something similar for kpatch. > The below patch is completely untested because we don't have > kpatch-build tooling support for livepatch hooks yet. > > Note that the load hook would need to run *after* the patch has been > applied and the transition has completed. And also, it would need to > run inside stop_machine(). I didn't put that in the patch yet. But it > should at least give you an idea. Actually the statement that it needs to run after the patch is applied isn't accurate. It was true with an earlier revision of the patch which modified the do_stack_segment() function. But this version only adds code. -- Josh