Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1352460ybt; Tue, 7 Jul 2020 13:42:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdoODArpGwNtovrTW84J4HqpSKsVPoqsX/kxN48RVvrPukAwctXOZpbJ52Ev/tqMznXNoW X-Received: by 2002:a17:907:212b:: with SMTP id qo11mr48195504ejb.452.1594154522888; Tue, 07 Jul 2020 13:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594154522; cv=none; d=google.com; s=arc-20160816; b=OOho+B53R8iqjGZYkxkDAPJ09EoLwHa6MgZi/PTYrOrj0tZxp6AW/uz70ClftcWA0Z d9EDAIEKrv1z64O4fG19zVkjPNJOjaB4Vvy24dn3JCJSJ/3kwtHzAMxfdX7M6Yv+2H8D WI+gT0cxxaJLkPUOVpuC1OykijBoqFxBvH2IK/tKa2X44DSO/Kq9zzk3g1GsoFFBQBtX G6iUQ7Rf9sxuKoDMIiqxMtT1eVdLGkPlZWBzvJfAnkAaMNGHS2JUu/+9w5vi7V6rlXXZ zokhAfwB1O34mDhI4G1oGzv/vsWqeMcVM/0CQGmPOfla4jSPtt/YRjVYWLL3OmCWBTBz AYDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=aMjCiC4fXOOzIsPO0KvxcCfMxXjgG381WcddzPegvjk=; b=XIK3OHkHXYIyD9g+0jAx5AthD+6SLWX6ijzFnk4KBfrpBWgSj1FNxFPQKkUdsYD3ci cQIJTaq+9FltnHk9AOhNugctbjd5817HtyHhQxeweTM8OVrwGxPgrhaJpdtRMiB/HyEI beeJw3mJsBTIl94PH9fdzSQYXrPpYRyh7qsgJ+8MjIuoXpp3Slg1Eqsli7MjT+bdCNfj m/gNpcEv4XbSjHmA/92wCmWl2USMSrzsUBrmNLATqOf7RAusL8xHQnesII/tkqB6yOTI Rj0oLkAi8OPNuWJyQEuEqxHlk+G0mnICFrmi75W2elPA933LMs3neJXKfu69ZFGffQkP /SSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OspgZzSh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss22si16782455ejb.530.2020.07.07.13.41.40; Tue, 07 Jul 2020 13:42:02 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OspgZzSh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728940AbgGGUia (ORCPT + 99 others); Tue, 7 Jul 2020 16:38:30 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57726 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728347AbgGGUi3 (ORCPT ); Tue, 7 Jul 2020 16:38:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594154308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aMjCiC4fXOOzIsPO0KvxcCfMxXjgG381WcddzPegvjk=; b=OspgZzSh+09WrDVaoEsrCrk+bOWWGA0jCh1lJVYVVLfN1bfgjW5ypvcHE7otgMp8axLEMT O8Rl0TeicwjK+4LbH6MyplExsI8i3tZ0i9yawT+PN/8ZBWMM9TXSU1OpSZR91XjGDF3i8t XJUUF4q2lkcY5ddn+ifYQRODA957XWc= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-211-X5COuLccNxujqkvCuZsU6A-1; Tue, 07 Jul 2020 16:38:26 -0400 X-MC-Unique: X5COuLccNxujqkvCuZsU6A-1 Received: by mail-qt1-f199.google.com with SMTP id s25so168838qth.9 for ; Tue, 07 Jul 2020 13:38:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aMjCiC4fXOOzIsPO0KvxcCfMxXjgG381WcddzPegvjk=; b=DFHhFt9taO+fJViugvjqfQSU4s7WDZx1/ItF8uv15bD9tLzD+GPw1S/bGLpJ6uuX+8 5rciHZHdWVhOOASI0VM7jOacBvO11tMv0bxO51jTeiB7QY1DSCpXncMXczPbjc42r8CS AMsW0HCWXnmvtdz3JGt9jVx5c64z/qWu9EhDo/hWmT4YBlk7g980p7eI2qzfNTlpp0NN WkWsVcQNI4ByFlHQOf/J1MmSfSbS3bZ0jdnsW5UV0HNEj7xc03SSQG28m92bmKIpyEO8 lT0Y43RskEVef+1Y+hBwB18CPyjoYfhWCZThz/ePfmPLaQpDgnBNrPQBoCe8jDgGxnvE EIOA== X-Gm-Message-State: AOAM532rcGngHie4IYJ/1WAP03jZ6CQiG3Uw2yyyFCywau2xAy1VdySb ZNrr0mWPHH8iNoXaGwVopN3KQ6M561zvXdtYrKr4vhNRbJjJPgkhS9msBkHska91N2lu61XijWd i1yVjzpLlOi/awvoxS5oTPiCQ X-Received: by 2002:a0c:a8e6:: with SMTP id h38mr48101763qvc.15.1594154306096; Tue, 07 Jul 2020 13:38:26 -0700 (PDT) X-Received: by 2002:a0c:a8e6:: with SMTP id h38mr48101747qvc.15.1594154305869; Tue, 07 Jul 2020 13:38:25 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id n143sm23806440qkn.94.2020.07.07.13.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 13:38:25 -0700 (PDT) Date: Tue, 7 Jul 2020 16:38:23 -0400 From: Peter Xu To: Sean Christopherson 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: <20200707203823.GI88106@xz-x1> 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> <20200707202623.GM20096@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200707202623.GM20096@linux.intel.com> 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 01:26:23PM -0700, Sean Christopherson wrote: > 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. Sure, will do. But again, I hope you allow me to add at least some comment. To me, it's still weird to set these in a destroying memslot... -- Peter Xu