From patchwork Fri Jun 20 17:27:13 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: 898377 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f54:0:b0:3a4:ee3f:8f15 with SMTP id cm20csp1560901wrb; Fri, 20 Jun 2025 15:21:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVyVU2P8HuDnZWb0Vn7dyD5ffF9D2VW3ZnmB10WVxjP/G2JXBd6Y9yxOhzYk/TbQK0MjbsOw==@linaro.org X-Google-Smtp-Source: AGHT+IECgrp8JVeKY3/VUCema45pjR38MmvCZVz+G8KsWU3OErQpse31/CVD8JG8orzs+CTfzNaQ X-Received: by 2002:a05:622a:a1a:b0:494:b1f9:d683 with SMTP id d75a77b69052e-4a77a256f97mr75065891cf.49.1750458093534; Fri, 20 Jun 2025 15:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750458093; cv=none; d=google.com; s=arc-20240605; b=EWtvbRSLFTUH5Lop6rUyOaV5sTrhYqlAPbcsiFhMkYyaQwJQo87lGfI2XLj+DNUnd0 qtLwIjjgk7TW/ZWnraPby/utYXAJ6F4uZtgWI9wioEWESPGBHVtN0escQugvFxxpsg+7 G3CcxXCLwdtJ+a0XBeyoZUBB5it05wUWfusKhE5mta/qiDEAyw1ZImqG7hrhhIuVMOvh 4RkHgZWAIyxpS+c2aKjQBk+bKQVqzv+frK0Wg8MQ/VJLBY+70b09A66NmIL/ImFhctzX 3DGaFECdcD9rNjDbhM/w/d7QeIj9BI3E3QJcFLCfvSZu2JEtmvzKe+8AWPSvbTczrbmw UG/g== 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=BVfl4a7zvO8Yq+0ojWc2U1WLc+2IZ+gWS0XMhXqWu+I=; fh=AyzBWpdZKvTUKIe2KsNBcRb7uNXo8uS2i+VtImaSwe4=; b=CADhg08FVfGPnN5YwXZoBcBqp302Tn9Ezc4inpzI1EtHEEjLcmhfi8WYT6iEkLfisJ N6boDjdFeAxKIZ6HulgFHT4tKPVsbb29ixfzpcKpCehERhT7SK64kdiw9KGCMl/e9nLu pxYj6Ev5d9sAQTMnF/Id/Q3LSQTRU8p18vUXbitZ3hop5Y+2MfRuyBqyI05gKJIOMPJY K38bMdSnkltkNNN2me73PBla9ZcRPBosjqvDAk2yGoPlmWOTxNqfMp/5aiy8eog732eO 59pM7Ven9shU0dg0vqAY4VoLh9beB5YUUcU0ysl7sV0+3xrhMbHIePrv+4iVz1u70Jnk QZKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vHEnxix2; 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-7d3f9a030f7si242455985a.392.2025.06.20.15.21.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jun 2025 15:21:33 -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=vHEnxix2; 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 1uSk5J-0002Zp-JF; Fri, 20 Jun 2025 18:19:46 -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 1uSfXb-00076U-LU for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:28:39 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSfXZ-0005uS-VS for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:28:39 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a4fd1ba177so1389566f8f.0 for ; Fri, 20 Jun 2025 10:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750440516; x=1751045316; 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=BVfl4a7zvO8Yq+0ojWc2U1WLc+2IZ+gWS0XMhXqWu+I=; b=vHEnxix22JjyjieKWX2fevIQEUEb0srNS9xKwdLZrka9CLDELYvG/Ivm4f75miMep+ vlpz1KAm+Ke+9L0Na4DHeqt2GyQIoPq+P2Lv2KnGALYK47WwsiaaFuD0ZLn7RorkIDVn WSa8Tm6tnsTtPp0f48Ng2UfGfC4Eg5Rs99MVSeymhUV9G6OeuHuqAG5RzGxiPrh+7HOt UwWKfPUQvIw0U26XuNwlLl9w7luloA3wIb6T7g4YgG3cPQgaS2QXHV/ySPSkeZLBm8gv RKtzaZUrwgMIeyPhL7rXQdUoSTDc4z2WVAonyegrnx6TAQL4QK+RigIZP/OZ8BNiBc5u c+BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750440516; x=1751045316; 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=BVfl4a7zvO8Yq+0ojWc2U1WLc+2IZ+gWS0XMhXqWu+I=; b=d0HvZHscu32B99UZjqH1QU4hJrwwzydxLMFmvyPvkXcgBJ75YJnYV5ZV4rjWzViEiN Ncd+If+I6iRWUnI8PlO08qHFGoGgZcAmYD4by47Nb+nUfJcLuin++mqp/AFFy82gdXNM IM+8FvboG0ly5a2BzM8CX135vbtdoyQUW5NtC/M7TvIPeoIQ/vFyDgW8a10Hg63UKnfG rOG93PsN0joTfCV9TOzB1fcFsFhV+/f1QHaGyEJLVgzyBOGwbUSr2ofuDIDle+DGbIUU sI/1md2aoufbl7nbNZ3MbM5hFIhZGrEZBRdHT2qVM7XxBcWrlHYKspI1EyFM5yzVs1i+ Jo6Q== X-Gm-Message-State: AOJu0YwuqYiyBdMyGPYEeNrUb+mtNMBeLZZXSBs00bI0ZfMgJcHWCwnE mNuAcN/8Ju+qwkvt0FUckPSaGMT5jlcFZ+eGsElcFLq4pBStHbwxB8MCb/0sfo3fTNeWeTkOsHw NePHx7JP8SA== X-Gm-Gg: ASbGncsRPAjWsx9izFgoqudZPbSaUE1CTPZX7TfZG2GCBFVKBYmZ6tgfz512AuLzW+j 1IR3EPPBH4IfGUUh5hE73tjQCN9JeQ55kpErstInjpRozDmhxggqz9OuP8KI/Jm6CGCp26rRjvq 6P7wUtS8E+pN/JLHh6c5WDTzAB6qkrOVsUq0vt9+6XV25wEB1MiczjeV/dCYT0fmj4TZdIWaQ+7 qV6IK24qlWFuRiS0wC5dahWvLNJBJ/W9LoMT2VO2U78zNqNp2dNBuXYQUbQGieDycQwv3Vw6qcr RAfiFDfAoZ7uzeRICFacuge3QOR+BshcgccHL584elDfGPLFC4K5bjNz7GiDuU07/I5EHmO/Qz1 PUxyYNrKIPiutburjCRCB/a3acw0DWatk/jO1swdsX9Ctu+3Vvza4QygfCiWYZ/pYrIg= X-Received: by 2002:a05:6000:178d:b0:3a4:ebfc:8c7 with SMTP id ffacd0b85a97d-3a6d278a2a8mr3083233f8f.8.1750440516113; Fri, 20 Jun 2025 10:28:36 -0700 (PDT) Received: from localhost.localdomain (101.red-95-127-63.dynamicip.rima-tde.net. [95.127.63.101]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a6d117bfd9sm2647567f8f.57.2025.06.20.10.28.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jun 2025 10:28:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Graf , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Peter Maydell , Julian Armistead , Cameron Esfahani , Mark Burton , Thomas Huth , "Edgar E. Iglesias" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [RFC PATCH RESEND 05/42] accel/split: Expose 'hw' and 'sw' properties Date: Fri, 20 Jun 2025 19:27:13 +0200 Message-ID: <20250620172751.94231-6-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620172751.94231-1-philmd@linaro.org> References: <20250620172751.94231-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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 In preparation of other accelerator (or potential emulator), expose the "hw" and "sw" keys. Only HVF and TCG allowed so far. Signed-off-by: Philippe Mathieu-Daudé --- accel/split/split-all.c | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/accel/split/split-all.c b/accel/split/split-all.c index 7cbe32ea768..28f626d0ff4 100644 --- a/accel/split/split-all.c +++ b/accel/split/split-all.c @@ -8,6 +8,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" +#include "qapi/error.h" #include "hw/boards.h" #include "accel/accel-internal.h" #include "split-accel.h" @@ -78,6 +79,42 @@ static void split_get_stats(AccelState *as, GString *buf) g_assert_not_reached(); } +static char *split_get_hw(Object *obj, Error **errp) +{ + SplitAccelState *s = SPLIT_ACCEL(obj); + + return g_strdup(s->hw_name); +} + +static void split_set_hw(Object *obj, const char *value, Error **errp) +{ + SplitAccelState *s = SPLIT_ACCEL(obj); + + if (strcmp(value, "hvf") == 0) { + s->hw_name = g_strdup(value); + } else { + error_setg(errp, "'%s' accelerator no supported", value); + } +} + +static char *split_get_sw(Object *obj, Error **errp) +{ + SplitAccelState *s = SPLIT_ACCEL(obj); + + return g_strdup(s->sw_name); +} + +static void split_set_sw(Object *obj, const char *value, Error **errp) +{ + SplitAccelState *s = SPLIT_ACCEL(obj); + + if (strcmp(value, "tcg") == 0) { + s->hw_name = g_strdup(value); + } else { + error_setg(errp, "'%s' emulator no supported", value); + } +} + static void split_accel_instance_init(Object *obj) { SplitAccelState *sas = SPLIT_ACCEL(obj); @@ -100,6 +137,15 @@ static void split_accel_class_init(ObjectClass *oc, const void *data) ac->get_stats = split_get_stats; ac->allowed = &split_allowed; ac->compat_props = NULL; + + object_class_property_add_str(oc, "hw", + split_get_hw, + split_set_hw); + object_class_property_set_description(oc, "hw", "Hardware accelerator"); + object_class_property_add_str(oc, "sw", + split_get_sw, + split_set_sw); + object_class_property_set_description(oc, "sw", "Software emulator"); } static const TypeInfo split_accel_type = {