Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2E41C7EE32 for ; Thu, 2 Mar 2023 17:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbjCBRTZ (ORCPT ); Thu, 2 Mar 2023 12:19:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbjCBRTX (ORCPT ); Thu, 2 Mar 2023 12:19:23 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FFB5CA26; Thu, 2 Mar 2023 09:19:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677777562; x=1709313562; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t6Bmp0fFrnUCAiBWt37tkMKRrr79WxRyKdKg/hHFkKg=; b=NaBkTcAU7tdLy2RfP3iodlo5NckgeVEwDH9wiAk0ihbkz9sEMyzQJ9+i gCkkH0KmOGewr5stGPufKx2i85dUFmXznsw/ZfmfjDZjLESj0w4ZTTLc8 0Dbu3edExg93KYjleZ8ICNiITWiwRiV+bb8XSEaNLus+2NNPOxVAggsSb e229dW3JMQFC9BAd/0I+X9yZcDeiBL9F8lG3hd26FQFjskbPguX/+T6Ro 1gdD4KgcDhzchQ0R3hHxblRdHQe3VOh4ydEcmkF4EhQ2hoSsPMtRIey9G D8b4p9aEvTbRpykGnhNcmJqYmKhhX0/wJhlBolD55lehJjmdVNOvIiOdq Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="333508780" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="333508780" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 09:19:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="849150513" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="849150513" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.24.100.114]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 09:19:21 -0800 Date: Thu, 2 Mar 2023 09:23:10 -0800 From: Jacob Pan To: Tina Zhang Cc: LKML , , Jason Gunthorpe , Lu Baolu , Joerg Roedel , Jean-Philippe Brucker , "Dave Hansen" , Thomas Gleixner , "X86 Kernel" , , "H. Peter Anvin" , Peter Zijlstra , , , , , Robin Murphy , Will Deacon , "David Woodhouse" , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Kirill Shutemov , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v4 3/6] iommu/sva: Stop using ioasid_set for SVA Message-ID: <20230302092310.77f97361@jacob-builder> In-Reply-To: <43e9711f-042e-eaf9-e091-07db78cad943@intel.com> References: <20230301235646.2692846-1-jacob.jun.pan@linux.intel.com> <20230301235646.2692846-4-jacob.jun.pan@linux.intel.com> <43e9711f-042e-eaf9-e091-07db78cad943@intel.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tina, On Thu, 2 Mar 2023 21:52:42 +0800, Tina Zhang wrote: > > if (mm->pasid < min || mm->pasid >= max) > Here seems not right, since the valid range is defined [min, max]. > Shouldn't the invalid range be: > if (mm->pasid < min || mm->pasid > max) yes it is better to be consistent even if we removed the inclusive requirements in the previous comments. Thanks, Jacob