From patchwork Fri Jan 3 17:10:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 854867 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp8353235wrq; Fri, 3 Jan 2025 09:11:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUkfrdmEHhfraotpf7auwb7maJbd/1ygHgME6tU/kazPqqHkORJcx8BNnUNE8ZX+yGrtw1sVA==@linaro.org X-Google-Smtp-Source: AGHT+IE6/fZNpFAoQneS4oa86zptBMhrCpqySTIqNQFuxfdTWeAFsuuoVKXspWQq4jMEf+iutllx X-Received: by 2002:a05:6214:20c1:b0:6d8:f005:b573 with SMTP id 6a1803df08f44-6dd15531556mr886018066d6.1.1735924291313; Fri, 03 Jan 2025 09:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735924291; cv=none; d=google.com; s=arc-20240605; b=ibsFrR/VHByoPwMfqAzXGyJeQvHFYqzcxC8gX6kj1umPBpWyD4IGzeitdgg/MdmITn 7byEExp9jJVnjmG+aVZ6yRknpTP40KZe0WgzeEKgfka1NxKfkWeLzXyvJLqOt1MZZWNM zlEssEn2yLmYyhLT4xN1I4wQDZd7/GSskmlzrzGUan/7+Fj2LrtACGW+tINirKXb8tOx h9DNGcvsrNBh6f/r4cfl7t6wSOZKMj86qJNi6yqseYlxe4/HN/lguF6YQtmzKvJtaQzT imxJj2NtViYA2VRdAgRFcYIIw/pkmKgxyzlF7VTU1qVSHI2b+6FhNnYgBNKKzy0CEWST IEtg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=wW81ZsV/iemciYIUPkkQZwi1T5j7zVtZZ41DJIlDy9M=; fh=VclK+25cToo2hY7i86CrNJRwJqsJDQE6QtSzvWpK7Ok=; b=jfjTCCue71ySHwDGtwu5R6XYcgfczqpB74zo0yIP5E/9ejYhoaCPwW9zvbR5P6ChOU xswawUjNwXXBRl2rnrRiV/tHROZTZIjRw+SXE5y0sB2hNf5QfwhxPI1yrqhlXwEF++g1 tBCKdZfnk1d4O1+id/uNVQyUXQQw4FaND/t1a1nUeoEsykXAGF+rkFgAIXjOwoh9o2SJ 2MyAHZP4IzGNosCnkUoSShb48nx16jOF0lfzQnzp7gKexKTeSOYeyYmNUIdHLlbFvR50 ApdY7g7mL6kpA311LtGCUsdihXYVm0lRJtAtS36xfWx8WmCjNNBxlurK6ZQMr/tEl0Kr 5PqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NTe+olGL; 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 6a1803df08f44-6dd1825081bsi388558756d6.299.2025.01.03.09.11.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Jan 2025 09:11:31 -0800 (PST) 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=NTe+olGL; 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 1tTlCG-0000QE-CN; Fri, 03 Jan 2025 12:10:53 -0500 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 1tTlC8-0000PU-3j for qemu-devel@nongnu.org; Fri, 03 Jan 2025 12:10:44 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTlC6-0006mE-Ds for qemu-devel@nongnu.org; Fri, 03 Jan 2025 12:10:43 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385deda28b3so8538204f8f.0 for ; Fri, 03 Jan 2025 09:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735924240; x=1736529040; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wW81ZsV/iemciYIUPkkQZwi1T5j7zVtZZ41DJIlDy9M=; b=NTe+olGL8SXDRfkskFdbMGkPDjstsBL4CZw/pnUVJC6CELqBGqoTIQdTsHz//38B03 T3pjCb2sfy8sSHTUdpxuvTGIIWGCANK3ucvdr2z8bsZmws45rfHuMwqsU3yAi+NLolx8 nQbmBoKx/2yJiYsitOTm5jQcXc84XLlzkdHoCzQSXjvTcNmTBVhQldsQFfJCuambVBhQ BGysm/CP2jmrvWe8ePInnlJtxdIdL5wrGRdTujWb2aJJqLS04BRlFsh9XJu/HMFCsGiR YdY4TDmhXaQGK7w0Wyyigc111GJMdY7ltX4KJSuOBYySohPzZhiXEhzzZVdSjly5dWgc zfpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735924240; x=1736529040; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wW81ZsV/iemciYIUPkkQZwi1T5j7zVtZZ41DJIlDy9M=; b=gMxAOzXjD7YwbT9vsNpfzpRmD7pVCpaLVAC1K3P9wrNixQA1ONXXfju/Slk9BHUX1K ZcJdET8T5kxQCxERb+7P+7emxSpV7sH9BIqXvdTya9zdBHIQ8D4NVYrQ0kSZP7NqF2Os z13UQsxNZ2hhRIRsnQ1SMwDOrXQCwx+qP4cvYIz3iX/qhojL247ZMx842SNT9RmbRSyr DpO1HElyUNpecCwZZa6COWywz3NA6HgAVivproDhIBxBf7XuN6mseyngKoikX+C3Fj03 zhKGrP8DG+83LNU9mUL42YlESANg9GGV6Ydw1xYthiwFDR2KI8z5kHY8obvpQGd8vb0L IZ7w== X-Gm-Message-State: AOJu0Yzw67VqMYgnYO9S/KeT2RbrEuEqbtcSewLbcbDEUv7uL00ue+B2 5uV7B5HOXEwAKQLKfIqnq5SBwqPam3HF30i9Ev31g975iUsF6v4QgPajwxcklSxz23oluVPwTlM 7M3w= X-Gm-Gg: ASbGncuTtNqN/YFMLc6rxrJ7VAy4sm8c01I2d2y6q/rUpvOZTXB+WgoULRu2sNdXNbS GAhbzOBEFGyJb6/BYcKlY1nr74son5SGiQ7BvyCXjmllWBgdjZKrYLnMnOjCEccuXJoMdinKjIX PuhcsFcfnWT52xjKQig9SdL2+qmQA1v0MZPj3o+mPXbSoJt/Jn8maqJO6dxSKTdFy6S1RbJ3QY8 uyV/1fcc1zXdg2/OgqRcnznuXV/P9gEJGWnWlr7pmYyoZkmKnvoJ4g6mxqqAECt8UVyLc1pn2Tl fQYYN99rAW5C2MVEmFCj7nUPAmhmZdI= X-Received: by 2002:a5d:47c5:0:b0:386:3213:5b9b with SMTP id ffacd0b85a97d-38a223f5cebmr41308637f8f.43.1735924240342; Fri, 03 Jan 2025 09:10:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea42esm496409315e9.9.2025.01.03.09.10.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Jan 2025 09:10:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Alistair Francis , Kito Cheng , Richard Henderson , Keith Packard , Daniel Henrique Barboza , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 0/5] semihosting: Reduce target specific code Date: Fri, 3 Jan 2025 18:10:32 +0100 Message-ID: <20250103171037.11265-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 This series makes semihosting config.c and console.c target agnostic, building them once, removing symbol collision of the following functions in the single binary: - qemu_semihosting_chardev_init - qemu_semihosting_config_options - qemu_semihosting_config_opts - qemu_semihosting_enable - semihosting_arg_fallback - semihosting_enabled - semihosting_get_argc - semihosting_get_target This function is still problematic, being built for each target: - qemu_semihosting_guestfd_init Note, it depends on CONFIG_ARM_COMPATIBLE_SEMIHOSTING which is target specific, so doesn't scale in a heterogeneous setup like the ZynqMP machine, having ARM cores with CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y and MicroBlaze ones with CONFIG_ARM_COMPATIBLE_SEMIHOSTING=n. I suppose the semihosting API needs rework to consider the CPUClass? I'll let that investigation for the maintainer ;) Regards, Phil. Philippe Mathieu-Daudé (5): semihosting/syscalls: Include missing 'exec/cpu-defs.h' header semihosting/uaccess: Include missing 'exec/cpu-all.h' header semihosting/arm-compat: Include missing 'cpu.h' header semihosting/console: Avoid including 'cpu.h' semihosting/meson: Build config.o and console.o once include/semihosting/console.h | 2 -- include/semihosting/syscalls.h | 1 + semihosting/arm-compat-semi.c | 1 + semihosting/console.c | 3 ++- semihosting/uaccess.c | 1 + semihosting/meson.build | 9 ++++++--- 6 files changed, 11 insertions(+), 6 deletions(-) Reviewed-by: Richard Henderson