Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2056986/?format=api
{ "id": 2056986, "url": "http://patchwork.ozlabs.org/api/patches/2056986/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20250307215623.524987-4-pierrick.bouvier@linaro.org/", "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": "<20250307215623.524987-4-pierrick.bouvier@linaro.org>", "list_archive_url": null, "date": "2025-03-07T21:56:19", "name": "[v4,3/7] hw/hyperv/vmbus: common compilation unit", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5b0c2f59d1ae40d9782cdb185eb4cbbbfe7d594b", "submitter": { "id": 85798, "url": "http://patchwork.ozlabs.org/api/people/85798/?format=api", "name": "Pierrick Bouvier", "email": "pierrick.bouvier@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20250307215623.524987-4-pierrick.bouvier@linaro.org/mbox/", "series": [ { "id": 447572, "url": "http://patchwork.ozlabs.org/api/series/447572/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=447572", "date": "2025-03-07T21:56:16", "name": "hw/hyperv: remove duplication compilation units", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/447572/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2056986/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2056986/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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=YYmn9/zu;\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 4Z8gBX0Cjrz1yKp\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 8 Mar 2025 08:57:40 +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 1tqfgQ-0004zz-Nm; Fri, 07 Mar 2025 16:56:42 -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 <pierrick.bouvier@linaro.org>)\n id 1tqfgP-0004zJ-78\n for qemu-devel@nongnu.org; Fri, 07 Mar 2025 16:56:41 -0500", "from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <pierrick.bouvier@linaro.org>)\n id 1tqfgN-0001jy-8l\n for qemu-devel@nongnu.org; Fri, 07 Mar 2025 16:56:40 -0500", "by mail-pl1-x62e.google.com with SMTP id\n d9443c01a7336-223959039f4so49592215ad.3\n for <qemu-devel@nongnu.org>; Fri, 07 Mar 2025 13:56:38 -0800 (PST)", "from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-736ac9247dcsm2000927b3a.125.2025.03.07.13.56.35\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 07 Mar 2025 13:56:36 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1741384598; x=1741989398; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sfg9fp/d1PdwCXS3veKjw2zFmzOBBZVU57mmT0JR/f0=;\n b=YYmn9/zuZMOhGFwgKNWqsx9Ax995GFn7L/kLtP6q9okJi8p2DTsDHr/K4/vG7xG+z2\n XNnZQPheP/MBDEry1D2yo7Lnuya6oSxyda4+A+dL+jxXw4/Kbbj7fCLRXejmlr2lj1aC\n iWuqoi96lHuHM95nmtVH9SS4U3P9bapLFpKaQGBBWdBwiRqYdVGCs+en7XaCv4geUOqt\n +/7SW1GNH6Vey2ecMbONR48FlPfnvb9KHbfCF17LJdu/0i2SEZGAAusfYsoeUd2rwPMF\n NMc9u0RTqTVFqz/BnTiQWYrPEFaL3xcOBt90osMU/X4zSz/N1xxuSKfErBlUVH4T/h5g\n UnHA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1741384598; x=1741989398;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=sfg9fp/d1PdwCXS3veKjw2zFmzOBBZVU57mmT0JR/f0=;\n b=F+cBKta2IMu/vGwWJaPmuPLXS4mjpNzPaS16JxVU2pUjnzWaLo28MsdlRHUR1mHr3H\n D6kWvrf49lzO1XEHraMESrV0Addq9dwagP+jkS22Iky4M+WxVgJ67HcI4iBO+IKedZ7K\n w9nM1UNcaEdMe4WlieP9s7Qq799E3LKkc0hLSipYWQ68gllZJtWl+CJsVGRcmoBkUBsH\n dyBZki/Ak7ddxeEzzWSUyYZU7vy/U14TzkFWvropIe5iW0uM1PXnZmhG8xJf/0UYJFSh\n jqT46PFRIxXj1VHuzVu5Gen/oG74H3AruPUAJT9s7kGcgs5GXcTJB2LvF172uxaoaf9i\n fvRA==", "X-Gm-Message-State": "AOJu0YzDMTnvv0ryjNtCo7Sxf8zlUhUpctAPleO+3v1ilaUCzeIB5A9J\n 5/5+VHzhfCQSYA4OcOVz5DAOLNWg35oQtOjwSRZuobg3OT92kMNw+9Cb/vy2fU1i5Ahk0F8DSCs\n A", "X-Gm-Gg": "ASbGncvWWfOU8+WfI0GkyZNVIN22xADpcXxoNPojeRpqgafoh85gAX+Xrd0YjAs19YE\n GxmpyijxPfhO3vgRW8cX5Lli/7w1ZOEzCTfoJKbSDLUQ7i1zEegN8FlUeSY/rgmIlMqW40ofcPy\n 7d/kGoIZLJNWosyPQo2dp3hFB+LNJ0qhTTbHWcx5sQOa87zxWgBSg7QwLNYjEm+rw9YLEypPh0z\n tENTF4Ga1tEla4OrtDMWt4aANV+ULYbBA8/KxKREAXE6OmvS7dN9BISbRWDdVsEUUt+sh6HEpFs\n PG/8m5YPdlVz6grTS6jYNofFCPCm5YhpejryASV6sLCd", "X-Google-Smtp-Source": "\n AGHT+IGX5pfQXW7bvmwqA+NptD1rpRnsLsnmq6044IHwx1QKIiIQW9IhEs7zgPLZDe/E6y36RfvBrw==", "X-Received": "by 2002:a05:6a00:1817:b0:736:3979:369e with SMTP id\n d2e1a72fcca58-736aa9f1fcdmr6571296b3a.9.1741384596537;\n Fri, 07 Mar 2025 13:56:36 -0800 (PST)", "From": "Pierrick Bouvier <pierrick.bouvier@linaro.org>", "To": "qemu-devel@nongnu.org", "Cc": "philmd@linaro.org, Paolo Bonzini <pbonzini@redhat.com>,\n pierrick.bouvier@linaro.org, kvm@vger.kernel.org, alex.bennee@linaro.org,\n Marcelo Tosatti <mtosatti@redhat.com>,\n \"Maciej S. Szmigiero\" <maciej.szmigiero@oracle.com>,\n richard.henderson@linaro.org, manos.pitsidianakis@linaro.org", "Subject": "[PATCH v4 3/7] hw/hyperv/vmbus: common compilation unit", "Date": "Fri, 7 Mar 2025 13:56:19 -0800", "Message-Id": "<20250307215623.524987-4-pierrick.bouvier@linaro.org>", "X-Mailer": "git-send-email 2.39.5", "In-Reply-To": "<20250307215623.524987-1-pierrick.bouvier@linaro.org>", "References": "<20250307215623.524987-1-pierrick.bouvier@linaro.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2607:f8b0:4864:20::62e;\n envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62e.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,\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-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": "Replace TARGET_PAGE.* by runtime calls.\n\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\nSigned-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>\n---\n hw/hyperv/vmbus.c | 50 +++++++++++++++++++++----------------------\n hw/hyperv/meson.build | 2 +-\n 2 files changed, 26 insertions(+), 26 deletions(-)", "diff": "diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c\nindex 12a7dc43128..109ac319caf 100644\n--- a/hw/hyperv/vmbus.c\n+++ b/hw/hyperv/vmbus.c\n@@ -18,7 +18,7 @@\n #include \"hw/hyperv/vmbus.h\"\n #include \"hw/hyperv/vmbus-bridge.h\"\n #include \"hw/sysbus.h\"\n-#include \"cpu.h\"\n+#include \"exec/target_page.h\"\n #include \"trace.h\"\n \n enum {\n@@ -309,7 +309,7 @@ void vmbus_put_gpadl(VMBusGpadl *gpadl)\n \n uint32_t vmbus_gpadl_len(VMBusGpadl *gpadl)\n {\n- return gpadl->num_gfns * TARGET_PAGE_SIZE;\n+ return gpadl->num_gfns * qemu_target_page_size();\n }\n \n static void gpadl_iter_init(GpadlIter *iter, VMBusGpadl *gpadl,\n@@ -323,14 +323,14 @@ static void gpadl_iter_init(GpadlIter *iter, VMBusGpadl *gpadl,\n \n static inline void gpadl_iter_cache_unmap(GpadlIter *iter)\n {\n- uint32_t map_start_in_page = (uintptr_t)iter->map & ~TARGET_PAGE_MASK;\n- uint32_t io_end_in_page = ((iter->last_off - 1) & ~TARGET_PAGE_MASK) + 1;\n+ uint32_t map_start_in_page = (uintptr_t)iter->map & ~qemu_target_page_mask();\n+ uint32_t io_end_in_page = ((iter->last_off - 1) & ~qemu_target_page_mask()) + 1;\n \n /* mapping is only done to do non-zero amount of i/o */\n assert(iter->last_off > 0);\n assert(map_start_in_page < io_end_in_page);\n \n- dma_memory_unmap(iter->as, iter->map, TARGET_PAGE_SIZE - map_start_in_page,\n+ dma_memory_unmap(iter->as, iter->map, qemu_target_page_size() - map_start_in_page,\n iter->dir, io_end_in_page - map_start_in_page);\n }\n \n@@ -348,17 +348,17 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)\n assert(iter->active);\n \n while (len) {\n- uint32_t off_in_page = iter->off & ~TARGET_PAGE_MASK;\n- uint32_t pgleft = TARGET_PAGE_SIZE - off_in_page;\n+ uint32_t off_in_page = iter->off & ~qemu_target_page_mask();\n+ uint32_t pgleft = qemu_target_page_size() - off_in_page;\n uint32_t cplen = MIN(pgleft, len);\n void *p;\n \n /* try to reuse the cached mapping */\n if (iter->map) {\n uint32_t map_start_in_page =\n- (uintptr_t)iter->map & ~TARGET_PAGE_MASK;\n- uint32_t off_base = iter->off & ~TARGET_PAGE_MASK;\n- uint32_t mapped_base = (iter->last_off - 1) & ~TARGET_PAGE_MASK;\n+ (uintptr_t)iter->map & ~qemu_target_page_mask();\n+ uint32_t off_base = iter->off & ~qemu_target_page_mask();\n+ uint32_t mapped_base = (iter->last_off - 1) & ~qemu_target_page_mask();\n if (off_base != mapped_base || off_in_page < map_start_in_page) {\n gpadl_iter_cache_unmap(iter);\n iter->map = NULL;\n@@ -368,10 +368,10 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)\n if (!iter->map) {\n dma_addr_t maddr;\n dma_addr_t mlen = pgleft;\n- uint32_t idx = iter->off >> TARGET_PAGE_BITS;\n+ uint32_t idx = iter->off >> qemu_target_page_bits();\n assert(idx < iter->gpadl->num_gfns);\n \n- maddr = (iter->gpadl->gfns[idx] << TARGET_PAGE_BITS) | off_in_page;\n+ maddr = (iter->gpadl->gfns[idx] << qemu_target_page_bits()) | off_in_page;\n \n iter->map = dma_memory_map(iter->as, maddr, &mlen, iter->dir,\n MEMTXATTRS_UNSPECIFIED);\n@@ -382,7 +382,7 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)\n }\n }\n \n- p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |\n+ p = (void *)(uintptr_t)(((uintptr_t)iter->map & qemu_target_page_mask()) |\n off_in_page);\n if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {\n memcpy(p, buf, cplen);\n@@ -591,9 +591,9 @@ static void ringbuf_init_common(VMBusRingBufCommon *ringbuf, VMBusGpadl *gpadl,\n uint32_t begin, uint32_t end)\n {\n ringbuf->as = as;\n- ringbuf->rb_addr = gpadl->gfns[begin] << TARGET_PAGE_BITS;\n- ringbuf->base = (begin + 1) << TARGET_PAGE_BITS;\n- ringbuf->len = (end - begin - 1) << TARGET_PAGE_BITS;\n+ ringbuf->rb_addr = gpadl->gfns[begin] << qemu_target_page_bits();\n+ ringbuf->base = (begin + 1) << qemu_target_page_bits();\n+ ringbuf->len = (end - begin - 1) << qemu_target_page_bits();\n gpadl_iter_init(&ringbuf->iter, gpadl, as, dir);\n }\n \n@@ -734,7 +734,7 @@ static int vmbus_channel_notify_guest(VMBusChannel *chan)\n unsigned long *int_map, mask;\n unsigned idx;\n hwaddr addr = chan->vmbus->int_page_gpa;\n- hwaddr len = TARGET_PAGE_SIZE / 2, dirty = 0;\n+ hwaddr len = qemu_target_page_size() / 2, dirty = 0;\n \n trace_vmbus_channel_notify_guest(chan->id);\n \n@@ -743,7 +743,7 @@ static int vmbus_channel_notify_guest(VMBusChannel *chan)\n }\n \n int_map = cpu_physical_memory_map(addr, &len, 1);\n- if (len != TARGET_PAGE_SIZE / 2) {\n+ if (len != qemu_target_page_size() / 2) {\n res = -ENXIO;\n goto unmap;\n }\n@@ -1038,14 +1038,14 @@ static int sgl_from_gpa_ranges(QEMUSGList *sgl, VMBusDevice *dev,\n }\n len -= sizeof(range);\n \n- if (range.byte_offset & TARGET_PAGE_MASK) {\n+ if (range.byte_offset & qemu_target_page_mask()) {\n goto eio;\n }\n \n for (; range.byte_count; range.byte_offset = 0) {\n uint64_t paddr;\n uint32_t plen = MIN(range.byte_count,\n- TARGET_PAGE_SIZE - range.byte_offset);\n+ qemu_target_page_size() - range.byte_offset);\n \n if (len < sizeof(uint64_t)) {\n goto eio;\n@@ -1055,7 +1055,7 @@ static int sgl_from_gpa_ranges(QEMUSGList *sgl, VMBusDevice *dev,\n goto err;\n }\n len -= sizeof(uint64_t);\n- paddr <<= TARGET_PAGE_BITS;\n+ paddr <<= qemu_target_page_bits();\n paddr |= range.byte_offset;\n range.byte_count -= plen;\n \n@@ -1804,7 +1804,7 @@ static void handle_gpadl_header(VMBus *vmbus, vmbus_message_gpadl_header *msg,\n * anything else and simplify things greatly.\n */\n if (msg->rangecount != 1 || msg->range[0].byte_offset ||\n- (msg->range[0].byte_count != (num_gfns << TARGET_PAGE_BITS))) {\n+ (msg->range[0].byte_count != (num_gfns << qemu_target_page_bits()))) {\n return;\n }\n \n@@ -2240,10 +2240,10 @@ static void vmbus_signal_event(EventNotifier *e)\n return;\n }\n \n- addr = vmbus->int_page_gpa + TARGET_PAGE_SIZE / 2;\n- len = TARGET_PAGE_SIZE / 2;\n+ addr = vmbus->int_page_gpa + qemu_target_page_size() / 2;\n+ len = qemu_target_page_size() / 2;\n int_map = cpu_physical_memory_map(addr, &len, 1);\n- if (len != TARGET_PAGE_SIZE / 2) {\n+ if (len != qemu_target_page_size() / 2) {\n goto unmap;\n }\n \ndiff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build\nindex f4aa0a5ada9..c855fdcf04c 100644\n--- a/hw/hyperv/meson.build\n+++ b/hw/hyperv/meson.build\n@@ -1,6 +1,6 @@\n specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))\n specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))\n-specific_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))\n+system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))\n specific_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))\n specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))\n system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))\n", "prefixes": [ "v4", "3/7" ] }