From patchwork Thu Jun 14 00:29:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 929141 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 415l763b0Vz9ry1 for ; Thu, 14 Jun 2018 10:36:50 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aJlqr6Rj"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 415l761tH2zDrpC for ; Thu, 14 Jun 2018 10:36:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aJlqr6Rj"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c0d::243; helo=mail-qt0-x243.google.com; envelope-from=ram.n.pai@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aJlqr6Rj"; dkim-atps=neutral Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) (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 415kyW4xyczDrnp for ; Thu, 14 Jun 2018 10:29:23 +1000 (AEST) Received: by mail-qt0-x243.google.com with SMTP id h5-v6so4221815qtm.13 for ; Wed, 13 Jun 2018 17:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lRFd+ts0TQLQ4bgrbRZyLrGCvM6wh9xyeeepmp1KYas=; b=aJlqr6RjKGvyQvJHn56sPSAk1euQaSAdhe3j6dsZUPKqHIzgYDMzLAIEzVzWdg11Wk 5mN51yRGToCwOEfANN/nB3giw2cT0iTXRufSD/iCUuKfQwIaV/bWIvE3dBUY+OBOccy6 GwGuTQfxm9bu31ZqZ3eiMcEoETy2mo8VjB42xMBw/bObZKs7MTT9QCwOot2jD0Er10sU feGzeFBsY2zR34yxlIXdrFYfWxgHC2g8tUEVEPIHMvUQ/ngrVJkQ/Fqmoddba+xqDPEF v9nwpHAwnvPbKbw7srnlNBSqnw0VOFelx2Ar0nt8FQGL0ZPftPMSoRFF7lkLIwhDB4sJ 5seQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lRFd+ts0TQLQ4bgrbRZyLrGCvM6wh9xyeeepmp1KYas=; b=oTkEgHvUNS0scQzEsDFoL+Hg12SEBLmXl0m3LnFZaypvqNc8ADLALrbLj0D+WmFav0 /hs/lIVjTjL4+0o5a7xbsPUr9y0GFvkLfGPjvXhGZUbipT2IyF7SmJymIpkVLtBe5Dma 3862YSyo4sOkP2SabzxmgQxTYfq/8j8O/SDmzSZikIEU0HydV+vDPDpieZONOBZmwEcx EoAERT+fIRIbu82mO5Bbd/u3YjhmbWIMJD986h6PjOeBhSVvW8qMnVjLVDlfQ1Eoduje DE26LKKTsZKmcVDd5uxtpjk45wpVqxHwwKoRoK3uFMRozGMbS19TuZhYqlHc69Q1aHwr qr2w== X-Gm-Message-State: APt69E2fC18o545VUdeq7Mhjx7UxIKzXXzgIMrw2CxoE+rQGjKHOF182 ic12yJJMlLcz9sqMfjPhuYA= X-Google-Smtp-Source: ADUXVKINTkBQMEXom33mlrhwy7BFp05d0XJlOQE0qYudFxExp3cXrOuRy4uhXN6+PsIlY7uf+8OGxw== X-Received: by 2002:ac8:28a4:: with SMTP id i33-v6mr370719qti.112.1528936161648; Wed, 13 Jun 2018 17:29:21 -0700 (PDT) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id s12-v6sm3159581qkl.65.2018.06.13.17.29.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 17:29:21 -0700 (PDT) From: Ram Pai To: mpe@ellerman.id.au Subject: [PATCH v2 2/6] powerpc/pkeys: Save the pkey registers before fork Date: Wed, 13 Jun 2018 17:29:00 -0700 Message-Id: <1528936144-6696-3-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1528936144-6696-1-git-send-email-linuxram@us.ibm.com> References: <1528936144-6696-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fweimer@redhat.com, Ulrich.Weigand@de.ibm.com, linuxram@us.ibm.com, mhocko@kernel.org, dave.hansen@intel.com, aneesh.kumar@linux.vnet.ibm.com, luto@kernel.org, bauerman@linux.vnet.ibm.com, msuchanek@suse.de, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 9ef4aea..991d097 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -583,6 +583,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)