Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp167352rwi; Tue, 18 Oct 2022 15:53:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ylnoOWkVrCtZ2TANw6qjeZ0mAavXglFSqNLVLKrGtRAWyB+shWlL004XYbjjUoSnWe7JT X-Received: by 2002:a17:90b:38cd:b0:20d:6f2a:69c2 with SMTP id nn13-20020a17090b38cd00b0020d6f2a69c2mr42932997pjb.114.1666133581920; Tue, 18 Oct 2022 15:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666133581; cv=none; d=google.com; s=arc-20160816; b=BPL3rVd0yWciBOzB7oWEI3+gN29XEWXFNvsEtWS+nfQn/MBtvJyCK6D+owTYpzchhC MYEHCkbys2Vk6DgfJeskbF/r8BVPTYKXzT0TDYR0Ypco0VV2K3Yk7WGxLJ4Gl/kBREl7 VJ0dgZQmogXDijArdLffwZ5ZeHqseQKzS3ajVRRjGT2OGmChMQBaiAIm6AqNgBm388cb e+/x7qCLSO2a0feLvX16w9i0LGsrvp8Btbqlu4P/DBPVNtLdxMj+IIxd+ziWc2WaaV06 qGYtW3rNH+mhxLOOGCrGlmpR0LxJtveFuiBd+L3g2CnNlpSiDIziENajSjw4VqTBwKjg WhKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8h9ss8oLHvUfPBTfJRUDsknp21AQ+tsGL8pzOBfiUXI=; b=ag5ZeyTbTMiFDqKITvci6kuZ8fnVC7RVMW4vvNlm+VW7aZUjYZ7QD9XQFvkQp1xwOQ tWqhFJm/xWAV2TV1kSUruZTY1cUub9mjmyhiEvj65182oxMQL0lzGNEEa5Fq2+pyiKps eLGENxzxB2RLyOolMXM4xY1lBmO6lZU5hIPDYkuZG+64IZZF3t/VYaEfoLt+VY5TUTHr 83mOhpHXc/KWqRJhe+C4cri5NevaHCdavLuLazezd56Pfi9BZidcyapu/7ygjGI4jpRf ePTlTJBjxfiFbuX0REc4+4g1iWv+GJEkWnQK83LzOF0D3v8JKcUGi0BpbKDFcL7Nct7d y4WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dSKBetqZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a17090332c900b0017f7de32cb0si18265914plr.85.2022.10.18.15.52.49; Tue, 18 Oct 2022 15:53:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dSKBetqZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbiJRWn2 (ORCPT + 99 others); Tue, 18 Oct 2022 18:43:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbiJRWn1 (ORCPT ); Tue, 18 Oct 2022 18:43:27 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66BC07D7A7 for ; Tue, 18 Oct 2022 15:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666133006; x=1697669006; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=qxulG9G/t9vwt+iUnsW6mUi/P6PmpV9ptb8IJUKW4BE=; b=dSKBetqZ6Z2lhffHOHqaVDvzBdzgiqOqRbQDnA4TsCqjFIayWhoAV3mr FnhrtefNXhiaOmRIuL95Lql6r9QHnUcHGaMNBY3w8WONFmsxAcs/pMUZn EjYHEdfvpGWwbBZ+7vIWVprlpAf9elA6CrqWZd58JDqKhXogUlydYpCwk OECTWUDi9Fv7C9QnqajEYARlw/oHCWUUFc51XD3SqFm++tMmlPFn0sXj+ /kfIsfn/FkiPMyE+dEOnPrC3l7aI9B797eJUHyc0vzJjUEAb5UP3TyUUM EXM9j5zLpvikq5kcTiXkTPiNvw6+VXWWcud5Thm/iYz98cEkJMzYWeGTc g==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="307938741" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="307938741" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 15:43:26 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="660033283" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="660033283" Received: from jjsopko-mobl.amr.corp.intel.com (HELO [10.213.163.40]) ([10.213.163.40]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 15:43:24 -0700 Message-ID: <3a0dd700-ce2e-e1ec-ee8b-74cd68c360b7@intel.com> Date: Tue, 18 Oct 2022 15:43:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCHv10 10/15] x86/mm, iommu/sva: Make LAM and SVM mutually exclusive Content-Language: en-US To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , Bharata B Rao , Jacob Pan , Ashok Raj , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20221018113358.7833-1-kirill.shutemov@linux.intel.com> <20221018113358.7833-11-kirill.shutemov@linux.intel.com> <20221018223341.tiyypudh6k63mnnb@box.shutemov.name> From: Dave Hansen In-Reply-To: <20221018223341.tiyypudh6k63mnnb@box.shutemov.name> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/18/22 15:33, Kirill A. Shutemov wrote: >> Is this #ifdef really necessary? CONFIG_IOMMU_SVA selects IOASID, >> without which pasid_valid() is just stubbed out to 0. > mm->pasid is only defined for CONFIG_IOMMU_SVA=y. > > Do you want me to add mm_has_valid_pasid()? A quick grep makes it look like pasid_valid() could be *replaced* with mm_has_pasid_valid() since all the places doing pasid_valid() do it with mm->pasid.