[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h7c0htkb.ffs@tglx>
Date: Thu, 25 Nov 2021 21:24:52 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: isaku.yamahata@...el.com, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, erdemaktas@...gle.com,
Connor Kuehl <ckuehl@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: isaku.yamahata@...el.com, isaku.yamahata@...il.com,
Sean Christopherson <sean.j.christopherson@...el.com>
Subject: Re: [RFC PATCH v3 49/59] KVM: VMX: Add macro framework to
read/write VMCS for VMs and TDs
On Wed, Nov 24 2021 at 16:20, isaku yamahata wrote:
> From: Sean Christopherson <sean.j.christopherson@...el.com>
>
> Add a macro framework to hide VMX vs. TDX details of VMREAD and VMWRITE
> so the VMX and TDX can shared common flows, e.g. accessing DTs.
s/shared/share/
> Note, the TDX paths are dead code at this time. There is no great way
> to deal with the chicken-and-egg scenario of having things in place for
> TDX without first having TDX.
That's more than obvious and the whole point of building infrastructure
in the first place, isn't it?
> +#ifdef CONFIG_INTEL_TDX_HOST
> +#define VT_BUILD_VMCS_HELPERS(type, bits, tdbits) \
> +static __always_inline type vmread##bits(struct kvm_vcpu *vcpu, \
> + unsigned long field) \
> +{ \
> + if (unlikely(is_td_vcpu(vcpu))) { \
> + if (KVM_BUG_ON(!is_debug_td(vcpu), vcpu->kvm)) \
> + return 0; \
> + return td_vmcs_read##tdbits(to_tdx(vcpu), field); \
> + } \
> + return vmcs_read##bits(field); \
> +} \
New lines exist for a reason to visually separate things and are even
possible in macro blocks. This includes the defines.
Aside of that is there any reason why the end of the macro block has to
be 3 spaces instead of a tab?
Thanks,
tglx
Powered by blists - more mailing lists