From patchwork Fri Mar 14 17:31:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 873464 Delivered-To: patch@linaro.org Received: by 2002:a5d:4308:0:b0:38f:210b:807b with SMTP id h8csp837176wrq; Fri, 14 Mar 2025 10:36:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXC+Xjx8ViLcW1t6u7CDDxG2FmXxFI2yoL/Q1JUIbAupoCJH2LbacubvnpcnI5XgxIbY/Ssew==@linaro.org X-Google-Smtp-Source: AGHT+IHZcZd0GmzBiIHVQO9OBV+JR8Vz4JqpVibucRcCH3uXxlZRcRqzgQmeYWJiwzxQRlwMxQpo X-Received: by 2002:a05:620a:269b:b0:7c5:54d8:3d43 with SMTP id af79cd13be357-7c57c8f320bmr415899385a.58.1741973777599; Fri, 14 Mar 2025 10:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741973777; cv=none; d=google.com; s=arc-20240605; b=i7Tr9QicAG8J+TfTBgiC5nVPOUV6mvxTwy3rdftdMdC35ukARVhCKV0qy8zJqCRe01 S8QM9YwrEtYE82q8vafIZk0RuiIqGiUslftLMEdLU/yaCACItrIBYM94PngxsTrvMT7m tvcwkC2Rgvs3HJOAmf3ckQm0UuKscZpNXh5ADHjGv7qnuFh3KM9w9Z9GRTOcYPH0VYMR J/ORUv6YrVKsjO0x586G6SoJH2UW5FY2DwGNpoTSZEdWVfGgvjXZPhYqWaIuitJTltUR U3le+LnuwHHHTFWQ4fXkaYxP4UgQTA0MgVWlm6R+tlq7s6/7eowV0LtX/cutx+C2buIF 4Qdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:cc:to :from:dkim-signature; bh=WZK4IDfbpcoj/UHXYNBc9hj61CH/qnmJNHrSERoWz24=; fh=1eYTt0LXtkjMcfys9030kry1SyzhnfeGSEB2y21iMUE=; b=DmUNrBQNexZRpVc/LvzB94vbqq5TS9ttPvzCBbTk/zm1pKp3Cn3D5wPQmlQXHNmHgp SizljHQSKYbuUfG5Xnf4m8s0UoaYb0dUopD4q1dIA2bf1x2r5nqXciTS5+QJdAMeKN4d +nk0meONIqeKPReF4y6y3DlL8UTqaQEzvChh6Vtsedx23ovjAEL8i59yAYNBwPrtFtIq j7tJ0HWvwv6dAbk9e5I0WElZOQIcklaptIwjt+6SO7gC5b11x1Uj31p7qxsb+zcNrVHa LthXiLrxFYg82HUfXSpUtyqqiIKmq947i4gXg3vVEYppNgOKKDc9CWhwgDJqrfuYr8Tp VJeA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k285P5i9; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c573b73815si450932885a.12.2025.03.14.10.36.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Mar 2025 10:36:17 -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=k285P5i9; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tt8ts-00061Q-NA; Fri, 14 Mar 2025 13:32:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tt8tE-0005ed-5z for qemu-devel@nongnu.org; Fri, 14 Mar 2025 13:32:10 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tt8t6-0008HG-HA for qemu-devel@nongnu.org; Fri, 14 Mar 2025 13:32:06 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-22409077c06so62105905ad.1 for ; Fri, 14 Mar 2025 10:31:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741973519; x=1742578319; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WZK4IDfbpcoj/UHXYNBc9hj61CH/qnmJNHrSERoWz24=; b=k285P5i9vOuCu9IxPnh7OBLSosROs8en99zv6zczWSCR9fI16nQSB1ZKJhuimUck6P QMT8a2nOci676V8rchwL97ywt4v5jj/U/zANyulfkxL33nnwRCSXBlSFli+5kOwMa5Sw Jct6qfL/2y3S415Be2+Ptd8kNpxao1GpH6lpRGGf/j+hkFmDGd8WtWCV3b1CJ4OIMoer tK+y6vtrSwy2LRnFEm5fnT4TW9BGr8FZz0+bocPDzY7Mb8MEmkkYcNsoa5B74dEEnOhm 1qH2c7ySCW4/BpS26uCJjZGCuHPfa8E+1aLs/ccFn4lUgLJloJJRCoUSFN5uUYFcOC5h mfgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741973519; x=1742578319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WZK4IDfbpcoj/UHXYNBc9hj61CH/qnmJNHrSERoWz24=; b=SbYIyHJczAtdWV+zbe0jgoi9xlg/tnI6TW4VqgerRP7oQtghyByvnuJxCXgdHVjGLA gNdVtWG+kqBqHcpGG0a6EhFXxdtdzX8qHlrx102iEVgN8Fkd/AUwgwVuBiMsflN46av1 EZEaAFOq9KQLa4tWiowmAraqi7Bk/xIccHEl32x47q2Av0TCtag4uzj1zFK+fkEbQAZw w+p/Aie/i1AILQOpA31KHKMJbfHtMqcowkU2gXUwMaFHKr7eDJfqHwKf2vRqWyW8ex1M xBxJPla2u0IoJ7NfqtaTC40Phou2o1zfO34rF39VL9p/bHrMjEaTrNJJ5erufdAw7yAM taZA== X-Gm-Message-State: AOJu0Yw1se82XyrCAvC2eyR94H/jLN0n9PNmeQoP/0E6kXRtdPZZkUgU n1xS1E4N8rFg6tuPO6ZfaReAVWSvJ5YKVJVWshIDU+0v7R3vHBz3AVhPkVvyXqQnNt9ZeQYtilt vQtY= X-Gm-Gg: ASbGnctoAY5PoC2QLK/kUwdan7L3DlIX2lC5DRSypi1CsUqg8YC7S8UJ9cxD6Csym2U HCBdSRI0ruIIwjfhTr+ODi5tT989WuImoufzFzeMH8nYSFWIgsh6hGthRsVTGbJq25xH3c5d1Oq WNoOUcQ1ZCs09qrdvHmzt+98JgIjjG6stpgdT/aiWVEQzJBLiElY/aRSKL26q4vmlpELQHVtmRB +DaNN8rrJz+R6PVvOuudfkV/GaHDd/3qPj412xq0PTp4rIWcY0jZLmsUgB0wdiiDxdHAu+t6THa UbE8gU/k/Q4fhlJQVv24IqWGLL8kA1LkgBNvCZkqfOJn X-Received: by 2002:a05:6a00:b4e:b0:736:533b:f6fa with SMTP id d2e1a72fcca58-737223bf5e7mr3790179b3a.13.1741973518933; Fri, 14 Mar 2025 10:31:58 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-af56e9cd03bsm2990529a12.8.2025.03.14.10.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 10:31:58 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Yoshinori Sato , Paul Durrant , Peter Xu , alex.bennee@linaro.org, Harsh Prateek Bora , David Hildenbrand , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , "Edgar E. Iglesias" , Liu Zhiwei , Nicholas Piggin , Daniel Henrique Barboza , qemu-riscv@nongnu.org, manos.pitsidianakis@linaro.org, Palmer Dabbelt , Anthony PERARD , kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Stefano Stabellini , Paolo Bonzini , Weiwei Li , Pierrick Bouvier , Anthony PERARD Subject: [PATCH v5 12/17] hw/xen: add stubs for various functions Date: Fri, 14 Mar 2025 10:31:34 -0700 Message-Id: <20250314173139.2122904-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250314173139.2122904-1-pierrick.bouvier@linaro.org> References: <20250314173139.2122904-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62a.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 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-bounces+patch=linaro.org@nongnu.org Those symbols are used by system/physmem.c, and are called only if xen_enabled() (which happens only if CONFIG_XEN is set and xen is available). So we can crash the stubs in case those are called, as they are linked only when CONFIG_XEN is not set. Acked-by: Richard Henderson Acked-by: Anthony PERARD Signed-off-by: Pierrick Bouvier --- hw/xen/xen_stubs.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++ hw/xen/meson.build | 3 +++ 2 files changed, 54 insertions(+) create mode 100644 hw/xen/xen_stubs.c diff --git a/hw/xen/xen_stubs.c b/hw/xen/xen_stubs.c new file mode 100644 index 00000000000..5e565df3929 --- /dev/null +++ b/hw/xen/xen_stubs.c @@ -0,0 +1,51 @@ +/* + * Various stubs for xen functions + * + * Those functions are used only if xen_enabled(). This file is linked only if + * CONFIG_XEN is not set, so they should never be called. + * + * Copyright (c) 2025 Linaro, Ltd. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "system/xen.h" +#include "system/xen-mapcache.h" + +void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) +{ + g_assert_not_reached(); +} + +void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, + struct MemoryRegion *mr, Error **errp) +{ + g_assert_not_reached(); +} + +bool xen_mr_is_memory(MemoryRegion *mr) +{ + g_assert_not_reached(); +} + +void xen_invalidate_map_cache_entry(uint8_t *buffer) +{ + g_assert_not_reached(); +} + +ram_addr_t xen_ram_addr_from_mapcache(void *ptr) +{ + g_assert_not_reached(); +} + +uint8_t *xen_map_cache(MemoryRegion *mr, + hwaddr phys_addr, + hwaddr size, + ram_addr_t ram_addr_offset, + uint8_t lock, + bool dma, + bool is_write) +{ + g_assert_not_reached(); +} diff --git a/hw/xen/meson.build b/hw/xen/meson.build index 4a486e36738..a1850e76988 100644 --- a/hw/xen/meson.build +++ b/hw/xen/meson.build @@ -9,6 +9,9 @@ system_ss.add(when: ['CONFIG_XEN_BUS'], if_true: files( system_ss.add(when: ['CONFIG_XEN', xen], if_true: files( 'xen-operations.c', +), +if_false: files( + 'xen_stubs.c', )) xen_specific_ss = ss.source_set()