Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1200767pxb; Sun, 11 Apr 2021 10:49:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz25LEaX2M9jNHJyJ18Hlm2WK+R5GRyMfrKB8kyTLw7caxhUWTDXXUcb9O+bRlhNJQKyIfD X-Received: by 2002:a17:906:2e59:: with SMTP id r25mr15163560eji.268.1618163354361; Sun, 11 Apr 2021 10:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618163354; cv=none; d=google.com; s=arc-20160816; b=TbBsFrp1ECfx8Qcypw4pqVsO5emex4ecbkIGbtMMk4MTRJKaBRrqHlJgbThm+XOiZd XCmQgIzFSheUG6egvKNh4/uiTndhh/cIkk7tIbUGHNiJruOxYnT5ZYN481/auMzbRoBl bmYhzexabqGkmT6rNNd1lqPutsJGDc4D2/i/S5D1tzrwwkuGM1M+uOL68PuEj1tHbGtt Pu6RaJnBJV1P0ONX+C0PVskI297YOwqZkkOpnDnT/nhr1NTLvP8Gl57fCrY03OP/Af3y 4wmHK+ydXLfKCCXLDEClV28dXbTzKoZvYOiHJhfNJAiLjoV81MgXxsnKrgaYj/svh6Qd AwyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:message-id; bh=B4BW3yfnmwn3Y5mLWAhRPI9PjYBvCUwh0v0xSjYEHQU=; b=MmCV6Lnc5ZiiQNA9d83l1AeAZ7WMwCzhphTXfe12NI1oWq9L83LxXKxLdPdJPL/PKb 7tY9H8z7PQW5ejVonHwvyBiYeIivpbtQBUK3o7kYNgtINyQPDTvvMbt78WT7JFfZStJe w4VQScKQ2rDrq1IiJRZT8hPmYMtXbzXq+OAZqU/rCkHfac6qq2v7AdVXcJ8CL6JIZixp 4uiEjlhn/jAqZKp8qRWM2Y8jTLiVdoHGWDDYK0YbPTr7IL4Gu/QZtP+J1M9xk4096JQE m8jf0FPku0QA5u3nz5lq7V5lDZ+uez1TrPtMORUvcxWzPcu14MZgZjbiNUplfGyCdEaV 2E0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id op17si5297503ejb.131.2021.04.11.10.48.51; Sun, 11 Apr 2021 10:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236421AbhDKQkN (ORCPT + 99 others); Sun, 11 Apr 2021 12:40:13 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:25832 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236406AbhDKQkM (ORCPT ); Sun, 11 Apr 2021 12:40:12 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FJHdy6tXMzB09bC; Sun, 11 Apr 2021 18:39:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id ccZeimTKb--K; Sun, 11 Apr 2021 18:39:50 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FJHdy5tmDzB09b7; Sun, 11 Apr 2021 18:39:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 638FD8B770; Sun, 11 Apr 2021 18:39:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id oaTK-YMuW23J; Sun, 11 Apr 2021 18:39:54 +0200 (CEST) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 229C68B75B; Sun, 11 Apr 2021 18:39:54 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id C752D679DE; Sun, 11 Apr 2021 16:39:53 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] powerpc/signal32: Fix build failure with CONFIG_SPE To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux@roeck-us.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 11 Apr 2021 16:39:53 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add missing fault exit label in unsafe_copy_from_user() in order to avoid following build failure with CONFIG_SPE CC arch/powerpc/kernel/signal_32.o arch/powerpc/kernel/signal_32.c: In function 'restore_user_regs': arch/powerpc/kernel/signal_32.c:565:36: error: macro "unsafe_copy_from_user" requires 4 arguments, but only 3 given 565 | ELF_NEVRREG * sizeof(u32)); | ^ In file included from ./include/linux/uaccess.h:11, from ./include/linux/sched/task.h:11, from ./include/linux/sched/signal.h:9, from ./include/linux/rcuwait.h:6, from ./include/linux/percpu-rwsem.h:7, from ./include/linux/fs.h:33, from ./include/linux/huge_mm.h:8, from ./include/linux/mm.h:707, from arch/powerpc/kernel/signal_32.c:17: ./arch/powerpc/include/asm/uaccess.h:428: note: macro "unsafe_copy_from_user" defined here 428 | #define unsafe_copy_from_user(d, s, l, e) \ | arch/powerpc/kernel/signal_32.c:564:3: error: 'unsafe_copy_from_user' undeclared (first use in this function); did you mean 'raw_copy_from_user'? 564 | unsafe_copy_from_user(current->thread.evr, &sr->mc_vregs, | ^~~~~~~~~~~~~~~~~~~~~ | raw_copy_from_user arch/powerpc/kernel/signal_32.c:564:3: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [arch/powerpc/kernel/signal_32.o] Error 1 Signed-off-by: Christophe Leroy Fixes: 627b72bee84d ("powerpc/signal32: Convert restore_[tm]_user_regs() to user access block") Reported-by: kernel test robot Reported-by: Guenter Roeck --- arch/powerpc/kernel/signal_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 23fdb364b511..d489ccea2ab3 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -562,7 +562,7 @@ static long restore_user_regs(struct pt_regs *regs, if (msr & MSR_SPE) { /* restore spe registers from the stack */ unsafe_copy_from_user(current->thread.evr, &sr->mc_vregs, - ELF_NEVRREG * sizeof(u32)); + ELF_NEVRREG * sizeof(u32), failed); current->thread.used_spe = true; } else if (current->thread.used_spe) memset(current->thread.evr, 0, ELF_NEVRREG * sizeof(u32)); -- 2.25.0