From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f74.google.com (mail-ot1-f74.google.com [209.85.210.74]) (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 6F24E1D540 for ; Fri, 17 Jan 2025 01:07:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737076064; cv=none; b=C8L835nTMx+axA7FU2sg1idrRDGH4SEEg99vkwHaluVTMomnxEn9n1kpJQW9ay5zhRve/zQ+SE1IALnQ9WD3n6MhvgjwtJ5ofTw2kiNr7OJO96xQ+wEdHdLKfTp7V4Nlcr8ag/JYl9v2yV0TruSglVOuhG75WwK2aaPJ6Oc0Hdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737076064; c=relaxed/simple; bh=BuldEnEeGmI9Hw0DVTb8LsiZwmC3XXvZPUEZhBILBts=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=g52yEKzbskP9tR+mgkL/9RE2W8TEGmwtYbhPtq/IygkXyb+LBIjwyf5wS5ER3rzI2BKfu7pAzJzQ235bFqbZUqjaI/9DhoK0vnzJhusobkouS4VdOtnpWxqevmzS33J+4jbc+k+MsQpnqFU1Yc0GSTjCbS5jIrrrQnJyVdnQ96c= 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=ry4307EL; arc=none smtp.client-ip=209.85.210.74 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="ry4307EL" Received: by mail-ot1-f74.google.com with SMTP id 46e09a7af769-71e1356a00bso1194604a34.0 for ; Thu, 16 Jan 2025 17:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737076062; x=1737680862; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=uNacvWVxexFG3YeYZaGodI9DphNDLIiWKnJHtghb0eg=; b=ry4307ELgmpdfo0Rhoh2G8VHeCkyxtN1P2mrIqrYNKqa4Qgpn8xFkh8jCpCR/crDyx 05+Vug3kOonLxqZwlywugRqH509P4xFnslNNLSY7m+2cYc0L54ebhSgVWUGHPdw7eIbb wHGXDZcoer7+PWROMRd7J+8Rnx1oP2ABbX8e2Y7foy2NU7nIuXyw8dbKARpaTl1R3crb 9NpoDACG4Jpd8OJNBkN6Iifi1wzAyRSWuUL25fC8EaehNFZg3Of4geVZ+Wmseoqkq+bU IT9QT/6EHXZoT8XRDfmC+4rzeoj/usKTYd5zQ30Jl+SB4+ub4Q3Y5/VxMy9lPbEqHyIG Dw9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737076062; x=1737680862; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uNacvWVxexFG3YeYZaGodI9DphNDLIiWKnJHtghb0eg=; b=aYXF25UqCdlknXPtWggwsjEbuki4mj3MsU0otiVgRNbNb1NjUdf1CEcVmjU3caXcLH LLnJfBiOtqHiTCeMSgq87snT4UGbtg8xpCMVLErmZ2V6s/QCjwgP0Upa7TJPm5dwN6Dm yqJ06gJnXTtinCUUNwPxb2FZlOuOWtv5XbHY3YcAo0plezmMVpp5XdAVcsyNf26spRpc cFJ0gGE7bXsQTfAgUKJ4PrkWDyXuoKJq7CS050yqvZ7U4S+aSeCHwGc2fRJhBNZ9BaX6 ++Ww//g7AmYoXFWHAFDOFPQocA3ciW+rnrbd3K3nL91SYZAwx3l4+f1RT5owsCJNHJDN jMNg== X-Forwarded-Encrypted: i=1; AJvYcCUFZ8p9SqAv/OKtpcj1Na7yHhdLMLyUamiv8Vu79Jw/Ny9R2qQclxMZ7UmNDmi/jOiu5io5gD+0uK8MFCI=@vger.kernel.org X-Gm-Message-State: AOJu0YxbyEoLG2n5z/JDQdpcgmuYFfaAz9B9DJ1lBMLrIEOLSwvDGkpK YDJf7+B62a/vjHP1OVD4+51W0HZLUe0Vy2TnLK2cRLHJ3XI5WNf8UzIcpLAbqd3wq6muyNNfF70 2uA== X-Google-Smtp-Source: AGHT+IEPoyfyZtaaWCrK+yiJe5hZZ9ztN6DYrVpU93GAOQGnvPWsHL1Iwb6I63C0xEYdVtHQaeGD+6C0ERY= X-Received: from pjbse4.prod.google.com ([2002:a17:90b:5184:b0:2eb:12d7:fedd]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:534c:b0:2f6:dcc9:38e0 with SMTP id 98e67ed59e1d1-2f782b01f69mr1289968a91.0.1737076052353; Thu, 16 Jan 2025 17:07:32 -0800 (PST) Reply-To: Sean Christopherson Date: Thu, 16 Jan 2025 17:07:17 -0800 In-Reply-To: <20250117010718.2328467-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250117010718.2328467-1-seanjc@google.com> X-Mailer: git-send-email 2.48.0.rc2.279.g1de40edade-goog Message-ID: <20250117010718.2328467-7-seanjc@google.com> Subject: [GIT PULL] KVM: vcpu_array fixes and cleanups for 6.14 From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson Content-Type: text/plain; charset="UTF-8" The wonderful vcpu_array changes that you already know and love :-D The following changes since commit 3522c419758ee8dca5a0e8753ee0070a22157bc1: Merge tag 'kvm-riscv-fixes-6.13-1' of https://github.com/kvm-riscv/linux into HEAD (2024-12-13 13:59:20 -0500) are available in the Git repository at: https://github.com/kvm-x86/linux.git tags/kvm-x86-vcpu_array-6.14 for you to fetch changes up to 01528db67f28d5919f7b0a68900dc212165218e2: KVM: Drop hack that "manually" informs lockdep of kvm->lock vs. vcpu->mutex (2024-12-16 14:37:30 -0800) ---------------------------------------------------------------- KVM vcpu_array fixes and cleanups for 6.14: - Explicitly verify the target vCPU is online in kvm_get_vcpu() to fix a bug where KVM would return a pointer to a vCPU prior to it being fully online, and give kvm_for_each_vcpu() similar treatment to fix a similar flaw. - Wait for a vCPU to come online prior to executing a vCPU ioctl to fix a bug where userspace could coerce KVM into handling the ioctl on a vCPU that isn't yet onlined. - Gracefully handle xa_insert() failures even though such failuires should be impossible in practice. ---------------------------------------------------------------- Sean Christopherson (6): KVM: Explicitly verify target vCPU is online in kvm_get_vcpu() KVM: Verify there's at least one online vCPU when iterating over all vCPUs KVM: Grab vcpu->mutex across installing the vCPU's fd and bumping online_vcpus Revert "KVM: Fix vcpu_array[0] races" KVM: Don't BUG() the kernel if xa_insert() fails with -EBUSY KVM: Drop hack that "manually" informs lockdep of kvm->lock vs. vcpu->mutex include/linux/kvm_host.h | 16 +++++++++--- virt/kvm/kvm_main.c | 68 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 65 insertions(+), 19 deletions(-)