Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp182798rdb; Wed, 14 Feb 2024 17:41:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXl2ma92DeEMEGZzSoJYT9vfvmfX2oDzEPTtEchvnnELLkCRLlBc2vbYvJYLE55Zj7JsfA+KZ5dXS7irQ0VcUEb2uZGCio84cPHADaepA== X-Google-Smtp-Source: AGHT+IFMvJV4cVT1kojl+t9eKToKW4AckMseX5Ke7NqRkrqIwCMJi4XJJPboRUEStUA1wmPbcygP X-Received: by 2002:a05:6830:19a:b0:6e4:2769:e9d8 with SMTP id q26-20020a056830019a00b006e42769e9d8mr274847ota.22.1707961301134; Wed, 14 Feb 2024 17:41:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707961301; cv=pass; d=google.com; s=arc-20160816; b=gTtzspcZbvyhcHs/goga1Xhg+dEeCXHwF8rY3/jw8l2cqh3QLYecgY7ltXaNjpYz1d iaIUHA/oVNYIt+MBT/zD7w7jeg9POiZt7o2REwy5CO6mCkQ+Y26EVOlNki5O1MQzTQaw HpHYNvj+/a8+O+GsajYZPKIPvE+l5GlxmE88Z4UR6lMUK9IdSKrQ1YjXGXtuBYulGrsU QvtxgLnWON94dFVmMCl6McxNxmLtKrbHq2Gr8LUiAVSybk8H5mcu+umKCQQD9nAeoXmw 7CfAdpvgTY99zrjhSg5hjvFCWaEeG+vymz/EDiadLofFimu3LSCoJKIegdQ6SFSI8t+g cDwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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 :sender:dkim-signature; bh=gedE0L9Ouy/oIx8vXboFUteCNYZmLOHoNTlwQC5vaB4=; fh=UJUq5JgYK1MHJwocA6l4a7BtohXpEEjR0/pca8H34i0=; b=qSlz4cdYgEaDY2BBp0nbzQIaJjGo2LXi5wzhTlwGXIWw6rapXujSUYpAJtjP9bL2Ro NmwauecfI6qZazxtKmFRMHoItd1rUjbAWlldQ8nSK63Vs1GvBRtsVd1QtAoHkpPNQ8kB YyQwQ6vszqrMK+vBDh+FgZquExsvEr03PF1BXzhRMhsqQSptbV1GEW28AoCs56PpFt+L j9qHSI8m5LdSpk9jZFpgUDV9rD2a0xJTryEqI+jEGVR4NK2rHTcAQegEQTUpSIPeAo2n QssJyMHtJnl+nFL+r9N5eIo2/OxkSTk5b8QnI4EVSuJh+3pWFoeYugOsaR7iqDoNIvjA j8NQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BsJ4FpBR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66227-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s130-20020a637788000000b005d8be4f9ef2si179591pgc.105.2024.02.14.17.41.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 17:41:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BsJ4FpBR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66227-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 4CCD2B21636 for ; Thu, 15 Feb 2024 01:24:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B774C17F5; Thu, 15 Feb 2024 01:24:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BsJ4FpBR" Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 3546D10F2; Thu, 15 Feb 2024 01:24:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707960256; cv=none; b=XmJBWS7pdyhsB+1zViuXYeoYF0Zlv857PeLSQXu4snMLBE1Pu/Il73OPFlT7dkMQ7ePPCwssOGwZGqPaLoRGcBBgH2r1r1BV3cOKXEOsiB1OrRrGobI/Kjv0vcyiRHW7XeKAVRz9ZkH6RtzuV0DnYRihZ8LCggtHNqwIVg250vw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707960256; c=relaxed/simple; bh=PgXSHMP1jNw+Xh52N9SCK2KPIf7b2fiKcPI3A90/8aY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lb+BrvEsnqrzUXvd6PGwRKOZOEc9QwOqgqMdewxaOSmRNY4SOT/SIo8IQgps3FKDEjn2IF3VHYyJAtY8Ml6/RfZqPw9BjxfY58P+D270Li1muX9nj8V1ToMFRKrbdH3W6u2V4FFnkbCwXQUm1htswSrrY3dy6OQXrTMIXKeihSo= 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=BsJ4FpBR; arc=none smtp.client-ip=209.85.210.176 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-f176.google.com with SMTP id d2e1a72fcca58-6e104196e6eso456452b3a.0; Wed, 14 Feb 2024 17:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707960254; x=1708565054; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=gedE0L9Ouy/oIx8vXboFUteCNYZmLOHoNTlwQC5vaB4=; b=BsJ4FpBRvJovcYn2/RQnfntX0k8oSjHz8uUdvG6qvO0XQATqNcG0nlH5UuY0E9b1Lg V5/GjAfJlrj6tPanKUMrsXXfcJEg9GZVaz7RwuvTIWwxzwdukJ8eRbM29AluR/YF2GHo 4IknZUkcy7nkfq90KVCp7TcG6RqqPCBaq/El2R/lcQeq86ltSNfVMQTt+yft1KyDUd2J CmiL6iTR5rJFVGTp6jz0YEWoNtaBUc4Cho1KMOFI12NMbBx3EpbWV1hhvP6y4Lm5XIIv ioDUa0hGPPQpzLedO1pVY+VT/nEWk5UjJbqS0r9m55CysX5hEp0SE27ORnFx9yorMI4p jGxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707960254; x=1708565054; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gedE0L9Ouy/oIx8vXboFUteCNYZmLOHoNTlwQC5vaB4=; b=CypMZli75dC4HWBOkhsraoUAcjv4p+VfcpYQKF3I2PES92kSQc/eXJklSshCJIq81/ MIPLzhxR0PviH5WPwbwRQpvunMoGVFbkqBtrVm57gF6w1FXDqfZ0uVXlq/TeO0ggilcP UdX4gjGwgf/casbOeWXqEl7u05VN4zKKzh8YaQM7KpVrAcyyAjJLVuwbiOQnpPDFSgJU Dumy2Z2gky5rdigyVFCkIbE/uz8gzURRzD2SwHavETMwmPk99NoLTYQCuzO0JOO8YImC Dsho00Yn6L9PnkhyWEEvYxZe/7/ubUur0MAMecKgYl0kSzhfp0RsgsoVGhadkdpNjZEW krvQ== X-Forwarded-Encrypted: i=1; AJvYcCXdqdP0FD/TL+Lk4iZxJz/oBOY895cjY+InmRfbaLHoIn9bUzwxf1DsKNs2e1MoJMo1pJD4VNfqCai8SfWIkrIN8LfH6kNEwc4oJ615 X-Gm-Message-State: AOJu0Yz1ZS77mvNF3l0mjBykQUpvGMJErkMiDSDmIRdFjUBu66BQyjfH VytTOiO2sLsfr14OpIGuCF9jlWf3bg0BdD8hjjeDPTdieE3LPd/9 X-Received: by 2002:a05:6a00:1995:b0:6e0:e618:7eb0 with SMTP id d21-20020a056a00199500b006e0e6187eb0mr651601pfl.8.1707960254432; Wed, 14 Feb 2024 17:24:14 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id o16-20020a056a00215000b006e0938f7c57sm86145pfk.121.2024.02.14.17.24.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Feb 2024 17:24:13 -0800 (PST) Sender: Guenter Roeck Message-ID: <285cd809-d5e0-4688-ace1-630aa8c30aae@roeck-us.net> Date: Wed, 14 Feb 2024 17:24:13 -0800 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 v8 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Content-Language: en-US To: Charlie Jenkins , David Laight , Palmer Dabbelt , Andrew Morton , Helge Deller , "James E.J. Bottomley" , Parisc List , Al Viro Cc: linux-kernel@vger.kernel.org References: <20240214-fix_sparse_errors_checksum_tests-v8-0-36b60e673593@rivosinc.com> <20240214-fix_sparse_errors_checksum_tests-v8-2-36b60e673593@rivosinc.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJM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o4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20240214-fix_sparse_errors_checksum_tests-v8-2-36b60e673593@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/14/24 13:41, Charlie Jenkins wrote: > The test cases for ip_fast_csum and csum_ipv6_magic were failing on a > variety of architectures that are big endian or do not support > misalgined accesses. Both of these test cases are changed to support big > and little endian architectures. > > The test for ip_fast_csum is changed to align the data along (14 + > NET_IP_ALIGN) bytes which is the alignment of an IP header. The test for > csum_ipv6_magic aligns the data using a struct. An extra padding field > is added to the struct to ensure that the size of the struct is the same > on all architectures (44 bytes). > > The test for csum_ipv6_magic somewhat arbitrarily aligned saddr and > daddr. This would fail on parisc64 due to the following code snippet in > arch/parisc/include/asm/checksum.h: > > add %4, %0, %0\n" > ldd,ma 8(%1), %6\n" > ldd,ma 8(%2), %7\n" > add,dc %5, %0, %0\n" > > The second add is expecting carry flags from the first add. Normally, > a double word load (ldd) does not modify the carry flags. However, > because saddr and daddr may be misaligned, ldd triggers a misalignment > trap that gets handled in arch/parisc/kernel/unaligned.c. This causes > many additional instructions to be executed between the two adds. This > can be easily solved by adding the carry into %0 before executing the > ldd. > > However, that is not necessary since ipv6 headers should always be > aligned on a 16-byte boundary on parisc since NET_IP_ALIGN is set to 2 > and the ethernet header size is 14. > > Architectures that set NET_IP_ALIGN to 0 must support misaligned saddr > and daddr, but that is not tested here. > > Fixes: 6f4c45cbcb00 ("kunit: Add tests for csum_ipv6_magic and ip_fast_csum") > Signed-off-by: Charlie Jenkins Reviewed-and-Tested-by: Guenter Roeck Guenter