[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <875y55eb9f.ffs@tglx>
Date: Wed, 23 Aug 2023 22:47:56 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
Shuah Khan <shuah@...nel.org>, Jonathan Corbet <corbet@....net>
Cc: "H . Peter Anvin" <hpa@...or.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Tony Luck <tony.luck@...el.com>,
Wander Lairson Costa <wander@...hat.com>,
Erdem Aktas <erdemaktas@...gle.com>,
Dionna Amalie Glaze <dionnaglaze@...gle.com>,
Chong Cai <chongc@...gle.com>, Qinkun Bao <qinkun@...che.org>,
Guorui Yu <GuoRui.Yu@...ux.alibaba.com>,
Du Fan <fan.du@...el.com>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH v3 1/3] x86/tdx: Add TDX Guest event notify interrupt
support
On Sun, May 14 2023 at 00:23, Kuppuswamy Sathyanarayanan wrote:
> +static int __init tdx_event_irq_init(void)
> +{
> + struct irq_affinity_desc desc;
> + struct irq_alloc_info info;
> + struct irq_cfg *cfg;
> + int irq;
> +
> + if (!cpu_feature_enabled(X86_FEATURE_TDX_GUEST))
> + return 0;
> +
> + init_irq_alloc_info(&info, NULL);
> +
> + cpumask_set_cpu(smp_processor_id(), &desc.mask);
desc is completely uninitialized here and therefore desc.mask and
desc.is_managed contain random stack content.
The only reason why this "works" is that tdx_event_irq_init() is an
early initcall which is invoked before SMP init, so the only choice of
the allocator is to pick an interrupt on CPU0.
Thanks,
tglx
Powered by blists - more mailing lists