From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF4EB1E531 for ; Thu, 16 Apr 2026 00:30:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776299426; cv=none; b=nv5EYVSG55v5CJhKRaZRHTbFzEfLyh60AdaxHCvA2vCIoktWpcTDUIpAtynhyNIXBlKwE6hkwGptARP29rFDzBmCCXV5G+4omZhnMZj5pOSAiG5b9IG7j4ONoqD/jibeiGGcIxSu6tmy+7GewLyAPp+cXe1Rf9+xAoj48ZHRy0w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776299426; c=relaxed/simple; bh=CcCwRytegUwsJjSZ6eoAOigRploRUfqEvFZTbZletZE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kSux/2igxkn5Lpreq09sgU3Qceb0j7ZS9GbTXBXaCm0wq9HKqXnb4dtQM8+d4vo4m5rHEmwjXT/ur7BVrkfiaxOlB5bwMLGPk93kCKk5Oar95aakuxpVrGrzNWjoAvKi3mUd1SbUDY9YI0FJyMd8Aj/6xdAzpsKbZNa0VWend+o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=aoEm8Oen; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="aoEm8Oen" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-82f2478c37bso6035236b3a.3 for ; Wed, 15 Apr 2026 17:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776299425; x=1776904225; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=EGo4VOJQPFyHusz55hlkxA3lp3eULjapJ3aQapxGGCk=; b=aoEm8OenhaSdolh21/YisaP6qP24cAO0xwq87gAJLFIrYHFSVlVPD8uTOq2DFFibTv uGxWHY3CXj8FeVlu+/KlKVV/k9uEhfzhCzDejsDYchA+5Lv84iCYqOIkjge2XMJ+EvCR 7ayGgj6ZOKSVpat7Gxw0LYpwEPm5w+yrE4gDIrKRz+rSignaF7AX/IyL0ltaNgsQaekp 9kVQOUubV9JS2YUzdzGNfvRvT4ieoVSHrNmjIeJO+GMVdG0XTmy/Ysm6yjflpy/DhFBu mgBz2HhrglpdW0x/EOc7YjiMRPX2k/MkmLlB8YNEG4W0jUzDN3hZ72EP9Qcz507xXnLp 817g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776299425; x=1776904225; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EGo4VOJQPFyHusz55hlkxA3lp3eULjapJ3aQapxGGCk=; b=OJHizsjgYNNXaXFeQiB5FYSudXo2ADfZsVNCGVayts6KDanl4QDApnOLUeG9FWVdRf sXLYpd6DUNnX65BY0LTdM9YNhwxNoid7pf1GxXmkh73jco6uDYdXbgBpjHSOU81MKP+R p57XIuX6HEWS5RPofCtoQJI0UW7SoNRdyeCspeEJGHQ5ScnClaOugXIEU9UnjCbbmDfM h5TukULVLQ6CA/tFCAVOQfdf2mirBD0dYT6dF/8pHZtK4YoIRTOhm/72S9INHQHNiv3J fv7B5DLU/c4P+mWdXk+ggeBdeKi+QUiKT55amhCS2nVz57lXCOI3zDystARjRDkndr2t c72w== X-Gm-Message-State: AOJu0Yy5SZ6r+SLaG13UfeEL7aicI+YQ+1h4eHntojBK3yxwji5Ma/5m jZaDBd40Sh7lbSrJqtRauwj9qKKfdAT4/iNF/lGqipt0U8X/XdtuVej/eUReQ3pbMCLimZ76Zo1 WlohLxQ== X-Received: from pfbcj18.prod.google.com ([2002:a05:6a00:2992:b0:82a:6195:3c55]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4981:b0:82f:776f:a78a with SMTP id d2e1a72fcca58-82f776fb4efmr827828b3a.30.1776299424746; Wed, 15 Apr 2026 17:30:24 -0700 (PDT) Date: Wed, 15 Apr 2026 17:30:23 -0700 In-Reply-To: <20260413125149.2876836-2-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <2026041316-tribunal-pendant-dc80@gregkh> <20260413125149.2876836-1-sashal@kernel.org> <20260413125149.2876836-2-sashal@kernel.org> Message-ID: Subject: Re: [PATCH 6.19.y 2/2] KVM: x86: Use __DECLARE_FLEX_ARRAY() for UAPI structures with VLAs From: Sean Christopherson To: Sasha Levin Cc: stable@vger.kernel.org, David Woodhouse Content-Type: text/plain; charset="us-ascii" On Mon, Apr 13, 2026, Sasha Levin wrote: > From: David Woodhouse > > [ Upstream commit 2619da73bb2f10d88f7e1087125c40144fdf0987 ] > > Commit 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with > flexible-array members") broke the userspace API for C++. > > These structures ending in VLAs are typically a *header*, which can be > followed by an arbitrary number of entries. Userspace typically creates > a larger structure with some non-zero number of entries, for example in > QEMU's kvm_arch_get_supported_msr_feature(): > > struct { > struct kvm_msrs info; > struct kvm_msr_entry entries[1]; > } msr_data = {}; > > While that works in C, it fails in C++ with an error like: > flexible array member 'kvm_msrs::entries' not at end of 'struct msr_data' > > Fix this by using __DECLARE_FLEX_ARRAY() for the VLA, which uses [0] > for C++ compilation. > > Fixes: 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with flexible-array members") > Cc: stable@vger.kernel.org > Signed-off-by: David Woodhouse > Link: https://patch.msgid.link/3abaf6aefd6e5efeff3b860ac38421d9dec908db.camel@infradead.org > [sean: tag for stable@] > Signed-off-by: Sean Christopherson > Signed-off-by: Sasha Levin > --- Acked-by: Sean Christopherson