From: Sean Christopherson <seanjc@google.com>
To: David Matlack <dmatlack@google.com>
Cc: "Huang, Kai" <kai.huang@intel.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"peterx@redhat.com" <peterx@redhat.com>
Subject: Re: [PATCH v2 01/10] KVM: x86/mmu: Change tdp_mmu to a read-only parameter
Date: Tue, 20 Sep 2022 17:16:32 +0000 [thread overview]
Message-ID: <Yyn1cL4dviXwTqXA@google.com> (raw)
In-Reply-To: <CALzav=cuwyFTn6zz+fJqjKNs6XYx2-N61sgMQ9K5C-Z=a4STZg@mail.gmail.com>
On Tue, Sep 20, 2022, David Matlack wrote:
> On Thu, Sep 1, 2022 at 9:47 AM David Matlack <dmatlack@google.com> wrote:
> > On Tue, Aug 30, 2022 at 3:12 AM Huang, Kai <kai.huang@intel.com> wrote:
> > > On Fri, 2022-08-26 at 16:12 -0700, David Matlack wrote:
> [...]
> > > > +#else
> > > > +/* TDP MMU is not supported on 32-bit KVM. */
> > > > +const bool tdp_mmu_enabled;
> > > > +#endif
> > > > +
> > >
> > > I am not sure by using 'const bool' the compile will always omit the function
> > > call? I did some experiment on my 64-bit system and it seems if we don't use
> > > any -O option then the generated code still does function call.
> > >
> > > How about just (if it works):
> > >
> > > #define tdp_mmu_enabled false
> >
> > I can give it a try. By the way, I wonder if the existing code
> > compiles without -O. The existing code relies on a static inline
> > function returning false on 32-bit KVM, which doesn't seem like it
> > would be any easier for the compiler to optimize out than a const
> > bool. But who knows.
>
> Actually, how did you compile without -O and is that a supported use-case?
Eh, IMO whether or not an unoptimized build is supported is moot. KVM already
uses "#define <param> 0/false", e.g. see enable_sgx, I don't see any reason to
employ a different method.
next prev parent reply other threads:[~2022-09-20 17:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 23:12 [PATCH v2 00/10] KVM: x86/mmu: Make tdp_mmu read-only and clean up TPD MMU fault handler David Matlack
2022-08-26 23:12 ` [PATCH v2 01/10] KVM: x86/mmu: Change tdp_mmu to a read-only parameter David Matlack
2022-08-30 10:12 ` Huang, Kai
2022-09-01 16:47 ` David Matlack
2022-09-20 16:57 ` David Matlack
2022-09-20 17:16 ` Sean Christopherson [this message]
2022-09-20 21:01 ` Huang, Kai
2022-09-20 21:13 ` David Matlack
2022-08-26 23:12 ` [PATCH v2 02/10] KVM: x86/mmu: Move TDP MMU VM init/uninit behind tdp_mmu_enabled David Matlack
2022-08-26 23:12 ` [PATCH v2 03/10] KVM: x86/mmu: Grab mmu_invalidate_seq in kvm_faultin_pfn() David Matlack
2022-08-26 23:12 ` [PATCH v2 04/10] KVM: x86/mmu: Handle error PFNs " David Matlack
2022-08-30 23:45 ` Isaku Yamahata
2022-09-01 16:48 ` David Matlack
2022-08-26 23:12 ` [PATCH v2 05/10] KVM: x86/mmu: Avoid memslot lookup during KVM_PFN_ERR_HWPOISON handling David Matlack
2022-08-26 23:12 ` [PATCH v2 06/10] KVM: x86/mmu: Handle no-slot faults in kvm_faultin_pfn() David Matlack
2022-08-26 23:12 ` [PATCH v2 07/10] KVM: x86/mmu: Initialize fault.{gfn,slot} earlier for direct MMUs David Matlack
2022-08-26 23:12 ` [PATCH v2 08/10] KVM: x86/mmu: Split out TDP MMU page fault handling David Matlack
2022-08-30 23:57 ` Isaku Yamahata
2022-09-01 16:50 ` David Matlack
2022-09-20 21:17 ` David Matlack
2022-09-21 23:43 ` Isaku Yamahata
2022-08-26 23:12 ` [PATCH v2 09/10] KVM: x86/mmu: Stop needlessly making MMU pages available for TDP MMU faults David Matlack
2022-08-26 23:12 ` [PATCH v2 10/10] KVM: x86/mmu: Rename __direct_map() to direct_map() David Matlack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yyn1cL4dviXwTqXA@google.com \
--to=seanjc@google.com \
--cc=dmatlack@google.com \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.