Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp35426lqc; Thu, 7 Mar 2024 09:32:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWuhFAfnVCuu7rGI3ehaWKXGBVA/QwQZRr0muWshVJ/mfpEuLrYiKZaVkOx4Cv+ZG0obQbCJw7vb9iEhGKUpOpzb8wWWYsp481Y3HR/+Q== X-Google-Smtp-Source: AGHT+IFPehwL5ltNQj828k098Exwym6JF9Ivrm0lZDCIs1zAY8unmivZsuzffEsh9uKphM8f/BGO X-Received: by 2002:a05:6214:1847:b0:690:83f4:8344 with SMTP id d7-20020a056214184700b0069083f48344mr8603194qvy.46.1709832743853; Thu, 07 Mar 2024 09:32:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709832743; cv=pass; d=google.com; s=arc-20160816; b=070qcujIkkKSK1VDF3WZnmkFOOFWFW7iPAFh15qrpIzMGT53LlaQwVVZvn2Zv9Q4cb OTiq7EHaE5RUGXo02gR2f+rc4s0b5l5l3pBRuZfx91qlTWWaeR6vz98UVw67ibfoMpiX LBe2Rgw5JiMKQYHE2S2ssMnz/9T1y/DVQ2y0r54VQM8KLDMUB7Zop94J6B19CSYXNZwg iO+/hUpkto7kd/h79RWfQ1UXGESVCIjbW3Q/setNnOiocA6FN518IZI7fCbaAhGaZ7by LhGYgE4Oe5HOpLVyO33caNS64MVpJaxcPIg5S6meHZtH5aePip7PiQhaZXjCmJzcpcHS 5lCg== 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=pulpokqXIwwJXaP2hMiYPOsVLQIW3sjIgjaBXcj8CkI=; fh=tj1/N7k3DinjgtsukVzA1FZB5kBIqDmHrjEq/RKRaBQ=; b=a6y1KC4LEWmVesbvAl0AVWuGy1NQjAlFF0AlqsXOxULaDx49S5jCOYdITB3oZGYtrD 5S1D9SFeNMot2gv8NPLXiIXEPARKmqHxsCxGFwYuPZ+jN9/nPcMT7LNUqrIKCep01KhT tzzUZgBSCpPkpSG00mADFTbHd/vp0ZbEBOkl8eXKNGeDgH5yycQNOLmzhvhRU5wPomqP t4VWMviSrfj6v9rRRQITaaV8bxFjeQ7rGar0RwcHy8q0NkFk1Nj5jANc+XP17SheBdrG xYhGwIhMEE5Lz1GEEo3IEZp8BMb9dDoLiDBogaQFiJAs79a8OnZ6gyLPYwx6Kp/vY3aR V+Fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=I0YUjJL9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-95944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95944-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 dt39-20020a05620a47a700b007881c2088eesi12431064qkb.600.2024.03.07.09.32.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 09:32:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95944-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=I0YUjJL9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-95944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95944-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 917CF1C217C5 for ; Thu, 7 Mar 2024 17:32:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6074130E23; Thu, 7 Mar 2024 17:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="I0YUjJL9" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 83CC4130E46 for ; Thu, 7 Mar 2024 17:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709832712; cv=none; b=MkhBgtpwPPhsB9IVKLQJt3zAdAXw7FQCiWJgiZVXZK5l8PyR0MXcu2S9zGqS1HR63rCZlnPHPU/Hr1s3XTnU3GmclFWz4o5fXh6F8A2iQSEx/CmaSew+Nq0tMFP+dV2Zn/CHArCqiA1sg/1e4Holhk5RW0T5goeFIuzk0jwitug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709832712; c=relaxed/simple; bh=vzADUwGQeVvOM48WKXm4UNqLNwBN9ej4gnBvU/nQcbU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uqx+UhsMN3LnX/wH1fmuWkcQxOsRA1RzjOH7Rf498D3psNEIInE9It9+yxBv6o6SgvBrlmLl3JKUJUsQD7VqGl9NY6ht0JBkVQ5yko6JJZbPvFJktmCepueRSUCNXsiMxb8FFNccGhoSnbi/WJb7r7RdtHERNQu/SV1s1OwFmOQ= 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=I0YUjJL9; arc=none smtp.client-ip=198.175.65.9 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=1709832711; x=1741368711; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=vzADUwGQeVvOM48WKXm4UNqLNwBN9ej4gnBvU/nQcbU=; b=I0YUjJL9q425t3L8LmQFCI9qTawf/Z0swLZzDwA8GtqaoBp/kDSM3MAk +9lRwnwTrgYk/FQmehr6vMggyeg1sXBXCGqgSg1GyYF+RzyWsxJ3YJfax JBixwS8kDEihVpLEEMhDHh7U7ly6ohdHJNUhSvBKrdRycA0A+50goFaxW MoGVak/jehpAzkzclXewbf7IJgXDrJ42FjNou9B5UQ64cb0NNvFy43idS PoFKuOQHx/kaT4dFv0FP0DRfuOqytjT8Q4qEapqbGu2e/xv/DtDHwzdAs xXkoHL9soDl2ddMgpvpKor0NAseDPsBdMf0tatjOr6wtHC3qrGm847QiW w==; X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="26987286" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="26987286" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 09:31:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="937046429" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="937046429" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2024 09:31:45 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 8B8BB128; Thu, 7 Mar 2024 19:31:44 +0200 (EET) Date: Thu, 7 Mar 2024 19:31:44 +0200 From: "Kirill A. Shutemov" To: Yosry Ahmed Cc: Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , Andy Lutomirski , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 3/3] x86/mm: cleanup prctl_enable_tagged_addr() nr_bits error checking Message-ID: References: <20240307133916.3782068-1-yosryahmed@google.com> <20240307133916.3782068-4-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: <20240307133916.3782068-4-yosryahmed@google.com> On Thu, Mar 07, 2024 at 01:39:16PM +0000, Yosry Ahmed wrote: > In prctl_enable_tagged_addr(), we check that nr_bits is in the correct > range, but we do so in a twisted if/else block where the correct case is > sandwiched between two error cases doing exactly the same thing. > > Simplify the if condition and pull the correct case outside with the > rest of the success code path. I'm okay either way. I structured the code this way as I had separate patch that adds also LAM_U48. But it is unlikely to get upstreamed. -- Kiryl Shutsemau / Kirill A. Shutemov