get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2224344/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2224344,
    "url": "http://patchwork.ozlabs.org/api/patches/2224344/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260417100302.162260-3-djordje.todorovic@htecgroup.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260417100302.162260-3-djordje.todorovic@htecgroup.com>",
    "list_archive_url": null,
    "date": "2026-04-17T10:03:10",
    "name": "[v7,2/6] target/riscv: Add big-endian CPU property",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "fe1158473d6e9518e12e8434efd14098a81b72dd",
    "submitter": {
        "id": 90738,
        "url": "http://patchwork.ozlabs.org/api/people/90738/?format=api",
        "name": "Djordje Todorovic",
        "email": "Djordje.Todorovic@htecgroup.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260417100302.162260-3-djordje.todorovic@htecgroup.com/mbox/",
    "series": [
        {
            "id": 500299,
            "url": "http://patchwork.ozlabs.org/api/series/500299/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500299",
            "date": "2026-04-17T10:03:08",
            "name": "Add RISC-V big-endian target support",
            "version": 7,
            "mbox": "http://patchwork.ozlabs.org/series/500299/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224344/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224344/checks/",
    "tags": {},
    "related": [],
    "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=htecgroup.com header.i=@htecgroup.com\n header.a=rsa-sha256 header.s=selector1 header.b=sImdi8yn;\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=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=htecgroup.com;"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.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 4fxr7b2GCBz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 20:03:53 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wDg2r-0000W0-Fa; Fri, 17 Apr 2026 06:03:29 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <Djordje.Todorovic@htecgroup.com>)\n id 1wDg2l-0000Us-S9; Fri, 17 Apr 2026 06:03:24 -0400",
            "from mail-northeuropeazlp170100001.outbound.protection.outlook.com\n ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com)\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <Djordje.Todorovic@htecgroup.com>)\n id 1wDg2h-0006gN-BK; Fri, 17 Apr 2026 06:03:22 -0400",
            "from PA2PR09MB7634.eurprd09.prod.outlook.com (2603:10a6:102:412::6)\n by AM7PR09MB3736.eurprd09.prod.outlook.com (2603:10a6:20b:10e::16)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.25; Fri, 17 Apr\n 2026 10:03:10 +0000",
            "from PA2PR09MB7634.eurprd09.prod.outlook.com\n ([fe80::c461:b510:b6b9:f442]) by PA2PR09MB7634.eurprd09.prod.outlook.com\n ([fe80::c461:b510:b6b9:f442%3]) with mapi id 15.20.9818.023; Fri, 17 Apr 2026\n 10:03:10 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=xJC3MFnwTSUmaAHRdbmjxeG2OVmt3bdEMWcOlOi73ft2qpWyRUysVWcnUfVJR8dfxnHJ16HAkXVHDh3rNIrGSc2jlT12eQIU9X0YpgtONK1WGnVqExjgHUh31qFNe8xk7QEqXhG+nfdZIXxkELY0O8sdNLkOi4y/GoPJWIxEH7Qr7gYV6WU7AO0dFIf0MxBj08QjODn3y2FCbjsbhBU6h78drCq0IUuet+8JBTB7viQ6T47gFmRQhfM8s3O33RG70jdLY9twlvg6LRh+4z9glGT6dqb3IapZwgcGGE3H7k8pDV0QuLp5FsYb+QaT+KDz34mKqOID5Rd3aHWknW1cfA==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=gyJTcEOGqZbsM/+0V779RHADg7sXv4dYp7g8aLTJ4/0=;\n b=eyTGbnIabCzJdBWJf4jUu0nCGbsHJAHk/YmCgDGURXRr/K4b4ygK319kpXg+WbsYNtZls+GyB/r3itgA+GJx9mxS3qh9zZncdpvToAZDisNzpsLmYd2/3R4LaLpLFg9heoc+NA+oXDGegZNoUc/Teya7VJQaXqBoEai5ioLYMZigfaZD4UE+IZFKBdlc/7lP9RR5BpyngxlHjtN46rDpE5kXmarOSwc7Gs8Q0vpKCMx9c7eO6pA0WSFaPZl5arPWppKmsOcOPb1OhpIc7J8locmrQV6fE2KG3S1lC1vuhgJxlchGVHOznKj6QVaIdXbQxbw+ZIaNM8jcfSMaEsBZ+w==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=htecgroup.com; dmarc=pass action=none\n header.from=htecgroup.com; dkim=pass header.d=htecgroup.com; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=htecgroup.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=gyJTcEOGqZbsM/+0V779RHADg7sXv4dYp7g8aLTJ4/0=;\n b=sImdi8ynPcTMjRpLj8gMAMJxtXFLIyBMRoeLGXEiWhz8BU7LGtMLn2aN0LK+0uh58t0gAMJTA2GJTJ2Fli7YtB1n8nufXtyMTkpuzWmrLahhsB6vwMAdLnB1y8Y74Urt8M5pgg+pGG3rfHFeGdvN/DyGc0okCB1Jb2VpFU0RjNaAyyJv0meWcX5MK7aFapwphuYz7mIwDtcBY79fRUEgaZrKGtPueL1aQ1ZPaHv9JnLrjI/HnHA0wVQpEDB5AmfkPEnmdBlhc1+UWrxD280bkCboYNOWF8EdQZVdSh4eC3BLimG0idXJA2JTSuHKhu2AHIyO1o906lRKPQDJHxJUdg==",
        "From": "Djordje Todorovic <Djordje.Todorovic@htecgroup.com>",
        "To": "\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>",
        "CC": "\"qemu-riscv@nongnu.org\" <qemu-riscv@nongnu.org>, \"cfu@mips.com\"\n <cfu@mips.com>, \"mst@redhat.com\" <mst@redhat.com>,\n \"marcel.apfelbaum@gmail.com\" <marcel.apfelbaum@gmail.com>,\n \"dbarboza@ventanamicro.com\" <dbarboza@ventanamicro.com>, \"philmd@linaro.org\"\n <philmd@linaro.org>, \"alistair23@gmail.com\" <alistair23@gmail.com>,\n \"thuth@redhat.com\" <thuth@redhat.com>, Djordje Todorovic\n <Djordje.Todorovic@htecgroup.com>, Chao Liu <chao.liu.zevorn@gmail.com>",
        "Subject": "[PATCH v7 2/6] target/riscv: Add big-endian CPU property",
        "Thread-Topic": "[PATCH v7 2/6] target/riscv: Add big-endian CPU property",
        "Thread-Index": "AQHczlFlSjRd9usdwkWfBofvuRil5A==",
        "Date": "Fri, 17 Apr 2026 10:03:10 +0000",
        "Message-ID": "<20260417100302.162260-3-djordje.todorovic@htecgroup.com>",
        "References": "<20260417100302.162260-1-djordje.todorovic@htecgroup.com>",
        "In-Reply-To": "<20260417100302.162260-1-djordje.todorovic@htecgroup.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "authentication-results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=htecgroup.com header.i=@htecgroup.com\n header.a=rsa-sha256 header.s=selector1 header.b=sImdi8yn;\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=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=htecgroup.com;"
        ],
        "x-ms-publictraffictype": "Email",
        "x-ms-traffictypediagnostic": "PA2PR09MB7634:EE_|AM7PR09MB3736:EE_",
        "x-ms-office365-filtering-correlation-id": "0bbda141-0cd9-4f07-4da0-08de9c688803",
        "x-ms-exchange-senderadcheck": "1",
        "x-ms-exchange-antispam-relay": "0",
        "x-microsoft-antispam": "BCL:0;\n ARA:13230040|1800799024|366016|376014|7416014|38070700021|18002099003|22082099003|56012099003;",
        "x-microsoft-antispam-message-info": "\n Viu1cTvFPVQgfeqv54dIGLvXNYUYx5wCZCmEw5TP5CJoaxHDuZLGLKgUcSgYymjGs0JhC8DafoBm8RxK3VPy3k4yzkoj4He7JyiivCR9ZK0DVC8zNVieskHt5kxPVy7Zur8hdHQzPzUD44ezqzi3ncPdSGtJTQ0dLC+5d7BqwCpd7/Dq/n7a7wlVJ47pCNuvkwCZ253ecAt2DW5cXDXOJg0uiTb8gd7q+kkXu3xZ0oNgXi+cMVxHQ9MMAPdnIe3FlShMLbfE6GdTD/XfvWiCpmocj210rt9GwS0syA5/0XT8Yt6zsLvV32lnqbX9lsN+AlwWxf4uK63ZxkzhUqFhqua1wTP8QMKkj089hgc0p4OfbY6ChnF8C/08e4MZz8F9VeKsTnwAnt79MI5+qagdb311hk65CsCI8q6Wl1ZBG4slfchIVBbnug0MgHs+SMMoYSp7bhGgs4Atdl/rGVwwpqQiX6ZHNW5jRdOonlSye/Vvh6CbKG/vkgIuEZPfg2mjIJj90U0kj/M8MtJZCwWjSBWUuWPbjUiienhIgewhpknFLTU4/tuScmHeAJ/eVYpe4BoPn7wrgmhjdERtHNv4SVdZwe3WyhlJlp7igsNESBsv0CuN0H6kGlDO1bJs/n1W6bRF7umvzE/jyNdAmI0BRp7tCchF52XqMb14qYKYgsmwJuUaOxH6WDftNss1a8yz9MKa8lMx6PZnkXD1wYa1HTtjM48xBmnJvYPi44V2klwgKZYi6O0L+LmWvxRrUVvPTNs1URCTv8yvY6y95lu/qiS37L+jDtZ/nqwJMcWTPPU=",
        "x-forefront-antispam-report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:PA2PR09MB7634.eurprd09.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230040)(1800799024)(366016)(376014)(7416014)(38070700021)(18002099003)(22082099003)(56012099003);\n DIR:OUT; SFP:1102;",
        "x-ms-exchange-antispam-messagedata-chunkcount": "1",
        "x-ms-exchange-antispam-messagedata-0": "=?iso-8859-1?q?qGCdG9ZRKXMmNq4PzKa2Sw+?=\n\t=?iso-8859-1?q?a+4bgeizwj0H5ZusFp5o69Wp9ZF6gbu2YwYzETRL1UT9TOTHENdDQegAMMF5?=\n\t=?iso-8859-1?q?On7hgfR4jnw2OlGGJB4zWDGhX6VdN7yP9ada+ZK/iWpXakK8r+6M98zxa04G?=\n\t=?iso-8859-1?q?L+MfKZEvJGf+EhfQLPf1seoydZTWC5oHfS4cgVi8MMra+PsWLqpjqwC0hFqR?=\n\t=?iso-8859-1?q?VRqUETjqQfxMtagaKDnyO8nS9PKxYzM9DJ15U9HY2cUX+/PIaU4kzw8IokL6?=\n\t=?iso-8859-1?q?harP7rl1ODpXICgBfJXvSNoYcfzsVQ1A3o3nz1tD8QaBwyEqP9IOmDwRoa4S?=\n\t=?iso-8859-1?q?SBr6K+jwSdn/gSc0IrDk2CbJoYDG4LJGnqPWKa7KBpUyyJ/MhiLxPjhfJB0K?=\n\t=?iso-8859-1?q?4TyVpRXG5KzqmMy8sn6kDfiyJH5yNiJW3nSi73zGEhZNqGmfcvyu4iZpQ4Xe?=\n\t=?iso-8859-1?q?CusAII6R8Lj8IqeobW5B0pcjTkpFUBg/AYR619iPxd9FLO4QIIkMwIaDzNcM?=\n\t=?iso-8859-1?q?ydViBYq87jgoicCol4Wn8v0FYxe22T4ymmLNd48Jtz9myQMasrApAU+eNLXh?=\n\t=?iso-8859-1?q?RBPFKBAJQQk2Wv6jWYtFdWWx8cRwsWsFg2V2kjMbk1OtlDTpON3XKVK55Bbv?=\n\t=?iso-8859-1?q?V7ny2ijL/CRMSzhEdee+TdDaL5edx7gisqj/JvigbnA2/Xuz3ytX4WwwFqjb?=\n\t=?iso-8859-1?q?78VpKVxqccKHlqbEFgveD9IrB6uQkXIqYJsTS/xYiW5qSETDsUHHmYYVRGlb?=\n\t=?iso-8859-1?q?X9sGrfmbvRSeVcuRRhee03yNJnC5D4UpkOLtXCnAWLSZO8AXMqlcRgBa0rFM?=\n\t=?iso-8859-1?q?sxgYrBqSA3FZXqeF6vuPhL7MTz9Wp1Uo//1ChbygMqCVU9voMxRBDCa3sSzx?=\n\t=?iso-8859-1?q?3cIU4vNeTFk6WISEByEgwiOi9DG/Lsb12rArw+mpULl9eelc24WDzkD39J6Q?=\n\t=?iso-8859-1?q?efBqA5EYfe6tMmDrZAqxQwhMFd3DDD745WpmIlWCoghELogZbQx2QTrkrDGT?=\n\t=?iso-8859-1?q?x+sqvIByskG2B3hPPWSrbVs9dXOuAAUY6ULHjMjaQTtdJkxEd79he6H6Lg4V?=\n\t=?iso-8859-1?q?bZ10sxH1CeYiMl+rhJmrWo/JG28UpJ7A5olHxVpq4pk6LWIM1CeBJJrc1PkD?=\n\t=?iso-8859-1?q?GjnBcMTd4301F0OD2Xje2MFIVN9bfa8+kIB4wl9BMTjn1iTl2R9I817Kngmg?=\n\t=?iso-8859-1?q?LAd9M+y/AscIWRXqED0wcryXHguXG7/thfzduF6LOQ89hJhxmCqlQSiIFakN?=\n\t=?iso-8859-1?q?6je2OLKok8EQVjywcvIj73S2bEbxjIqeLJ30ul5jD5J3FjHwdsjfpK2Io3d7?=\n\t=?iso-8859-1?q?hwKK8r6ge0Ho26HfV02Lwy+vaGjrbhLaRysZ2PnXYeN/u69q4PRwUEvihDVL?=\n\t=?iso-8859-1?q?R1995m1zA0f9JZ+PV9XX0V8UCDVP1t9UyDCATNmZuwipElYFce3VkY2xlx5k?=\n\t=?iso-8859-1?q?DtuK3Lk6N8qG2FKcU4QOtXxh10aeW3lALRyiKd8xvYLY7P2gWh+1wZrnzhqD?=\n\t=?iso-8859-1?q?8/h05uI8TO6WFhos03HfuYqk5Bar4bMdynF7PNT5qstOsxM6xhDCFWHiDGhz?=\n\t=?iso-8859-1?q?jGhK8y4ogVGBO0k4vUC4uAG0upE8EFR9dw/sKJs62D49a2OyPAE2f4pjYzu2?=\n\t=?iso-8859-1?q?e4HZ+3r/kD6ZMBQSAY8w4ko8OB1RAgx1VQr8n42MwGpl0e+OT0aeeVE3dKO/?=\n\t=?iso-8859-1?q?wd3qKEX4aoR9o6pXbnY6vRaCuvY55qQ/zDfYl9cyCN/FfrX5tLtGzRmxyaxH?=\n\t=?iso-8859-1?q?+CD7Hirl6wOC5Z8Tjk/Rb9T7Pou+EroyJ0WQbv9rNQfUk4sNRwZLsWrB1fDy?=\n\t=?iso-8859-1?q?3hv7MvT+msn1z9cSgD1odTidMIczA?=",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "htecgroup.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-AuthSource": "PA2PR09MB7634.eurprd09.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 0bbda141-0cd9-4f07-4da0-08de9c688803",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "17 Apr 2026 10:03:10.5052 (UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "9f85665b-7efd-4776-9dfe-b6bfda2565ee",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "X-MS-Exchange-CrossTenant-userprincipalname": "\n /T/f0nD3KCCBK/XQNRLJ/SQJiO6AVhyaPPhc9CL5ULCCHJLRu8UypcF79Hs3QHxDj8Eb2t48Zy5vvSQijW0hCW16BIEB6icmCMjk1r98yuI=",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM7PR09MB3736",
        "Received-SPF": "pass client-ip=2a01:111:f403:c200::1;\n envelope-from=Djordje.Todorovic@htecgroup.com;\n helo=DB3PR0202CU003.outbound.protection.outlook.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,\n SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 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": "qemu development <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": "Add a \"big-endian\" boolean property to the RISC-V CPU configuration,\ndefaulting to false (little-endian). When enabled, this models a\nbig-endian-only RISC-V implementation as described in section 3.1.6.5\nof the RISC-V Privileged Specification (\"Memory Endianness\"), where\nthe MSTATUS MBE/SBE/UBE bits are hardwired to 1.\n\nThis is a static, per-CPU hardware configuration option, not a runtime\nswitch. It is intended for modeling RISC-V CPU variants whose data\nendianness is fixed to big-endian at the hardware level. Instructions\nremain little-endian regardless, per the RISC-V ISA specification.\n\nWhen cfg.big_endian is set, riscv_cpu_reset_hold() writes 1 into the\nMSTATUS UBE/SBE/MBE fields; otherwise it writes 0. The assignment is\ndone with set_field() so the reset value is deterministic on both\ncold and warm reset, rather than depending on the pre-reset state.\nThe MBE/SBE/UBE bits are not included in the writable mask of any\nmstatus/mstatush/sstatus CSR write path, so the value chosen at reset\neffectively hardwires them. The actual effect of those bits on data\naccesses, page-table walks and boot code is implemented by the\nsubsequent patches in this series.\n\nAlso update the disassembler comment to clarify that BFD_ENDIAN_LITTLE\nis correct because RISC-V instructions are always little-endian per\nthe ISA specification.\n\nNo upstream CPU currently defaults to big-endian; the property can be\nenabled from the command line, e.g.:\n\n    -cpu <cpu>,big-endian=on\n\nSigned-off-by: Djordje Todorovic <djordje.todorovic@htecgroup.com>\nReviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>\n---\n docs/system/target-riscv.rst      | 24 ++++++++++++++++++++++++\n target/riscv/cpu.c                | 11 ++++++-----\n target/riscv/cpu_cfg_fields.h.inc |  1 +\n 3 files changed, 31 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/docs/system/target-riscv.rst b/docs/system/target-riscv.rst\nindex 3ad5d1ddaf..7798184ebe 100644\n--- a/docs/system/target-riscv.rst\n+++ b/docs/system/target-riscv.rst\n@@ -95,3 +95,27 @@ the images they need.\n * ``-bios <file>``\n \n Tells QEMU to load the specified file as the firmware.\n+\n+RISC-V CPU endianness\n+---------------------\n+\n+The RISC-V ISA specifies that instruction fetches are always little-endian,\n+while data accesses can be either little-endian or big-endian under control\n+of the MSTATUS ``MBE``/``SBE``/``UBE`` bits (see section 3.1.6.5, \"Memory\n+Endianness\", in the RISC-V Privileged Specification).\n+\n+QEMU implements the full data-endianness behaviour described by those bits.\n+In addition, the RISC-V CPU object exposes a ``big-endian`` boolean property\n+which models a big-endian-only hardware implementation, where the\n+``MBE``/``SBE``/``UBE`` bits are hardwired to 1. When the property is set,\n+the CPU is reset with all three bits initialised to 1, so the guest starts\n+executing in big-endian data mode from the reset vector. The property is a\n+static, per-CPU hardware configuration option and is not meant to be toggled\n+at runtime.\n+\n+The property can be enabled from the command line, for example::\n+\n+    -cpu <cpu>,big-endian=on\n+\n+No upstream CPU model currently defaults to big-endian; the property is\n+provided so that big-endian-only RISC-V CPU variants can be modelled.\ndiff --git a/target/riscv/cpu.c b/target/riscv/cpu.c\nindex e56470a374..c39500cb3f 100644\n--- a/target/riscv/cpu.c\n+++ b/target/riscv/cpu.c\n@@ -716,6 +716,9 @@ static void riscv_cpu_reset_hold(Object *obj, ResetType type)\n             env->mstatus = set_field(env->mstatus, MSTATUS_MDT, 1);\n         }\n     }\n+    env->mstatus = set_field(env->mstatus, MSTATUS_MBE, cpu->cfg.big_endian);\n+    env->mstatus = set_field(env->mstatus, MSTATUS_SBE, cpu->cfg.big_endian);\n+    env->mstatus = set_field(env->mstatus, MSTATUS_UBE, cpu->cfg.big_endian);\n     env->mcause = 0;\n     env->miclaim = MIP_SGEIP;\n     env->pc = env->resetvec;\n@@ -803,11 +806,8 @@ static void riscv_cpu_disas_set_info(const CPUState *s, disassemble_info *info)\n     info->target_info = &cpu->cfg;\n \n     /*\n-     * A couple of bits in MSTATUS set the endianness:\n-     *  - MSTATUS_UBE (User-mode),\n-     *  - MSTATUS_SBE (Supervisor-mode),\n-     *  - MSTATUS_MBE (Machine-mode)\n-     * but we don't implement that yet.\n+     * RISC-V instructions are always little-endian, regardless of the\n+     * data endianness configured via MSTATUS UBE/SBE/MBE bits.\n      */\n     info->endian = BFD_ENDIAN_LITTLE;\n \n@@ -2641,6 +2641,7 @@ RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[] = {\n \n static const Property riscv_cpu_properties[] = {\n     DEFINE_PROP_BOOL(\"debug\", RISCVCPU, cfg.debug, true),\n+    DEFINE_PROP_BOOL(\"big-endian\", RISCVCPU, cfg.big_endian, false),\n \n     {.name = \"pmu-mask\", .info = &prop_pmu_mask},\n     {.name = \"pmu-num\", .info = &prop_pmu_num}, /* Deprecated */\ndiff --git a/target/riscv/cpu_cfg_fields.h.inc b/target/riscv/cpu_cfg_fields.h.inc\nindex 70ec650abf..51436daabf 100644\n--- a/target/riscv/cpu_cfg_fields.h.inc\n+++ b/target/riscv/cpu_cfg_fields.h.inc\n@@ -154,6 +154,7 @@ BOOL_FIELD(ext_xmipscbop)\n BOOL_FIELD(ext_xmipscmov)\n BOOL_FIELD(ext_xmipslsp)\n \n+BOOL_FIELD(big_endian)\n BOOL_FIELD(mmu)\n BOOL_FIELD(pmp)\n BOOL_FIELD(debug)\n",
    "prefixes": [
        "v7",
        "2/6"
    ]
}