[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXwJqkVErsY3CBuX@google.com>
Date: Thu, 29 Jan 2026 17:30:18 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Thomas Gleixner <tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
Kiryl Shutsemau <kas@...nel.org>, Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
linux-coco@...ts.linux.dev, kvm@...r.kernel.org,
Kai Huang <kai.huang@...el.com>, Rick Edgecombe <rick.p.edgecombe@...el.com>,
Yan Zhao <yan.y.zhao@...el.com>, Vishal Annapurve <vannapurve@...gle.com>,
Ackerley Tng <ackerleytng@...gle.com>, Sagi Shahar <sagis@...gle.com>,
Binbin Wu <binbin.wu@...ux.intel.com>, Xiaoyao Li <xiaoyao.li@...el.com>,
Isaku Yamahata <isaku.yamahata@...el.com>
Subject: Re: [RFC PATCH v5 16/45] x86/virt/tdx: Add tdx_alloc/free_control_page()
helpers
On Wed, Jan 28, 2026, Sean Christopherson wrote:
> +/*
> + * For SEAMCALLs that pass a bundle of pages, the TDX spec treats the registers
> + * like an array, as they are ordered in the struct. The effective array size
> + * is (obviously) limited by the number or registers, relative to the starting
> + * register. Fill the register array at a given starting register, with sanity
> + * checks to avoid overflowing the args structure.
> + */
> +static void dpamt_copy_regs_array(struct tdx_module_args *args, void *reg,
> + u64 *pamt_pa_array, bool copy_to_regs)
> +{
> + int size = tdx_dpamt_entry_pages() * sizeof(*pamt_pa_array);
> +
> + if (WARN_ON_ONCE(reg + size > (void *)args) + sizeof(*args))
The above closing ')' after args is misplaced, this should be
if (WARN_ON_ONCE(reg + size > (void *)args + sizeof(*args)))
I'm still in disbelief that I managed to end up with such a horrid bug that
compiled without any warnings. *sigh*
Powered by blists - more mailing lists