Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2132536rbb; Tue, 27 Feb 2024 11:34:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9AxOaORe6gD+sQw98q/7PwKDbvZwPOu0lsfXhnRIMWOrJi8lCP3sCW+E+0+Wva9xHolLod05ogSkaxrQVid721lBjeGqVSFWglJhL3w== X-Google-Smtp-Source: AGHT+IHWbSUDcTfS0i3ZKMOEbbzxaF1YoL1ObVkvSOrKyfbdP8lJIMayZ6r16UFMkFwsu1kE433/ X-Received: by 2002:a17:902:ec85:b0:1dc:6528:d495 with SMTP id x5-20020a170902ec8500b001dc6528d495mr12535406plg.27.1709062450466; Tue, 27 Feb 2024 11:34:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709062450; cv=pass; d=google.com; s=arc-20160816; b=HAax9vuQD1kAg7KgwZ12g0qAFivguPJ7tD7kuFwvxDz1KkKzXtBqZ3BWBWNNjhl+2e ivR3hjYQXS+SEgTMCMntYsw2iXmHsvmlVZ+JTm78+3/njYs2f1udA7JmTDUR4lZzVGgd Gq5kQpR/X5/f+pGnfW/+rrAjV4WOH5425r/8QuLVOr/+9jPTFMNJWRT8vpu/7SVirC1F xqp/kzitWbbGI0+r3/G+cO2r4BO/2rt2bauFLq/zzjoxCrBLOcxWl+RTBalTpAVxRvs5 PTclHUJp8Pw7eu4BmQMGe21oqcwmJ+4a1WqYFxLHAAwDwUp98dijeQKrOjKMCCZhZIW6 YAxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:sender:dkim-signature; bh=cpCYkRMcyEqaONCfb5aChB5RBA9px7XTtxAnjvNYuKY=; fh=bxoE7bLOrorsG28yULe5ttroJhk+zclckGX8M2OqStw=; b=h5OiLc9tyVmc8GUn1eY6bNA2FVk6K1sr7p+Ya9ao5ouZR3BZsRyIbQXPLncv3rNpMt U9dKwTHco5/4x03uJJhl2XNhYaWQuxFn6FPK7p+KpnDJgGQPs3xOceacux68Nv6hrNrG y+tmZUGy/LjxdrNPGd1O5KJRFN/0sCAd/ytFQgDHb0wrBB1CVcIya5GfrqdhUftyhLXB zagqbxesao2cd7fomP3QW2WAHpnxOjWfdwVGzMXYpv0r8yinlzn1PzpNcAWiaMBpIAaQ n+dkNuu7f0QkLZymZ5+Uwo5b1KvLHkuTaPfu8MpyvKgfZx+sWh6CumcjqWDSpGXvDLxz 9BcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="iLQq/bjY"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-83863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83863-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c12-20020a170902c1cc00b001d3c375bff6si1784882plc.534.2024.02.27.11.34.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 11:34:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="iLQq/bjY"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-83863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83863-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 05488B26E73 for ; Tue, 27 Feb 2024 18:53:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CF9550A7C; Tue, 27 Feb 2024 18:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iLQq/bjY" Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F7301EB20; Tue, 27 Feb 2024 18:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060020; cv=none; b=HaQCjulwR0xi/uoxIP8atj7Iz6mVYOgzrNYiIIBFEr3cNiwrit2LXgH9qYUsNcy6rWxxTi1QK1+iR8VXl6WxMO/SDAYGYhTPEmSRCTzwCNwc5JfxsQqztplRqC2PfdjXYl7Z+MhzgcoS0CegSG+xO0crDKI2/mL/HvRyADJ8N6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060020; c=relaxed/simple; bh=XWdSQTiJ5UeZ7Y9pEB7wgt+hK9Ql9hUqNK43darvBNA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=mm/WttfI3Gc1GzqezoUOQAdQ/GTx/8N5y3q+UOaRZtKRJcScsdN9ImWQxdoht0rdHVZ4Ovrdpz2ESorH2enP1O/o+o5vgvgryQQBYqM3Ifma1aWuIilzEZlvjZt53O0T4KoU2mnvcrah3HtjhR47Qz8RyEzJ69PXusNTyCUoOH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iLQq/bjY; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e558a67f70so286755b3a.0; Tue, 27 Feb 2024 10:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709060018; x=1709664818; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=cpCYkRMcyEqaONCfb5aChB5RBA9px7XTtxAnjvNYuKY=; b=iLQq/bjYXCiG/1mRl3JsAGnABluiXGRdUvO08sEkU2kpKk2JTlwSs3R4nJ+86cYzYG UuIhDpEGanOD7feoSdj1W2YLamh4IKnrTdUss5Dnlg18v910HiUJJjEEE1MHkb8raJEv YWJnfMdhJEDh/SGtsa7COUpNjH7YbhiXEUzNUqZ5/t88aUsPBbxiMQHtCttyIfVRwe98 NDsj88wfRbAy5X3EO9WAiH5LfB/9FlyTaKKp2RThD5+4xfBB7XROUHFoq067JFeI6Ws0 mgqSkGUVbO0Er3G991uhR2uGy4cMewAZBQh0kXaIhwvSo0KrH52DN5QehPws+ugtT9pF PGKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709060018; x=1709664818; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cpCYkRMcyEqaONCfb5aChB5RBA9px7XTtxAnjvNYuKY=; b=iTvEPNkVQygFxUmVzmRN6TJXdi3hHQoKoMQcfD0on798PZqH6+RRyWw5JuJ5rhCN9/ lfJeMb1keSEVumW3SnBGNl7EK/Z2zrPLw4C3AUk4IYTJz3sPIFwxdJ48CcQxJIlzOFIC MNCbFaaecUjyw1//qTlRBRdD5LJRci2Xeh1fYKSrpJc2wUIF5l/kNQlrynnO5m8At6+J PfS2t0LqD1bcoEXKIv/sVYDBGShRqJa942UDQw9auA7LFiFJCyvLBgDQ8BGGqsDFeLrX a/aaMQQ4+FrXxLF1H7iiIek3jkFuuxCdu7aSxVqEngbN/oH2I7sxN+yP1FiS7Ppz4rFr dDWQ== X-Forwarded-Encrypted: i=1; AJvYcCUP9RS+tbwKfcCoXW/CYtYwUXrGTL3SQ7awAVKdmkGB6awB2Yt9qJGXwqVRYfnJyxMHb2uPlf1FJkEk/zWEF6I1DxxN7GaokmYfvgmzhbIBpeg+pzMwnn3RlsEkabiSrGPAfZSsi6OiEU4H X-Gm-Message-State: AOJu0Yy4Yrp35xftnPiS1AUMmRyB9EhM93LCCToL9Fhvuc3MnjbfR1RF +vL3gB61yfcgnvedxUNpuro/K7aMCnTYOo8CsS8xx/GoOs5a4dcbIcwz0e32 X-Received: by 2002:aa7:88cd:0:b0:6df:c3b1:1c2e with SMTP id k13-20020aa788cd000000b006dfc3b11c2emr11949486pff.30.1709060018244; Tue, 27 Feb 2024 10:53:38 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id y5-20020a62b505000000b006e4cb18123fsm6198444pfe.84.2024.02.27.10.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:53:37 -0800 (PST) Sender: Guenter Roeck From: Guenter Roeck To: Helge Deller Cc: "James E . J . Bottomley" , Charlie Jenkins , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH] parisc: More csum_ipv6_magic fixes Date: Tue, 27 Feb 2024 10:53:34 -0800 Message-Id: <20240227185334.2697324-1-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit IPv6 checksum tests with unaligned addresses resulted in unexpected failures. Expected expected == csum_result, but expected == 46591 (0xb5ff) csum_result == 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 type. However, it is treated as 64-bit variable in the assembler code. Tests showed that the upper 32 bit of the register used to pass the variable are _not_ cleared when entering 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. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Guenter Roeck --- Maybe there is a way to do this without additional instruction, but if so I have not been able to find it. 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/asm/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 struct 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" -- 2.39.2