Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2190707rbb; Tue, 27 Feb 2024 13:44:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCslbMLiL7X6Kk4z7Fl8RPPv+NbaUEQ3DTSrJ6xsNsWW3JIbizIO7O9yajEdyvY/YTbbPQQrnIjLzBVcAGyzfHBCSkVCbxnYljMm+pGg== X-Google-Smtp-Source: AGHT+IETd7i8SBiGqdiM1wU48rdHQaew26qDJNKvpa1DesQxdqn49mmPk6GZ2qretOduOT2TQzq9 X-Received: by 2002:a17:906:f6cd:b0:a43:c6d9:8bb0 with SMTP id jo13-20020a170906f6cd00b00a43c6d98bb0mr1526378ejb.59.1709070252527; Tue, 27 Feb 2024 13:44:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709070252; cv=pass; d=google.com; s=arc-20160816; b=WYzkwNrQsDBNR4VcgJLmPhSdTdgszwBM45Lkn6QIIK1KIxS0NI9TA02PP5ziTxhYTC SEWsSVry5MSywiIf6NzSCqHitNIOpQWS25/q7eDxrGkml6awARSiGzdbklDwbT4OWctI TDduBCKCLj+ehAPPueFUqJ9ICpcLIJbJwrr4rZcm6w66PE6Odtq40fFF77Iese5EAQpb lMc5bOeE6KW4RCj8bJuj+bPNdLPouKmtGD1jS3SUVBIvQa9V4ZUlabN/EhDqIt3c2Vtl SskskznEohV7d8eYQZEnfW5uKlnq6e62Qs1TiJNYjmJylfVLziMcJU19TvfRi8Ami6FJ EKcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=m+I5vRcrSCN46bAMlG4vwffCnArGEjnYvJmrkNKS1Ms=; fh=G0OavfMMhTNwGmnOMW7TiAwGc3LEXuBwvwCV2rr7weo=; b=iCGH37g843C7GmBrUy77Vk45kY51q3gM2S7hb40VlwpKURT5ZNI4LzVzg+oECiFVIZ 7Tl9nJ4vXqb8PD4DUSW/VHfXYQhqAQmBpUcE8zdCPDARy7sWV3YJsiTXf6oDHVO3Vdzv h/sfaotRnEeUQ+/xQ6Yn7KpaSJ3T8rqo1dHg+FyVN5cM89XzIYjO8fklQxXuVrngJvFg MLdclD46YJUFaBin2Jn4dLQ0coTtS5CoHT7KdXXFGuuYtM+TkyGWWbtP143kRzlNd8rW idV6FkZa/HfwY2/6iE5vcyiUC0xLd3GTb8jSKzrpOpZ8o2yID0krljmuN2zm8azrFaGD nS9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=msOK8oUm; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-84061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jz12-20020a170906bb0c00b00a3f4768ad73si1093527ejb.1038.2024.02.27.13.44.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:44:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=msOK8oUm; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-84061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8385A1F2B8B0 for ; Tue, 27 Feb 2024 21:43:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84B9614F961; Tue, 27 Feb 2024 21:43:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b="msOK8oUm" Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2803B2D60B; Tue, 27 Feb 2024 21:43:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709070210; cv=none; b=Hb1UGycVXqjM+hu1KUUXA0Tp5RBgrFxMnoOFpj9Rt7qhaRvK6LDIaL5ym7ASt3JBsaPNLHRrCSWJpVjBX7BfhG8a1kE+QsmYGot2w9UNIbM1MI9Ci4S0ypld0XUcNIV6rbCyqMPcTrBcYvdgCpmZnvO8SvwMhXcTEOH7tuKPSm8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709070210; c=relaxed/simple; bh=jt8unC483IhQ8MJvE5mBrE1Joy0tUhMSb/gpWTBv198=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jxMp2a0D189u8m0Wa6O5FdWV4qFaogflwn+EXkvyk2LHiB3MJIvkFi413U1CkhdM5KY9y4QRDkJkTPVqic9iTkwXBrtfOjDevDY97sP3NML8qPKUciZ872mQX+y/seGMBYoJd0e5Wd6cY+6Mb/kdl1CJ7EkQRg3ubokLO43XNik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b=msOK8oUm; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1709070190; x=1709674990; i=deller@gmx.de; bh=jt8unC483IhQ8MJvE5mBrE1Joy0tUhMSb/gpWTBv198=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=msOK8oUm2aaYzEnf0rMTvQj5nQEChAtTry6ADLeVBArR8Efjs9NblokNDPnO7hMg JjA0PFOBtV5Hwv6I3aVm5Yr/nrsli/IXEXTA7nk2G4mKKR+8oqiCzSVy8xm9CclEn U8hzx/IUSIh4rLE/PmGCaLccNt2eiCMTLJHAhjFUB3fJQqP0zUD1zc4zn4r1uP3X+ LMxI3p4XQZrwxGq9IEp4zFI8ad7Puo6BcrUj+mwr4pRoUOdx3IQECrUYRvHFR0u1h uPTtKzW7yGo05YzyL86fvmmC5dUoO1xpGR66EGxMPn99ENBqZzjdj+2CN6U/lSt57 4dH9iMcSzl+CrFNYUQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.55] ([94.134.157.76]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MulqD-1qo4rt0fXX-00rnpP; Tue, 27 Feb 2024 22:43:10 +0100 Message-ID: <00ea2941-0289-440b-8281-84d283d796b3@gmx.de> Date: Tue, 27 Feb 2024 22:43:09 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds Content-Language: en-US To: Guenter Roeck Cc: "James E . J . Bottomley" , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240227203351.3445929-1-linux@roeck-us.net> From: Helge Deller Autocrypt: addr=deller@gmx.de; keydata= xsFNBF3Ia3MBEAD3nmWzMgQByYAWnb9cNqspnkb2GLVKzhoH2QD4eRpyDLA/3smlClbeKkWT HLnjgkbPFDmcmCz5V0Wv1mKYRClAHPCIBIJgyICqqUZo2qGmKstUx3pFAiztlXBANpRECgwJ r+8w6mkccOM9GhoPU0vMaD/UVJcJQzvrxVHO8EHS36aUkjKd6cOpdVbCt3qx8cEhCmaFEO6u CL+k5AZQoABbFQEBocZE1/lSYzaHkcHrjn4cQjc3CffXnUVYwlo8EYOtAHgMDC39s9a7S90L 69l6G73lYBD/Br5lnDPlG6dKfGFZZpQ1h8/x+Qz366Ojfq9MuuRJg7ZQpe6foiOtqwKym/zV dVvSdOOc5sHSpfwu5+BVAAyBd6hw4NddlAQUjHSRs3zJ9OfrEx2d3mIfXZ7+pMhZ7qX0Axlq Lq+B5cfLpzkPAgKn11tfXFxP+hcPHIts0bnDz4EEp+HraW+oRCH2m57Y9zhcJTOJaLw4YpTY GRUlF076vZ2Hz/xMEvIJddRGId7UXZgH9a32NDf+BUjWEZvFt1wFSW1r7zb7oGCwZMy2LI/G aHQv/N0NeFMd28z+deyxd0k1CGefHJuJcOJDVtcE1rGQ43aDhWSpXvXKDj42vFD2We6uIo9D 1VNre2+uAxF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3/yWf FwRDcGV6nxanxZGKEkSHHOm8jHwvQWvPP73pvuPBEPtKGLzbgd7OOcGZWtq2hNC6cRtsRdDx 4TAGMCz4j238m+2mdbdhRh3iBnWT5yPFfnv/2IjFAk+sdix1Mrr+LIDF++kiekeq0yUpDdc4 ExBy2xf6dd+tuFFBp3/VDN4U0UfG4QJ2fg19zE5Z8dS4jGIbLg== In-Reply-To: <20240227203351.3445929-1-linux@roeck-us.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/1ym+tJ7pi4GE6vNP5deNz7oOXAYx/Ru2jHagOnFxFfafytxJY/ wEEIxma0amCz6RNy7jPJWHbnkfX4eV20qX34vI09YLmYBYIZuRiqJsnY+i2HLYpqjbVlQBq BdBIEP9d+ydDJR0hg3EAh7QlSbFNK/kmX8GZpFUmAT6k6WxCJTiKFp4/JL11oBKfD9CWmD/ dBNrqPRCMwuJGleVu9uoA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:nvU+gO8JLzY=;HmlVYUv1uymRKPhnHVVNUulnj7G mFQllGoXlxmRR2I03Ha+AC8cpsnM2eYUEL0YYqiTi1M4Ft6IOlLu3HfA8FselcZ46J1hGF6Nr lM6JqKt6+aGqLHdp2HprIYQ7yf5GZuTVJ6HLViH1kQTpGJi9GB3caArSHvRYdqe+Uo89q1gB+ Db3aRwNCJYJk+Juk66QmoDP965AZEh/oRNZHiNxU2o0B8MHZtg/f8jTWq3pB5H2+htB1W/xu6 QzhsNruQhnrEXR+otWiWl/YVPDSxZBm5z2TNRbh733tozhqxA9ZdrcriRrpVDEO4BfhBSypmW eIAux1nrXsy4JRP6e9wSPHJaQ1qldVPR0pIfqDIt96STtPf0u48dQn2JGt0GoH7+mDonEZJ2X X3ZO9fBeC4u6/T35kiUUrNhyqayFAvLbMnyknMHnwnU3aXXh6XiTujUAU6eQOy/o3rm9yObUg y5Tb4LeRMdhyT+/q+jOqIHamoNAGbdgTc3zT31N7Ey0gF9L1Z6s3R4/ORMShOoNS1gkAMxgkV 0JkN2usA9JHFpo1tHVyISy8QML28vFQmWC/4xH21Eg4M13olTboBu9iifMHPLUKisFsZ28vCX acwHa8R6eNIymvBWS25HL36bnLBYBiHQaJz+5OiyZDmnE9gREuArHwq9YHuJ2qFpQcBEHO0ex XyVIJGSf3vDmRawxxe9lj4uEcYPdbu9TAIlDpyc/PRxLYFv+ea5Ihy+BD3NulKmZ6By/6nJK/ EMMXWWA9Ds3GAKuq6k+eeAt/H3q2upskUBKuI2LJwErzzq0y4EFpvnx0wd9/e2G4yQ48qgY3i VculGdm9awwBsYQeNvTJcvTB/svOF26eGZo9T0yeG5rN0= On 2/27/24 21:33, Guenter Roeck wrote: > IPv6 checksum tests with unaligned addresses on 64-bit builds result > in unexpected failures. > > Expected expected =3D=3D csum_result, but > expected =3D=3D 46591 (0xb5ff) > csum_result =3D=3D 46381 (0xb52d) > with alignment offset 1 > > Oddly enough, the problem disappeared after adding test code into > the beginning of csum_ipv6_magic(). > > As it turns out, the 'sum' parameter of csum_ipv6_magic() is declared as > __wsum, which is a 32-bit variable. However, it is treated as 64-bit > variable in the 64-bit assembler code. Tests showed that the upper 32 bi= t > of the register used to pass the variable are _not_ cleared when enterin= g > the function. This can result in checksum calculation errors. > > Clearing the upper 32 bit of 'sum' as first operation in the assembler > code fixes the problem. > > Acked-by: Helge Deller > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Guenter Roeck applied. Thanks! Helge > --- > v2: Updated subject, clarified that the problem only affects 64-bit buil= ds, > added Helge's Acked-by: tag. > > arch/parisc/include/asm/checksum.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/parisc/include/asm/checksum.h b/arch/parisc/include/as= m/checksum.h > index c949aa20fa16..2aceebcd695c 100644 > --- a/arch/parisc/include/asm/checksum.h > +++ b/arch/parisc/include/asm/checksum.h > @@ -126,6 +126,7 @@ static __inline__ __sum16 csum_ipv6_magic(const stru= ct in6_addr *saddr, > ** Try to keep 4 registers with "live" values ahead of the ALU. > */ > > +" depdi 0, 31, 32, %0\n"/* clear upper half of incoming checksum */ > " ldd,ma 8(%1), %4\n" /* get 1st saddr word */ > " ldd,ma 8(%2), %5\n" /* get 1st daddr word */ > " add %4, %0, %0\n"