From patchwork Thu Mar 19 20:51:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Torsten Duwe X-Patchwork-Id: 452267 X-Patchwork-Delegate: michael@ellerman.id.au Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 366AA1400EA for ; Fri, 20 Mar 2015 07:52:20 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 0272B1A0C40 for ; Fri, 20 Mar 2015 07:52:20 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id F1EBB1A00B0 for ; Fri, 20 Mar 2015 07:51:23 +1100 (AEDT) Received: by newverein.lst.de (Postfix, from userid 2005) id 51AEEAAADD; Thu, 19 Mar 2015 21:51:20 +0100 (CET) Date: Thu, 19 Mar 2015 21:51:20 +0100 From: Torsten Duwe To: ppc-dev Subject: [PATCH v0 3/4] ppc64le: kgraft support Message-ID: <20150319205120.GD19524@lst.de> References: <20150319203522.GA19524@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150319203522.GA19524@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Linux Kernel Mailing List X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The kgraft hooks for ppc64. Just massaged a bit to get them to compile and not interfere. Feel free to test them if you're daring ;) diff --git a/arch/powerpc/include/asm/kgraft.h b/arch/powerpc/include/asm/kgraft.h new file mode 100644 index 0000000..7f8600d --- /dev/null +++ b/arch/powerpc/include/asm/kgraft.h @@ -0,0 +1,33 @@ +/* + * kGraft Online Kernel Patching + * + * Copyright (c) 2013-2014 SUSE + * Authors: Jiri Kosina + * Vojtech Pavlik + * Jiri Slaby + */ + +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + */ + +#ifndef ASM_KGR_H +#define ASM_KGR_H + +#include +#include + +static inline void kgr_set_regs_ip(struct pt_regs *regs, unsigned long ip) +{ + regs->link = ip; +} + +static inline bool kgr_needs_lazy_migration(struct task_struct *p) +{ + return true; +} + +#endif diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index b034ecd..aa6a084 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h @@ -92,6 +92,7 @@ static inline struct thread_info *current_thread_info(void) TIF_NEED_RESCHED */ #define TIF_32BIT 4 /* 32 bit binary */ #define TIF_RESTORE_TM 5 /* need to restore TM FP/VEC/VSX */ +#define TIF_KGR_IN_PROGRESS 6 /* kGraft patching in progress */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SINGLESTEP 8 /* singlestepping active */ #define TIF_NOHZ 9 /* in adaptive nohz mode */ @@ -115,8 +117,10 @@ static inline struct thread_info *current_thread_info(void) #define _TIF_POLLING_NRFLAG (1<