Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3282256rwp; Fri, 14 Jul 2023 22:44:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmX6TYMR2UFCB19Hnvci18l3MBpal4ojQZh1tPYtf/JwXm3USKSMW6hCsmgQOp8VR1JlYB X-Received: by 2002:a17:903:1206:b0:1b9:d307:c1df with SMTP id l6-20020a170903120600b001b9d307c1dfmr7386352plh.17.1689399871595; Fri, 14 Jul 2023 22:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689399871; cv=none; d=google.com; s=arc-20160816; b=YqUKNyq2XjQAo/C7LaEuie8HxftH6t2u8fNM1E/XPadgrx0WAC+LEyDvjPiMgtNpoo GuWMNMslj8CHDotZa7ybao1x63ftBXtlYW5smkAm+jMsvm6teysBM0RQ+g08rqUE4Ign DrTO8jCuM1f2U+GJvf1TvdOK1FWr21ykUO5gKKFL7dchcarsgxQ/cmqy7ZEjNYrPVtR1 hl3zadC17G920BfGVqr61AuAI9jq9EnoUGA4ZIyzqcnxrsHbLdyJFwiPw7hfxenq9Pna tQlXvfb+F16qfEHWpP7ao7uQpBZdJWDzFoJBoKxIjmmyJSokZ0EeAMuMIwrenNcOS7Gt O/kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=fY7WqLus7jVclsKOgyv5P2i48ZMgYiFyiuJB7T/iYJw=; fh=ASJJoMsn/juSfR4CQOMw069PmTBQoy5BjGvX2CxtxLQ=; b=QuJw9GsaO5Kxx3PBMS+u1KJsO/3pbWAxbZg75LmcqeiJoCI89ehCP1PZjvxARVGtov Q8raRN0Ol8O8E1SeYeh9f4Hy4O6VOpsJv+imbOazDibfMP4Izsr1Y4z0NOwgyAk8xHr2 yWol640dt2RMbfJziqHi/UCDHu8lmQX0Iik3gdfIaunG2iUATDUPKdXTiwwsBdHFZdxC gx7skPjMJ6zI/jAEOx0sXfB+l3HqP0UjfpU7kyBHQVjIFCM9Ud6671B0wPPNh64N7F// yy/1Hb6hQxctMNyhy7MbBWjNB1m7aB16BfIdVOAZ7gis5PdikfCiVA1ETmQVMTVzCD4y btJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=y3dyDswL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk18-20020a17090b33d200b00262ecc71b13si2481109pjb.109.2023.07.14.22.44.19; Fri, 14 Jul 2023 22:44:31 -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=@google.com header.s=20221208 header.b=y3dyDswL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbjGOEbU (ORCPT + 99 others); Sat, 15 Jul 2023 00:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbjGOEbT (ORCPT ); Sat, 15 Jul 2023 00:31:19 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0928C35AE for ; Fri, 14 Jul 2023 21:31:15 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-4036bd4fff1so154201cf.0 for ; Fri, 14 Jul 2023 21:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689395474; x=1691987474; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fY7WqLus7jVclsKOgyv5P2i48ZMgYiFyiuJB7T/iYJw=; b=y3dyDswLm3NG+cpBXivvLpSQvnVsie+3RNQD59vC88TeX5oQlKJWglbWb6NaoPiIxR vTpVITn+vdMr1SiSU+03FlOhPQ4ghz50pXAYzN9ukMPtRGnQlJ+6zzuHSaTm7KvjgJYc 7x+0inTyoU07FtS0QsqwAtSBBgp58Pbkn8gN3euUXpTS87wyXqM48JTk4DuhLoyX8Frp r1SUzOKQCccxN6jt5CMNHFmjM3I3zRi/DXsgKurWcsj7mEUHImgQosgFXVjIn51PBvar UCQWrHchg+e5Zm1TEOI+R7EYg7weo5PGoOMEc66nWIf/UOpWBd+fx38x4TYx+mJtuhUj /iJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689395474; x=1691987474; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fY7WqLus7jVclsKOgyv5P2i48ZMgYiFyiuJB7T/iYJw=; b=aRQx84ueljLF5655AoIVlRvtUxsUmGr8fQrYzh0pi0eIOV4jKaRcUityEEbtz5tRSi 0MF/QveAyp2OmrUpqKnejDvM7Vo1VuYI7OPfX8+1DSnxtRslK//P+mG6b3jvE3tPc67H 5fsrpALDiBb8t/Vorv5EAQiK1y1iyPudhck/icQIHVVFdGSLjD7aAyIn4ijAERdMsZsg 9Ku9hFvEiWsUiRoRvkC/YacpbK6KhE/FjAnuoq2dNUi2afiOZe37liY5p2SIWifCzq/1 RPusA2omUfjHnisFFYak3SKWMGzve/czGyrmJzIjjACE8U0WdDYZ9rWOVxo24e8d8a8O 3f/A== X-Gm-Message-State: ABy/qLbSQ5XNPuJZ9S5HClb2tfbaqg6KvXVo2fiw9qDZiy/T+bafmLMF 2DyUO7vCgYy4KniXLM0LBBhp7ZGiGChPNN7zG2Cwhg== X-Received: by 2002:a05:622a:208:b0:403:e1d1:8b63 with SMTP id b8-20020a05622a020800b00403e1d18b63mr39255qtx.24.1689395474099; Fri, 14 Jul 2023 21:31:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yu Zhao Date: Fri, 14 Jul 2023 22:30:37 -0600 Message-ID: Subject: Re: [RFC PATCH v3 09/11] KVM: Add new members to struct kvm_gfn_range to operate on To: Sean Christopherson Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sagi Shahar , David Matlack , Kai Huang , Zhi Wang , chen.bo@intel.com, linux-coco@lists.linux.dev, Chao Peng , Ackerley Tng , Vishal Annapurve , Michael Roth , Yuan Yao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Thu, Jul 13, 2023 at 4:10=E2=80=AFPM Sean Christopherson wrote: > > +Yu > > On Wed, Jun 28, 2023, isaku.yamahata@intel.com wrote: > > void kvm_mmu_init_memslot_memory_attributes(struct kvm *kvm, > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index 1a47cedae8a1..5ca0c8ee4292 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host.h > > @@ -260,7 +260,13 @@ struct kvm_gfn_range { > > struct kvm_memory_slot *slot; > > gfn_t start; > > gfn_t end; > > - pte_t pte; > > + union { > > + unsigned long attributes; > > + pte_t pte; > > + unsigned long callback_arg; /* needs a better name */ > > + }; > > Making the union needs to be done in a separate patch. And coming back t= o this > with fresh eyes, I think it makes sense to give the union a name. I thin= k an > anonymous union is actually worse in the long run, and there aren't _that= _ many > instances to update. E.g. that way a single build-time assertion can cap= ture > all uses, and it makes it more obvious that the usage is poking into a un= ion. > > I'll post a patch separately so that it can be picked up for the MGLRU se= ries > (and maybe even merged ahead of both). Thanks a lot, Sean. And sorry for having not addressed your comments on v2 -- I'm wrapping up a few other projects and will be focusing on addressing all pending comments in a couple of weeks.