From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 465FEC001DF for ; Thu, 13 Jul 2023 22:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232637AbjGMWKU (ORCPT ); Thu, 13 Jul 2023 18:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231316AbjGMWKR (ORCPT ); Thu, 13 Jul 2023 18:10:17 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 510202719 for ; Thu, 13 Jul 2023 15:10:16 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1b9de3e7fb1so5801355ad.1 for ; Thu, 13 Jul 2023 15:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689286216; x=1691878216; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=gogTPYXLafipe4IJKLi8OWwxTihyvKkXkU2xENddLLA=; b=1K8OGQlOcob1VgQdPzcGoytN+L/KRaX4Y/HBOpcGL7kWPNn9RNw9JgP1mOrSTOEEO6 gvR8cI2i85f2Umwo6f1HeslwyYD8R1JP2lyMc8EdeaIWRYrKB4/+VoLYOnWTfWSN69Jf 5h84/eOwMNndzs/wiac+jyKQR26gi01fIW214lh4wXvNn84jvebBpjsDhGtoWxNxmg8B iteQ+h19RpXAUNatWnXUuoRi/y9oKljW+OIsS6ccCT9HDU3aabhLgQrTgsXix94rYiwC PCiBTEdmvu52n7ObZnUx44SnTnKs2zusczwZOnx5FoppnzwauGCib16Ht5Nk1IzU3PgI v+XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689286216; x=1691878216; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gogTPYXLafipe4IJKLi8OWwxTihyvKkXkU2xENddLLA=; b=BGDHfwZLVl9/KoI9GvMyf/vm641uDG9CD1rWVlor8439QZrVlE5WOzdgRuzop/mfIW E0SL0kiC2XAs+/sxSvQyD+2/TqUz+K7zekp3dtX1YMIpArkYIzB7p+Nas8boYw3yxS4S +QJo/jEZzqj0wzMC4Nwp/3nb0gs0MV+YYpROwauPIuFN4Y4jvihrmU3eqr4fKz3TAt+i xJZC2NNbLRb+GL8jebu5zT1boo8y7MKutIn43ZFUqGEYGk4ZY+kaS3IcmPbkea/8/XWH 2bZtPQQWIaey3yeG3hvJ+hX1ddU1Cm7GWn0Empt4EXL8zlc0TnRszUmmnOHQM2MWWqhu 9xOw== X-Gm-Message-State: ABy/qLZeSwQq845V0PzIq7rhgFIWICbPbmQl1npCvlbXGRJzhtThURcC avhh6k81Dpm8+fj6+uGskqb1/0ylUsY= X-Google-Smtp-Source: APBJJlFKBTGdsU9w5fXlOdzBJ3H1Wj190qbeOOztvGOvOIo9NINmHgA6U0s9w6S48to8L8SQgUj82tMSHIs= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:cecc:b0:1b8:866f:6fc1 with SMTP id d12-20020a170902cecc00b001b8866f6fc1mr10059plg.0.1689286215874; Thu, 13 Jul 2023 15:10:15 -0700 (PDT) Date: Thu, 13 Jul 2023 15:10:14 -0700 In-Reply-To: Mime-Version: 1.0 References: Message-ID: Subject: Re: [RFC PATCH v3 09/11] KVM: Add new members to struct kvm_gfn_range to operate on From: Sean Christopherson To: isaku.yamahata@intel.com Cc: 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 , Yu Zhao Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +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 to this with fresh eyes, I think it makes sense to give the union a name. I think 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 capture all uses, and it makes it more obvious that the usage is poking into a union. I'll post a patch separately so that it can be picked up for the MGLRU series (and maybe even merged ahead of both).