Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2722179lqo; Tue, 14 May 2024 07:23:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnF+1N48zPpLld4ogWA8WDSq3gF1S8/Ro4L0vejQ0wLrmfv77wHvW4qZjNGDihpUkN4fy/y+ERexynMVD7gycAlEhvNw+5YbBxf/+9yQ== X-Google-Smtp-Source: AGHT+IEPrMnSEE/nQBVLbedX0SpeoDh2fq4i7STgp1MqWJXNv4SHJQQcAqbAdax9KoBLjMnSIphH X-Received: by 2002:a05:6a20:5643:b0:1a7:9b0e:ded3 with SMTP id adf61e73a8af0-1afde0b72f1mr15652257637.11.1715696618745; Tue, 14 May 2024 07:23:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715696618; cv=pass; d=google.com; s=arc-20160816; b=oXdHEqRLOErXh8o/EK+e/FxS3NbpIPOvT8NwV8o7bl9VfveanB157IXeIaY+LiGodr q4j5hVKWXpTKOurNp+44kB+rmYwgdI2LufnRnDZoYYOiR0xfWO66yYy5q4Iw7aT4yoas Fkl4khU52UwOIxW2jmc3hO2PJ27uR6i7FOALcd05j0URqiIIbLVGXUGPACxS0E/+IyYw qB16zxeFOo0qLGOsWybWZ7iuQzrovTkm9wOJec4niI2CCuJI+Jr5ZTvcY91l4eu0NAHs 3kagzr+dizHncMEHgq77nRo3/vbV84/phtFpGsCmmGl7p5NeMrG2LWPSlYq4x/T99a9r 6Rdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=BjB/g1fsGgJ3ndb7UWh4o1aNB2C9AwXmQNr5OwDHHdk=; fh=5TjbHwMfRWwMwSkCVunYJrWiSMRLc/MPlgAuUSr+C6Q=; b=l099yHC2SYZsh9g6KPC6MFMtxxqHNefq5xRPYUhayxkvXOEr4FeW8SwHFyFFQOCXQC 3g1UldbytXuXmzmZvTfrMLqew9btKhq3nYoRaN3I7eroout7tVM2WHOI9Spz0q/ZR3tS dZZ2Yn0T9SjjDtm5CYLJs8wqqOxVH1WdG9uljZMvD9hAnSFiNbomf7sAcAw8F7J5nkI9 9F41kkVYNWOKvi+XWNXroPQT+4EjHsXVyxtjR2ivtJ8i2nbRzx0J65cUfkzu70rpxBjc myIQKoZf60Ew0l3ujnKszPujdrx5+OwwD5UvEXF4D6Tox3N7lDD+IMa/GZUWPUlEjXmb Clkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gkndv8e7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-178798-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e83971si10006072a12.40.2024.05.14.07.23.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 07:23:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178798-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gkndv8e7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-178798-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 54E9C280FA1 for ; Tue, 14 May 2024 14:23:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45D04144D3B; Tue, 14 May 2024 14:23:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gkndv8e7" Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 4E456139589; Tue, 14 May 2024 14:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715696609; cv=none; b=S9cGNXZCqnLk0OLOBlrI6XARr6NuXOZVW5N9bo9C+mhS8uDrQsL1/xK1763vLTznlB2ofFO5XEmDpWFfsCJiFgN55g0RRMf/8OxsZ2VKb6flP8Kqm3X9nRGDVBRx+RrzPmqAMC+qJ43FV5APVBIAXK3CUMTMEQ7/ur5Z7DXrjmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715696609; c=relaxed/simple; bh=BjB/g1fsGgJ3ndb7UWh4o1aNB2C9AwXmQNr5OwDHHdk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=qf7PNQMmrUOGs759qrwGDdC8O2LQZetacF5+Kzyh5DwBpGb+czq1R4vsqDlQ+xSRPzWdiZrWT0G4qRzKDHHpQDJAZsAN5CTHqqzt2Nd4bfjEh7iQ1jKSlHM7kRM1vR3bA3+JM0DPgIUI+H4Br4q16eD0NoGIHBBuMoM7Bgnk4eQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gkndv8e7; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2b38f2e95aeso4605357a91.0; Tue, 14 May 2024 07:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715696607; x=1716301407; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BjB/g1fsGgJ3ndb7UWh4o1aNB2C9AwXmQNr5OwDHHdk=; b=gkndv8e75DDRsNJSBOPpRxLTsZTXKqIfCmR8tVoxa+cIyBxiKtiwKNpit1K8KAsDeZ gJ/XcZ5ZTLDzNr23sIGmHfhIs9JNvbcPrx1mYjbtui8rMIPGKyJVtGlvBaxb6/lsyFif TzyB6/LNLGjfSnAWZ+UZHhwW3YMfUG7050tEngG6ydQt5Jd77PTxYu4LD5inT+Ma054x LiEmNyPcg4peJ2JfXPD4WMwkgFyGqLuymYnlFMNGSSoMRPCC3LMGgCYxU33rwUUX9xyH KcR94uREX6oAf2KzaXzCkAF8z8lknG4AJAAe07vgzZ/YR43Ex/Uiuv1X3QRQGgxJgQTv sm5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715696607; x=1716301407; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BjB/g1fsGgJ3ndb7UWh4o1aNB2C9AwXmQNr5OwDHHdk=; b=sguttgkb7PFXaO980FlgtWRbymxrgnkebVxTj4F1TA3bSGVRCxqiEv+GDHJUMzccuV 2pEzFs6LCDH3DETAFDDJD7MWaq1qU4ZvoHBaovAnUNaZJbtMDxwdf+X7YKVIYhrrCl+v zsMkqdn1BQVpkx2NMp85QZMsDn3mgUNe497Nc4s3wOMQTjiWqotBeS/0qWo+3+08a1zp mYlHgbZYP1I+NvfmXsBN+574t1TxPj3n9vLixnp0JiqjS/9XfALalBELUivg0qA+15IB gi9dezJihc/oAid++MMDPdxfieA7NAFUKWysAKjU1VnYHgERFYrEWo7VVbNCN6dnpglL JyBw== X-Forwarded-Encrypted: i=1; AJvYcCXhVhwCcZ0NIczPKH+qEJ1g86lfeYGlUWq3Ma94a1OVoo+BxnwTrMGOFrlQmCPJCRDHCNUTNRTgIYXUO9haJB5TpI+swyq6NSo3gqc9HZhVmqjtHlvdlVQcGhyw3VJSRilD/VmowpbNASsWtvY= X-Gm-Message-State: AOJu0YxDYASDWHMsYg7fP0MCC7R7DDmiuGJbhqYGRcMYLWMkxsDvcb9/ pUEI9O1Y6tDoyRlkQ2eN/0X39oYUd5QfNnf8cf8Y1Jz0PT7HLJJ2F8y3Om/6RO6JZeYMY4V1Xk3 rshR45zTKOXzLZ/lxV1cWfurZ9ug= X-Received: by 2002:a17:90a:7309:b0:2b5:9534:56d6 with SMTP id 98e67ed59e1d1-2b66001a464mr21043668a91.24.1715696607584; Tue, 14 May 2024 07:23:27 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <87cypvnpwn.ffs@tglx> In-Reply-To: From: Miguel Ojeda Date: Tue, 14 May 2024 16:21:50 +0200 Message-ID: Subject: Re: [PATCH 2/2] rust: time: Use wrapping_sub() for Ktime::sub() To: Boqun Feng Cc: Thomas Gleixner , Miguel Ojeda , John Stultz , Stephen Boyd , Alex Gaynor , Wedson Almeida Filho , Gary Guo , bjorn3_gh@protonmail.com, Benno Lossin , Andreas Hindborg , Alice Ryhl , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Mara Bos , "Amanieu d'Antras" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 14, 2024 at 3:13=E2=80=AFPM Boqun Feng w= rote: > > However, I must point out that it needs more than a customized panic > handler to work: we also need to change the code generation (or adding > a different flag similar to -Coverflow-checks), because the current code > generation is Rust panic when overflow happens, which means the > subsequent code is unreachable. Yeah, definitely. That first step RFC is a bit ambiguous ("custom implementations of `panic_*`"), but what we discussed was the ability to customize the report and continue, rather than providing a different panic handler. So the customization point function should not return `!` for our use case, at least in the integer arithmetic overflow case. Cheers, Miguel