Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp340654rdb; Thu, 15 Feb 2024 01:30:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1LpWgKAJCkioIq/9+/myKi+lOTUZoeH0EPgwMx0CjlaYmmI7ldkRrSt69PenjSdkhT9mbnfR9wvSHl3VIJ7SN4PzF+8CAQu5YRfg+5A== X-Google-Smtp-Source: AGHT+IEXM7QPSPXilfkPwvU/Kdx47QY+dQO1XttsijvAVyhY5TxJPi4XPtT6qdL/rmIAXux5eLLl X-Received: by 2002:a05:6358:d095:b0:178:632a:f527 with SMTP id jc21-20020a056358d09500b00178632af527mr1137012rwb.23.1707989452953; Thu, 15 Feb 2024 01:30:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989452; cv=pass; d=google.com; s=arc-20160816; b=q/cO6Bj93PovoCOxOb72dlT6gkta+Ol9OdQl4B/QVW+EkL3FK2Qd0VhbqM+4IOxSQg 7cbidlyoP0fHq56kaM10C1+R0vfwoPN/fhkE4P48I80V4Oh6lebhqlhyetxOJx+JzIWF x/lq/3N6FQRREsg5gjOxpAzrASL5c7eBpf8wprooLF0J7zlRdzr/7pCk+nXm7P6NlEZG RxXkfHgcr+wByWwFSz1J1613WvdC/g9gDxWYhDz0szDjHiQVKU8J5j4O1pFERUr8zPS2 cjui3HBvdg7vtgRPf72LsjDoQh4e6dsuQwlgYeSUmTBGen7ho057rB1saPQJNFOYdDOY Lsbw== 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=dewtdZMyloFiQnPyoazWlr4DOVfKVCdGKw6OrWcJ5MU=; fh=NjnbW/3SGwL7fY2yHOrtE0N1V68OtY5RM6aEkVnb0E8=; b=qypVbpao6YEhXy9dUgR1iz8roG6vuwpY4Mec6w8Sa3GtOSkj0m+OYgr51l37IdbiVv cLG75dx3yD/0dP2QptemSeeA1bWuEFNwn7uPPIq6PrmB/nFhvKLk5pnMYyRnZNY9gjNh BNMp6+4kL5RHx7FxwLKMg7xJbXc0y/pIourCzrPdtU4nEni05rvXRdjWCB6AJZr+AHKx 98kHDN4no2K8OfKGw+evQOcKb+6xrOATDB4Btsdm3bYtgadP5N4iuHmdkw+NeA+kxj6P IrKc9O4Kr90GeA10tUMf6b05wo6ebuwzqLB8wQgRmGzZPN7SmNyw2y8Kf4lh7NHA/9+O rXqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=itAkpQ4s; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66466-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 b7-20020aa78107000000b006dbd19a0a0asi845928pfi.185.2024.02.15.01.30.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:30:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66466-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=itAkpQ4s; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66466-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 B7D32B2C129 for ; Thu, 15 Feb 2024 08:59:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ECBD1C6B2; Thu, 15 Feb 2024 08:56:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="itAkpQ4s" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 6BBA41C683; Thu, 15 Feb 2024 08:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987378; cv=none; b=cyaNsJI6t7YNzAMYWHOLZ53G0LgxV7AnmfWOZEKHcN2LPpWu6gHNC/WsqsRcPMrj5VyEgx5aQD7ENx6ramHJtW4IHtAohoOG3X4Ze0DLS3v4JYbHViK3cEppNt0xUu9IZnZ/HCoUvEndG7FgpkQxxSn3QpiKY2CTHDjMZbo8xOQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987378; c=relaxed/simple; bh=ALyl+bYujG8tsP4ZtTQd7/ial9uO/MFRzgKH335+l8c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=orFSCxRby7/ZOFNPQneePeBG9A+Nz4GM/+/UvKstYxPnV6rNHykIyn0vA0se0egpJVt+ltRcr/22cHBNuB7FpIV2KTg7AahmG2mESjgIOuY4CQrWpm8eo+BZYQPGNLFPPdoBXXSXJ0vyjyC9oFkqI2WgYXlZF3kEuADg68ZoQvY= 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=itAkpQ4s; arc=none smtp.client-ip=209.85.214.171 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-pl1-f171.google.com with SMTP id d9443c01a7336-1d91397bd22so4455095ad.0; Thu, 15 Feb 2024 00:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707987376; x=1708592176; 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=dewtdZMyloFiQnPyoazWlr4DOVfKVCdGKw6OrWcJ5MU=; b=itAkpQ4sqx2WEdc2qlk53OcwIhunVvP6dFHzD7bYnCbfOuY8ucYeg85KUGkIYFQZTN UdUZL3R1WhBOkU3yG4IbAOebZIVO/r7lJhwTq5Ed5nDQm8Msj4L6vhCE3K/d766T4+TT Ii0vsFUeODTem6ZEeB/VcPlUmJ04A1KW1nCOxjIrcWZoDYVbSW9uf3QO38gYke6mgA8e nYAj8Mm/kAKvyd0zDrvRqXHnT0MFghYkG1T5IoHj64BKq4r9ANZFLNhMKLCHue95pWtV mxWK8eLfps8bLxsdfOGox1IRvaCpOW9BQPrPaZAFgeQPuf3IqRoEkq+Oud5th/tS0g0P 0jPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707987376; x=1708592176; 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=dewtdZMyloFiQnPyoazWlr4DOVfKVCdGKw6OrWcJ5MU=; b=azjjoCZJFJGU5UiOgUZD5H0AD+wPVrSsfyJlNVDAyHFwTboRjCR1fKXmNzULhS4i9b AbkXGbritZFWsZ+PtUzqIiGeiCNB6/jtqpsqjPBx/AM3HqOh1oxptFS7zbHoGQDphY/c QMsBnhDrrFXVakfo8QjHelvOVG8DpLNUQEdACFwuKr5j/tXVNw2BaiyQLbUxAAnp2C/j FPqGt3bz2tfKskuXGOXza+FP6AFNMW8gPnqxALDP2vq1AiVJvrA2mqV2lZV2ue/yr41J r4R+NHTuKQA0t2mfNeObgWKlhOPm9h5qgt34HaulDuFQ+rcbto33ohsJSJEYgUE7Fhhr cHhA== X-Forwarded-Encrypted: i=1; AJvYcCUTGq5UersK08hcYPXXf8XGTWwowfckyitCtIEN0GwU5yj92BuNe4IzMstVRxCvOZmtkQfzQO+9KtZwhIWTJ6ZI2FrKbKR16EOwtVmhBFRZQ4vrb55Cd/oqkkj7kg0IqBhugohZcfxmIfQ1 X-Gm-Message-State: AOJu0Yyva+b4ufyDMAAEtAnFvffwduO7Agn8ZY8AUAD5U8aori6pZyrB SEJiUCPz1xgvMjmzKAq3UbZi9dPo4rChyINvEaJqJJQrC5XZFrl9 X-Received: by 2002:a17:90a:6c44:b0:298:db59:b6a7 with SMTP id x62-20020a17090a6c4400b00298db59b6a7mr1283667pjj.34.1707987375708; Thu, 15 Feb 2024 00:56:15 -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 qc14-20020a17090b288e00b0029900404e11sm893067pjb.27.2024.02.15.00.56.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Feb 2024 00:56:14 -0800 (PST) Sender: Guenter Roeck Message-ID: <11fff7fe-ec4c-4340-a67f-d1d54d0712d8@roeck-us.net> Date: Thu, 15 Feb 2024 00:56: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 , John David Anglin Cc: David Laight , Palmer Dabbelt , Andrew Morton , Helge Deller , "James E.J. Bottomley" , Parisc List , Al Viro , 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> <2ec91b11-23c7-4beb-8cef-c68367c8f029@roeck-us.net> <1d5e059e-5b31-415d-ae41-593415812e94@bell.net> 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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lzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/14/24 19:35, Charlie Jenkins wrote: > On Wed, Feb 14, 2024 at 10:00:37PM -0500, John David Anglin wrote: >> On 2024-02-14 8:58 p.m., Guenter Roeck wrote: >>> Specifically: Yes, the carry/borrow bits should be restored. Question is >>> if the Linux kernel's interrupt handler doesn't restore the carry bits >>> or if the problem is on the qemu side. >> The carry/borrow bits in the PSW should be saved and restored by the save_specials >> and rest_specials macros.  They are defined in arch/parisc/include/asm/assembly.h. > > Why would they be needed to be restored in linux? The manual says "The > PSW is set to the contents of the IPSW by the RETURN FROM INTERRUPTION > instruction". This means that the PSW must be restored by the hardware. > > We can see the QEMU implementation in: > > rfi: > https://github.com/qemu/qemu/blob/v8.2.1/target/hppa/sys_helper.c#L93 > > handling interrupt: > https://github.com/qemu/qemu/blob/v8.2.1/target/hppa/int_helper.c#L109 > > However the implementation appears to be faulty. During an RFI, the PSW > is always set to 0x804000e (regardless of what the PSW was before the > interrupt). > Not sure if I agree. The interrupt handler in Linux is the one which needs to set IPSW. Looking into the code, I agree with Dave that the tophys macro seems to clobber the carry bits before psw is saved, so they can not really be restored. The only issue with that idea is that I can only reproduce the problem with an interrupted ldd instruction but not, for example, with ldw. This is why it would be really important to have someone with real hardware test this. Thanks, Guenter