Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2297299pxb; Wed, 9 Feb 2022 15:29:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYPzkouTdGWzlviglFaZH56Vst425UkDnVRLYjx8fQf8mmNpNrEYpL5yg25pLzhGZJW1R+ X-Received: by 2002:a65:5b08:: with SMTP id y8mr668165pgq.166.1644449381560; Wed, 09 Feb 2022 15:29:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644449381; cv=none; d=google.com; s=arc-20160816; b=j3csY2/UH7LqQtL0iln1NyyLJgIVY3OBZqDaCIPeMS+3tvNpWzwjymXHbF8cUVU+Bg fsv3adqASF9Ox+zWCa+O7lk2pEha1FJmeEnlE78tMTRFF89H3ZPhA7+lpPExmTinNE+H VKmqQx+EGVZN5faW/TGjymRUhx8XWL5NIBorbWWjQRsbfVtqdGSw36Jn/tH4tfzvAr3z 15qewGqAv3nH4yK3nFI+zH4HtWGvuDiVM6sX6o/B9z22ki+Fnu8gsleEZw8p53+1sluV ujFSb42FxNI4gfR8bdkJsnvAV1+plcp+CUK0PXqjL45/jQXjfUBgWQZrCG4pvIZHw56s A33A== 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=9hlT9vQoLsVUjhpXGLlm7SvL3xA/YnfAS42BSAPz/pE=; b=Y5NDF5d+9/KTUwmEDD4nc+uklpqeBcK7++RXshuOEn6vMNDPNYq8NL1ctydPkLf3e7 xx3QetnLYNs7qJuoT1XEAdVCNyiVTnexlF8/nhjgj2PKcAiH1gIOHb6VCyHrbA0E4y68 /YwF9PiydfNhRhux3KNxGsZomQbU/RHtdQunSNh72KjcggiiKicat8rds9F+vbAI6/B3 JosSydVmZRO5NqNAAorU6wQsWvwIPlaLWJLgM7MQgnMy1qT7unCD6uXkKiMbVrcmRY7S JU3HbLVBaTz/QOJ3iHvdaEOlLdcOCK7rN3pJHS+BhrRWC5vNydSIUOQJHZV/g81g6E4i frlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=r734V9jL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l12si17878952pga.479.2022.02.09.15.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:29:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=r734V9jL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB248E0717E9; Wed, 9 Feb 2022 15:21:15 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236828AbiBIW6F (ORCPT + 99 others); Wed, 9 Feb 2022 17:58:05 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:41320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236862AbiBIW6B (ORCPT ); Wed, 9 Feb 2022 17:58:01 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F5FE051102 for ; Wed, 9 Feb 2022 14:57:54 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id x4so247764plb.4 for ; Wed, 09 Feb 2022 14:57:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9hlT9vQoLsVUjhpXGLlm7SvL3xA/YnfAS42BSAPz/pE=; b=r734V9jLiaYfgXN0U+a0+2HFTV0eBCXCPquFaY/jlvnSdXeYv8CNvRDh/k7nddphJt i8MOmjleXPePA6uvYMQC2S8sulBSJ8DjBef7De+Qt/G30bc1Ij6Wau47EIQHjyvzr767 zEDwNvkCqLOmt1Jt+Z63JDDnSrNnXQyyR5s0gNfZKAqOn47bYilzIbNHWdbXFsYJhZkk dz01b+CjCMs7TzyfXo9oORg+cwjc4++HwDCXGps1KqbJMfg7ozkyCtGABKVvSC3lFm1n fC5HzenqA0xBzwiHiaG6eMG6VvXtSS42e9ELMj9likPB63B2zJzx7PaOerJbkPVJpUqw I2kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9hlT9vQoLsVUjhpXGLlm7SvL3xA/YnfAS42BSAPz/pE=; b=F64c23DNXho93/KMlHIo1QRpRim+VnN8P7IrwIgI0zdlLQjBty4V38fqCUxIsh8mFt ci9HYLmzkq+964FhspGJQY31MYbV+9i/D4u5If3Ume7k0gpcrWAw5MjQVyfhmiSrqFA7 94Bk+iPzvggiW7vNvBfa8eIxcMEnlthdD3+xCbmke/ti/yFq3QiG0lQ4OJv5WkZjig9t q+Qak7fPEZcKsY0200ACZwHj0N5fPuzEhyAN2D5tcKrMNL3NGBRwTyL5C/oodN1ePFP2 guU6db65N0UEmqAdMndF4hhgdn2VvcLZLNn2oHtMltr2nSKTzI6lYnYYOvzUZdyqT54O 9oag== X-Gm-Message-State: AOAM532Q6I7Rh/d2PdzACSRlxocCmESJ+U8/dKMwQRgqhEnDbQKZGjci SpbC6XWR6wI6bhLW3egbrAmEjkCZNorStg== X-Received: by 2002:a17:90b:3a82:: with SMTP id om2mr4731200pjb.167.1644447468162; Wed, 09 Feb 2022 14:57:48 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id gk15sm269582pjb.3.2022.02.09.14.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 14:57:47 -0800 (PST) Date: Wed, 9 Feb 2022 22:57:44 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, dmatlack@google.com, vkuznets@redhat.com Subject: Re: [PATCH 04/23] KVM: MMU: constify uses of struct kvm_mmu_role_regs Message-ID: References: <20220204115718.14934-1-pbonzini@redhat.com> <20220204115718.14934-5-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220204115718.14934-5-pbonzini@redhat.com> X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Fri, Feb 04, 2022, Paolo Bonzini wrote: > struct kvm_mmu_role_regs is computed just once and then accessed. Use > const to enforce this. It's not new enforcement, just syntatic sugar (though it's tasty sugar). All fields in struct kvm_mmu_role_regs are const specifically to prevent such a struct from being changed regardless of how a pointer was obtained. struct kvm_mmu_role_regs { const unsigned long cr0; const unsigned long cr4; const u64 efer; };