Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1845442rwb; Wed, 26 Jul 2023 20:54:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlEOtNBTwvv7RSimHp3IKhwHwF0EhryHBE9WcES4L1Pofz1xQ2/yXoX9OZtEBKCO3cuyde0W X-Received: by 2002:a05:6a21:a105:b0:135:38b5:7e63 with SMTP id aq5-20020a056a21a10500b0013538b57e63mr3227357pzc.46.1690430076122; Wed, 26 Jul 2023 20:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690430076; cv=none; d=google.com; s=arc-20160816; b=SKWZLYNeiyLiVeYqBdKif8M7/+kUJz0/5R96fsON6M2JhZmX3SCHIGLC7scECnPYOL XEopbhdzmtJwgfsTEeYX0iAm9EMRplFMAli+X1Ivn1voL2o6AfwxwD8YQJm1OUUGalCJ tRLLDuKxLIy6SL4ut/su4ty+tPUP4NosFhDzB4E01dnX1BcZ9pGc8YHugxs6X3v4CoWV 8QL8kwe3t9JJledPRD9BVd4vKsKUQo8vigN/Dtp8qm7enfbAv12SvLqY5UhREKRr6BTc spXq48cv3r0M7QZqHcyO2zMsg6SL+D2N65vlJ3DD87DWJN3NpTCLRlSRbHRR8DGU+Nv+ 1Cog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=a6s81Kuj4FNcPDKjE3VxHTDXGuyZc7Wg9wbMWXkj7oQ=; fh=8Not1fDpAokYGWYQqDKzQyOHaNe3Yii5zgkCRaRcXag=; b=Gg1TKX2ZmORz3rsElwRCWBgMo/A2VGLYpFX03+vRoWB/Ajl7Ht4rFSLug1n3cbI0ap LUGmVi/a29gMhHNzs2xsvxBzZ6LM17Ud5nbCOWlIrqRp9t357TUdip0tu8OedzbOzoyP N7QZIdt1tN8gF5KxKywJPjJoJ4tHcKG41yAOT0kAQ/DBRiQxUiM2jTHqhTETKN0ytZqa k4y8h1OuqYH4P8rHlQ30WYjujF5z/Eb/pCQTG55yJhAUZ5mgPQdlMQ4N/lwId+s1xDKV j1Y48isrd/KyYoXm0n0LKGgY3+chz6l21LeZQ5wjWIlpQ03DmH2qKt4/+s3x+Gwzg6dl QNWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aTYPRcRq; 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 kl15-20020a170903074f00b001b89b691c7asi494455plb.196.2023.07.26.20.54.21; Wed, 26 Jul 2023 20:54:36 -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=aTYPRcRq; 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 S231367AbjG0D1g (ORCPT + 99 others); Wed, 26 Jul 2023 23:27:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbjG0D1c (ORCPT ); Wed, 26 Jul 2023 23:27:32 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA4F5270D; Wed, 26 Jul 2023 20:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690428447; x=1721964447; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=zZw7shzyeqWcwUz/3pXk4wTr0ManqzTTZSighI1zgHU=; b=aTYPRcRqpH42utWO6lEysW9MF2mhE0PVstZMMcn0HUI2O9AC7eTyZ8rK Ky59kZRXpvy+eOy5JtvaZgAgmhJ9R0dGcj+0HxoKa8mrP+SXFTBLu/j9q uGdbEUb/jQuSTobf0x6nXGl+sPotAWatAWqSqf3nZhs+MKgT/I00/vmbu WbVgxD3rGhr0AkrMf0qYdwPJbJKqtucPAMGxBKXvJP6uczAD951hSf7YC xVOsSUfcn8YD0jH3BUL+j2niY8c3AVoxlhR8bjL/vDPNpRy2whaq5vlv4 XA0GpLdRuJQaRluDS0vDpc0FB1YKFabqtcPSlCwlr+1zmfMY3086Eaa1B Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10783"; a="347799001" X-IronPort-AV: E=Sophos;i="6.01,233,1684825200"; d="scan'208";a="347799001" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 20:26:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="870179046" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmsmga001.fm.intel.com with ESMTP; 26 Jul 2023 20:26:15 -0700 Date: Thu, 27 Jul 2023 11:24:22 +0800 From: Xu Yilun To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Subject: Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes Message-ID: References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-9-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 2023-07-26 at 08:59:53 -0700, Sean Christopherson wrote: > On Mon, Jul 24, 2023, Xu Yilun wrote: > > On 2023-07-18 at 16:44:51 -0700, Sean Christopherson wrote: > > > + if (WARN_ON_ONCE(start == end)) > > > + return -EINVAL; > > > > Also, is this check possible to be hit? Maybe remove it? > > It should be impossible to, hence the WARN. I added the check for two reasons: > (1) to help document that end is exclusive, and (2) to guard against future bugs. Understood. I'm good to it.