Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1149883lql; Tue, 12 Mar 2024 08:36:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0+hkcZ9eWL+Ch4d7RQO2r6sohYb3CF/Mv25ipyYkw/HXZAdrJIAAIwGVs9n1TJVKG06gMZgGoLqHTzkz1RAB24N7owSGwFTZkTaWUTg== X-Google-Smtp-Source: AGHT+IHYR7elpR8mhU58L/KMiprYL8NpOaAU7dqF63LXbk4KH7kBvOfowaFrYYfvPYE9I6lPhgqA X-Received: by 2002:ad4:4e06:0:b0:690:c733:f027 with SMTP id dl6-20020ad44e06000000b00690c733f027mr764260qvb.53.1710257776946; Tue, 12 Mar 2024 08:36:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710257776; cv=pass; d=google.com; s=arc-20160816; b=C5hoEezaE5qcTFAlOTv2lbMqsn1heKnTOmv567pCITjrPtUsfavOoKsNuxmzPF/rNX bHNtnpLO/CFBhheyaMBhqbHW98ymePdhFx26dhYTg9Cn7S2KsmWCRXmwU2tHHjrVZrZh yt/x6svnNTRymLBHwYQTyAEW+vRgeZQzvAE5//au/ljelnqlDUnx7Rnp2C86+H375O54 7fwy3fEQ8/KslYz+z+sPuxxoJweI3pZB89lIv0nzX0UvAJLFdYyOxE8Y/HPWHnAtJny4 mYWViGStxuQ6WZbVYnMSas/vxb38gC5z8db0a93IzudFniP6LvnmaajJYrwhoiOTyeme GPJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hEovke+9JUAscMogDxZgjbZxMwS6JgLRoKVMzDBV0YM=; fh=BSBbTJquq2grMKgwp1ACEd/EKIn62NX55fQ47ANICbI=; b=EAYC1jTxTAoV3Khb42uGUDoxa7pISlFB6wpqhHbQLSN/s1hRGWNbm18hKt4Lfo9xrw xIgfrPH+KqrkwaHqAsRnaET3PcNtFUt8UFUf+MpPcEplR26Z3D44k41V0e7YycqM0rdZ MjKwGzyn3sLaXQCYa+j4WwSwSHDq41emdeSjsYMXedLKQpdt+/dzQ6RGzDMw3IAEd84a CXuhsmLyDzg3mw6Gls2RTTg42TT6m8FYvljmZUDLZDi/jEQbLEGkQyCtVi4qWpe9g0Vw 3PJ5pBymEJI0pg0MMOclCmWCEZovCyMQh6NxuoLqYfw0BQvtAqhsNtnAVjN/A6oEtnKw tYZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bx8msQRi; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-100264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 7-20020a05621420a700b006910a72721dsi95259qvd.230.2024.03.12.08.36.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 08:36:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bx8msQRi; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-100264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6499F1C23316 for ; Tue, 12 Mar 2024 12:36:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8B5956457; Tue, 12 Mar 2024 12:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Bx8msQRi" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5B2E811 for ; Tue, 12 Mar 2024 12:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246986; cv=none; b=mC3mVj+06Z80HLIr8625iW9oIK+wep9C+KlO+3conFQHMM4wcDpiC6lgO/DH/q4dQYmMzsmupWYlDXBSq8+kdfRnWgw35G+odm/DU4W9zI0/qPnuiGN91XDgPMPeQcv8NPKs68Gc/CUGYD3zS1iU5yrxFzvYrEtpkAczUXQy5A0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246986; c=relaxed/simple; bh=Msp8CavuCxkwBzmx3Zc//1lyf8RG9ukhad+UhCA9Vfs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SOIghFCwuVT+HYsunldz2mtAZyrktQEVuj8BogIvWiiFgDyI5DplTlZVFAujNL6tNXbqiJ4g90xlspmSguzkj9dBfAnfOwaj5362ZZfZLb6JwBOk7/b8CaTpoEerItQZTV9K6O5kmAQeCSeb1127up2OuUPkiSJ/Z2j4ZGCcGQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Bx8msQRi; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710246985; x=1741782985; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Msp8CavuCxkwBzmx3Zc//1lyf8RG9ukhad+UhCA9Vfs=; b=Bx8msQRiltwUzIBSTne23+gPG0ncSDBHURMp3yCZ4TdrzO2CdOi1L3sT IpwFVfegxPD4PPLr//viLWksMeZhQuFNuzKwEdS/vUszFzBMazx5EKEPH /ZxUpExQhBnc51AViDDv2M1vASBOuuoL5uoJ7/G3GAJRWfZ82iuJt3qqC NvZOh+qUVr4Q0F21VKTGe8DGFlVL+Z+WjpRf0fy70OghXIcwRX7c2uSha Avhzgy46Mj/2hzFYN8aYO3JK1Qjco8+lm+Hy95Dv0j24PosM+Yr4skwDV TvXVx1eWEqJwiaNPoJ/ZaOwU8FX8PD2wO/BcLcycfMR8ZM8f4HYCi2o/f Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11010"; a="4824019" X-IronPort-AV: E=Sophos;i="6.07,119,1708416000"; d="scan'208";a="4824019" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2024 05:36:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11010"; a="937051835" X-IronPort-AV: E=Sophos;i="6.07,119,1708416000"; d="scan'208";a="937051835" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 12 Mar 2024 05:36:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id A604C27D; Tue, 12 Mar 2024 14:36:19 +0200 (EET) Date: Tue, 12 Mar 2024 14:36:19 +0200 From: "Kirill A. Shutemov" To: Yosry Ahmed Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Rick Edgecombe , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] x86/mm: Cleanup prctl_enable_tagged_addr() nr_bits error checking Message-ID: References: <20240312035951.3535980-1-yosryahmed@google.com> <20240312035951.3535980-3-yosryahmed@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240312035951.3535980-3-yosryahmed@google.com> On Tue, Mar 12, 2024 at 03:59:51AM +0000, Yosry Ahmed wrote: > There are two separate checks in prctl_enable_tagged_addr() that nr_bits > is in the correct range. The checks are arranged such the correct case > is sandwiched between both error cases, which do exactly the same thing. > > Simplify the if condition and pull the correct case outside with the > rest of the success code path. > > Signed-off-by: Yosry Ahmed Reviewed-by: Kirill A. Shutemov -- Kiryl Shutsemau / Kirill A. Shutemov