From patchwork Fri Apr 22 10:04:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 564798 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp347299map; Fri, 22 Apr 2022 03:43:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykFDa1j10tkJF+3KpDasyiyMVPYpnWyf85Cq1Szu1Ril+Bo1SWKlCJcwl5sMnBRViRJRG4 X-Received: by 2002:a05:620a:1a9a:b0:69c:4a99:ea50 with SMTP id bl26-20020a05620a1a9a00b0069c4a99ea50mr2144124qkb.632.1650624188422; Fri, 22 Apr 2022 03:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650624188; cv=none; d=google.com; s=arc-20160816; b=mSaoPzYWq9fiE/uFQABYs81qqgbEBpEofP29PO5CEePQndrExMKtGFW2Ze8xnHAW4x SC8GuKKZH8sv/hBJXWJdXHXE33r529rikZNDndJoWogogFBnvHLOUdGpsB3jSvWqxjg/ QnJ/+srL9dS0I4GMbaSxr1IMiSABYoMJ22+p+m5GTB+I4quagSCYOpm6g5lzTmRFjjUZ 5vzyMZj9vM4zFtC68lIMhvZWurejSsAtYYHJGZLzFpe66xMuM5bId0yOyjG+3Sx4Rgp6 A1ka+FXPLe9aTGps3V54BoCoenQKOfpKWIgU4n5+n/qB6KAWGWxLQmj9/yoMFbdQUw5G QkuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Fd3KVJcBKmzClgCV6dFquqvBXsUvGLaOK7cLjXe1F7c=; b=Yj6L34/AFszRtqEWRQyC4QHYTucMX3cm3kqio2jKplcnyOLReJmN9BzLU8JrMcPw8R JvEUf1hejL1R7HppCfB/dYuWBMLxCU8hJpzU2kUsiYGozEQTWrYIfXB4lxFyuFHGOLpI IACRcyrFemoHSHfTDnpcmusrLJuGYWh6HZSfZf4SX/ki5cse5H9Y65shDOKBdkt7oz/a 3nb2k8VM+/rfSmMCmxTCnR4ofHyQ1Yw7+982Pz073ReiIYvXe2qkg1OLwqGRVtBoGSv0 X4ylwb8ukOAzbQ5BfZu0VC5ZJWoDmhVfr9zm3aMOaZz4E7bjJq9lihoai5iom0344Bv/ aDkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BLXX2csi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p7-20020a05621421e700b004464f471090si2069917qvj.501.2022.04.22.03.43.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Apr 2022 03:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BLXX2csi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhqkl-0003QX-W4 for patch@linaro.org; Fri, 22 Apr 2022 06:43:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhqA3-0004xw-1C for qemu-devel@nongnu.org; Fri, 22 Apr 2022 06:05:11 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:51054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhq9x-0002pn-J3 for qemu-devel@nongnu.org; Fri, 22 Apr 2022 06:05:10 -0400 Received: by mail-wm1-x32d.google.com with SMTP id r19so4805432wmq.0 for ; Fri, 22 Apr 2022 03:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Fd3KVJcBKmzClgCV6dFquqvBXsUvGLaOK7cLjXe1F7c=; b=BLXX2csiLGOBJC0uhGqiuzQG5ybKZPT78oJ5pqQCEHb6oobkX0HEV83QFnTYZStJnU WGzgl9boRn8VWGSXh8P4seUQUGFP7ZMshXHxR+4tOoljmLvCfxUJj9RBnHWxFkXmjIB9 9JgMmbLyGpc+fJ1ecxB6zumd1TvK01v15ikC1FZRNgyv9RIFmT+dLvAdG27KWyRLsjI7 V6K12NYZdB7GpOMwpN0UjSxJ3CYbUEqbIB1XGnnw8eTi18UZNlPUyiZlysgZ+GWYB9M3 iDJFVDCxDVvLePpX5+wRhwOC486A0CHN2z1Np7S6PZ6O6ipEljz70qYYcNspafABkN6/ UX6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fd3KVJcBKmzClgCV6dFquqvBXsUvGLaOK7cLjXe1F7c=; b=Ge0ZjIqQ910uVD5B287QC1CI2hJ0b49k6hvhdb9P3u2u58N1uSumTqbXyszuZUY5gg mCHwDjh+qqOdoLBqnFAlSQg1rFEC+pXwTpo4YwALp2WxN/BIBwzdUqnfJVsTaneX8Nci y96fFct9aTl6I7YVAueX9y51tabSS6bOytb6W7Y6BIBsU1ZrhOPsMtmw4D8n/rmIAn83 z4Yd8tQCUnvJxL6yJ/27kWaqkb2gTNsR9Wv0QmF+F0ghYFK2up9GRrqq/qKqNq25jpJ3 lTnU7yp2HLpawBSwAzRWs+De6bLIJ7wa8Jofc6TlCNPlj5XbsGRXMNvvsuAb7imD2CF6 TXuw== X-Gm-Message-State: AOAM533718NbcQCFo8aXeVdgJboyROVx+I02bo4iWWjgn5T+CN/bBppj 0XNJmiNB7S86YX3aYHiR48Trrt4dnkkodQ== X-Received: by 2002:a05:600c:a06:b0:392:a4f2:2097 with SMTP id z6-20020a05600c0a0600b00392a4f22097mr12706970wmp.97.1650621904141; Fri, 22 Apr 2022 03:05:04 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e16-20020a05600c2dd000b0038ed449cbdbsm4312148wmh.3.2022.04.22.03.05.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 03:05:03 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 32/61] hw/intc/arm_gicv3_redist: Implement gicv3_redist_vlpi_pending() Date: Fri, 22 Apr 2022 11:04:03 +0100 Message-Id: <20220422100432.2288247-33-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220422100432.2288247-1-peter.maydell@linaro.org> References: <20220422100432.2288247-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Implement the function gicv3_redist_vlpi_pending(), which was previously left as a stub. This is the function that is called by the CPU interface when it changes the state of a vLPI. It's similar to gicv3_redist_process_vlpi(), but we know that the vCPU is definitely resident on the redistributor and the irq is in range, so it is a bit simpler. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220408141550.1271295-33-peter.maydell@linaro.org --- hw/intc/arm_gicv3_redist.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c index 1ed251b87be..0fbb04f9986 100644 --- a/hw/intc/arm_gicv3_redist.c +++ b/hw/intc/arm_gicv3_redist.c @@ -1009,9 +1009,28 @@ void gicv3_redist_movall_lpis(GICv3CPUState *src, GICv3CPUState *dest) void gicv3_redist_vlpi_pending(GICv3CPUState *cs, int irq, int level) { /* - * The redistributor handling for changing the pending state - * of a vLPI will be added in a subsequent commit. + * Change the pending state of the specified vLPI. + * Unlike gicv3_redist_process_vlpi(), we know here that the + * vCPU is definitely resident on this redistributor, and that + * the irq is in range. */ + uint64_t vptbase, ctbase; + + vptbase = FIELD_EX64(cs->gicr_vpendbaser, GICR_VPENDBASER, PHYADDR) << 16; + + if (set_pending_table_bit(cs, vptbase, irq, level)) { + if (level) { + /* Check whether this vLPI is now the best */ + ctbase = cs->gicr_vpropbaser & R_GICR_VPROPBASER_PHYADDR_MASK; + update_for_one_lpi(cs, irq, ctbase, true, &cs->hppvlpi); + gicv3_cpuif_virt_irq_fiq_update(cs); + } else { + /* Only need to recalculate if this was previously the best vLPI */ + if (irq == cs->hppvlpi.irq) { + gicv3_redist_update_vlpi(cs); + } + } + } } void gicv3_redist_process_vlpi(GICv3CPUState *cs, int irq, uint64_t vptaddr,