Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp120299lqo; Wed, 27 Mar 2024 08:26:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUC+12wm2yQEKZNYZxV6Bb/MskIQJ1o3RlFYAlUr8pzL9rLloVOCRlGTYabzrvCJrDxuYBhKwWHnSPXEfFVVBs90KNxbFAszkYuRJA0qA== X-Google-Smtp-Source: AGHT+IG5wCEbCX9nGkhp0+MWAwS+A1PuRPHCwdKQmxPIrYzDP3g9PeON0qvx9pjjorlj8Zu8OJpc X-Received: by 2002:a05:6512:60e:b0:513:cc25:d3b5 with SMTP id b14-20020a056512060e00b00513cc25d3b5mr3507970lfe.7.1711553200879; Wed, 27 Mar 2024 08:26:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711553200; cv=pass; d=google.com; s=arc-20160816; b=L8ON8D3wiyXQXzNitoyaQaFYl6aBzYjElcPBWE5zxSUcI40yUPml9F/izx1tWnKG29 8ze5LjyFmNTwGW6X8OP/rsId+pMXzRbvTkYMWOBm4Y4Y48lXNKXKN881xlyJ11L6dl9I XnR4msKTuLH5r1ZZ7TKuOeGGrA3pCZOajfcQpJ22HOsa0BK3xm9pfU0DdhsXm2x4LLSI UpCuVR9s05T/piKG5/aTC/v/GtmKVdTajucCmqCVmk6vdacx/slDPTjF+dZma+cuwYdr oGobdTFPru8yk1+ngryoAI+fAfE8CIUeKgHZMG0JMdOOwTv8VakDqRDTbCzlH13GF5CS dFSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=UuoTzi8rOFJ87iK0QDMAtmZ0NUzmHRlY2Wibz55w4qg=; fh=t1vNNo5nHJwjYHJiRM41Q2TlRPYaJFNJxPi5juEtZ9s=; b=KYVUsuYOXIWqgOJZSicwrI0SCzIMvMud/65LaGIueLFyphcSLZH8CchVRJaaPekJe5 1KCXZiiAilr3LccXjhqkZ9i2E6CdpMeQqrX75aIXtTzPRmEvf8mFHoIG6ZHM0z02Q96H be8rxVkaSA7/mbuagU+fn5oLcinXXvY4db2U7zG1siTlSKr5dYZJar54at7x/hCohMBC 6qYkKsA7fn1g9vJBk1jKbD1MyuiUIa8YMp0R4yzU7wGkIbmpqa8zkHdcL9/0Ryul+sAc LrnwZbhq9HOFmr/sifV/+vNTHKxNfw2p+dQPgzh02RV27fLrQH6FfUu30RLiztyv34i9 VBcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=ZqwBLxsr; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-121485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121485-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w23-20020a170906131700b00a4665f6d4bdsi4893067ejb.457.2024.03.27.08.26.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:26:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=ZqwBLxsr; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-121485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121485-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 92A3C1F339FD for ; Wed, 27 Mar 2024 15:24:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EFA613A3FB; Wed, 27 Mar 2024 15:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="ZqwBLxsr" Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 1739313A3EF for ; Wed, 27 Mar 2024 15:12:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711552358; cv=none; b=DPHzPK4NMntRX5y+i0r59Nna26Stv9krjjW6GgDsKhc4sqWIKX9ToC1hMpkljOO9UL5sTUOfnz4Fqt80h1yHPr6TF9oFk0NObf/9N1gwd5at6Np5lBLPZN4ku8lnkIo+R49sRFZ+7AZF9C2UJPwtBf6gQGj9d0viFJlzwvnp6Gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711552358; c=relaxed/simple; bh=bk6V3Tph/BTikIMlnsHClFRVc8U6mY/3tucdVLV08Lg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N7afMgX2Z0DnewZb39fdJMwmJHXcbJVN2C4e2i1LZPAxpWoWp34cxfZbuZ8PxOXBbyX0/Avo0+FOvWD8IyGV4VC8qgdI8uLf/EJPhTwGWqx5DfXi0jmhj7JCe2Inu/KkkdQZLHTc5SdOalSc+Cv9OEMRtUG/C6j4b6JRPgyJrKc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=ZqwBLxsr; arc=none smtp.client-ip=209.85.166.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7c8ad87b2acso184683439f.3 for ; Wed, 27 Mar 2024 08:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1711552356; x=1712157156; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=UuoTzi8rOFJ87iK0QDMAtmZ0NUzmHRlY2Wibz55w4qg=; b=ZqwBLxsrjFDOHipeXM8xoNGRg0mjQlJK8aiBHCLjEUbFmckaCcA8KiBNn+ddUBkWLK dHBlzXwRQsWCZL7QmB2pHeK3BgBSRVSzIBkV3Uox4rKf/ulCFlsJi1tqE8NEgBIZEVCO kiLdbdn0cd/P2hbxLlwmybe87f9PA2j8WQn0ejNKGNyyu5Eqclk6QMOWvRePausWoIZN vpi7+7zA3f9bydC0VyyPetTuGbb8RKlcm8SqE6sQZ05vh5rIJqXc/1+HPhltSwaCODy1 Cr+imflIBNStjMoTlnOq4UaLKaTrfvENkT2Wzi1MSX1QoWFsT6P1kSfkWttgR+p2+Pml Uc5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711552356; x=1712157156; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UuoTzi8rOFJ87iK0QDMAtmZ0NUzmHRlY2Wibz55w4qg=; b=ctn4hx2S4f5QB+dKGN5+fNRaXJP1WtpdEVRY/oGAJO2TEtk/2DqBMJxnpfbbNCgThT z7+fntNFXk/DHLfwmH7LffrdWtrm2LV3F89eV4ra863g/Sf9EmIUAuoRcL53ueJNl+3X zu+KBmDVqJlB4aHJ7u1XForVWaNzpUuLCccYFEDMh+lI0VEq3rjgNK6/WzLi4gjTKbA8 TDBXTOqHPRGqPpNZSLAkUjjeHTAexP+kFeM5xoKexbmMCwzY/LmzNtCGTqv1P/tlcTIz biADmZD60G8qv56ByBWpmSHd8C7wMi4YDigFzrlr3OGV7eaCUO887wcpQ4WCGQ93mzAn riRQ== X-Forwarded-Encrypted: i=1; AJvYcCVaX1olrtqDfcWL2nBuzaFYMAv3jdSwhB6fDSVRg5Nm50VQsPdWC1zkAcPB7cR47ebuHn+9pOAlgzdwtRxovdLJ3yy7cH2uLY+ZlCuA X-Gm-Message-State: AOJu0YwZwM9b4Z6B6cqc7/+s138JU4WNd47tqrmNakzSEbWZ6ZbVagSG ZCfHrFog6CG8tGXm3csdlmq6KbxL+JQT8RJ0TruZrJMZsLvojV+I77XsO6gin/o= X-Received: by 2002:a5e:9903:0:b0:7d0:676a:d0ec with SMTP id t3-20020a5e9903000000b007d0676ad0ecmr486405ioj.0.1711552356161; Wed, 27 Mar 2024 08:12:36 -0700 (PDT) Received: from [100.64.0.1] ([170.85.6.190]) by smtp.gmail.com with ESMTPSA id n15-20020a6b410f000000b007d0445ac470sm2603214ioa.29.2024.03.27.08.12.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 08:12:35 -0700 (PDT) Message-ID: <198af54d-10da-4320-9623-85dfb102f5de@sifive.com> Date: Wed, 27 Mar 2024 10:12:34 -0500 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 4/7] riscv: Simplify text patching loops To: David Laight Cc: "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , =?UTF-8?B?J0Jqw7ZybiBUw7ZwZWwn?= , Palmer Dabbelt References: <20240212025529.1971876-1-samuel.holland@sifive.com> <20240212025529.1971876-5-samuel.holland@sifive.com> <874je4fvxl.fsf@all.your.base.are.belong.to.us> Content-Language: en-US From: Samuel Holland In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi David, On 2024-02-19 4:13 PM, David Laight wrote: > ... >>> - while (patched < len && !ret) { >>> - size = min_t(size_t, PAGE_SIZE * 2 - offset_in_page(addr + patched), len - patched); >>> - ret = __patch_insn_set(addr + patched, c, size); >>> + while (len && !ret) { >>> + size = min_t(size_t, PAGE_SIZE * 2 - offset_in_page(addr), len); > > Does that need to be min_t()? > Both arguments seem to be unsigned. > (Did it even ever need to be?) You're right, this never needed min_t(). I'll update this for v2. Regards, Samuel