From patchwork Fri Apr 22 10:03:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 564782 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp332157map; Fri, 22 Apr 2022 03:19:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBGAHnaqlZ+oZpnSdtWeImOrsfJGFJ/C9cBfc6vVqmDA8C6M+UZ9o2GX6NCcK36Jsb3z4t X-Received: by 2002:ad4:5968:0:b0:446:60d1:40d7 with SMTP id eq8-20020ad45968000000b0044660d140d7mr2953899qvb.88.1650622783284; Fri, 22 Apr 2022 03:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650622783; cv=none; d=google.com; s=arc-20160816; b=LCrEz8EDtWcmh1jHJBeVLQpiBqn5Pe09MTvz/vdq1upg4KAbYl6VJxdJyAp2MSi5w9 Y5siAgxmLEvJ18RVzuiFeuGWPjvgU1eXnQPLyG/9W8JzvkGqoJLARECorPFyFqHwAggr PhpVoyV04fBjqPWjCCLmXHJ//9B1vFppdacrNkehU3mLJb1XFNW/ds8g7WTA2cf5vqye qE6RESJLL1YBYmloQMjGKt5VPm+JNJbSY99POl42pds4xxrfx9xbO3PPiM6rTEI629hw TN6NVcBMowzLZedhK9tFVAXRVhbSmFWBOyvD2/+aTis0HmdUahhS6t5XrpRCE0d92Ri0 CkDQ== 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=bF2VxJju+9YWyEUIW0SitG+F9+86cJzwUXdO302ijVA=; b=KlN4iOjSc6Rsa+n60pQsI8DPTGTyHgImMty61dn+NycrgA9VTBtyMEaZLdc2djrJzO w/onP/dSDmuW+ug2o3oXQbAnQbL6YmL3QwgUg+h29aUrob8T2hHQZwi8nboI3ygSxuiv yQR3ru2DQvgDXSlP27Cedg4YW/Z7+Wu3203BScemrGfPtGjjxibVLfJzPFXjHLWoC6w7 6XmdcvU6uRSBIha9/TmAbdzdu/V93Dw4Zp5TJsTmFhP7Byb9EqhUvlMY6cwT9niKW7hV oD0qIbq6g7WmXQdT6xQu9K7TjrgmoUtd6eaVqe6GGJSh29W6L9AeViPmqrNL1PQ7Nrpp /oyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TsNezgKt; 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 v2-20020a05622a014200b002ed08723842si2352772qtw.92.2022.04.22.03.19.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Apr 2022 03:19:43 -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=TsNezgKt; 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]:49152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhqO6-0002Mi-Rz for patch@linaro.org; Fri, 22 Apr 2022 06:19:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhq9l-0004LG-Ph for qemu-devel@nongnu.org; Fri, 22 Apr 2022 06:04:54 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:33680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhq9j-0002bt-D1 for qemu-devel@nongnu.org; Fri, 22 Apr 2022 06:04:53 -0400 Received: by mail-wr1-x42a.google.com with SMTP id x18so10355180wrc.0 for ; Fri, 22 Apr 2022 03:04:51 -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=bF2VxJju+9YWyEUIW0SitG+F9+86cJzwUXdO302ijVA=; b=TsNezgKtO5E0odcdgJ/9efnHdoRqShKIkrEZUfyirqxilbvHkmi9FYX3l2AfH3YoVq WCwYRWI9Pwq9k2tBqtNvL891j4n6kiXZRPVD+FAg6tLiHPAjBMqPvkLDxj1N3fpA0uK6 1IorTwa3BVxi3vCLGoziQA8XTfsQhFMShKzRs9Av17YoWSCxUkkFdNVjPz5++ZwiSKC2 8ZX8VrG4NnJfkYM9TwIKusrXTnAflv6KluaUy25Mg2Y3nDQvR4g0ILYWqIJtOBHcj17W tnoeSum8uRFy/vc/7nOP/L5yPxEaS1vYKC6LNe52uf+yM7h1S8nOx3vmJ9//pbKAZHUa ZsRw== 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=bF2VxJju+9YWyEUIW0SitG+F9+86cJzwUXdO302ijVA=; b=UN6T8gBn1TIp2RG45xgqc9bm8so0401OY+t81T7p2P0CTR8xB9QbYvnCXoWJ5iCuok zFaM786TiV+e6+4wXTLbU12dYqnY2bD4K8wbqhmCZTHyJpPMSwcDldtrXe5VKs8rj0ug vP30rgekBa7u6ugrjoLzXmru5HGQigEy2qnPYp7Mt71yN6DqLSfOaNYvz2i3N4PWqjoV j1G/ksueTW+ZTOrzolWvA5XKOaycj/MF+hcp5hYNflk5H3248KeYjLzQl3JgW9kcDtyc n2pCyee15Vyax6Hn1qTwWGlnGUv0nohmaRoXHwvI+KDwn9mq6wY92HRX/dVZ38ZsNF/Y tR1A== X-Gm-Message-State: AOAM531lmvowG+0CmpSjZQ8vu8zO3e2FOD3SwybHI1NvNVQGSEmhNrAR yEQGZ/ukuZ1gQKOl9595lk+Jh0JbqYuoSw== X-Received: by 2002:a5d:6e87:0:b0:206:452:5b87 with SMTP id k7-20020a5d6e87000000b0020604525b87mr2987031wrz.473.1650621889996; Fri, 22 Apr 2022 03:04:49 -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.04.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 03:04:49 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/61] hw/intc/arm_gicv3_its: Implement VSYNC Date: Fri, 22 Apr 2022 11:03:48 +0100 Message-Id: <20220422100432.2288247-18-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::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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" The VSYNC command forces the ITS to synchronize all outstanding ITS operations for the specified vPEID, so that subsequent writes to GITS_TRANSLATER honour them. The QEMU implementation is always in sync, so for us this is a nop, like the existing SYNC command. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220408141550.1271295-18-peter.maydell@linaro.org --- hw/intc/gicv3_internal.h | 1 + hw/intc/arm_gicv3_its.c | 11 +++++++++++ hw/intc/trace-events | 1 + 3 files changed, 13 insertions(+) diff --git a/hw/intc/gicv3_internal.h b/hw/intc/gicv3_internal.h index c1467ce7263..ef1d75b3cf4 100644 --- a/hw/intc/gicv3_internal.h +++ b/hw/intc/gicv3_internal.h @@ -330,6 +330,7 @@ FIELD(GITS_TYPER, CIL, 36, 1) #define GITS_CMD_MOVALL 0x0E #define GITS_CMD_DISCARD 0x0F #define GITS_CMD_VMOVP 0x22 +#define GITS_CMD_VSYNC 0x25 #define GITS_CMD_VMAPP 0x29 #define GITS_CMD_VMAPTI 0x2A #define GITS_CMD_VMAPI 0x2B diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c index 8bc93295fb5..a3f5bac5513 100644 --- a/hw/intc/arm_gicv3_its.c +++ b/hw/intc/arm_gicv3_its.c @@ -1165,6 +1165,17 @@ static void process_cmdq(GICv3ITSState *s) */ trace_gicv3_its_cmd_sync(); break; + case GITS_CMD_VSYNC: + /* + * VSYNC also is a nop, because our implementation is always + * in sync. + */ + if (!its_feature_virtual(s)) { + result = CMD_CONTINUE; + break; + } + trace_gicv3_its_cmd_vsync(); + break; case GITS_CMD_MAPD: result = process_mapd(s, cmdpkt); break; diff --git a/hw/intc/trace-events b/hw/intc/trace-events index a2dd1bdb6c3..b9efe14c690 100644 --- a/hw/intc/trace-events +++ b/hw/intc/trace-events @@ -191,6 +191,7 @@ gicv3_its_cmd_vmapi(uint32_t devid, uint32_t eventid, uint32_t vpeid, uint32_t d gicv3_its_cmd_vmapti(uint32_t devid, uint32_t eventid, uint32_t vpeid, uint32_t vintid, uint32_t doorbell) "GICv3 ITS: command VMAPI DeviceID 0x%x EventID 0x%x vPEID 0x%x vINTID 0x%x Dbell_pINTID 0x%x" gicv3_its_cmd_vmapp(uint32_t vpeid, uint64_t rdbase, int valid, uint64_t vptaddr, uint32_t vptsize) "GICv3 ITS: command VMAPP vPEID 0x%x RDbase 0x%" PRIx64 " V %d VPT_addr 0x%" PRIx64 " VPT_size 0x%x" gicv3_its_cmd_vmovp(uint32_t vpeid, uint64_t rdbase) "GICv3 ITS: command VMOVP vPEID 0x%x RDbase 0x%" PRIx64 +gicv3_its_cmd_vsync(void) "GICv3 ITS: command VSYNC" gicv3_its_cmd_unknown(unsigned cmd) "GICv3 ITS: unknown command 0x%x" gicv3_its_cte_read(uint32_t icid, int valid, uint32_t rdbase) "GICv3 ITS: Collection Table read for ICID 0x%x: valid %d RDBase 0x%x" gicv3_its_cte_write(uint32_t icid, int valid, uint32_t rdbase) "GICv3 ITS: Collection Table write for ICID 0x%x: valid %d RDBase 0x%x"