Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2168285rdb; Tue, 20 Feb 2024 21:43:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX6ME0nzQWPlSlmYijT8pWeFQRDrIqpm5fAE7LDTXFEw3UHzrgCfeLAGAPdJJuq56D4XjafO8gOGtg7p2yPc/7+bCG6Damlm2tBWpgqdw== X-Google-Smtp-Source: AGHT+IEv24M6b2OgSH4H1JQW24pFmOOlyE4KesKwtadY70y46lxYtRosLvdgmq/hX6CLGWLCr7Xg X-Received: by 2002:a05:620a:640d:b0:787:4ee8:3692 with SMTP id pz13-20020a05620a640d00b007874ee83692mr13484978qkn.51.1708494238862; Tue, 20 Feb 2024 21:43:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708494238; cv=pass; d=google.com; s=arc-20160816; b=CeMzjwymu1zltVyiL42PZ5yYtc9vJJ+U2wUFjD7Pgwpi65iIpf2mYT686OeFFEqAcA mqWaxWyqGAV+BUgh4mBMWiSyVStmziYX7WJM65WYOstJ7fbYjomOJbboBAwH3BGZbAEJ VKYkEEliPuTCdCcwg8qqZbuEdBZLopCzv4+y9X5IsgAsvZF359qY0S24UT5aeVJKTJFH As06J8bZePJFI6ln8vDeZywZlSzk3MCoIbIinWEEexOx6ETU1RTbQVcKZ7BSIG6NA2Gg buPfR+Y0XSh5L83/irn68m5AQ4jsG1W6qz3NSNfY/WD1L64Ubnzh+fimUYOoIqGfI81v /8Vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=R/Or/Yh2fAMtkGN2IdwrHuQeB2WLq6uP7r3G04y+nVk=; fh=kCIhDCwfhVa+1moYcBlLNuY7yX/BfELZCoRk1wSf3jY=; b=mDpb5qwJ0wqoyKjTO5g6s4e/6gbZJK+MxNyoTq0TLKycZME5MurEfvWPn7z+c9HjbL VbzolsGi0x9xionw7ejM/uyuw/7VhF64383DWukSnrdyaJgBlV3G3yx6H1J2Bmw/slHn OiJ7SaoQKMl4TXmC3VDPKG6UWC/REH9lIJDEdEM6fKqB0NdHaBEiARSx7sf5LYuoV5vg +HmEb5Tj0zJR32qtnknO/UB3qYUtIUmfSNLdFWUDJRIFdd0+cdEfSxjp+deYD4d8ZOwr M7iR6q5/raaF8hnKnsoGO7N1pB686cEvjtTKddjvzZhcXDTwtWCQiIYYGrN7rBbjMvlx TkXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QlIZNZ1D; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-74098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id br11-20020a05620a460b00b00787879dd09bsi503722qkb.570.2024.02.20.21.43.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 21:43:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QlIZNZ1D; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-74098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CEA421C2365D for ; Wed, 21 Feb 2024 05:43:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 496833A8D0; Wed, 21 Feb 2024 05:43:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="QlIZNZ1D" Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EED33A8D9 for ; Wed, 21 Feb 2024 05:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494202; cv=none; b=ChZqCBE4pB3/wsaE0Emw63RijegWeRWTtBW5G5+qFh4r4z/9iiJTEWd+MIkwyDWRf8kUR99p2XhRIViCrTGJ4SgNFDiqqF0R6BwSNeG3b5cloiED5+cOmAr1iItAFtUn4XhXR/CEbJQpdld2lTWkVJKoyqNPw41ysg1IW2YfiM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494202; c=relaxed/simple; bh=7Rss8dEy/kleI+VwoacNEfis/mgGm1UZXOe2ZRncC0o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GK42h0cXyI4g5ECFIzW9IoPnnb9STJ/1Yla3gzo4juWjFHdmMXHKhGHapnV43Jru3QEukxhTgFyBtJJDswmoymZx0eGgLIQpNuoY6f/WA1FZTms9HUca2A5mPOqtQCnZWaonG8Xgx7wFRpAT7s682uAvl4L1ZbYv7QhUbTacb4o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=QlIZNZ1D; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708494198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=R/Or/Yh2fAMtkGN2IdwrHuQeB2WLq6uP7r3G04y+nVk=; b=QlIZNZ1DPWCe1i+G3NUfzvZGRnxgOcqyEY/nDbKoZZFAtnXrvqNokC8nAIe74UMerLAVQP 3PRjEsb9s7Fh6gKlOBloWypS7xAfOouIToj/uuwOZgWdu8NP+TamKP6qQmSTdB5UTVnYEH m7WNUpJF6lsl2OzO7+py7MtmhiA1Ue4= From: Oliver Upton To: kvmarm@lists.linux.dev Cc: kvm@vger.kernel.org, Marc Zyngier , James Morse , Suzuki K Poulose , Zenghui Yu , linux-kernel@vger.kernel.org, Eric Auger , Oliver Upton Subject: [PATCH v4 00/10] KVM: arm64: Avoid serializing LPI get() / put() Date: Wed, 21 Feb 2024 05:42:43 +0000 Message-ID: <20240221054253.3848076-1-oliver.upton@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Addressing a few more goofs that Zenghui was kind enough to point out. Clearly all of the bugs have been found and addressed at this point. v2: https://lore.kernel.org/kvmarm/20240213093250.3960069-1-oliver.upton@linux.dev/ v3: https://lore.kernel.org/kvmarm/20240216184153.2714504-1-oliver.upton@linux.dev/ v3 -> v4: - Actually walk the LPI INTID range in vgic_copy_lpi_list() (Zenghui) - Ensure xa_lock is taken w/ IRQs disabled, even after purging usage of the lpi_list_lock (Zenghui) - Document the lock ordering (Marc) Oliver Upton (10): KVM: arm64: vgic: Store LPIs in an xarray KVM: arm64: vgic: Use xarray to find LPI in vgic_get_lpi() KVM: arm64: vgic-v3: Iterate the xarray to find pending LPIs KVM: arm64: vgic-its: Walk the LPI xarray in vgic_copy_lpi_list() KVM: arm64: vgic: Get rid of the LPI linked-list KVM: arm64: vgic: Use atomics to count LPIs KVM: arm64: vgic: Free LPI vgic_irq structs in an RCU-safe manner KVM: arm64: vgic: Rely on RCU protection in vgic_get_lpi() KVM: arm64: vgic: Ensure the irq refcount is nonzero when taking a ref KVM: arm64: vgic: Don't acquire the lpi_list_lock in vgic_put_irq() arch/arm64/kvm/vgic/vgic-debug.c | 2 +- arch/arm64/kvm/vgic/vgic-init.c | 4 ++- arch/arm64/kvm/vgic/vgic-its.c | 55 +++++++++++++++++++---------- arch/arm64/kvm/vgic/vgic-v3.c | 3 +- arch/arm64/kvm/vgic/vgic.c | 60 +++++++++++--------------------- arch/arm64/kvm/vgic/vgic.h | 15 +++++--- include/kvm/arm_vgic.h | 9 ++--- 7 files changed, 79 insertions(+), 69 deletions(-) base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d -- 2.44.0.rc0.258.g7320e95886-goog