[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170720042000.34trkuzwevrkscds@treble>
Date: Wed, 19 Jul 2017 23:20:00 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Joe Lawrence <joe.lawrence@...hat.com>,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
Jessica Yu <jeyu@...nel.org>, Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Chris J Arges <chris.j.arges@...onical.com>
Subject: Re: [PATCH] livepatch: add (un)patch hooks
On Wed, Jul 19, 2017 at 11:17:23PM -0500, Josh Poimboeuf wrote:
> +static void swapgs_unload_hook(void)
> +{
> + if (paravirt_enabled() && strcmp(pv_info.name, "KVM"))
> + return;
> +
> + write_cr0(read_cr0() & ~X86_CR0_WP);
> + barrier();
> +
> + set_intr_gate_ist(X86_TRAP_SS, stack_segment_v2, STACKFAULT_STACK);
s/stack_segment_v2/stack_segment/ for the unload hook
> +
> + barrier();
> + write_cr0(read_cr0() | X86_CR0_WP);
> +}
> +KLP_UNLOAD_HOOK(swapgs_unload_hook);
--
Josh
Powered by blists - more mailing lists