From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6767BC433DF for ; Wed, 8 Jul 2020 14:50:32 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3B8820720 for ; Wed, 8 Jul 2020 14:50:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="ceRc8dnF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3B8820720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4B22KZ6g83zDqfW for ; Thu, 9 Jul 2020 00:50:26 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=efficios.com (client-ip=167.114.26.124; helo=mail.efficios.com; envelope-from=compudj@efficios.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.a=rsa-sha256 header.s=default header.b=ceRc8dnF; dkim-atps=neutral Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4B22Cd1w54zDqWS for ; Thu, 9 Jul 2020 00:45:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 7E1261B620E; Wed, 8 Jul 2020 10:45:13 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Et16AzUfdKBt; Wed, 8 Jul 2020 10:45:13 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 54EE11B5F4B; Wed, 8 Jul 2020 10:45:13 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 54EE11B5F4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1594219513; bh=SHut1EIp+ELt3B/h+9ybKH0lxKyV695z/1ZHRom0nLs=; h=Date:From:To:Message-ID:MIME-Version; b=ceRc8dnFJdzCaBbyosfCmjVeDRK7SdhnMeTKjClPV63x4les66JXU1GQNy7+AOKOX UUUvFXpoYDVl9AmncqWxL+huG3Q+gh4b1DnT+FN2ZSlkq7m2lzsxJh3luqvczyOLrY uIv+5AKi6O96A1yR2RhXnux2J/XwvTx3/pWX8HL159L20IvZx4d+BnTKYrlTuBndJ0 IuFGoRBvkSFumwLrlcgaW+aeCFdcUKGynmrxh2fzqvSef45TMzdFWHfsRhUQR3U+WF uSsMpMYs8SKBQM960OVENYb6HrrSa7uK1U0hv7lLtNdSr6t1iddJYf29IJiaVGq/y5 X/eESI7088GcQ== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id iWFdNSxASxig; Wed, 8 Jul 2020 10:45:13 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 4C6071B6037; Wed, 8 Jul 2020 10:45:13 -0400 (EDT) Date: Wed, 8 Jul 2020 10:45:13 -0400 (EDT) From: Mathieu Desnoyers To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Message-ID: <873469922.2744.1594219513228.JavaMail.zimbra@efficios.com> Subject: powerpc: Incorrect stw operand modifier in __set_pte_at MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3955 (ZimbraWebClient - FF78 (Linux)/8.8.15_GA_3953) Thread-Index: ZxAKM7+GNRds2BqvHRzx1uNzHAoNkg== Thread-Topic: powerpc: Incorrect stw operand modifier in __set_pte_at 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: , Cc: linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi, Reviewing use of the patterns "Un%Xn" with lwz and stw instructions (where n should be the operand number) within the Linux kernel led me to spot those 2 weird cases: arch/powerpc/include/asm/nohash/pgtable.h:__set_pte_at() __asm__ __volatile__("\ stw%U0%X0 %2,%0\n\ eieio\n\ stw%U0%X0 %L2,%1" : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4)) : "r" (pte) : "memory"); I would have expected the stw to be: stw%U1%X1 %L2,%1" and: arch/powerpc/include/asm/book3s/32/pgtable.h:__set_pte_at() __asm__ __volatile__("\ stw%U0%X0 %2,%0\n\ eieio\n\ stw%U0%X0 %L2,%1" : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4)) : "r" (pte) : "memory"); where I would have expected: stw%U1%X1 %L2,%1" Is it a bug or am I missing something ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com