From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 410FdH6SxpzF1SJ for ; Tue, 5 Jun 2018 12:10:27 +1000 (AEST) Received: by mail-qt0-x242.google.com with SMTP id h5-v6so818586qtm.13 for ; Mon, 04 Jun 2018 19:10:27 -0700 (PDT) Sender: Ram Pai From: Ram Pai To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, dave.hansen@intel.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, linuxram@us.ibm.com, Ulrich.Weigand@de.ibm.com, fweimer@redhat.com, luto@kernel.org Subject: [PATCH 2/5] powerpc/pkeys: Save the pkey registers before fork Date: Mon, 4 Jun 2018 19:09:51 -0700 Message-Id: <1528164594-23823-3-git-send-email-linuxram@us.ibm.com> In-Reply-To: <1528164594-23823-1-git-send-email-linuxram@us.ibm.com> References: <1528164594-23823-1-git-send-email-linuxram@us.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , When a thread forks the contents of AMR, IAMR, UAMOR registers in the newly forked thread are not inherited. Save the registers before forking, for content of those registers to be automatically copied into the new thread. CC: Michael Ellerman CC: Florian Weimer CC: Andy Lutomirski CC: Thiago Jung Bauermann Signed-off-by: Ram Pai --- arch/powerpc/kernel/process.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 1237f13..999dd08 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -582,6 +582,7 @@ static void save_all(struct task_struct *tsk) __giveup_spe(tsk); msr_check_and_clear(msr_all_available); + thread_pkey_regs_save(&tsk->thread); } void flush_all_to_thread(struct task_struct *tsk) -- 1.7.1