Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1288801rdb; Fri, 16 Feb 2024 10:43:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVyOQqflg7XF/OK9CKT4z4WmAwjKKhMeSCVHGC47f1ON1ujoCl31L6CLxd8Id3lVL6rdDQHc2tKm/oLEXLMLbYv+TKGH2qpO4S/T3LLxw== X-Google-Smtp-Source: AGHT+IHTjCaEVxs8F6htWYSu9Q8BMEbNvu7nM1DNw+zPkUbxgqCboxtQMQV/kdDeQyf9utMD6TMk X-Received: by 2002:a05:6214:ac7:b0:68f:2b1e:4379 with SMTP id g7-20020a0562140ac700b0068f2b1e4379mr7015596qvi.42.1708109019639; Fri, 16 Feb 2024 10:43:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708109019; cv=pass; d=google.com; s=arc-20160816; b=TQe1ptLk+AN30/myidrzQa7g99nGw7ZiqdCswQd3i7K7pvhPeWeisIkCWw6Oq9/Hyk lBs5bEFKft1thT3B8I0bDa5s+uoFYZIj5Ansa3wVmNFkOb5kBeJYtiGgcro5J6WKoxR3 xjtFyCbzJp6wbWYKm+h/7mkoSrxoAnQGRtiu2zfk+92n7hVxl02f50a8y3p8k4ud23BG +u7RV6pPU4pUn92cI/G8lRTG7hwLA+MnO+bJqBkAQRyJGxSBMbhZrau1MJX1Zuz9jRrr iQnpnpuRJzzmgNmHF9Pfzq+jECOjXeVxQms6DnJIFlFT2iH8C2/2NsgmKm/6WKoFtnJ2 SsZw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=p7/gBwWxFbIZwFC+F2czZFaZoLMKZvcePyaMRonjua4=; fh=OGIcGdyoke6ohfCedcQQ3UJr3JDRxZcQDHVG7x10Yg0=; b=0wdxl++Nub0NVxP2lQBU8GwWGO8RhmP675il0kaW8eonnObw5+g8ltfxrBvoB24n4A Gcu7T9L+OgtUmHxC5gA0vmeqDfOUSTEREsXaMnH7QHB42YchlEkfgYu7IWY01EmGWt+T wXgX+xh35vl8SJj1wDE6aTMoHRXRkFOLhE6FVHGlCqQKZjHjEQgLZvCdBoHHcfxDufGg Qf3B5fzAotPsYZ5rGatxi1KWLlLhTsyOCcDR2Sw8ElyTOt6fFLjXnzw3rs4Njr1aadPe WRR/qpQ83EPJ3tmYT6rae/RkW/udAZHFG0mfpoXm1HBsSKu2mjLsB6s7ZLREZ4j/zCyW kq/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZLbfNeSQ; 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-69184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69184-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 12-20020a0562140dcc00b0068c87dfc7edsi334183qvt.311.2024.02.16.10.43.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:43:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZLbfNeSQ; 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-69184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69184-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 46DA81C20892 for ; Fri, 16 Feb 2024 18:43:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B94EE13665E; Fri, 16 Feb 2024 18:42:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ZLbfNeSQ" Received: from out-175.mta0.migadu.com (out-175.mta0.migadu.com [91.218.175.175]) (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 333F71369BC for ; Fri, 16 Feb 2024 18:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708108936; cv=none; b=SPSWZbJcUgEvvQihG/rRxypvkQ8lPZ4fy5LLmEVb7k68q66JcXnDpGZ1kG+pGNjA1GbCkXE4bJoBW7w6ynzTHzTw8zErKzKINtiwUuaOWpHlCNKAJEw0puiIlOoPCoLOiyfC/IHdpTDsA40qhYSSTzT6cZMJOC0ibzLsuATQ/fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708108936; c=relaxed/simple; bh=RxF9w33LgnXLTuXV5O9RLdzK9dXUqE5MSbsOmdxxwVA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pQ9MhjPWHt9UW8i4bNUEMyW1Xw5Zp6J6avj9IsLeaLaYVPA7CbFA9cAE83ZEwq18pWnQfCxBPhKak/xrX/ZuB6ZL2IX3737YASiJYaB0T/OESfjLh1TJOv046VIxl6LmJInixCpHZJ2T4cocEBL7HfTRbJESmyUe1zwRicSO7TM= 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=ZLbfNeSQ; arc=none smtp.client-ip=91.218.175.175 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=1708108931; 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: in-reply-to:in-reply-to:references:references; bh=p7/gBwWxFbIZwFC+F2czZFaZoLMKZvcePyaMRonjua4=; b=ZLbfNeSQ+vvMysguJereiuL6HX9y7yTkwAqfZDi01alhaBPsgpmVjE5rDkwu1Yn8Htvw9v fzVoJNNRJHANhXohgMOEmDPfTxdaCfZD8ONhfVqCE7ZJVf2ocgo0jDD1DRg4a2cUdGSBHp 8wDn/MKghWUzK463T149MUkCPXm0D6Y= 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, Oliver Upton Subject: [PATCH v3 03/10] KVM: arm64: vgic-v3: Iterate the xarray to find pending LPIs Date: Fri, 16 Feb 2024 18:41:46 +0000 Message-ID: <20240216184153.2714504-4-oliver.upton@linux.dev> In-Reply-To: <20240216184153.2714504-1-oliver.upton@linux.dev> References: <20240216184153.2714504-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 Start walking the LPI xarray to find pending LPIs in preparation for the removal of the LPI linked-list. Note that the 'basic' iterator is chosen here as each iteration needs to drop the xarray read lock (RCU) as reads/writes to guest memory can potentially block. Signed-off-by: Oliver Upton --- arch/arm64/kvm/vgic/vgic-v3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c index 9465d3706ab9..4ea3340786b9 100644 --- a/arch/arm64/kvm/vgic/vgic-v3.c +++ b/arch/arm64/kvm/vgic/vgic-v3.c @@ -380,6 +380,7 @@ int vgic_v3_save_pending_tables(struct kvm *kvm) struct vgic_irq *irq; gpa_t last_ptr = ~(gpa_t)0; bool vlpi_avail = false; + unsigned long index; int ret = 0; u8 val; @@ -396,7 +397,7 @@ int vgic_v3_save_pending_tables(struct kvm *kvm) vlpi_avail = true; } - list_for_each_entry(irq, &dist->lpi_list_head, lpi_list) { + xa_for_each(&dist->lpi_xa, index, irq) { int byte_offset, bit_nr; struct kvm_vcpu *vcpu; gpa_t pendbase, ptr; -- 2.44.0.rc0.258.g7320e95886-goog