Show a cover letter.

GET /api/1.0/covers/2175694/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2175694,
    "url": "http://patchwork.ozlabs.org/api/1.0/covers/2175694/?format=api",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.0/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20251218183122.408690-1-sergeev0xef@gmail.com>",
    "date": "2025-12-18T18:31:15",
    "name": "[RFC,0/6] More extendable PMU subsystem.",
    "submitter": {
        "id": 92294,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/92294/?format=api",
        "name": "Aleksandr Sergeev",
        "email": "sergeev0xef@gmail.com"
    },
    "series": [
        {
            "id": 485896,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/485896/?format=api",
            "date": "2025-12-18T18:31:20",
            "name": "More extendable PMU subsystem.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/485896/mbox/"
        }
    ],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=CL6nTjha;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4dXK6p1p4Dz1y2F\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 19 Dec 2025 05:33:22 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vWIo3-0003wO-4J; Thu, 18 Dec 2025 13:32:55 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <sergeev0xef@gmail.com>)\n id 1vWImw-0003mM-Nl\n for qemu-devel@nongnu.org; Thu, 18 Dec 2025 13:31:48 -0500",
            "from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <sergeev0xef@gmail.com>)\n id 1vWImv-0007Kr-6b\n for qemu-devel@nongnu.org; Thu, 18 Dec 2025 13:31:46 -0500",
            "by mail-lf1-x12c.google.com with SMTP id\n 2adb3069b0e04-5942b58ac81so840803e87.2\n for <qemu-devel@nongnu.org>; Thu, 18 Dec 2025 10:31:44 -0800 (PST)",
            "from NB-8855.Dlink ([81.201.19.27]) by smtp.gmail.com with ESMTPSA\n id\n 2adb3069b0e04-59a185dd229sm46777e87.22.2025.12.18.10.31.41\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 18 Dec 2025 10:31:41 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1766082702; x=1766687502; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=6BGntqKFd1qeOs3HM5pbsy2UgQ8QcXcof4/Fo0gSHZc=;\n b=CL6nTjhaziDRxLZQ/CLw5VJSyY77Rpt7HTA9q3nwjqIUAtYAwvrli/QPWb1eiPsZtS\n STTgvebtpjHiejgd+TkRqBbFZxJvUfAWHNiw5rJOeLckF/uG49FUDQXxOT0Q8IKrCivC\n yl4AWkFSFULY0JsXbcDRvhBIVXqQWGVU+8ZIzf16fHkVBnYNN3FY97b54LTKXifW6tfb\n Oqt5PVHcFWx/W2N85nSV5FqmDFCeNmHXz4SdH3jyzOkHy3VBh1PcezvdPjsn+tK7M5sl\n cAaqWtu0xwJCLjHA4+39VAognK+wtWw14VvoJhZfr1+PYshJfmq34u/dpOf1iSdFhDhW\n UkeA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1766082702; x=1766687502;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=6BGntqKFd1qeOs3HM5pbsy2UgQ8QcXcof4/Fo0gSHZc=;\n b=oWVBfY1MKVKzVdJPSFisveSsvOhxRPR0oTFyAEDFHf3tUoWXyA1Yd8njHhnSYJkxAD\n ZbiGTGX3b6BIR3uY68sQPpmTBKpIWqLXyxMihjdfbI0yH/G0UvKSSSTX6PDmQyhohVAJ\n sA7uE9huR/uNYw+zav1E6BZNwJ4El7V/NvI0FwoXAiLYN7HBJD0M7BpGGZGHDIJNaHG6\n k/8GA7jHNKJnjQvvPM0DvuXlGONx3vS62YFn3ItlSkLf8FlF7vMxK1gRcAOXn9Wz7tKB\n Pn16bJxlNLfH1gfdG03Q47RMKKYmFfgST2bO1fCsbldG7bUjqp+oewP8vLAPes5cpAf3\n TLTQ==",
        "X-Gm-Message-State": "AOJu0Yy/9OpHH7lkAkCy6vMP7aVBGSYrOAaV8te5jHrUndQkwH0eyZwr\n 70x1LxfDknqMkerBEjBDTPH5P0vKASTPg3lGeB5kAO7kQCCZlprWLmoSmUuzh1N3",
        "X-Gm-Gg": "AY/fxX75YOF8zeL5fxFLypRZAs+XKJXaz+wTIwv0GWB8IkF0JIa+ivdWIfG2izu75s6\n bJ9l+VLfqy1ZocmReCgmvQRaCovj135566hh1vid56HEk8Apwa28dK6fzgTWbQYH/nxLLVdmp1L\n CKjcqAlwnHfVta0fMqMWudz7kLtnLxmKWhDpVoDQBBjxrzCyfjbheGZVux8VpWZQSI3spMNLVIP\n ZUTtNrGgT1KdW98w6ccIKaUf+GvjjIzFhWRsCRgoMpbysbci+AbK0hla1koTrR/2m8+h+dwa8oZ\n w221RHlVlhbawB0UdFi7fXZ+Abw5nhj73OFiVi5Shjgh6UaeYo710ySGYvqOQcBnP0kSBqAw9l1\n chJsIGOt+HiAPb0Lq9S4a6p70CUP3OcUMvNnV0bnFKRP9GdppQH9zpNkwM2fxT4vMwg/TYf/HGi\n i4OTETyt4+iLxk0JVongXFcxA=",
        "X-Google-Smtp-Source": "\n AGHT+IGO87ou0IurjacOsA/i4cw51esYBqOTJ4iYrYLeEzL+gw+xUmDzWW6LorMhGLqO0C18UApQTA==",
        "X-Received": "by 2002:a05:6512:4020:b0:594:2e9b:f28f with SMTP id\n 2adb3069b0e04-59a17d7203amr177885e87.7.1766082702028;\n Thu, 18 Dec 2025 10:31:42 -0800 (PST)",
        "From": "Aleksandr Sergeev <sergeev0xef@gmail.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "halip0503@gmail.com,\n\tAleksandr Sergeev <sergeev0xef@gmail.com>",
        "Subject": "[RFC PATCH 0/6] More extendable PMU subsystem.",
        "Date": "Thu, 18 Dec 2025 21:31:15 +0300",
        "Message-ID": "<20251218183122.408690-1-sergeev0xef@gmail.com>",
        "X-Mailer": "git-send-email 2.51.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2a00:1450:4864:20::12c;\n envelope-from=sergeev0xef@gmail.com; helo=mail-lf1-x12c.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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-Mailman-Approved-At": "Thu, 18 Dec 2025 13:32:42 -0500",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "Currently, the pmu implementation consists of two parts:\nthe first part is mcycle & minstret registers (let's call them \"builtin events\")\nand the second part is mhpmcounters.\n\nThe builtin events are supported well,\nincluding implementation of inhibiting, filtering, etc.\n\nBut the implementation of mhpmcounters has few problems:\n1. Non-builtin events are vendor-specific.\n   The vendor, who wants to implement them (including filtering, interrupts, etc),\n   has to write exactly the same code\n   as which is already written for mcycle & minstret events.\n2. To implement custom events vendor must\n   hardcode it right inside the general methods.\n   So if there are two different vendors with\n   their own events, they would write their code\n   right beside each other, making the code\n   harder to support.\n   Also some collisions may occur in event indexes,\n   as it is a global enum.\n3. SBI events hardcoded right inside the general code.\n   As they are not a part of RISCV specification,\n   it should be up to vendor to implement them or not.\n\nTo solve these problems, let's:\n1. Generalize code, handling builtin events & mhpmcounters the same way.\n   So if some vendors want to get logic of builtin events,\n   it would take minimum affort.\n2. Add special callbacks for custom events. So when vendors want\n   custom events for their machine, they would not have to\n   change the common code.\n3. SBI events are now implemented for virt machine only as a demo\n   of how a new pmu subsystem works.\n\nAleksandr Sergeev (6):\n  target/riscv: Refactor counter index calculation.\n  target/riscv: Reimplement Smcdeleg/Ssccfg via read_*, write_* methods\n  target/riscv: Get rid of hardcoded SBI events.\n  target/riscv: Rearrange custom hpm counter api\n  target/riscv: Add PMU events implementation for `virt`\n  target/riscv/machine: Add smcntrpmf registers to VMStateDescription\n\n hw/misc/Kconfig            |   3 +\n hw/misc/meson.build        |   1 +\n hw/misc/virt_pmu.c         | 142 ++++++++\n hw/riscv/Kconfig           |   1 +\n hw/riscv/virt.c            |   4 +-\n include/hw/misc/virt_pmu.h |  91 +++++\n target/riscv/cpu.c         |   8 +\n target/riscv/cpu.h         |  96 +++--\n target/riscv/cpu_bits.h    |   4 +\n target/riscv/cpu_helper.c  |  34 +-\n target/riscv/csr.c         | 470 ++++++++----------------\n target/riscv/machine.c     |  11 +-\n target/riscv/pmu.c         | 708 ++++++++++++++-----------------------\n target/riscv/pmu.h         |  26 +-\n 14 files changed, 769 insertions(+), 830 deletions(-)\n create mode 100644 hw/misc/virt_pmu.c\n create mode 100644 include/hw/misc/virt_pmu.h"
}