From patchwork Tue Feb 8 06:57:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike X-Patchwork-Id: 1589671 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P3azDx6E; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jt9ft5bCnz9sFn for ; Tue, 8 Feb 2022 15:55:01 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Jt9fr3CX8z30Pf for ; Tue, 8 Feb 2022 15:55:00 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P3azDx6E; 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 (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::e29; helo=mail-vs1-xe29.google.com; envelope-from=michael.heltne@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P3azDx6E; dkim-atps=neutral Received: from mail-vs1-xe29.google.com (mail-vs1-xe29.google.com [IPv6:2607:f8b0:4864:20::e29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Jt9fX22T8z2xF0 for ; Tue, 8 Feb 2022 15:54:42 +1100 (AEDT) Received: by mail-vs1-xe29.google.com with SMTP id g10so2112895vss.1 for ; Mon, 07 Feb 2022 20:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=fD1hXo7qbnaSareXBr4uvCy8YTTwxcAvgF9/GXRp2Rg=; b=P3azDx6EqoNGBwRScKbwSdobHCcjQPDa0qWkZ22zM6ylu4/sAsp/wWiRKYBijRFT+1 C7iJ7ZE4vuaZNIeSRp21/HyjX3hKJvGVmqUsHhNOhDiKqCpYwSjoCTjb0Qj+A6tvcSuR e1zqurlzGuHJkYgScvRpXAxrL02/I4IjFtK21hsBEWJ8drPXEWljEphCoeja8FDWZ55C aeutSlQGLWZ0Yd13ONrgrfB+2htuA0ZDFPxmTJDwB3vo4S7cZFzGSg32bKVO9gLrCzV2 /C49VWRzGoCs7ho03bERwcghIoc7j9aVZD2kcNQscsr2ApT2nUEFgH13VBiVVb7A6vJL MOqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fD1hXo7qbnaSareXBr4uvCy8YTTwxcAvgF9/GXRp2Rg=; b=O7SWIBaPFBd0POtcJCW0Jaep9YJrPEAdb2YwoTmuDkBL/zUuFqPUxQBZ5F29AgeoAY iuhAZFXp+kOF1tkU78ZOeEc1RSaeVojt0aloLBv7iUd6qlC+jwYZI5uYIkS0qP9Z9lYW 6yHzpgZ8TG6scIQCFbplCTsx7ftLGS1kubh47+c6zr1Vs6w9cS4pdBM5o0BCSwJsSbCO OJOcpsJTVHYl6lp3g1muLPqx6D1HR812LYp0T0TzV5Kotu4L882OH5N2vSSLPn0KC3IA wL4t78Abkue53EVWhuBPnywG9BSRT9hoW6LlqMWwn05ad5IzyyuJc8xot+wGo/iVmqt5 MunQ== X-Gm-Message-State: AOAM531AhIcKUtxcI8Ld7DXH5W/L3m/mn2gPcSp/IOqx1ugCMuO2+dfc 2aK9XawrV0FULcTZGgCBxZBIXTiCqLEv/Ju8bdxfORinnn4vDw== X-Google-Smtp-Source: ABdhPJwt6vJ4yp+wtZ2AJS6YvuCDgqBLi13K+6b8Fr1rplk27PDNcVoxGMgCjLA9yOPURl2oQR1AGANbck/BFi5IAgA= X-Received: by 2002:a05:6102:2416:: with SMTP id j22mr1123383vsi.8.1644296078743; Mon, 07 Feb 2022 20:54:38 -0800 (PST) MIME-Version: 1.0 From: Mike Date: Tue, 8 Feb 2022 07:57:14 +0100 Message-ID: Subject: [PATCH] powerpc: fix building after binutils changes. - but the 'lwsync' question To: "open list:LINUX FOR POWERPC..." X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" We are seeing errors like ' Error: unrecognized opcode: `ptesync'' 'dssall' and 'stbcix' as a result of binutils changes Unless 'stbcix' and friends aren't as exclusively PPC6 as I've gathered from binutils/opcode/ppc-opc.c there shouldn't be much of a problem, but i suspect a lot more needs to be done? The following builds for PPC32 but also considered a cry from a powerpc64 user: https://github.com/threader/linux/commit/226efa05733457bb5c483f30aab6d5c6a304422c I've been running my PowerBook G4 with this 'lwsync' patch for a few weeks now, but due to, uhm, soft bones, i haven't ran any benchmarks or have been to distracted to do so, but thought maybe timing an 'apt' operation in single user mode might reveal something, if it's being used properly at all....? Now I remembered reading something from 2013 on 'lwsync', https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html https://gcc.gnu.org/legacy-ml/gcc-patches/2012-07/msg01062.html so that would end up something like break; #ifdef CONFIG_PPC64 case BARRIER_PTESYNC: Best regards. Michael Heltne --- a/media/thread/12fd50d6-d14c-42af-ad1d-a595e5f080cd/dev/linux-main/linux/arch/powerpc/lib/sstep.c +++ b/home/thread/dev/linus/linux/arch/powerpc/lib/sstep.c @@ -3265,7 +3265,11 @@ void emulate_update_regs(struct pt_regs *regs, struct instruction_op *op) eieio(); break; case BARRIER_LWSYNC: +#if defined (CONFIG_40x || CONFIG_44x || CONFIG_E500 || CONFIG_PPA8548 || CONFIG_TQM8548 || CONFIG_MPC8540_ADS || CONFIG_PPC_BOOK3S_603) + asm volatile("sync" : : : "memory"); +#else asm volatile("lwsync" : : : "memory"); +#endif break; #ifdef CONFIG_PPC64 case BARRIER_PTESYNC: