From patchwork Fri Apr 22 10:04:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 564787 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp334778map; Fri, 22 Apr 2022 03:23:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz3LLuUoMv0Xm3k3SZgRrwc/GvvJB+GyB2RCPA2FhPIa1wMppk9e7mz6zkTbdItKfZ4ZVG X-Received: by 2002:a05:622a:20e:b0:2f3:4ef6:3aa7 with SMTP id b14-20020a05622a020e00b002f34ef63aa7mr2641297qtx.136.1650623001981; Fri, 22 Apr 2022 03:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650623001; cv=none; d=google.com; s=arc-20160816; b=OCLn+IA7Q42DNWhAq2otGEIdo2iTj9Y3VnyBYYp98uRVHbAySF8ZOSoCd29vG70uU+ qOK7RMh6veel1W8kwlc/o8eRMlsrNvwLFwRJI4PX6fZrmczFixiwNqy6VB5IfcmfQVr5 wxfCu4TZ2aF5dMeVtuhXkEYPVrnjQv+3fzHRvXX/RWiV/NxmKOU+Ag5LicWSPkMaZj7r 6pj0q5CMxeYmIKYdHtrnlp30/3fsOYNVdP3dvXrdwmXjKfEQg1NvqHTHjM+Eiif3vumr 01J2eI8RUGb3BKfzjEo2jUqNA6YnefZ3XTFWe/AlfGjW0RDrxnoYkDTOVzZQi4LFmQGb Rhwg== 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=l5uJxy4WfAzOW7qSBnV+0WxIG9WxiypmDb7cHj2F97M=; b=Yjh3oWvG6m2/bdQOdQXC2u5rWpmeLHY5Ri6VolzDCGxhZLubsbc25TwEFMqxYPo4Nn +RAMpEh+mmZodNS7cB8Oul2AG2lB26750y9/uSdbRLkIKjEm4ZYt+Re9zCPYWvAUTz+J FUFsQcKoKvn8CrpB1dA6ytZvvCvO5dXkTyJqTT+gp+YaY/wEBdxH6X5dB453cYol+EiI 545kipcuRyH3KpQuyU/sUIBdxQ//3ZvvRgKv1qxIIS4DMH7e6VJLkC49pt32b+uGMopa 4pnR6Gnn9syxYl3gvLYykWjmxFh0bpRFiAe2wfERd1wKk0KLxcvTcFLJrZ0yWYRpMQRx MKDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n4HQ57pz; 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 2-20020a05621420c200b0044ccdbad094si1276799qve.389.2022.04.22.03.23.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Apr 2022 03:23:21 -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=n4HQ57pz; 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]:58420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhqRd-0000Fq-HR for patch@linaro.org; Fri, 22 Apr 2022 06:23:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhqA0-0004um-OX for qemu-devel@nongnu.org; Fri, 22 Apr 2022 06:05:08 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:51059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhq9z-0002qS-5J for qemu-devel@nongnu.org; Fri, 22 Apr 2022 06:05:08 -0400 Received: by mail-wm1-x332.google.com with SMTP id r19so4805479wmq.0 for ; Fri, 22 Apr 2022 03:05:06 -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=l5uJxy4WfAzOW7qSBnV+0WxIG9WxiypmDb7cHj2F97M=; b=n4HQ57pzA89rxgqy9XnftRnmfbPKrlkiPHcoU57SL6YE3GU2knV/MWH3LtS8tQdHZ3 XlobWnsboUmB15JFZ+PAbZ7/qNx2iF7kMOnMSxwNoaiO4yv+h+RcHShu95Bdlrx0DCFS 3GSWI+mcQ7DZM2klgSOTmzrWav7esYRtQ6HGW26FRoqG41KnqrR5vucawmgMRsnhmKUA gmWlqC+/rA7iuh/eL0ZMrClaqotj8R9AHcAjBxpQxjrKaTu/ojVgUqvKqzRg5NC6HQt7 YK6HxB7t+hG1GptKkE5PDBJ41bhS5pH3kpINwpsbVUZOyfwx4fPXbMDi7BYCI1/RuGwc PcjQ== 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=l5uJxy4WfAzOW7qSBnV+0WxIG9WxiypmDb7cHj2F97M=; b=G2RlnRc0D9R989kftBzgR6Mdrcky3wkqNQhYJALCHUuoSnL4751vG1J0hHcTzxxg7E mLVUMuSIiJ9cr+3Vbov2KbHEBdrUrNm1jOpWeQa+KJyKTJlUnjDENfp04DIK920vk1P2 bufVhrD+jI93sXbc3AA99Y66VMJRzd/r/wW7QzH2uwaqQDD8v0WGvbb7Vg22yWa2FD1/ Az8iblFT1KRbUMDljyigPn3X6ZB2T/TueHHKVKThHcCTW94v3uGhX/SVHc58qiwHYYUI B40DlMHuYBs94TUAW0z9ZMp/VKjnAam0aih4W8OMCCYwsMYTRfA+/QxwxF1VBTmGfDpe IxnA== X-Gm-Message-State: AOAM532pp5TZYaHvPXYaXPTBty52+8Z/Lk8nJ1oEIL/9xN0BSu/QXBQ0 kjQn3G039851Pwfj8AiKMYRZ7PADLmRpgw== X-Received: by 2002:a1c:2904:0:b0:37b:ea53:4cbf with SMTP id p4-20020a1c2904000000b0037bea534cbfmr3428761wmp.46.1650621905830; Fri, 22 Apr 2022 03:05:05 -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.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 03:05:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 34/61] hw/intc/arm_gicv3_redist: Implement gicv3_redist_mov_vlpi() Date: Fri, 22 Apr 2022 11:04:05 +0100 Message-Id: <20220422100432.2288247-35-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::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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 gicv3_redist_mov_vlpi() function (previously left as a stub). This function handles the work of a VMOVI command: it marks the vLPI not-pending on the source and pending on the destination. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220408141550.1271295-35-peter.maydell@linaro.org --- hw/intc/arm_gicv3_redist.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c index 2c4a87318bc..78dcdcc7621 100644 --- a/hw/intc/arm_gicv3_redist.c +++ b/hw/intc/arm_gicv3_redist.c @@ -1067,9 +1067,25 @@ void gicv3_redist_mov_vlpi(GICv3CPUState *src, uint64_t src_vptaddr, int irq, int doorbell) { /* - * The redistributor handling for moving a VLPI will be added - * in a subsequent commit. + * Move the specified vLPI's pending state from the source redistributor + * to the destination. */ + if (!set_pending_table_bit(src, src_vptaddr, irq, 0)) { + /* Not pending on source, nothing to do */ + return; + } + if (vcpu_resident(src, src_vptaddr) && irq == src->hppvlpi.irq) { + /* + * Update src's cached highest-priority pending vLPI if we just made + * it not-pending + */ + gicv3_redist_update_vlpi(src); + } + /* + * Mark the vLPI pending on the destination (ringing the doorbell + * if the vCPU isn't resident) + */ + gicv3_redist_process_vlpi(dest, irq, dest_vptaddr, doorbell, irq); } void gicv3_redist_vinvall(GICv3CPUState *cs, uint64_t vptaddr)