From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (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 C790223D2A3 for ; Wed, 28 Jan 2026 14:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769611450; cv=none; b=BSST5HFkKFmkDvzwIqzArCGiZAS0z2qHI6ctQErI/S/X0FeN7qi5Oq41Ziq8tlw0q0YOl70sm0i3p6J29i2k0EqFOVKlXRDyeXJ10YbpC7H9CztS+gGeSAWaXpoibPWKBcF9lLQBUaBTE7EV8RKkc5XbNrpJE5c/JNzIq0RguLg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769611450; c=relaxed/simple; bh=Eifm+5IJG2WQcz8KqADEZNqgSy4azlf0NZp9PbMUSwE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=oCoHZ6XQmoSpj9CDiIY5Rqw2xDXuNQbz5E9/oieYMZUkkGtfHuGy2BhmHY/pCn0MhqxC73cDNAWAas72//3jlp+OnRvMR7rvPgZTCicnMDcmEDxTxvfSYwgBZfUxmeCObF+/SHB2P3NiRqXfr8Ygz+fG28Bq9oP+8xtCdOIr0nQ= 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=fkw3jZG/; arc=none smtp.client-ip=209.85.214.201 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="fkw3jZG/" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2a7a98ba326so13745355ad.1 for ; Wed, 28 Jan 2026 06:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769611448; x=1770216248; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=cvJo/tir+J2/AtqQsUlOrgU1ueJuDktH3Ssw+42VW2E=; b=fkw3jZG/5wB85wEo1RZZ3fYxv7dBYcsfBtHVq3y3+WalADv3UMVIHozQRLFyN1pCUl QhFh1fWiSeFxq0zWdZRj+2x5amcGP+tLBgrFfg83PBsADUm4xzjQj8CrPFFJuDeSoPmA 7wBF0tANtae6xUBuu0xrDMWvjTmh8yJQzgUn3Cz7UXOxH36UWIa33P1zk5iwHPfxWMec U3IKotg2cvAEWWqhpimJQfzTq5t1C8L+yoLyf85kinm7T19ufWegMBYXqYBdxa5lU6MB 9iylyLvKsh5X7wSmppgqkdUZo1Mm4SLlh8hN627HXdTuJGBhInme6MFS4YppnyPG3kiT UC9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769611448; x=1770216248; h=content-transfer-encoding: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=cvJo/tir+J2/AtqQsUlOrgU1ueJuDktH3Ssw+42VW2E=; b=BhnOMgL/OLcAsZ/zlYKIDz//Aq6h2oLDOklVzm8PA3qnSbxmawd8P8DXOLjRrztjNj ur8aFhDMGKvQkI1qO6/W4LodlcBr1zJJXoWDqCRO0y8CAnrXuEAsLi/g5JeosMVUgZ3R F3y25DMuvKq96CiC+b8/EGO2bWpJn8Aj4/CEOxz476bdrpNbTwU2Q+AnEGwC5WHdNhGa /58Io5eBiYldwmFKK6VvD+1XvuHeNHPy8Dnr7T/CWKtpVIVSSZjgR7uTOOxlcM6LJDhQ khIazeN60IXQVrJyadINJ71UQBs/zh70wGKDOmNmvTsc7Hfamk9PsgVdrrmaPKpg+fEq XQpA== X-Forwarded-Encrypted: i=1; AJvYcCVkyL6Tnk2mmoJxJq8bFTTxIVnMjuocAv3dblBvAax68I5meNSN6T3ezloTbg75IjqohkHoCdg=@vger.kernel.org X-Gm-Message-State: AOJu0Ywd5oUqdXBbi9eaUfdzU8Dk7uWbo701yp1YUvI7ejMhoE9rqxgq w6JFneEaCNHnTX9IuOblZ/1Y5aHdG9DKbOvO3L6hGBSC514eylt2F+7VRNquyAyO2ZnMyZ9BEwz PEhNilQ== X-Received: from plbmj14.prod.google.com ([2002:a17:903:2b8e:b0:2a0:de6a:ac6c]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2348:b0:2a0:eaf5:5cd8 with SMTP id d9443c01a7336-2a871267ae6mr39141105ad.9.1769611448055; Wed, 28 Jan 2026 06:44:08 -0800 (PST) Date: Wed, 28 Jan 2026 06:44:06 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260123125657.3384063-1-khushit.shah@nutanix.com> Message-ID: Subject: Re: [PATCH v6] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression From: Sean Christopherson To: David Woodhouse Cc: Khushit Shah , pbonzini@redhat.com, kai.huang@intel.com, mingo@redhat.com, x86@kernel.org, bp@alien8.de, hpa@zytor.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, dave.hansen@linux.intel.com, tglx@linutronix.de, jon@nutanix.com, shaju.abraham@nutanix.com, stable@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 27, 2026, David Woodhouse wrote: > On Tue, 2026-01-27 at 13:49 -0800, Sean Christopherson wrote: > >=20 > > Nope, we should be good on that front, kvm->arch.irqchip_mode can't be = changed > > once its set.=C2=A0 I.e. the irqchip_split() check could get a false ne= gative if it's > > racing with KVM_CREATE_IRQCHIP, but it can't get a false positive and t= hus > > incorrectly allow KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST. >=20 > Ah, so userspace which checks all the kernel's capabilities *first* > will not see KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST advertised, > because it needs to enable KVM_CAP_SPLIT_IRQCHIP first? Only if userspace creates a VM and uses that to check capabilities, in whic= h case KVM is 100% right to say that KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST isn'= t supported. If userspace checks the system-scoped ioctl, i.e. with @kvm=3DN= ULL, it will see KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST. > I guess that's tolerable=C2=B9 but the documentation could make it cleare= r, > perhaps? I can see VMMs silently failing to detect the feature because > they just don't set split-irqchip before checking for it?=20 Hmm, if we want to improve that particular documentation, then we should do= so in the description of KVM_CHECK_EXTENSION itself, which currently says:=20 Based on their initialization different VMs may have different capabiliti= es. It is thus encouraged to use the vm ioctl to query for capabilities (avai= lable with KVM_CAP_CHECK_EXTENSION_VM on the vm fd) Because there multiple capabilities that are conditionally supported based = on the VM type/configuration, i.e. this behavior isn't novel. > =C2=B9 although I still kind of hate it and would have preferred to have = the > I/O APIC patch; userspace still has to intentionally *enable* that > combination. But OK, I've reluctantly conceded that. Eh, VM really should be returning '0' for the check for all KVM_CAP_X2APIC_= API, and disallowing the capability, if the VM doesn't have an in-kernel local A= PIC. Because enabling any of the KVM_X2APIC_API_* options without a local APIC d= oesn't actually do anything. I say that because I'd be very tempted to "fix" that by restricting new fla= gs to VMs with irqchip_in_kernel(), at which point userspace needs to get the ord= ering right anyways.