Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2065173ybe; Tue, 3 Sep 2019 07:31:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD/nFtBsopoXZ3ChW6VrnWQwkA34fZS5A2op7/BSkS1W+e8ml/iatjUgT5mSPgrhqD0kTk X-Received: by 2002:a65:52ca:: with SMTP id z10mr31503011pgp.424.1567521063482; Tue, 03 Sep 2019 07:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567521063; cv=none; d=google.com; s=arc-20160816; b=pbtspCnMcDxll3TMwealU/ecUqYMJgrON4JGmvhk+kSvMA/OAHr1sE+d/fn3iFu3kn kAZPfRXkZIJgojL4rp9NaJJ/OT1SnKNfSqOFazlMvC4sybYABKM1DpG8eXf4oW2XpDyy 6cJhvQFjZKzECyN4R5Bu6oZSI61IXgmEbx3QbDHDb99kKfl7LMGDVdEwT6AzbK3QP9xy k3EIxIw/z4Mof9nOOWaqEKruVK5ktThK3H411m5JoX9x6ObJueZoqRH6q6lahyQ9BQJD oXm1bqdLe5VrP4dUpGp+FiA2BcV0I7y1z0TQ7uXUj6o0LND1fqmpjOY65XXKDCjBzLOM f+ZA== 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=kXB46zG+6q2eXqvLmy0/IgVzs9oH8tQXmcdlQmiB+wg=; b=uEsz8+MwLKTLfkkDdOyEcqbLlFwFap97jz0jfHFvtF/qUilOKeAdHMFVZ975l71bXE 7eQU3FCslvMfEgEM/vHHbzJ1wTMyQC5mAitMaxgsmKY0JUXoLJ8sBUxpTdfIeKfk74w/ wZ6Mbt0uhMt1LQzKGuZmR0U7LA4I6KJ3R+k5J0MLjBil1UMLseEHTsxcNiHTj/jrLeZE CYyj/SJsxWjxmTrJ15pQOlMaOkrmnP6N9UgsJS6GD483GLMDEpWGM1WXGkBp7EOms67S 9gWQmQfTJOJrSAQ0rV8T4rGgJIjOMzkh4PFic1k8VOURhr8ZUksMki4emLxuQffCj2Dr c/cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=NadPAAvo; 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 h95si8934984pjb.92.2019.09.03.07.30.47; Tue, 03 Sep 2019 07:31:03 -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=NadPAAvo; 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 S1729679AbfICO2O (ORCPT + 99 others); Tue, 3 Sep 2019 10:28:14 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:45354 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729659AbfICO2N (ORCPT ); Tue, 3 Sep 2019 10:28:13 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 46N8ST1qcLz9ttRm; Tue, 3 Sep 2019 16:28:09 +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=NadPAAvo; 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 YIqAoA6_GE1M; Tue, 3 Sep 2019 16:28:09 +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 46N8ST0jlLz9ttRl; Tue, 3 Sep 2019 16:28:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1567520889; bh=kXB46zG+6q2eXqvLmy0/IgVzs9oH8tQXmcdlQmiB+wg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=NadPAAvoij6yX6RdAFRjaR6rpb/dkxjSxBl8j5gqqihJMv86k9SOHVFf3G90VUqTH HhMohZu/PT9TKaaLsqXnapF2ZadS/o7ZcSFQpAKcQalYSpNNzAXTk3ElF93YgzXC+H dhY/cDlTR4wrqUoaKBESSfRJofXwcs3s7TZF1fdA= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 934488B86E; Tue, 3 Sep 2019 16:28:10 +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 6LTJD3JQLISg; Tue, 3 Sep 2019 16:28:10 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 663128B868; Tue, 3 Sep 2019 16:28:09 +0200 (CEST) Subject: Re: [PATCH v2 3/6] powerpc: Convert flush_icache_range & friends to C To: Segher Boessenkool , Alastair D'Silva Cc: David Hildenbrand , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Nicholas Piggin , Mike Rapoport , Paul Mackerras , alastair@d-silva.org, Qian Cai , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Andrew Morton , Allison Randal References: <20190903052407.16638-1-alastair@au1.ibm.com> <20190903052407.16638-4-alastair@au1.ibm.com> <20190903130430.GC31406@gate.crashing.org> From: Christophe Leroy Message-ID: Date: Tue, 3 Sep 2019 16:28:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190903130430.GC31406@gate.crashing.org> 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 03/09/2019 à 15:04, Segher Boessenkool a écrit : > Hi! > > On Tue, Sep 03, 2019 at 03:23:57PM +1000, Alastair D'Silva wrote: >> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > >> +#if !defined(CONFIG_PPC_8xx) & !defined(CONFIG_PPC64) > > Please write that as &&? That is more usual, and thus, easier to read. > >> +static void flush_dcache_icache_phys(unsigned long physaddr) > >> + asm volatile( >> + " mtctr %2;" >> + " mtmsr %3;" >> + " isync;" >> + "0: dcbst 0, %0;" >> + " addi %0, %0, %4;" >> + " bdnz 0b;" >> + " sync;" >> + " mtctr %2;" >> + "1: icbi 0, %1;" >> + " addi %1, %1, %4;" >> + " bdnz 1b;" >> + " sync;" >> + " mtmsr %5;" >> + " isync;" >> + : "+r" (loop1), "+r" (loop2) >> + : "r" (nb), "r" (msr), "i" (bytes), "r" (msr0) >> + : "ctr", "memory"); > > This outputs as one huge assembler statement, all on one line. That's > going to be fun to read or debug. Do you mean \n has to be added after the ; ? > > loop1 and/or loop2 can be assigned the same register as msr0 or nb. They > need to be made earlyclobbers. (msr is fine, all of its reads are before > any writes to loop1 or loop2; and bytes is fine, it's not a register). Can you explicit please ? Doesn't '+r' means that they are input and output at the same time ? "to be made earlyclobbers", what does this means exactly ? How to do that ? Christophe