Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1344588ybt; Tue, 7 Jul 2020 13:27:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd1dzOGihdCj2O4A0iyE2Ts+DESWrA+/P/p7EagkK6WvsTQHESSBbriFb6bso8pJ6bw6XB X-Received: by 2002:aa7:c305:: with SMTP id l5mr58689552edq.163.1594153640041; Tue, 07 Jul 2020 13:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594153640; cv=none; d=google.com; s=arc-20160816; b=whK0CvIqCRycpEE9ITG/emQ11c7ZtOlhQtJcwyzerZDjvhgaTMFvrWDCiK/4/0Y37r ynyRbWVTtD3VfBTh4ntK6o8nu/Y4A8pJ1PuaAoRW5Sb57zmC6cl7ZvfUFNcl9c3lyJK+ iYrPpCv/1qmHpTsRVncbIDwZkRB6gCKmfvsHkccou+9hgorspM0Nr0hzj+dG43qqYbs/ 7tZFj06y/frTukR3fxSgxqTrUpZNyz0hd4mXFCMTmISDFiM99ZhA7R5KvLbnoV9idxsB hWcPp8VBi6lAejeYHRYstrPnUZ3PVXMtsutuJzxSBbp1f/67G73CTv7LcsKczf2o9b3b Lbhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=mlvVxUMINhI24YiaYgTOpPe0QcJ++UwGDlve5ZhWoUY=; b=ME0N35r1ebtmKpAK1Hbe2DBhErestTz9uvekf6J19cb3MK4HDTYzhWsFr+tqAKEeYW PXdbngNJDDNvcii7QCnD2WTSGRypcydZ8jGXvY4GqfqRY+7wBO4MzNbKovplt8rbIxky rj1uKkfhiML/kmH44RQVvAw3QcEjpVbvAlzOx3hkqy1PlGYJypFo1zgVJE8RbFXa2xLr Z2p49pkWRjYlTQ/E2A3uDY8K5Oc44L4GQORmQyWb/4iasOGJ9y7iacAjqkNKtzeYWIxS bgHq+wo5EykSN/OYr7UR8yWAcItVQmaqaY+wLNbWdro9ZPS2fbaz4uxZWov0P46SI3C4 QAWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v23si12702193ejo.738.2020.07.07.13.26.57; Tue, 07 Jul 2020 13:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728369AbgGGU0Z (ORCPT + 99 others); Tue, 7 Jul 2020 16:26:25 -0400 Received: from mga14.intel.com ([192.55.52.115]:6241 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727908AbgGGU0Z (ORCPT ); Tue, 7 Jul 2020 16:26:25 -0400 IronPort-SDR: 7Qjh6edZuJGpqxlHnDQ8L5qOBjx0mLTEpsB+oQuF8/x7NyrZjc/gaxIvESKF/6aNRtQy+0D+Cv I5VnFsqXCJ2Q== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="146759192" X-IronPort-AV: E=Sophos;i="5.75,325,1589266800"; d="scan'208";a="146759192" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 13:26:23 -0700 IronPort-SDR: kKJnIcKlGwzU4Mpw47283qOwWXFTF6OyFfUa/NJP4HDbjorz4a5ST4WPrHLMiWQJILAkUJhV6/ HYLbcOegt8RA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,325,1589266800"; d="scan'208";a="315637082" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.152]) by fmsmga002.fm.intel.com with ESMTP; 07 Jul 2020 13:26:23 -0700 Date: Tue, 7 Jul 2020 13:26:23 -0700 From: Sean Christopherson To: Peter Xu Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr . David Alan Gilbert" , Andrew Jones , Vitaly Kuznetsov , Paolo Bonzini , "Michael S . Tsirkin" , Jason Wang , Kevin Tian Subject: Re: [PATCH v10 02/14] KVM: Cache as_id in kvm_memory_slot Message-ID: <20200707202623.GM20096@linux.intel.com> References: <20200601115957.1581250-1-peterx@redhat.com> <20200601115957.1581250-3-peterx@redhat.com> <20200702230849.GL3575@linux.intel.com> <20200703184122.GF6677@xz-x1> <20200707061732.GI5208@linux.intel.com> <20200707195009.GE88106@xz-x1> <20200707195658.GK20096@linux.intel.com> <20200707201508.GH88106@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707201508.GH88106@xz-x1> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 07, 2020 at 04:15:08PM -0400, Peter Xu wrote: > On Tue, Jul 07, 2020 at 12:56:58PM -0700, Sean Christopherson wrote: > > > > It's a single line of code, and there's more than one > > > > "shouldn't" in the above. > > > > > > If you want, I can both set it and add the comment. Thanks, > > > > Why bother with the comment? It'd be wrong in the sense that the as_id is > > always valid/accurate, even if npages == 0. > > Sorry I'm confused.. when npages==0, why as_id field is meaningful? Even if > the id field is meaningless after the slot is successfully removed, or am I > wrong? > > My understanding is that after your dynamic slot work, we'll only have at most > one extra memslot that was just removed, and that slot should be meaningless as > a whole. Feel free to correct me. Your understanding is correct. What I'm saying is that if something goes awry and the memslots need to be debugged, having accurate info for that one defunct memslot could be helpful, if only to not confuse a future debugger that doesn't fully understand memslots or address spaces. Sure, it could be manually added back in for debug, but it's literally a single line of code to carry and it avoids the need for a special comment.