From patchwork Tue Apr 22 19:26:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 883068 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp2591037wrs; Tue, 22 Apr 2025 12:45:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8+DRFr9a2fVildQo11qeiHX/XpM1WYA/tgitgmrF1kURf9yWbMBl90jUf3TMhd/oY5CB5+w==@linaro.org X-Google-Smtp-Source: AGHT+IGzR+hogIb3KfGTJyZqH7NgKBcu0DKP5wiSbhS5TQe7lF9u2uGRdPenRSE+u5qaJO0I+1NG X-Received: by 2002:a05:620a:29d1:b0:7c5:d888:7098 with SMTP id af79cd13be357-7c928018a11mr2451138785a.44.1745351129661; Tue, 22 Apr 2025 12:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745351129; cv=none; d=google.com; s=arc-20240605; b=b1rderKtXulBq4R4RhaEIlW0mYZMP8MuYZpb/K0K5lRKmO+HLczFDcpDR7H6o9nFl8 76Rmv6vv1og0Rt1NkQZtjCtthZIaIOlSF/DI1hSk1cVl50fgjv0aNhqrQHxmCyuVrrkL 91jem75oOOoyAe+nVg4PA6HtnyVLmhqvJbS27GZzdrXqCQ7ZPB6pkDWNAQOCinFi08Hl QEl9pgdZhZEUk+OfdcdspqkWC849OikZGLiJt2imTuBz+6PExyPON6pooCWgkq8Wxrv6 WrE2db8TZHC2hlL+PuZD3OPKxT86speXHIKpbFc5zTcFNh8zQv1q1HSzX2dcD7OhJMco TrnA== 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=uUDSMb2yaWobcfq2T8zvFcLGEMZI8wXQ4enYzV4I/Bs=; fh=rJy1HOIne0e2I55ApsoYJgwPj2V3k4hGoy6oqa7hAuI=; b=BFE2RCXi3e4luI7/4Xkg7xWcLnrSd+sV+G2sa5KcuvW2dWvL+6c78JLD7GQcUJuaG+ Gtif9iyD4otxxQKHB4VYhSpT0Q8foI6Vdlqoh4vcwEyU6IK3PfKelrUUDV+kSiz0akOJ x/14320FDQiF0czUa/VqO0uJZrJzHAxzKK1j/0IRfRq92dSh5t7zY3n+AaRXA/iezztr NkzhyBJKc4j8aD2mrLGQtKWkXAybAo3CL6H6U3D4E7QIqyzWywcZqValHqOAEi7dEXun ZzavSwAsMHz0AuFdVfXYwwraYT56NGORVjIT98Y5p9CdCn0cCfsjIo6qFHD5EqxeGM2d cNrg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=euiKftqL; 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-7c925ab06e8si1226878585a.37.2025.04.22.12.45.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Apr 2025 12:45:29 -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=euiKftqL; 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 1u7JIZ-0002XU-1Q; Tue, 22 Apr 2025 15:28:51 -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 1u7JII-0002Ss-LV for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:28:34 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7JIG-0006B0-JD for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:28:34 -0400 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-308702998fbso5010833a91.1 for ; Tue, 22 Apr 2025 12:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745350109; x=1745954909; 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=uUDSMb2yaWobcfq2T8zvFcLGEMZI8wXQ4enYzV4I/Bs=; b=euiKftqLZ07t+NtkP7Pdx55QJIBNhO+sEkBy/+23LiidypbkTIkqmAIpDBLyI+5G++ xhCXH1I0GwKqRUKGYpzSFPTtCE82bQIIcR8H+fJnMih19rkn9hmVCjWxSqCZ5z6Tg0qV 9KpQ8rDsCZV/e36uO7m351V/VOM5FCZdW/sx8QIboLdBf2oXP3c2WOp/NjbNvwwE8XW2 B6ABFOn4iFVoayq/06+kQJabXBHS9DmCei+GmMuXzBfNorfG85kBnGeA3xJ5B2dWJD17 Y8C8zXJ5+u/gFG8RpRPTgmdY7vWUS41uyLZbZVhTRFfRNWHtP4wEcexFZ4aVQUqQibd0 BacQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745350109; x=1745954909; 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=uUDSMb2yaWobcfq2T8zvFcLGEMZI8wXQ4enYzV4I/Bs=; b=OQgYyfx1ep2EWKF4LwFH83+fvgAltiCERt+9uUOMFyM2QTLgrhBfQ9ZYLxXMrs/9UU t853bUIL/Df05Fnpjouu+1tANGQRArUQ4EZpNaPLVc+lEiaIAM4m/al1lfjQf+1Gstj1 c1sT5rUJj8sA/lhV2bJY1yMSuj74mvg/kQWnODZB8D6jkFgAvkws/ePZ89Xgi0vXmWhU YcyBuSsHoe2PPqI/zakzd5BTSYV9BEYg8Ovyhoz1P87W9CS80HU1vLmnrcCl53dDB15a s/dlCYKVaJALUsNGLq2kyCUMw57nLJVYU7f6zBbimTo8d4lxlwJO/A+zfXN9yCK+f95w FTFw== X-Gm-Message-State: AOJu0Yz86GFfffI3Dr05xQYHTugjmCMAdO4YBleQ3vTtpn1lPQdB3I6I kmGQjx+Sh3mr8uIfv1259EzisQlC/AORuq4mfLcECmoZcut1dkFzmJUkl/GgtP4hTOKA9477ylg 7 X-Gm-Gg: ASbGnctejfkR8m8Xuu46Qpo4JbZq6XGdl0WIEih2q1HNSueId0AgTg4GjeSKn0os0tl +O9PD5umgXJjHpfNRaX9n3gfgHXhk4HAzCtBtGo2IzuddXK8X80SMwEoBVLtLKEJ4rJ832vfJCH mWQIkekA8vJs7MJlzGYkiMJeiNQ125j668IC9OtWg4ZhhcgKKUITr6hzCY4kGQ12JE9DaFgwlzc UNBN2BB6wlrupjIrSYss67wV/3BCnrS6IhZ6HKBuxVWOXGNCM3yb+k8u5yZUM6SkJlrr/L0x0Cj MhBSWu22mc/Nf+HiiAHV9W1Y1Z2uDmfIcptapl4i/XMJ6jrw4DvL0qlEHwJExU0gYmpdGGINJ1P aZ+c4VgXDtQ== X-Received: by 2002:a17:90b:58ec:b0:2ee:8e75:4aeb with SMTP id 98e67ed59e1d1-3087bb69d13mr27495369a91.17.1745350108650; Tue, 22 Apr 2025 12:28:28 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3087df21278sm9146865a91.29.2025.04.22.12.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 12:28:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Anthony PERARD Subject: [PATCH 012/147] hw/xen: add stubs for various functions Date: Tue, 22 Apr 2025 12:26:01 -0700 Message-ID: <20250422192819.302784-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250422192819.302784-1-richard.henderson@linaro.org> References: <20250422192819.302784-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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 From: Pierrick Bouvier 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 Reviewed-by: Anthony PERARD Signed-off-by: Pierrick Bouvier Signed-off-by: Richard Henderson Message-ID: <20250317183417.285700-13-pierrick.bouvier@linaro.org> --- 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 0000000000..5e565df392 --- /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 4a486e3673..a1850e7698 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()