Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1406182ybm; Thu, 23 May 2019 00:02:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuxEnuVES0bBbcmfytAbUcSx/+PVCosIyCChyCveItstS5EBDJcuyXuS0fRqSgVXjas0PX X-Received: by 2002:a63:27c3:: with SMTP id n186mr91316460pgn.189.1558594968473; Thu, 23 May 2019 00:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558594968; cv=none; d=google.com; s=arc-20160816; b=ywXVYN/PzLAmAKgMeXSrMVazdtUf0o5L9c4E3XsDSJOz/sgGZ3I1p2JZMfPGTVhD82 3+yoYfXG3YDnmj/kkbRh6GTyFxApDbhZH6QGDiDC1YgnxdAogiop7k72GpIn3ZKDGwXC q36zsfkyQtB8zn/kwVi/o37hAhifagkwIMOF8980Xff1Vtd19FtTQOp7FNTjOiMR8U1g MSRicocWnEGhpDQDXMUPceOTFFRREK186W1SBaElDWjRQr46cKrG7SZ/F9HuWpSnV2To GGkQxdVlySWl3GQ8mKGyJZe+JQknCLJ1E62+d5RM7ROPGGWm0hX1iXcww2b92QhLjyof EIIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=SUPlvML+tdx1yeEzk+b+73oi/1jwsm7iSUeW9uFAnME=; b=JuHgRc/f+wUhID5o4i6y9w6puwAp3QCra54I7v1Bs4pwhro4hHihUYwbblf6psZPJc YfoYLItkBPHfkjC+XO+r5+/dJ79Q6P4z1KGTxYexA9QbTr2g8NsJ8OubEkb1EDRdUM0j KFhLwOXjAdWue7yu5jjxDeh62y3PYK9IACx7FK91X7/y1yOMR79vN1vy6XhyUVSYtbzX qv3HFetRWBzfB69jCqXenBFNfYbDMUKu2pk1NKtiv7dFlW26r+vgJBy8AqzbjvqrfwsG gRSeo+mOPU8Qzwi6lQPTVxu6ArS+aiT/XJQayVrXWvFOLLEhqLMwtt4mzLhfTKtuHhW8 ooyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=jnQhvOhi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si14781336pgu.316.2019.05.23.00.02.31; Thu, 23 May 2019 00:02:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=jnQhvOhi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729937AbfEWHAz (ORCPT + 99 others); Thu, 23 May 2019 03:00:55 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:64092 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727466AbfEWHAv (ORCPT ); Thu, 23 May 2019 03:00:51 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 458gPr10Z2z9v1Px; Thu, 23 May 2019 09:00:48 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=jnQhvOhi; dkim-adsp=pass; dkim-atps=neutral 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 ZgPyeXb_h0lj; Thu, 23 May 2019 09:00:48 +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 458gPq70rCz9v1Py; Thu, 23 May 2019 09:00:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1558594848; bh=SUPlvML+tdx1yeEzk+b+73oi/1jwsm7iSUeW9uFAnME=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jnQhvOhiUB08k1W4VZVgqaHp3zR+5g6/5YQZAcS/+o5M5np7VNTGhKaEgJhnT0KG3 rgJiaSIg8mjdh2nGQk+3oA78ZDMIxX1gXI2JOpMtME95WJPpLcbpdfyuT8V9f9fwv1 vHcou2OEK1MwvAWTVx5gALiOEoShSsdaaw5Uf3+w= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E99318B75A; Thu, 23 May 2019 09:00:48 +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 eVuKMmI_EIz3; Thu, 23 May 2019 09:00:48 +0200 (CEST) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 824F78B77D; Thu, 23 May 2019 09:00:48 +0200 (CEST) Subject: Re: [PATCH v3 14/16] powerpc/32: implement fast entry for syscalls on BOOKE To: Paul Mackerras Cc: Benjamin Herrenschmidt , Michael Ellerman , Nicholas Piggin , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <3e254178a157e7eaeef48f983880f71f97d1f296.1556627571.git.christophe.leroy@c-s.fr> <20190523061427.GA19655@blackberry> From: Christophe Leroy Message-ID: <98bf5745-88ae-7f17-fcb9-7d06ba5b9e49@c-s.fr> Date: Thu, 23 May 2019 09:00:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190523061427.GA19655@blackberry> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 23/05/2019 à 08:14, Paul Mackerras a écrit : > On Tue, Apr 30, 2019 at 12:39:03PM +0000, Christophe Leroy wrote: >> This patch implements a fast entry for syscalls. >> >> Syscalls don't have to preserve non volatile registers except LR. >> >> This patch then implement a fast entry for syscalls, where >> volatile registers get clobbered. >> >> As this entry is dedicated to syscall it always sets MSR_EE >> and warns in case MSR_EE was previously off >> >> It also assumes that the call is always from user, system calls are >> unexpected from kernel. > > This is now upstream as commit 1a4b739bbb4f. On the e500mc test > config that I use, I'm getting this build failure: Is that a standard defconfig ? If not, can you provide your .config ? > > arch/powerpc/kernel/head_fsl_booke.o: In function `SystemCall': > arch/powerpc/kernel/head_fsl_booke.S:416: undefined reference to `kvmppc_handler_BOOKE_INTERRUPT_SYSCALL_SPRN_SRR1' > Makefile:1052: recipe for target 'vmlinux' failed > >> +.macro SYSCALL_ENTRY trapno intno >> + mfspr r10, SPRN_SPRG_THREAD >> +#ifdef CONFIG_KVM_BOOKE_HV >> +BEGIN_FTR_SECTION >> + mtspr SPRN_SPRG_WSCRATCH0, r10 >> + stw r11, THREAD_NORMSAVE(0)(r10) >> + stw r13, THREAD_NORMSAVE(2)(r10) >> + mfcr r13 /* save CR in r13 for now */ >> + mfspr r11, SPRN_SRR1 >> + mtocrf 0x80, r11 /* check MSR[GS] without clobbering reg */ >> + bf 3, 1975f >> + b kvmppc_handler_BOOKE_INTERRUPT_\intno\()_SPRN_SRR1 > > It seems to me that the "_SPRN_SRR1" on the end of this line > isn't meant to be there... However, it still fails to link with that > removed. This SYSCALL_ENTRY macro is a slimmed version of NORMAL_EXCEPTION_PROLOG() In NORMAL_EXCEPTION_PROLOG(), we have: DO_KVM BOOKE_INTERRUPT_##intno SPRN_SRR1; The _SPRN_SRR1 comes from there Then in /arch/powerpc/include/asm/kvm_booke_hv_asm.h: .macro DO_KVM intno srr1 #ifdef CONFIG_KVM_BOOKE_HV BEGIN_FTR_SECTION mtocrf 0x80, r11 /* check MSR[GS] without clobbering reg */ bf 3, 1975f b kvmppc_handler_\intno\()_\srr1 1975: END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV) #endif .endm Christophe