From patchwork Thu Apr 25 11:01:34 2024 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: 792028 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1319355wrq; Thu, 25 Apr 2024 04:03:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV1iO7DEBAygIyKOXMxVU/1mI2M/QR1mDcOE5rMpYUv5f51dhCxIioWkskhZQiabBnH6qTAttbG4Ua8ByPrXZNz X-Google-Smtp-Source: AGHT+IGY8IUbUn7wOGZyt7ndOpRDp78Cx+hVz9gVLG4HvAKqHn3IUL87gLkL2s/WEeF/22BSnzDx X-Received: by 2002:ac8:5896:0:b0:436:8356:bf5 with SMTP id t22-20020ac85896000000b0043683560bf5mr6760615qta.60.1714042991244; Thu, 25 Apr 2024 04:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714042991; cv=none; d=google.com; s=arc-20160816; b=YElybDGTmBHoRFmfwKJoxZ6iBO0mA0C9jVl+LfpxNtAQiLyPpziZ/wCJ0ShX7TloHq hCNgsIkQKj8LFatiOkriu7KsuupHI1basDX/fUPT0b22JMpqZrEfJAPgWMzjuEJ11qRu UzmJx5ZuBw9dO3uXbeVrufD6YULhlDZjVz42wQwF2oIli8XIlcG7jzr7RJ7qANgjwrYQ GWq4ZUr7SzVlh5B0z0gw5OkGJyhwNd2AmXmS71OxAxapcgQuHG6AvpEPka9L6+1Pn5aF HdrJiBsazw4U1IQ2gu0AMb5CuN/9b6s18bQ/w1UZuxoGuB6ku/euoKqA/+8aI058W10P 0WOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=wjoLmpbwfS6wFuFSJimySduX47ZEmh3QOL6abPkvr5o=; fh=UBFeMdVBrl0zPdUyGbCKbIMerQW2B3zKMdUH78o47og=; b=g2Vvozx5yacURegE9fM09N2k8AkasCl6oLzFNTeE5AK2V/3U5FnNB1vG8Y7twJ9pvv gc68nKrxE2QHlU9DMdEkD7wdHzVpGuIKMz+CFVloJwtWoYq8Y7rrULruVmv1N0XrfzTH PsfLlFZyOv4v+r6YU2nU2Y0jUzFKay07nWoRJKBtiFzivDfmQPQlPUBYElMkwJE7bTL/ 4iv+0sv3aJv/Rqk5I1CIfdUmqY0qh97dYG5Ws/pWdjI5iKVgZCsJ+w9cwAVHuR9w7nIE 8xsRjWLjH8CjUoNgazrE+zkQeMOTDHlb+wLfN1Efm41EWrVPumPi/EzjLEprsWW+DBdU 4mXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LiSA7jOV; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ge17-20020a05622a5c9100b00439ff62d6d8si5481087qtb.192.2024.04.25.04.03.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:03:11 -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=LiSA7jOV; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwro-0007ka-G3; Thu, 25 Apr 2024 07:02:16 -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 1rzwrj-0007ju-R1 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:12 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwrg-00088I-Th for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:11 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-418e4cd2196so6833835e9.1 for ; Thu, 25 Apr 2024 04:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042927; x=1714647727; 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=wjoLmpbwfS6wFuFSJimySduX47ZEmh3QOL6abPkvr5o=; b=LiSA7jOVkbTokpNSinr3zsFN61oPTSKAuVYvpHfbHxwIk+tJAek43Wlr7awXyBC3/V DH5Q8v1rO/VFtXzpKiVCaqtH299eXylf3Xjx+r+EikvMffQg3UGS0ChbbEH52Qxuo6H9 Qoe+S0gFCgOpxhny2r1+51pgBJOOc0EcpNi1jBcItdH18SLba5xCaalowv+cFYuAflDq chgAS5l9hZNOJYVOgOdWF4U3btPV1/1i4FpLeC+LnO3ru8gDZ6FUYKUYKvHcIsNYH6dd s8MA1FP5W3zvPN5TOTx6Ff8lg1VRMRzpGkj3//vj7LeTqIWU+zleYuIc9g4FZPGI/0kQ NMDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042927; x=1714647727; 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=wjoLmpbwfS6wFuFSJimySduX47ZEmh3QOL6abPkvr5o=; b=HDTJfggxeqpht4dLrBO4cAEbs1EMibxVvLaYq/lib0uSDCYs42AXrcGh9HqV9DnL0O 5idTv6rG/1FAWgzES+iVCoRwEgJIn2rgPeuoBXvsO1kZjU3K1dmVW8hagqDnkB8AdIiD 2KUKkkFA/WPZTMvVFIiSQHzGcv19s4d3vdyT4MCFYjvnbXJXavWykn0wDPb2lYuUV5dM JQwsDdsSkr8Ay5dumv7Rj7UI69oasHdnsISQt/ez6J/etG5j0VcREB0cPtO3yd2nGjsq fCiGVBbRolpIG/dZzMSOMAh3mUrU0CeBmV6XGRRtOn2Nw/7e2G1isAEP0mNhVpZ0N1Yg dOVg== X-Gm-Message-State: AOJu0YwKZMPFtO4SkAf90iPtMw6HuJbk6GqtgiXN+yymvcjM0v/rVBa8 +3P+jDlAVS478e1PDrNIJnyTYlpnc4qFBkkl+fbKN/ll5KZ6ijQNdFKX9hulMKb95ILuMTTzmjp 1 X-Received: by 2002:adf:efcf:0:b0:347:d21:6855 with SMTP id i15-20020adfefcf000000b003470d216855mr3965037wrp.14.1714042925092; Thu, 25 Apr 2024 04:02:05 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id b16-20020a5d40d0000000b00346406a5c80sm19587104wrq.32.2024.04.25.04.02.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Maksim Davydov , Vladimir Sementsov-Ogievskiy , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 01/22] qom: add default value Date: Thu, 25 Apr 2024 13:01:34 +0200 Message-ID: <20240425110157.20328-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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=unavailable 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: Maksim Davydov qmp_qom_list_properties can print default values if they are available as qmp_device_list_properties does, because both of them use the ObjectPropertyInfo structure with default_value field. This can be useful when working with "not device" types (e.g. memory-backend). Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Message-ID: <20240318213550.155573-2-davydov-max@yandex-team.ru> Signed-off-by: Philippe Mathieu-Daudé --- qom/qom-qmp-cmds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 7c087299de..e91a235347 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -212,6 +212,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename, info->name = g_strdup(prop->name); info->type = g_strdup(prop->type); info->description = g_strdup(prop->description); + info->default_value = qobject_ref(prop->defval); QAPI_LIST_PREPEND(prop_list, info); } From patchwork Thu Apr 25 11:01:35 2024 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: 792032 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320081wrq; Thu, 25 Apr 2024 04:04:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8mQVdp9r07U1OUImZnnyQ1QzREKTn9pTH7rRCSd2B31d44zk326tllluWR6EmQ9qPcOZpr3oxDaFfRIGV3tJJ X-Google-Smtp-Source: AGHT+IFeTfAnJ4MmfiQoY7mOrU/e2y+gDDkvchxb/yQ5fGmxXvGLrj2n0m7ExW43MCNhR5Wo7iz+ X-Received: by 2002:a05:6214:2b0:b0:6a0:7e34:b70d with SMTP id m16-20020a05621402b000b006a07e34b70dmr5682233qvv.39.1714043065395; Thu, 25 Apr 2024 04:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043065; cv=none; d=google.com; s=arc-20160816; b=Djy+cHejgtpf6cig+IkNgbRZp7ZzGUe7J4LbNksuH5ZHf4AsW3/iF7jj9TJHjNwhoe IjJGjvo9cmgbFnslk2mjTveIWFSRlBKagocVoUFyO5TLITqqDtDbYDt3MEwvtYru3YS+ KGkoRmvdYGqEqWcq38xkQfx7ME96odMVL9fCLdvdAiVWfeW7Rcp1CovMqBLAHyhzO+iH jmGcrhKHfGHE+DauluhH51eAio6x2XF4tOdVOHDYFrWXpLaDozEkAvqbbyDL5Ay6xxV/ XlU8CM3Jn+4uXF6kpWVVMX6T4QdAqKeu0QxaBlIR/M9Q21Qb28PwGUgVTfu2qcFr9QIr LZaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=vLZ+JSbydZ+0P9XLjVkCEIbh5VWxC42GBVm2ZIIKLSk=; fh=BFX1ralkYTnSQgjfyb6nKIs84DsuWtwHVrO6IfZQEYA=; b=wizfFwZlLd0S6EVCV7FEgtUVdlpn/nBW3t0DOe2Odj9f6A5c0w/L6GM0xNKoCDoe0p DMJprmEqpxKJafcs5mY6CH9gHmwGcgN1i+C+qmjIueZghB2uzuMX3vCwtPEjC2M35Fvy NhVtF3VnTmYZxNSiW2griQGD1eKbPakOZf4Ke9Ys+duv9msXMGHNNZy4deXcZgE2BNtQ uWXDFs4nPt3zuLcxuE9VAGuQWhrv9fzQKG+NCXTDpH+XntuVZxPr5LYFGRQxSuaqn3Vq 82o0jNdFnGWBbPtkM7fMGSK36yHXr6SACgDDt3rDABpM3a3ZGKE4u0DNgwKBSiw0PjXX Nx5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J4G96lAU; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h10-20020a0562140daa00b0069b4f640ea5si17075931qvh.24.2024.04.25.04.04.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:04:25 -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=J4G96lAU; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwru-0007oC-FM; Thu, 25 Apr 2024 07:02:22 -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 1rzwrq-0007lf-P9 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:18 -0400 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwrn-00089U-Q5 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:18 -0400 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2dd041acff1so9300301fa.1 for ; Thu, 25 Apr 2024 04:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042933; x=1714647733; 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=vLZ+JSbydZ+0P9XLjVkCEIbh5VWxC42GBVm2ZIIKLSk=; b=J4G96lAURIAg+kmcYhgjVDW9HYr8wnW1rI66EHq9itxF++2G7BpXZcwRrHgspLFJz4 qXJTpVMA6A2XKRpDYkHZBFX8QDaLENEum298A7VBXw2BMfsS8QoTdQ28D7fT21wi4a1D CsXRg96wAghBks2Imv6xfFZjyZiPfg1PEEEeI3IjEREz2VbKN5E5+h/a7Mw39G+emooP IEWrMMiz9Bcjkev0ZR9KT9uCTNR+ar/BdFTgRDywXF6PSbbyXcvquk897uBj+GWe50Uq VpyUyv7T6C1Dnpr++Csov+MXkZFOhEUBUTHaWUj1pl/1iSRU/YikE65P4g1Gm9hIbiHD lUsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042933; x=1714647733; 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=vLZ+JSbydZ+0P9XLjVkCEIbh5VWxC42GBVm2ZIIKLSk=; b=ffuy7P8zXZeuSPIP6zmD14irKv+c+Wk/lp5rsmLPzaxGy2caDll2Ss2e4ipnzzwiFi TBHDg8mgQm8Q8P9lVZf4zB8Q4hADG5IR/Rd041irekAc27v0EYR5VLASlgNKi98PF4aG JYN7MYe0zITWifDyNNIazovrxUGslCHwLJtBpxbtcFJcfk2fiNl62ai28q2wqV38Rbl8 GYfWJBVu3V05SxNtNO9cTHdtOBPKHjrKJRIp+BvAjP2M25kxIiMooLwV+VNWxQ0YSDEn C7q4Chhs6rNTO1/qO5/gqNdTKYCHWcT5RuNYWOjexPxaxldlMGKZ5CEJTJu6UV94GNjP 8xqg== X-Gm-Message-State: AOJu0YxJhgKQkZwQV1LlUZn0z3RJnmzas0cVWirIufHKulMc1Gqux/Go itGlXPjZxiCiu/PQd7kl7kiZ6SXoVA1e4y30ASX0w1sftbL24KXi5O8kU8cNsy+G15kheN91cT1 Z X-Received: by 2002:a2e:88d1:0:b0:2dd:2fc:3cd with SMTP id a17-20020a2e88d1000000b002dd02fc03cdmr3419727ljk.29.1714042933255; Thu, 25 Apr 2024 04:02:13 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id bi14-20020a05600c3d8e00b0041b5944a197sm1195465wmb.45.2024.04.25.04.02.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Maksim Davydov , Vladimir Sementsov-Ogievskiy , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Eric Blake , Alexander Bulekov , Paolo Bonzini , Bandan Das , Stefan Hajnoczi , Thomas Huth , Darren Kenny , Qiuhao Li , Laurent Vivier Subject: [PULL 02/22] qmp: add dump machine type compatibility properties Date: Thu, 25 Apr 2024 13:01:35 +0200 Message-ID: <20240425110157.20328-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=philmd@linaro.org; helo=mail-lj1-x22f.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=unavailable 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: Maksim Davydov To control that creating new machine type doesn't affect the previous types (their compat_props) and to check complex compat_props inheritance we need qmp command to print machine type compatibility properties. This patch adds the ability to get list of all the compat_props of the corresponding supported machines for their comparison via new optional argument of "query-machines" command. Since information on compatibility properties can increase the command output by a factor of 40, add an argument to enable it, default off. Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster Message-ID: <20240318213550.155573-3-davydov-max@yandex-team.ru> Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 67 +++++++++++++++++++++++++++++++++++-- hw/core/machine-qmp-cmds.c | 23 ++++++++++++- tests/qtest/fuzz/qos_fuzz.c | 2 +- 3 files changed, 88 insertions(+), 4 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 2df407e877..3e9cc3f17d 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -135,6 +135,26 @@ ## { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] } +## +# @CompatProperty: +# +# Property default values specific to a machine type, for use by +# scripts/compare-machine-types. +# +# @qom-type: name of the QOM type to which the default applies +# +# @property: name of its property to which the default applies +# +# @value: the default value (machine-specific default can overwrite +# the "default" default, to avoid this use -machine none) +# +# Since: 9.1 +## +{ 'struct': 'CompatProperty', + 'data': { 'qom-type': 'str', + 'property': 'str', + 'value': 'str' } } + ## # @MachineInfo: # @@ -166,6 +186,14 @@ # # @acpi: machine type supports ACPI (since 8.0) # +# @compat-props: The machine type's compatibility properties. Only +# present when query-machines argument @compat-props is true. +# (since 9.1) +# +# Features: +# +# @unstable: Member @compat-props is experimental. +# # Since: 1.2 ## { 'struct': 'MachineInfo', @@ -173,18 +201,53 @@ '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', 'deprecated': 'bool', '*default-cpu-type': 'str', - '*default-ram-id': 'str', 'acpi': 'bool' } } + '*default-ram-id': 'str', 'acpi': 'bool', + '*compat-props': { 'type': ['CompatProperty'], + 'features': ['unstable'] } } } ## # @query-machines: # # Return a list of supported machines # +# @compat-props: if true, also return compatibility properties. +# (default: false) (since 9.1) +# +# Features: +# +# @unstable: Argument @compat-props is experimental. +# # Returns: a list of MachineInfo # # Since: 1.2 +# +# Example: +# +# -> { "execute": "query-machines", "arguments": { "compat-props": true } } +# <- { "return": [ +# { +# "hotpluggable-cpus": true, +# "name": "pc-q35-6.2", +# "compat-props": [ +# { +# "qom-type": "virtio-mem", +# "property": "unplugged-inaccessible", +# "value": "off" +# } +# ], +# "numa-mem-supported": false, +# "default-cpu-type": "qemu64-x86_64-cpu", +# "cpu-max": 288, +# "deprecated": false, +# "default-ram-id": "pc.ram" +# }, +# ... +# } ## -{ 'command': 'query-machines', 'returns': ['MachineInfo'] } +{ 'command': 'query-machines', + 'data': { '*compat-props': { 'type': 'bool', + 'features': [ 'unstable' ] } }, + 'returns': ['MachineInfo'] } ## # @CurrentMachineParams: diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index c20829b9ae..5972100b1f 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -64,7 +64,8 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) return head; } -MachineInfoList *qmp_query_machines(Error **errp) +MachineInfoList *qmp_query_machines(bool has_compat_props, bool compat_props, + Error **errp) { GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false); MachineInfoList *mach_list = NULL; @@ -96,6 +97,26 @@ MachineInfoList *qmp_query_machines(Error **errp) info->default_ram_id = g_strdup(mc->default_ram_id); } + if (compat_props && mc->compat_props) { + int i; + info->compat_props = NULL; + CompatPropertyList **tail = &(info->compat_props); + info->has_compat_props = true; + + for (i = 0; i < mc->compat_props->len; i++) { + GlobalProperty *mt_prop = g_ptr_array_index(mc->compat_props, + i); + CompatProperty *prop; + + prop = g_malloc0(sizeof(*prop)); + prop->qom_type = g_strdup(mt_prop->driver); + prop->property = g_strdup(mt_prop->property); + prop->value = g_strdup(mt_prop->value); + + QAPI_LIST_APPEND(tail, prop); + } + } + QAPI_LIST_PREPEND(mach_list, info); } diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c index e403d373a0..b71e945c5f 100644 --- a/tests/qtest/fuzz/qos_fuzz.c +++ b/tests/qtest/fuzz/qos_fuzz.c @@ -46,7 +46,7 @@ static void qos_set_machines_devices_available(void) MachineInfoList *mach_info; ObjectTypeInfoList *type_info; - mach_info = qmp_query_machines(&error_abort); + mach_info = qmp_query_machines(false, false, &error_abort); machines_apply_to_node(mach_info); qapi_free_MachineInfoList(mach_info); From patchwork Thu Apr 25 11:01:36 2024 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: 792027 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1319351wrq; Thu, 25 Apr 2024 04:03:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU1BBzJFjUgNoT+JrgUFPYUZgOD/iI7jD+vaEFeoJEC5SHllPUtNDEb9/7SPztYme9Htlekfx9VF5GsFLps9KjO X-Google-Smtp-Source: AGHT+IHQ2xt5POPEmQi5ZM/B0XtIdJyddngHJ3iu12HtqbDyGQspUlPXLaRWNLgn+YdL1rZIv7BI X-Received: by 2002:ac8:5802:0:b0:43a:3fce:32c2 with SMTP id g2-20020ac85802000000b0043a3fce32c2mr2915857qtg.3.1714042990921; Thu, 25 Apr 2024 04:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714042990; cv=none; d=google.com; s=arc-20160816; b=CTrqkr9RkB9hH8WMekVL+HLw5SE7nQSD3obCml51l+g8EWRghLRGntWhyDu+jPKWSI PZq6bjkMyBNsEC/OPyNmFuAsTXQopSsKjuAu+ofgIebjvRhZjHlKpRyu3jz060LFOZC5 pNgocwjGxtg6zFz1XIvxS/nufokbahoIlp02/Jt9XvatnYGvvxHBNPoa+8jYfLVvEHc2 glNTXYEZ4LcIZMhLCNLriRMQfwe3ZQysAPMW/DI80yuumXyCOpyb7K2jmgSWvf+aAFgU YA2y3Cawvr+F21NYYQyrlt2pMFuQ+Lx9ofCo+0XcryXtXtYd5vRHCmenEtzPLXddBfBh dKyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=eiSgNxRXT9EJcnQ8aO7qTnStvPwh3mzz93fTZzoT/NU=; fh=MOKVcUN+K0+zqccHitQmp2tjlMJbVcy0Qxc3Hai1eys=; b=oH9rOqlkmZSvRHZDNjk+Hqqh4mb4fyXGFwjQkDtTHvV3IjGJnGkO9D3JO8Nb1ZRnY3 495243in7agDB4m4l98Yh+/2yiSSI3uy8VtvHZvwxbK/J9FaJe0LulJidbaI5XtyDegz g9S5uBWYn24K7t0Cvg3yizC9JWrVCJJ4vc/TlXLbAAIz/Sy6/MpGsdRAABOzbA7uuvP0 sAWJvPYQvBDZtEauWovo985alHi2R9ndPkLum+8FBQxD3yYElOakMDbNlOUO/G24LUvA rvAcLF/hd1Wpb86FOk8vDdablJemwc3A8BScQ7WTj6vnq/Phuby4z6kpFVJbHk8Bv5H1 /LHA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VOrNwkjE; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id cz38-20020a05613011a600b007eb87481cc2si2843264uab.44.2024.04.25.04.03.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:03:10 -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=VOrNwkjE; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwrw-0007p7-OL; Thu, 25 Apr 2024 07:02:24 -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 1rzwrv-0007od-F5 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:23 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwrs-0008Ai-Jk for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:23 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-34c1fff534fso204561f8f.1 for ; Thu, 25 Apr 2024 04:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042938; x=1714647738; 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=eiSgNxRXT9EJcnQ8aO7qTnStvPwh3mzz93fTZzoT/NU=; b=VOrNwkjEc18XDYZn+sCdPXF09AvzrAv6uTFbdrdv2L5DxNnyWPIyaLdVGDhpfwYsi1 kYBOgtZo2EATtxrtPUkJk7axCF1UcOwP+sPAOi9quSXHTl/8pP0rDcaotA1ebdLE8YLn 794fwgrGxGE0fGgraq79JHMEHJrmi6qSjh2a0ATvlUqnKDMOj16WF+qPUnEMxnjfk+6O Rm1Kg7UmsqEMNJI1glB2I04m1v8ab5iZVGB7p539WX/rrkpXA0eG0qzTuZ8oZFHPfUHN watrBGVN9V0GnLIajZHkP4DwY05b6OxQvC5xqaUW9ZPaNPJ5Qjs68BxwfXyPCpYMyxyW CGeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042938; x=1714647738; 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=eiSgNxRXT9EJcnQ8aO7qTnStvPwh3mzz93fTZzoT/NU=; b=T+dLKBBBg57vOE121PBtb/o8j/mXbN8mCL9WIqWqsOwOPrtLdviadIyaVTolw7xSho au1Xbyv+bmnMtC7yTR+9p2/1L4ckDlB7JhPaAWQHGYrMz6hsdeHV7xaI0EWqn6A0QzNE LIioyvJ/AGZR5Cx6NfKTlkqxc8n4ydPsnfV5WERE8iF72FS4FjUJmlDuP3kGgwJYTvsE t5uqZDZL0qEUXw0GXrtMkjsDCeoVDwykciTzEDQcTepCrjicuiygR0X/0AcBeBF96Eui /RgumpeF4e/2FU4my8okpdg6PMH2Pnwn3bqXOy3CRbreU7z3Q4dSbvzd8s/jor/GC98J 9YUg== X-Gm-Message-State: AOJu0Yw1PGSn5JAv/Mbpb4hfRvMsv2F6WNaUvW16E+XJ/UApLBpRPBZ2 TlbFEMDfRBc9e0J1YKhp+SxgKJWMl1Ec91F9lVlZoyqcr4fYwlEba0cAdEvfZkV9gf2gd9J+YxB R X-Received: by 2002:adf:f34d:0:b0:34c:233e:f40c with SMTP id e13-20020adff34d000000b0034c233ef40cmr522061wrp.7.1714042938701; Thu, 25 Apr 2024 04:02:18 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id p3-20020a5d6383000000b00341b451a31asm19488279wru.36.2024.04.25.04.02.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Maksim Davydov , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cleber Rosa , Beraldo Leal Subject: [PULL 03/22] python/qemu/machine: add method to retrieve QEMUMachine::binary field Date: Thu, 25 Apr 2024 13:01:36 +0200 Message-ID: <20240425110157.20328-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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=unavailable 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: Maksim Davydov Add a supportive property to access the path to the QEMU binary Signed-off-by: Maksim Davydov Reviewed-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240318213550.155573-4-davydov-max@yandex-team.ru> Signed-off-by: Philippe Mathieu-Daudé --- python/qemu/machine/machine.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 31cb9d617d..f648f6af45 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -328,6 +328,11 @@ def args(self) -> List[str]: """Returns the list of arguments given to the QEMU binary.""" return self._args + @property + def binary(self) -> str: + """Returns path to the QEMU binary""" + return self._binary + def _pre_launch(self) -> None: if self._qmp_set: if self._monitor_address is None: From patchwork Thu Apr 25 11:01:37 2024 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: 792030 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320056wrq; Thu, 25 Apr 2024 04:04:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVq7pQ8PwcWTsiR/S0lEtXusj6ROUOIWTjatTGXK/jWfw024n0TqfcqsrI/93qfGA088N4bZU+hZ31Tl+4e/Vju X-Google-Smtp-Source: AGHT+IE3R7F3vYUkP5+w3xB06uJvHr8JNVtUhboXLE9c3ujv9cNIT57IESK+6mkZb+yoKRC6Rhy0 X-Received: by 2002:a9d:7342:0:b0:6eb:8e8a:10f with SMTP id l2-20020a9d7342000000b006eb8e8a010fmr5573063otk.24.1714043063529; Thu, 25 Apr 2024 04:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043063; cv=none; d=google.com; s=arc-20160816; b=W795gobL/0TB4+PrBQb3in36k1VbwDnxvN80HdKS3CvSZkoVhP2pr1bBcG23IaW5+W bw0qIh5KbX8U1/DH/dCN2uoX7SNRAyzwtouC8jIaMm2PteAxULU6BHzqD+tusktc6SoP 15toxj6Fi/9La88vU64UJShE1JMOmB007bvpOrshyp57zNwSY2rFFkNolPNkoNih8JQK LOuOBe+DjLm8TG/bExNajJr0BjuC+F8fdyUkHeAmUkfZ+hy7SEF79UBMLKqMaxwcDGJe Wv4R73SXZ5w4+lpphhX1WnZxAQEpD4GMMnB4KswIP6ROEJbbAhpzuisUTBTw4gmpYTwN 16Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=5bWeBXj+Rcq1Ig4OiKi3ZYcboAcFHPofG2jdDBnd1oA=; fh=rB+NeQ2rhy4rP7WS19y1FV40/+T0y7indbwMcOFQa2k=; b=VAnix8+RkMcIeYGK3QDE4LI8IG8L1WxhMoQYDFWAK7MhMesFOjRZn5TlqFeOdvdHVG Vu9jAhWd1XCWNHwkTWeZ+RD8fJMSBkca4IuAZAmwqvtSb7ZG6mKNRyNChXVkw92fQlPz IXLmgx5BAamHdISGcRtaYDg9DK7eXmDMBjGzRJHB3Q6XMQ6AMuPJFULS3aE+Y/5Umx/E Pc0jWkEq2U4e4yQ92G/gEjxlpp7L8Z+mzyAwUhUUGQ4nADTfqCP8HxBRE3nialJptxRT DKchEQK9OYHy5+atgMPEqzaS55xEJ47PPGG7Gy0AblONyaTtLRXmkjqAAUxCw9PvA0I4 bscQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xEw86AMv; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g10-20020a67cf8a000000b0047a30c99968si2606274vsm.198.2024.04.25.04.04.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:04:23 -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=xEw86AMv; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwsF-0007z6-E3; Thu, 25 Apr 2024 07:02:43 -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 1rzws4-0007rD-L1 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:32 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwry-0008Ce-Mo for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:32 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-41b51ee24f9so2079645e9.1 for ; Thu, 25 Apr 2024 04:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042945; x=1714647745; 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=5bWeBXj+Rcq1Ig4OiKi3ZYcboAcFHPofG2jdDBnd1oA=; b=xEw86AMvlTBI45QwaA88bFzsSXzgIU0/kRewvIUfr7aNKK7auG80Ghns65spgpLi1z bnDYNf9WM5ewD2NF8gxQA7NUJL7eBHfgtoNJrBAX8aKp6975f1rT3vgXrVLmHhJNoLtZ n3iOPVC5QUxSE9esAXR0ha1QhwYCTEwkPNzVW9bbBi8KdMGcBqis+Aedo4ZT7he7/TqB FIlkRj1WGG9fChyzrERBVAMeXFZcskWLKaplBscenUhSrBGalEaefQcUBIyoSzxQHOQL 0bKfEe6G1/mYw9dHeAhymrH7i44e0soEgpfW7FDGeNFV3SlkSyJS0RKAH2dD2ep/d+Je i2AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042945; x=1714647745; 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=5bWeBXj+Rcq1Ig4OiKi3ZYcboAcFHPofG2jdDBnd1oA=; b=kpO5AbLYQZzy6bg1z7H97mHbhCYpT2IseuJ8/RLesU2dWNRh5+O3ZYA5SeSgMSyfqS tY/NZJGFPtNP7mOND3XCABWQK0mVvi+TiM9SRPWhc3py3YOvTYTC4pJeJPDZYvm7U1rG DmQpKb+WVO8rMtYs3dkVGAaKH5Q4SCE+Xfb1Xl0JovnOz2QrJdi5ENDreVYeXXG1nRv9 BxkMTXTSxZp4SsOXPrmti4z5PVdjsvdvdlJ/QQFLrdVhe6ehc1Cezlp9mks12W1YA6CB oN+/o+DdmGBquGN1v/8UrJSplFsJjy0AUPd5vNTRkkdu2GnH/6apTO4R1RFOCwdjFuUb IpZw== X-Gm-Message-State: AOJu0YyrSIXpWTyX+/qO/QmwsxlN1Y7ciN0Zr7xfF5v1B/Sdi8qWxLIv 1ocWWFLqnWV5C3aBQQGx+yy85B5S0jscc152l/PXOMmLwS73QNN6bsG7RGfWEJXUqzEDE94Mlc3 k X-Received: by 2002:a05:600c:4fc4:b0:418:98fc:a46a with SMTP id o4-20020a05600c4fc400b0041898fca46amr2040794wmq.15.1714042944275; Thu, 25 Apr 2024 04:02:24 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id z9-20020a05600c0a0900b00418916f5848sm26698328wmp.43.2024.04.25.04.02.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Maksim Davydov , Vladimir Sementsov-Ogievskiy , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , John Snow , Cleber Rosa Subject: [PULL 04/22] scripts: add script to compare compatibility properties Date: Thu, 25 Apr 2024 13:01:37 +0200 Message-ID: <20240425110157.20328-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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=unavailable 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: Maksim Davydov This script runs QEMU to obtain compat_props of machines and default values of different types of drivers to produce comparison table. This table can be used to compare machine types to choose the most suitable machine or compare binaries to be sure that migration to the newer version will save all device properties. Also the json or csv format of this table can be used to check does a new machine affect the previous ones by comparing tables with and without the new machine. Default values (that will be used without machine compat_props) of properties are needed to fill "holes" in the table (one machine has the property but another machine not. For instance, 2.12 machine has `{ "EPYC-" TYPE_X86_CPU, "xlevel", "0x8000000a" }`, but compat_pros of 3.1 machine doesn't have it. Thus, to compare these machines we need to get unknown value of "EPYC-x86_64-cpu-xlevel" for 3.1 machine. These unknown values in the table are called "holes". To get values for these "holes" the script uses list of appropriate methods.) Notes: * Some init values from the devices can't be available like properties from virtio-9p when configure has --disable-virtfs. This situations will be seen in the table as "unavailable driver". * Default values can be obtained in an unobvious way, like x86 features. If the script doesn't know how to get property default value to compare one machine with another it fills "holes" with "unavailable method". This is done because script uses whitelist model to get default values of different types. It means that the method that can't be applied to a new type that can crash this script. It is better to get an "unavailable driver" when creating a new machine with new compatible properties than to break this script. So it turns out a more stable and generic script. * If the default value can't be obtained because this property doesn't exist or because this property can't have default value, appropriate "hole" will be filled by "unknown property" or "no default value" * If the property is applied to the abstract class, the script collects default values from all child classes and prints all these classes * Raw table (--raw flag) should be used with json/csv parameters for scripts and etc. Human-readable (default) format contains transformed and simplified values and it doesn't contain lines with the same values in columns Example: ./scripts/compare-machine-types.py --mt pc-q35-6.2 pc-q35-7.1 ╒══════════════════╤══════════════════════════╤════════════════════════════╤════════════════════════════╕ │ Driver │ Property │ build/qemu-system-x86_64 │ build/qemu-system-x86_64 │ │ │ │ pc-q35-6.2 │ pc-q35-7.1 │ ╞══════════════════╪══════════════════════════╪════════════════════════════╪════════════════════════════╡ │ PIIX4_PM │ x-not-migrate-acpi-index │ True │ False │ ├──────────────────┼──────────────────────────┼────────────────────────────┼────────────────────────────┤ │ arm-gicv3-common │ force-8-bit-prio │ True │ unavailable driver │ ├──────────────────┼──────────────────────────┼────────────────────────────┼────────────────────────────┤ │ nvme-ns │ eui64-default │ True │ False │ ├──────────────────┼──────────────────────────┼────────────────────────────┼────────────────────────────┤ │ virtio-mem │ unplugged-inaccessible │ False │ auto │ ╘══════════════════╧══════════════════════════╧════════════════════════════╧════════════════════════════╛ Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy Message-ID: <20240318213550.155573-5-davydov-max@yandex-team.ru> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 5 + scripts/compare-machine-types.py | 486 +++++++++++++++++++++++++++++++ 2 files changed, 491 insertions(+) create mode 100755 scripts/compare-machine-types.py diff --git a/MAINTAINERS b/MAINTAINERS index 8bb32f4a7e..118206c3e0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4229,3 +4229,8 @@ Code Coverage Tools M: Alex Bennée S: Odd Fixes F: scripts/coverage/ + +Machine development tool +M: Maksim Davydov +S: Supported +F: scripts/compare-machine-types.py diff --git a/scripts/compare-machine-types.py b/scripts/compare-machine-types.py new file mode 100755 index 0000000000..2af3995eb8 --- /dev/null +++ b/scripts/compare-machine-types.py @@ -0,0 +1,486 @@ +#!/usr/bin/env python3 +# +# Script to compare machine type compatible properties (include/hw/boards.h). +# compat_props are applied to the driver during initialization to change +# default values, for instance, to maintain compatibility. +# This script constructs table with machines and values of their compat_props +# to compare and to find places for improvements or places with bugs. If +# during the comparison, some machine type doesn't have a property (it is in +# the comparison table because another machine type has it), then the +# appropriate method will be used to obtain the default value of this driver +# property via qmp command (e.g. query-cpu-model-expansion for x86_64-cpu). +# These methods are defined below in qemu_property_methods. +# +# Copyright (c) Yandex Technologies LLC, 2023 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . + +import sys +from os import path +from argparse import ArgumentParser, RawTextHelpFormatter, Namespace +import pandas as pd +from contextlib import ExitStack +from typing import Optional, List, Dict, Generator, Tuple, Union, Any, Set + +try: + qemu_dir = path.abspath(path.dirname(path.dirname(__file__))) + sys.path.append(path.join(qemu_dir, 'python')) + from qemu.machine import QEMUMachine +except ModuleNotFoundError as exc: + print(f"Module '{exc.name}' not found.") + print("Try export PYTHONPATH=top-qemu-dir/python or run from top-qemu-dir") + sys.exit(1) + + +default_qemu_args = '-enable-kvm -machine none' +default_qemu_binary = 'build/qemu-system-x86_64' + + +# Methods for gettig the right values of drivers properties +# +# Use these methods as a 'whitelist' and add entries only if necessary. It's +# important to be stable and predictable in analysis and tests. +# Be careful: +# * Class must be inherited from 'QEMUObject' and used in new_driver() +# * Class has to implement get_prop method in order to get values +# * Specialization always wins (with the given classes for 'device' and +# 'x86_64-cpu', method of 'x86_64-cpu' will be used for '486-x86_64-cpu') + +class Driver(): + def __init__(self, vm: QEMUMachine, name: str, abstract: bool) -> None: + self.vm = vm + self.name = name + self.abstract = abstract + self.parent: Optional[Driver] = None + self.property_getter: Optional[Driver] = None + + def get_prop(self, driver: str, prop: str) -> str: + if self.property_getter: + return self.property_getter.get_prop(driver, prop) + else: + return 'Unavailable method' + + def is_child_of(self, parent: 'Driver') -> bool: + """Checks whether self is (recursive) child of @parent""" + cur_parent = self.parent + while cur_parent: + if cur_parent is parent: + return True + cur_parent = cur_parent.parent + + return False + + def set_implementations(self, implementations: List['Driver']) -> None: + self.implementations = implementations + + +class QEMUObject(Driver): + def __init__(self, vm: QEMUMachine, name: str) -> None: + super().__init__(vm, name, True) + + def set_implementations(self, implementations: List[Driver]) -> None: + self.implementations = implementations + + # each implementation of the abstract driver has to use property getter + # of this abstract driver unless it has specialization. (e.g. having + # 'device' and 'x86_64-cpu', property getter of 'x86_64-cpu' will be + # used for '486-x86_64-cpu') + for impl in implementations: + if not impl.property_getter or\ + self.is_child_of(impl.property_getter): + impl.property_getter = self + + +class QEMUDevice(QEMUObject): + def __init__(self, vm: QEMUMachine) -> None: + super().__init__(vm, 'device') + self.cached: Dict[str, List[Dict[str, Any]]] = {} + + def get_prop(self, driver: str, prop_name: str) -> str: + if driver not in self.cached: + self.cached[driver] = self.vm.cmd('device-list-properties', + typename=driver) + for prop in self.cached[driver]: + if prop['name'] == prop_name: + return str(prop.get('default-value', 'No default value')) + + return 'Unknown property' + + +class QEMUx86CPU(QEMUObject): + def __init__(self, vm: QEMUMachine) -> None: + super().__init__(vm, 'x86_64-cpu') + self.cached: Dict[str, Dict[str, Any]] = {} + + def get_prop(self, driver: str, prop_name: str) -> str: + if not driver.endswith('-x86_64-cpu'): + return 'Wrong x86_64-cpu name' + + # crop last 11 chars '-x86_64-cpu' + name = driver[:-11] + if name not in self.cached: + self.cached[name] = self.vm.cmd( + 'query-cpu-model-expansion', type='full', + model={'name': name})['model']['props'] + return str(self.cached[name].get(prop_name, 'Unknown property')) + + +# Now it's stub, because all memory_backend types don't have default values +# but this behaviour can be changed +class QEMUMemoryBackend(QEMUObject): + def __init__(self, vm: QEMUMachine) -> None: + super().__init__(vm, 'memory-backend') + self.cached: Dict[str, List[Dict[str, Any]]] = {} + + def get_prop(self, driver: str, prop_name: str) -> str: + if driver not in self.cached: + self.cached[driver] = self.vm.cmd('qom-list-properties', + typename=driver) + for prop in self.cached[driver]: + if prop['name'] == prop_name: + return str(prop.get('default-value', 'No default value')) + + return 'Unknown property' + + +def new_driver(vm: QEMUMachine, name: str, is_abstr: bool) -> Driver: + if name == 'object': + return QEMUObject(vm, 'object') + elif name == 'device': + return QEMUDevice(vm) + elif name == 'x86_64-cpu': + return QEMUx86CPU(vm) + elif name == 'memory-backend': + return QEMUMemoryBackend(vm) + else: + return Driver(vm, name, is_abstr) +# End of methods definition + + +class VMPropertyGetter: + """It implements the relationship between drivers and how to get their + properties""" + def __init__(self, vm: QEMUMachine) -> None: + self.drivers: Dict[str, Driver] = {} + + qom_all_types = vm.cmd('qom-list-types', abstract=True) + self.drivers = {t['name']: new_driver(vm, t['name'], + t.get('abstract', False)) + for t in qom_all_types} + + for t in qom_all_types: + drv = self.drivers[t['name']] + if 'parent' in t: + drv.parent = self.drivers[t['parent']] + + for drv in self.drivers.values(): + imps = vm.cmd('qom-list-types', implements=drv.name) + # only implementations inherit property getter + drv.set_implementations([self.drivers[imp['name']] + for imp in imps]) + + def get_prop(self, driver: str, prop: str) -> str: + # wrong driver name or disabled in config driver + try: + drv = self.drivers[driver] + except KeyError: + return 'Unavailable driver' + + assert not drv.abstract + + return drv.get_prop(driver, prop) + + def get_implementations(self, driver: str) -> List[str]: + return [impl.name for impl in self.drivers[driver].implementations] + + +class Machine: + """A short QEMU machine type description. It contains only processed + compat_props (properties of abstract classes are applied to its + implementations) + """ + # raw_mt_dict - dict produced by `query-machines` + def __init__(self, raw_mt_dict: Dict[str, Any], + qemu_drivers: VMPropertyGetter) -> None: + self.name = raw_mt_dict['name'] + self.compat_props: Dict[str, Any] = {} + # properties are applied sequentially and can rewrite values like in + # QEMU. Also it has to resolve class relationships to apply appropriate + # values from abstract class to all implementations + for prop in raw_mt_dict['compat-props']: + driver = prop['qom-type'] + try: + # implementation adds only itself, abstract class adds + # lementation (abstract classes are uninterestiong) + impls = qemu_drivers.get_implementations(driver) + for impl in impls: + if impl not in self.compat_props: + self.compat_props[impl] = {} + self.compat_props[impl][prop['property']] = prop['value'] + except KeyError: + # QEMU doesn't know this driver thus it has to be saved + if driver not in self.compat_props: + self.compat_props[driver] = {} + self.compat_props[driver][prop['property']] = prop['value'] + + +class Configuration(): + """Class contains all necessary components to generate table and is used + to compare different binaries""" + def __init__(self, vm: QEMUMachine, + req_mt: List[str], all_mt: bool) -> None: + self._vm = vm + self._binary = vm.binary + self._qemu_args = args.qemu_args.split(' ') + + self._qemu_drivers = VMPropertyGetter(vm) + self.req_mt = get_req_mt(self._qemu_drivers, vm, req_mt, all_mt) + + def get_implementations(self, driver_name: str) -> List[str]: + return self._qemu_drivers.get_implementations(driver_name) + + def get_table(self, req_props: List[Tuple[str, str]]) -> pd.DataFrame: + table: List[pd.DataFrame] = [] + for mt in self.req_mt: + name = f'{self._binary}\n{mt.name}' + column = [] + for driver, prop in req_props: + try: + # values from QEMU machine type definitions + column.append(mt.compat_props[driver][prop]) + except KeyError: + # values from QEMU type definitions + column.append(self._qemu_drivers.get_prop(driver, prop)) + table.append(pd.DataFrame({name: column})) + + return pd.concat(table, axis=1) + + +script_desc = """Script to compare machine types (their compat_props). + +Examples: +* save info about all machines: ./scripts/compare-machine-types.py --all \ +--format csv --raw > table.csv +* compare machines: ./scripts/compare-machine-types.py --mt pc-q35-2.12 \ +pc-q35-3.0 +* compare binaries and machines: ./scripts/compare-machine-types.py \ +--mt pc-q35-6.2 pc-q35-7.0 --qemu-binary build/qemu-system-x86_64 \ +build/qemu-exp + ╒════════════╤══════════════════════════╤════════════════════════════\ +╤════════════════════════════╤══════════════════╤══════════════════╕ + │ Driver │ Property │ build/qemu-system-x86_64 \ +│ build/qemu-system-x86_64 │ build/qemu-exp │ build/qemu-exp │ + │ │ │ pc-q35-6.2 \ +│ pc-q35-7.0 │ pc-q35-6.2 │ pc-q35-7.0 │ + ╞════════════╪══════════════════════════╪════════════════════════════\ +╪════════════════════════════╪══════════════════╪══════════════════╡ + │ PIIX4_PM │ x-not-migrate-acpi-index │ True \ +│ False │ False │ False │ + ├────────────┼──────────────────────────┼────────────────────────────\ +┼────────────────────────────┼──────────────────┼──────────────────┤ + │ virtio-mem │ unplugged-inaccessible │ False \ +│ auto │ False │ auto │ + ╘════════════╧══════════════════════════╧════════════════════════════\ +╧════════════════════════════╧══════════════════╧══════════════════╛ + +If a property from QEMU machine defintion applies to an abstract class (e.g. \ +x86_64-cpu) this script will compare all implementations of this class. + +"Unavailable method" - means that this script doesn't know how to get \ +default values of the driver. To add method use the construction described \ +at the top of the script. +"Unavailable driver" - means that this script doesn't know this driver. \ +For instance, this can happen if you configure QEMU without this device or \ +if machine type definition has error. +"No default value" - means that the appropriate method can't get the default \ +value and most likely that this property doesn't have it. +"Unknown property" - means that the appropriate method can't find property \ +with this name.""" + + +def parse_args() -> Namespace: + parser = ArgumentParser(formatter_class=RawTextHelpFormatter, + description=script_desc) + parser.add_argument('--format', choices=['human-readable', 'json', 'csv'], + default='human-readable', + help='returns table in json format') + parser.add_argument('--raw', action='store_true', + help='prints ALL defined properties without value ' + 'transformation. By default, only rows ' + 'with different values will be printed and ' + 'values will be transformed(e.g. "on" -> True)') + parser.add_argument('--qemu-args', default=default_qemu_args, + help='command line to start qemu. ' + f'Default: "{default_qemu_args}"') + parser.add_argument('--qemu-binary', nargs="*", type=str, + default=[default_qemu_binary], + help='list of qemu binaries that will be compared. ' + f'Deafult: {default_qemu_binary}') + + mt_args_group = parser.add_mutually_exclusive_group() + mt_args_group.add_argument('--all', action='store_true', + help='prints all available machine types (list ' + 'of machine types will be ignored)') + mt_args_group.add_argument('--mt', nargs="*", type=str, + help='list of Machine Types ' + 'that will be compared') + + return parser.parse_args() + + +def mt_comp(mt: Machine) -> Tuple[str, int, int, int]: + """Function to compare and sort machine by names. + It returns socket_name, major version, minor version, revision""" + # none, microvm, x-remote and etc. + if '-' not in mt.name or '.' not in mt.name: + return mt.name, 0, 0, 0 + + socket, ver = mt.name.rsplit('-', 1) + ver_list = list(map(int, ver.split('.', 2))) + ver_list += [0] * (3 - len(ver_list)) + return socket, ver_list[0], ver_list[1], ver_list[2] + + +def get_mt_definitions(qemu_drivers: VMPropertyGetter, + vm: QEMUMachine) -> List[Machine]: + """Constructs list of machine definitions (primarily compat_props) via + info from QEMU""" + raw_mt_defs = vm.cmd('query-machines', compat_props=True) + mt_defs = [] + for raw_mt in raw_mt_defs: + mt_defs.append(Machine(raw_mt, qemu_drivers)) + + mt_defs.sort(key=mt_comp) + return mt_defs + + +def get_req_mt(qemu_drivers: VMPropertyGetter, vm: QEMUMachine, + req_mt: Optional[List[str]], all_mt: bool) -> List[Machine]: + """Returns list of requested by user machines""" + mt_defs = get_mt_definitions(qemu_drivers, vm) + if all_mt: + return mt_defs + + if req_mt is None: + print('Enter machine types for comparision') + exit(0) + + matched_mt = [] + for mt in mt_defs: + if mt.name in req_mt: + matched_mt.append(mt) + + return matched_mt + + +def get_affected_props(configs: List[Configuration]) -> Generator[Tuple[str, + str], + None, None]: + """Helps to go through all affected in machine definitions drivers + and properties""" + driver_props: Dict[str, Set[Any]] = {} + for config in configs: + for mt in config.req_mt: + compat_props = mt.compat_props + for driver, prop in compat_props.items(): + if driver not in driver_props: + driver_props[driver] = set() + driver_props[driver].update(prop.keys()) + + for driver, props in sorted(driver_props.items()): + for prop in sorted(props): + yield driver, prop + + +def transform_value(value: str) -> Union[str, bool]: + true_list = ['true', 'on'] + false_list = ['false', 'off'] + + out = value.lower() + + if out in true_list: + return True + + if out in false_list: + return False + + return value + + +def simplify_table(table: pd.DataFrame) -> pd.DataFrame: + """transforms values to make it easier to compare it and drops rows + with the same values for all columns""" + + table = table.map(transform_value) + + return table[~table.iloc[:, 3:].eq(table.iloc[:, 2], axis=0).all(axis=1)] + + +# constructs table in the format: +# +# Driver | Property | binary1 | binary1 | ... +# | | machine1 | machine2 | ... +# ------------------------------------------------------ ... +# driver1 | property1 | value1 | value2 | ... +# driver1 | property2 | value3 | value4 | ... +# driver2 | property3 | value5 | value6 | ... +# ... | ... | ... | ... | ... +# +def fill_prop_table(configs: List[Configuration], + is_raw: bool) -> pd.DataFrame: + req_props = list(get_affected_props(configs)) + if not req_props: + print('No drivers to compare. Check machine names') + exit(0) + + driver_col, prop_col = tuple(zip(*req_props)) + table = [pd.DataFrame({'Driver': driver_col}), + pd.DataFrame({'Property': prop_col})] + + table.extend([config.get_table(req_props) for config in configs]) + + df_table = pd.concat(table, axis=1) + + if is_raw: + return df_table + + return simplify_table(df_table) + + +def print_table(table: pd.DataFrame, table_format: str) -> None: + if table_format == 'json': + print(comp_table.to_json()) + elif table_format == 'csv': + print(comp_table.to_csv()) + else: + print(comp_table.to_markdown(index=False, stralign='center', + colalign=('center',), headers='keys', + tablefmt='fancy_grid', + disable_numparse=True)) + + +if __name__ == '__main__': + args = parse_args() + with ExitStack() as stack: + vms = [stack.enter_context(QEMUMachine(binary=binary, qmp_timer=15, + args=args.qemu_args.split(' '))) for binary in args.qemu_binary] + + configurations = [] + for vm in vms: + vm.launch() + configurations.append(Configuration(vm, args.mt, args.all)) + + comp_table = fill_prop_table(configurations, args.raw) + if not comp_table.empty: + print_table(comp_table, args.format) From patchwork Thu Apr 25 11:01:38 2024 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: 792037 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320830wrq; Thu, 25 Apr 2024 04:05:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8sLHozX+uAJ1P6fdBxp1EMkcg78d1vjZmsXoDxUV1odypN65OMxhoKJwGO2vhg7qkuJX6H+KZ2NzrhMAQ49VZ X-Google-Smtp-Source: AGHT+IHvGnjrfKDZiMV8ZQ4dvu4eJS/INkG1D0oYvRQhxJab6CLOWGiLTCam8nm1ONLE8dmhNjzC X-Received: by 2002:a9d:748f:0:b0:6eb:dfa1:a467 with SMTP id t15-20020a9d748f000000b006ebdfa1a467mr5894664otk.14.1714043152091; Thu, 25 Apr 2024 04:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043152; cv=none; d=google.com; s=arc-20160816; b=mS/kkNRHv5VjW4yn41h41tGoxqXP9aarRTiVsvUrQVKRfcuV7idZaIakzHnmRobgyS fO0ky64EEVSorUaivWi3cqDMHGJbB/gekJgRYOsz8J/MvY0pYhDahJBnPkUUym9cRk4W uFnqG5bavsYWH6/LCpnVdBFQE5f2AU9oDsVJyvZBlP9ULARxlo9KJVHc3AdhtHA2kkBd S0JgYKJkPYPfQGs5oDuvc3e7lj0VAK9i7cwcQEXLMiZShD4wDJpvt6O5MMZbWNXO3zfy phl5DcqXMsxv7j8byf+2s+JPm7QaDE0BXvYh09rzVXfJLULy5rCORkrYjOLaeFFCFLcf rhxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=b/DaGtvlqhC1nG0WRRs696RzTAGLW5V48G1JnVnt1qc=; fh=7a4wUqB/0Mozj0gkKgFFcC93j07dtjMKh0IG2Vg/uGY=; b=LqB2KNJ7UAZbYdOOl/OAGGw1w/79cs5bvWuguU+J9S/GrtmaWxIQ2eqpHtYPmC9L4y Me9GkYFZ3/s6R5tmCa7fovU/CsiwqtDqmZPfTn7pWu0plyLvA+nUFV/VN1/LM/Fwax5P qYSnaGrbrjfYkNwocl/N/9Chpodo05WqS0urGWxaTlCbRS5D0Do99gxzJFpHViFZITHn aByx09gFHtTd5arGALlh9GahuMs7cLzbQTL1M503Ub2r9GXaNBcM5qN2eowdgF2emQvd Cd3uooKFTDIhduU73lREop29uqTfONEd2vS81Q16LAR2AnOWjROE+pUCVB2xXhgqXsv+ izJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qDsNuyso; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j2-20020a056102000200b0047bd34fa51bsi2141568vsp.374.2024.04.25.04.05.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:05:52 -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=qDsNuyso; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwtl-0000OP-0z; Thu, 25 Apr 2024 07:04:17 -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 1rzws6-0007s4-0m for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:41 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzws3-0008Eq-Lu for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:33 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-418e4cd2196so6836675e9.1 for ; Thu, 25 Apr 2024 04:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042949; x=1714647749; 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=b/DaGtvlqhC1nG0WRRs696RzTAGLW5V48G1JnVnt1qc=; b=qDsNuyso8EAIa1u2Bmlv2bVFIvJwqUkA0b3keiTrsJYp1M+wmLxVEFk0eOi/c1I49x y/j9Spnv5W2cFVH3W/JMtNSXSnEB1t/WoFawPUsR/0y2OOBq+RLT+GxcvViAsDjt3ZCE MuT0xhwNUf+21c3gtc6B/m828+TBcBxCqWWxofoo5VL0DF2ohZgi9rEUzO1B+5YIIhcW Y2KEY0/LurwxZBmWySOpgPeLd/XSp1VvFUC/K+qwWOW3UpKD6W/fp4Dd+zIdZIHuLiQM IRg5or8377kSgoLSe99VZs+blbioxdAaRbATG8a9H86sUvWnU6Now7aMW7hDHGtw8NXW +Iaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042949; x=1714647749; 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=b/DaGtvlqhC1nG0WRRs696RzTAGLW5V48G1JnVnt1qc=; b=glc7XtRsSr55+y78ozAFU/VD9MPF2x291IOMrtJWxVJJIPqGarL5E+wuaDB6htqTph ooAPyNqvp5QTdHDhDCOwDbhmuJNUxF0qWcq5nIiE4Kfmw5lSyr2kNEZsyeBmYhuYFiu0 shINHH/0MaPZ0+vD05pGX4rkEryQVxciSjDrnsaFiQOCq37Ox3Y9S0coqNAoZAukZ4ZY 8PwODP4f03gc+1I3ZfSSyUlynguGyuWqsucICGYkdV9cno5mvivYcXV1Y0ALpoRr8XEd AmuTKz4uVRytbZzh+HbmR0D4chgl4JSelhx2NmA8owMvIbp36oPQKfUq/PQfkqFmpcS0 7S8w== X-Gm-Message-State: AOJu0YxGks1jJ+u1ptcpibQIcTIrmWzsYLK6xI2tcpFKobj1nFfZ/Uaa KhCc1WIy355z5n/hokenhIDEqUzCiN8yyVB2GbRHJb5raOjvaAChPMozqV9J3DKyIaHsP7v9xDz r X-Received: by 2002:a05:600c:4f03:b0:418:ed13:315e with SMTP id l3-20020a05600c4f0300b00418ed13315emr3752068wmq.2.1714042949561; Thu, 25 Apr 2024 04:02:29 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id f17-20020a05600c155100b00418db9e4228sm27280045wmg.29.2024.04.25.04.02.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Richard Henderson , Paolo Bonzini Subject: [PULL 05/22] hw/core: Remove check on NEED_CPU_H in tcg-cpu-ops.h Date: Thu, 25 Apr 2024 13:01:38 +0200 Message-ID: <20240425110157.20328-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=unavailable 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 Commit fd3f7d24d4 ("include/hw/core: Remove i386 conditional on fake_user_interrupt") remove the need to check on NEED_CPU_H. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240321154838.95771-3-philmd@linaro.org> --- include/hw/core/tcg-cpu-ops.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index bf8ff8e3ee..dc1f16a977 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -49,7 +49,6 @@ struct TCGCPUOps { /** @debug_excp_handler: Callback for handling debug exceptions */ void (*debug_excp_handler)(CPUState *cpu); -#ifdef NEED_CPU_H #ifdef CONFIG_USER_ONLY /** * @fake_user_interrupt: Callback for 'fake exception' handling. @@ -174,8 +173,6 @@ struct TCGCPUOps { */ bool (*need_replay_interrupt)(int interrupt_request); #endif /* !CONFIG_USER_ONLY */ -#endif /* NEED_CPU_H */ - }; #if defined(CONFIG_USER_ONLY) From patchwork Thu Apr 25 11:01:39 2024 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: 792031 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320071wrq; Thu, 25 Apr 2024 04:04:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXRdFpw7V1dDlcJziA0fOQg6Aq/GCA2KH8On1LS0nR4mIG59pqCG+uSzYk1lIi5RnYswyvUhW+2d87gjk10KLO9 X-Google-Smtp-Source: AGHT+IHuWTD06/aEcw/3eMw5ZlLeTzmLOUNgtVvIFSYLBNCx/AvxfOE5vTOFuDhVJm8xwEYcSteF X-Received: by 2002:a05:6358:7a4:b0:186:3c3:b415 with SMTP id n36-20020a05635807a400b0018603c3b415mr7383930rwj.20.1714043064420; Thu, 25 Apr 2024 04:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043064; cv=none; d=google.com; s=arc-20160816; b=ZdA/dEZfS9ZxoQIGgdr7xCAsUH3k0Y+VRj/8Q3rvNor9gMd3JZZ5sfnSZsvfVwM0xm z5j2p4K+M4ByxNQMF2ngxucMXR4+qjP/zfV8LhPvteTsuhSIlFkO+CLry8Y/uMt1qD/s E79vI9cxJSF3A9Hi+v9xQ1fwUKK/p7zAqw8qQd/e3sfOXHGzD4e6cym8NqQFiuP4s4sP WWCYhWiMMDt7GtbNxRPHJEqaYfiGDgXq71dlu42BW/sqjEXtAzdTlrEtYQ72JX/nlVtN KcURCPGOlN4mjfcT01hP2Gj5K+vD1vRJJusChidVDqbKoHGCuq5qGex4RJWGRWPdJeAf Mrag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=wFyOmcP9zazcZyBZQtyOmZdkDwwfij0kGGeaUavMPCY=; fh=emOP28a3iQKKj2abCjgxN2P2AcP1HjXRruYA/DLuow0=; b=iygg9boCB9FA8NBIpHXS7nroEC5zzPTB82sV5FpUr9Of2XR2erjM+aa6+T6TryA4u0 gMZY4E76XB46su3KlQBrUhgmTaCxy6WcAPb+AU5mhHVXq5jwe1LKYI4FG71cBTqKh4nB i3oSAH8G2SG1yyxlqGjTjuBchP4dXv2425GKkn7hYyt3oYA4EbLYzaSxSZbIS/iJG6LF 9LCnFyEvoUkB+7WNBWux+gbzUJ38/mr96o8kdN2fDOKIA2BK0soiJ4aRyks90VQDMq1M xobHz4zxxaujIHrkj7yF+bTNsWFG4ehPrFg/JQswCzyIci55/7EBDKqgPkxxRVKKwtML kPcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JM3p7lNo; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id cz38-20020a05613011a600b007e12de68a4esi2842692uab.35.2024.04.25.04.04.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:04:24 -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=JM3p7lNo; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwsU-0008Cq-9B; Thu, 25 Apr 2024 07:02:58 -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 1rzwsH-00085l-VR for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:47 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsD-0008GT-Ov for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:44 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-34a00533d08so477939f8f.3 for ; Thu, 25 Apr 2024 04:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042955; x=1714647755; 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=wFyOmcP9zazcZyBZQtyOmZdkDwwfij0kGGeaUavMPCY=; b=JM3p7lNoymgGwo9QJIAXFDLyYvg1zWCIQUh5HhR0sAs3LWhlzep73kVohA7FD0s2vC 8lo0fdYq0Zz+1H9Q9PiMaouFeqw02Ia4CjrsrkcuwQdlHKiJ42h6+iVg+yKtoS4E2IyW 0kOdUmeXjsAJLAZq0PKTp7gCP7clcREo4RB50sLth7LOLeJVZs77JNtkGmTVSPm0tR1+ upfmRvEBXwK70BG6hZn0RcUhbYiCEolR3bqwdfjOylExtwTmewNlYGh8cTBh5FSg91NQ HxvAgOmmDie/fyqa/aghpkkbQBdEXQNjjIAFo205DGRVyUZ6vu2grWDXaifh/jHNuPDS +m2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042955; x=1714647755; 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=wFyOmcP9zazcZyBZQtyOmZdkDwwfij0kGGeaUavMPCY=; b=Prb6W3cN8QZ/Z4k6wNl9EL2a2w5BaAxE4xQzFDhf15lwvxq3TgEL6nPZwtH+9yUnaW ZarigvqMrdDjh2G5jK1lIg0rHPT0oLXN411C+jA2b7j5kGNtIOdqJlvtdD6lE73eKZ0c EH1gN0jc8p1g6gJPKuiOfOdqBM+47ZhzCBVtfqvf7r1QI+cnG0WKGgA4yk6sBYtnKRdb yRe1oguFL3lS5ZTM/Akb1t22fyUnfoTRNrI/vjIcL1RweXar7Px2Op+2b7ODBKF6ytAL esu7fUYrGiFG8PtIeCzJAy9MP2/pQU0I8M+9r7Z/bbf2VrgrUmMeqqGmAEvY9CTDTiXd Hvbw== X-Gm-Message-State: AOJu0YyUiD4slfzsPafcn++/esVHwfcLxJbL6rj9VrlRBKqMzkszW9Ox v+QK7I9jIteWNDRswOAfzowdFuMb0tlO7ESt8PztV0Av9+v3Q+uLJROYxyjLCOW43d1kHhTWxDq L X-Received: by 2002:a5d:6709:0:b0:341:d3b0:ae7d with SMTP id o9-20020a5d6709000000b00341d3b0ae7dmr4204754wru.45.1714042955056; Thu, 25 Apr 2024 04:02:35 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id m18-20020adff392000000b00345920fcb45sm19699321wro.13.2024.04.25.04.02.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Richard Henderson , Zhao Liu , Paolo Bonzini Subject: [PULL 06/22] target/i386: Move APIC related code to cpu-apic.c Date: Thu, 25 Apr 2024 13:01:39 +0200 Message-ID: <20240425110157.20328-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com 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 Move APIC related code split in cpu-sysemu.c and monitor.c to cpu-apic.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <20240321154838.95771-4-philmd@linaro.org> --- target/i386/cpu-apic.c | 112 +++++++++++++++++++++++++++++++++++++++ target/i386/cpu-sysemu.c | 77 --------------------------- target/i386/monitor.c | 25 --------- target/i386/meson.build | 1 + 4 files changed, 113 insertions(+), 102 deletions(-) create mode 100644 target/i386/cpu-apic.c diff --git a/target/i386/cpu-apic.c b/target/i386/cpu-apic.c new file mode 100644 index 0000000000..d397ec94dc --- /dev/null +++ b/target/i386/cpu-apic.c @@ -0,0 +1,112 @@ +/* + * QEMU x86 CPU <-> APIC + * + * Copyright (c) 2003-2004 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "qapi/qmp/qdict.h" +#include "qapi/error.h" +#include "monitor/monitor.h" +#include "monitor/hmp-target.h" +#include "sysemu/hw_accel.h" +#include "sysemu/kvm.h" +#include "sysemu/xen.h" +#include "exec/address-spaces.h" +#include "hw/qdev-properties.h" +#include "hw/i386/apic_internal.h" +#include "cpu-internal.h" + +APICCommonClass *apic_get_class(Error **errp) +{ + const char *apic_type = "apic"; + + /* TODO: in-kernel irqchip for hvf */ + if (kvm_enabled()) { + if (!kvm_irqchip_in_kernel()) { + error_setg(errp, "KVM does not support userspace APIC"); + return NULL; + } + apic_type = "kvm-apic"; + } else if (xen_enabled()) { + apic_type = "xen-apic"; + } else if (whpx_apic_in_platform()) { + apic_type = "whpx-apic"; + } + + return APIC_COMMON_CLASS(object_class_by_name(apic_type)); +} + +void x86_cpu_apic_create(X86CPU *cpu, Error **errp) +{ + APICCommonState *apic; + APICCommonClass *apic_class = apic_get_class(errp); + + if (!apic_class) { + return; + } + + cpu->apic_state = DEVICE(object_new_with_class(OBJECT_CLASS(apic_class))); + object_property_add_child(OBJECT(cpu), "lapic", + OBJECT(cpu->apic_state)); + object_unref(OBJECT(cpu->apic_state)); + + /* TODO: convert to link<> */ + apic = APIC_COMMON(cpu->apic_state); + apic->cpu = cpu; + apic->apicbase = APIC_DEFAULT_ADDRESS | MSR_IA32_APICBASE_ENABLE; + + /* + * apic_common_set_id needs to check if the CPU has x2APIC + * feature in case APIC ID >= 255, so we need to set apic->cpu + * before setting APIC ID + */ + qdev_prop_set_uint32(cpu->apic_state, "id", cpu->apic_id); +} + +void x86_cpu_apic_realize(X86CPU *cpu, Error **errp) +{ + APICCommonState *apic; + static bool apic_mmio_map_once; + + if (cpu->apic_state == NULL) { + return; + } + qdev_realize(DEVICE(cpu->apic_state), NULL, errp); + + /* Map APIC MMIO area */ + apic = APIC_COMMON(cpu->apic_state); + if (!apic_mmio_map_once) { + memory_region_add_subregion_overlap(get_system_memory(), + apic->apicbase & + MSR_IA32_APICBASE_BASE, + &apic->io_memory, + 0x1000); + apic_mmio_map_once = true; + } +} + +void hmp_info_local_apic(Monitor *mon, const QDict *qdict) +{ + CPUState *cs; + + if (qdict_haskey(qdict, "apic-id")) { + int id = qdict_get_try_int(qdict, "apic-id", 0); + + cs = cpu_by_arch_id(id); + if (cs) { + cpu_synchronize_state(cs); + } + } else { + cs = mon_get_cpu(mon); + } + + + if (!cs) { + monitor_printf(mon, "No CPU available\n"); + return; + } + x86_cpu_dump_local_apic_state(cs, CPU_DUMP_FPU); +} diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c index 3f9093d285..227ac021f6 100644 --- a/target/i386/cpu-sysemu.c +++ b/target/i386/cpu-sysemu.c @@ -19,19 +19,12 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "sysemu/kvm.h" -#include "sysemu/xen.h" -#include "sysemu/whpx.h" #include "qapi/error.h" #include "qapi/qapi-visit-run-state.h" #include "qapi/qmp/qdict.h" #include "qapi/qobject-input-visitor.h" #include "qom/qom-qobject.h" #include "qapi/qapi-commands-machine-target.h" -#include "hw/qdev-properties.h" - -#include "exec/address-spaces.h" -#include "hw/i386/apic_internal.h" #include "cpu-internal.h" @@ -273,75 +266,6 @@ void x86_cpu_machine_reset_cb(void *opaque) cpu_reset(CPU(cpu)); } -APICCommonClass *apic_get_class(Error **errp) -{ - const char *apic_type = "apic"; - - /* TODO: in-kernel irqchip for hvf */ - if (kvm_enabled()) { - if (!kvm_irqchip_in_kernel()) { - error_setg(errp, "KVM does not support userspace APIC"); - return NULL; - } - apic_type = "kvm-apic"; - } else if (xen_enabled()) { - apic_type = "xen-apic"; - } else if (whpx_apic_in_platform()) { - apic_type = "whpx-apic"; - } - - return APIC_COMMON_CLASS(object_class_by_name(apic_type)); -} - -void x86_cpu_apic_create(X86CPU *cpu, Error **errp) -{ - APICCommonState *apic; - APICCommonClass *apic_class = apic_get_class(errp); - - if (!apic_class) { - return; - } - - cpu->apic_state = DEVICE(object_new_with_class(OBJECT_CLASS(apic_class))); - object_property_add_child(OBJECT(cpu), "lapic", - OBJECT(cpu->apic_state)); - object_unref(OBJECT(cpu->apic_state)); - - /* TODO: convert to link<> */ - apic = APIC_COMMON(cpu->apic_state); - apic->cpu = cpu; - apic->apicbase = APIC_DEFAULT_ADDRESS | MSR_IA32_APICBASE_ENABLE; - - /* - * apic_common_set_id needs to check if the CPU has x2APIC - * feature in case APIC ID >= 255, so we need to set apic->cpu - * before setting APIC ID - */ - qdev_prop_set_uint32(cpu->apic_state, "id", cpu->apic_id); -} - -void x86_cpu_apic_realize(X86CPU *cpu, Error **errp) -{ - APICCommonState *apic; - static bool apic_mmio_map_once; - - if (cpu->apic_state == NULL) { - return; - } - qdev_realize(DEVICE(cpu->apic_state), NULL, errp); - - /* Map APIC MMIO area */ - apic = APIC_COMMON(cpu->apic_state); - if (!apic_mmio_map_once) { - memory_region_add_subregion_overlap(get_system_memory(), - apic->apicbase & - MSR_IA32_APICBASE_BASE, - &apic->io_memory, - 0x1000); - apic_mmio_map_once = true; - } -} - GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); @@ -385,4 +309,3 @@ void x86_cpu_get_crash_info_qom(Object *obj, Visitor *v, errp); qapi_free_GuestPanicInformation(panic_info); } - diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 3a281dab02..2d766b2637 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -28,8 +28,6 @@ #include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "qapi/qmp/qdict.h" -#include "sysemu/hw_accel.h" -#include "sysemu/kvm.h" #include "qapi/error.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qapi-commands-misc.h" @@ -647,26 +645,3 @@ const MonitorDef *target_monitor_defs(void) { return monitor_defs; } - -void hmp_info_local_apic(Monitor *mon, const QDict *qdict) -{ - CPUState *cs; - - if (qdict_haskey(qdict, "apic-id")) { - int id = qdict_get_try_int(qdict, "apic-id", 0); - - cs = cpu_by_arch_id(id); - if (cs) { - cpu_synchronize_state(cs); - } - } else { - cs = mon_get_cpu(mon); - } - - - if (!cs) { - monitor_printf(mon, "No CPU available\n"); - return; - } - x86_cpu_dump_local_apic_state(cs, CPU_DUMP_FPU); -} diff --git a/target/i386/meson.build b/target/i386/meson.build index 8abce725f8..075117989b 100644 --- a/target/i386/meson.build +++ b/target/i386/meson.build @@ -18,6 +18,7 @@ i386_system_ss.add(files( 'arch_memory_mapping.c', 'machine.c', 'monitor.c', + 'cpu-apic.c', 'cpu-sysemu.c', )) i386_system_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'), if_false: files('sev-sysemu-stub.c')) From patchwork Thu Apr 25 11:01:40 2024 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: 792042 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1322082wrq; Thu, 25 Apr 2024 04:08:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW5ENRMTHk4J3lq/dbtwrLPzntWZ78seHC75QArfcS5Z9COF731ApF6jKYB/dOZBEW54t/UTmnGzxQN3qpB2iKb X-Google-Smtp-Source: AGHT+IH5WDkfY1P3MDmql14Au/GT8clYrAyhos8YaOTavTJwW/QvvYXmf8oKLzHH3yMSQ55A8bLH X-Received: by 2002:a05:6214:12d:b0:6a0:934d:1d7e with SMTP id w13-20020a056214012d00b006a0934d1d7emr5098891qvs.1.1714043313455; Thu, 25 Apr 2024 04:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043313; cv=none; d=google.com; s=arc-20160816; b=DFdqoKs8F//gbCfc2lYzzU8uvwfIUOYh9zbIrm2o2v/3K/Kfkv0wj0Vwa8M8HIbo/E ag1Rh7Yp+/yRL71YdwEq2hZxiB6tWROkEp+1ThFzFIyy0egPDVoTfwCu90TopWjoBRis w2cYvp4HBGCxJNAiIGwtoDaTBY/6OGAzcF5N+LOVBHrhIiteW7FABBYReDkNXhf0uXm/ 3Gw4aSTffmkT31SXqztDD/1oPpz53SVpbU4ITXBw4+/BFoBzW6mSXDsNf7Chxnn/gtLw JmdKEgZsINxVH/uN2bJkzuX7J0fc+LXbGyzrROXh+U95NEY6XnnhEgo6YO18Yh/L5hFx gY1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=lYhjl1/jGiesNQD68pOCk3VBrraJnT7fa7wrXc4FOT0=; fh=Y26SNCcx7mV3+DQ4GiURg25QCLf4EDTrA1pj2iVRPwA=; b=l35JXtC92dM/9IlK5ALrW8SpLeIHK14hnmrRWemY2ijuce59MvHpGk9m0sSg62jj5y r4GcJ4U1v0fJDoFoznGsXHwONAMXRTo/GJ6ftJdiCmysXPIN4gLRzjjTUFR2omiuXwga K6dmQv6PQIfOI1Uoni7XgfwdMSnp6I+jT1croMki1W1Tr8KXy1sMdykDvk9hb+EIqNpu v2B+eJW7ZcFrkPFoL+/+G2mLOlTkhocrlHjE6WrMzFVi7v3oyQRByREOFtAzL0Iq1Kx9 fim6yusiOxaDGf3vO/5XlpsXEGTpkfwXe/SzU2FdfH/FqLLjc6ISJUNpf0HF/ZlaJtdf Wtrg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sS9SNaY2; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id hf1-20020a0562140e8100b00695d4a4fbfasi17434266qvb.53.2024.04.25.04.08.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:08: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=sS9SNaY2; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwto-0000mc-AB; Thu, 25 Apr 2024 07:04:20 -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 1rzwsH-00085j-VR for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:47 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsF-0008IR-Lx for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:44 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-347c197a464so622174f8f.2 for ; Thu, 25 Apr 2024 04:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042960; x=1714647760; 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=lYhjl1/jGiesNQD68pOCk3VBrraJnT7fa7wrXc4FOT0=; b=sS9SNaY2m91SB2OuGxhRGe3Zi640dzqYr+7FM0qXPCca7ZjDwL/7jLEsJbRCeN/MHm zN1X0yKopOlZPSXZfLa3wjPoTrNBk8SINFYZR/C+049d1tuYW2c5L/Z0ui3IzYdHEbCm /hGKBzdn4K+uv4/MTZmHgpTgouyIjQAPlGqBs9O3RxD+gWzDjxjtPcu5D6Z2TY448kok 03cz9qZGWePMuofu9qcMXjLqfWrk9NMXwUz9movYjDmH9UMh8GuXIE2hefebeWK66uU5 hz7r/e/mwMwK/3nsJn/wKPm7RR9wIF+FSudPsR3mApq9xr3ehinTIGtLyNoPY+loV+th 7tww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042960; x=1714647760; 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=lYhjl1/jGiesNQD68pOCk3VBrraJnT7fa7wrXc4FOT0=; b=HCwH0z+oJkeau3d32PtsS498LrzpTPZaUSJM17Q+Hul9/Wbd8LKd6B48glQs+Uu6h0 mGvHMbJm/exttrKeQUJJAXv4Kd45HQSr05mQmQscw6U50M9WYYMqfmF82NsK6IHhK5C+ 4/BFbim4oS+OT9VII5nBc/4OjcbX9p9fH0pQsL1q4Baw7xPfZH8A0Pb+1MznyXYPlBjN B3C1721xS9telADV/bE6OkkHPseVevYBat1Yak1ECfNBmC0XSTBHQz2RllzPn5ljwmAm sfudfklqfGxbjy3fMIweN7LRfPw0sklo8mdoauy8My8WkCNqVfCjaei/Wnbp2bDXKdr3 1nXw== X-Gm-Message-State: AOJu0YwfWueNHvrTL7ezpyG+HxKeKLyvolUjR9bMiZAo8/im+ThOXES1 QkAwcsjSHO5CKoUer3jkhzm8ciIB6NLfqfL0nD/dp8OWBSbWHXN53NTpGSNWgUurP+0OpI3qgUm P X-Received: by 2002:a05:6000:47:b0:33d:b376:8a07 with SMTP id k7-20020a056000004700b0033db3768a07mr3496522wrx.8.1714042960487; Thu, 25 Apr 2024 04:02:40 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id y18-20020a5d4ad2000000b0034a0d3c0715sm19281014wrs.50.2024.04.25.04.02.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Peter Maydell Subject: [PULL 07/22] hw/misc/applesmc: Simplify DeviceReset handler Date: Thu, 25 Apr 2024 13:01:40 +0200 Message-ID: <20240425110157.20328-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com 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 Have applesmc_find_key() return a const pointer. Since the returned buffers are not modified in applesmc_io_data_write(), it is pointless to delete and re-add the keys in the DeviceReset handler. Add them once in DeviceRealize, and discard them in the DeviceUnrealize handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-Id: <20240410180819.92332-1-philmd@linaro.org> --- hw/misc/applesmc.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 14e3ef667d..59a4899312 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -145,7 +145,7 @@ static void applesmc_io_cmd_write(void *opaque, hwaddr addr, uint64_t val, s->data_pos = 0; } -static struct AppleSMCData *applesmc_find_key(AppleSMCState *s) +static const struct AppleSMCData *applesmc_find_key(AppleSMCState *s) { struct AppleSMCData *d; @@ -161,7 +161,7 @@ static void applesmc_io_data_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { AppleSMCState *s = opaque; - struct AppleSMCData *d; + const struct AppleSMCData *d; smc_debug("DATA received: 0x%02x\n", (uint8_t)val); switch (s->cmd) { @@ -269,23 +269,10 @@ static void applesmc_add_key(AppleSMCState *s, const char *key, static void qdev_applesmc_isa_reset(DeviceState *dev) { AppleSMCState *s = APPLE_SMC(dev); - struct AppleSMCData *d, *next; - /* Remove existing entries */ - QLIST_FOREACH_SAFE(d, &s->data_def, node, next) { - QLIST_REMOVE(d, node); - g_free(d); - } s->status = 0x00; s->status_1e = 0x00; s->last_ret = 0x00; - - applesmc_add_key(s, "REV ", 6, "\x01\x13\x0f\x00\x00\x03"); - applesmc_add_key(s, "OSK0", 32, s->osk); - applesmc_add_key(s, "OSK1", 32, s->osk + 32); - applesmc_add_key(s, "NATJ", 1, "\0"); - applesmc_add_key(s, "MSSP", 1, "\0"); - applesmc_add_key(s, "MSSD", 1, "\0x3"); } static const MemoryRegionOps applesmc_data_io_ops = { @@ -343,6 +330,24 @@ static void applesmc_isa_realize(DeviceState *dev, Error **errp) } QLIST_INIT(&s->data_def); + applesmc_add_key(s, "REV ", 6, "\x01\x13\x0f\x00\x00\x03"); + applesmc_add_key(s, "OSK0", 32, s->osk); + applesmc_add_key(s, "OSK1", 32, s->osk + 32); + applesmc_add_key(s, "NATJ", 1, "\0"); + applesmc_add_key(s, "MSSP", 1, "\0"); + applesmc_add_key(s, "MSSD", 1, "\0x3"); +} + +static void applesmc_unrealize(DeviceState *dev) +{ + AppleSMCState *s = APPLE_SMC(dev); + struct AppleSMCData *d, *next; + + /* Remove existing entries */ + QLIST_FOREACH_SAFE(d, &s->data_def, node, next) { + QLIST_REMOVE(d, node); + g_free(d); + } } static Property applesmc_isa_properties[] = { @@ -377,6 +382,7 @@ static void qdev_applesmc_class_init(ObjectClass *klass, void *data) AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->realize = applesmc_isa_realize; + dc->unrealize = applesmc_unrealize; dc->reset = qdev_applesmc_isa_reset; device_class_set_props(dc, applesmc_isa_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); From patchwork Thu Apr 25 11:01:41 2024 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: 792029 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320049wrq; Thu, 25 Apr 2024 04:04:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV5lI+VPQKj69UAke7dbiEaX/DDORKizS63gw2EjTfx3yoi+8XMrSxiCvptH6Ejjvb+sGKTHVF+50h6/po26gAI X-Google-Smtp-Source: AGHT+IHDF+GGjOV32UdacG3e0tP87QdQfva7JCWAIQrroMgG11Rm/OeumbQXCR6kQoJbcN8zhpgY X-Received: by 2002:a05:620a:e8a:b0:78e:cc40:b7e0 with SMTP id w10-20020a05620a0e8a00b0078ecc40b7e0mr4846379qkm.30.1714043063002; Thu, 25 Apr 2024 04:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043062; cv=none; d=google.com; s=arc-20160816; b=axD6AcnXpzhCXe577HWFunlKPoHXviIzLZa59lVHATAtCU11RjZkCvQhB450wZwFGK Zmm3lZ9dNm6TlBooL3164+nMvaqventx3hIj3CMCMctF1wVAp2gxoi2VnYINMX1uPfo3 rT5Ud4mdfGotrkADn1NYwxJtnKzwYR3/zY17FrWpB4ymsl8d5RINNG8ea0o0aCzTZNHy lqkAX+JcGabwtvDuXB2dMMYItKCb1sMiRK9VdYOpG8MJBveFCMphs0xUyIVhp+SFtiJd F2uADJFhGse84FoDnaCFWJ0NL7c+wOhNUOzFmkGb5lpgGa6apGBwUDqHXOdd/kxsTseR q9lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=1My8ZSy1rXly0MJHGOKnYCpxMH11O/qNA4PcnoQO/Bk=; fh=a29GfkxXuCrCS/IEwf5VceeLq0v9haw2+Y7TV49+8+Y=; b=j7aeh5vOYY0RAvoK3T4xDzec6r2pU0S+Y3IUueW9MjkYwgfHutLu7ILyBsakd7IRRY WT3rmvicLhHHXO1759plB0NOyvzFOR4uP4/ght6QuehEYgEkaLS6O80l0EI2cPY4LoV6 KFCbOKQ797+opU0LWUwM0PIY99O4w9tKV/5J8ceZVCmWpSP8Bpm1yIaQ3SvXZ/VMoSgn GwmwS2QVNCpfLOa78o8D9ZI2ylO1iZtaGgHZh+yrV7mJykO2ypm0fO9uUUkg7L7rYVR6 Loc+mou+WwS8LaoUZUBFM6Lf9SIP6gz0tzeeIwvfkSfBJnaVjBTkuWTtkfGOVzdxoDE+ LsKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KVskqAR3; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b6-20020a05620a118600b007906e405789si10741685qkk.189.2024.04.25.04.04.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:04:22 -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=KVskqAR3; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwti-0000Le-Ma; Thu, 25 Apr 2024 07:04:17 -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 1rzwsP-00089g-1V for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:53 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsK-0008ME-L7 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:52 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-34782453ffdso774951f8f.1 for ; Thu, 25 Apr 2024 04:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042966; x=1714647766; 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=1My8ZSy1rXly0MJHGOKnYCpxMH11O/qNA4PcnoQO/Bk=; b=KVskqAR3LQ9dvMHcvBTznebqLCn/DRkEwFiSaYB/Mgfjq36jG4YPFzAFs6j15i7QWo CYTMZTakuAMZ1eqoxdg9kAOu1UEh6nbMMT94cyz0ycXKLoSS7sVcfVNdKVuS52/Jmj9U dbVAIorWMZONE0F2lZeSVQrqwvD0TbCW1pd7TpwkVUVsHXjZ85ZiOyY5tGBF3+wzdEdk zYwZRdnbk9frdRd8e9xqAADnjwMKICbEWLqRxEEXsK21kFd5a+RZKisM26ZQx/bAaus3 lFCclX8cTBJRSzQ4Zg4kdRT4tR+SbqIb5rlhUy5hRd/OkuuJ/BjuLrRPCsTdv1SQA1jc 6+pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042966; x=1714647766; 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=1My8ZSy1rXly0MJHGOKnYCpxMH11O/qNA4PcnoQO/Bk=; b=O7wUdr12Ntb/RD6rNbmd6LMRL0YqF2Ub6gisDNPAJS7+429t322KOBjAwoxogDJjJO D4llyVCVWeZzmrr3DQ99lvMQLKwh0oWymqCPKGeabITWyLyCNPCw4wE1/2kVPBpHPR/Q 4cqStm0sGlmSwjym5D4T/hgqulUkSIuH6JfN+A1BJxaMlb7Pk5dagvRwYKY7bSVI7cdM pTFvjRzd7yLXuVm6st18s4wmNaXxUtSh5TFdpr0p/tT5zuOOM+uD8t0JhDd707HTyUSn AMqefwUQZ/eFxYDy3AojSx2G7pICyWG2Mekc/IdqbF37DfD95+qWsIEet5Huy71GpVoi awHw== X-Gm-Message-State: AOJu0Ywon049P6UT2lE+zIyq0vq3l6Fthj9YN+MjO9bU0cM+Js3TbGlJ jbYU/FzknMvQ2RdCgISqM0wJrTzUfESrtXNfvNpQ6kxhZOVUFSn0g2FTEiSFps49MVYOYyjJk/d s X-Received: by 2002:a5d:420a:0:b0:34a:33e6:440d with SMTP id n10-20020a5d420a000000b0034a33e6440dmr4481547wrq.24.1714042966196; Thu, 25 Apr 2024 04:02:46 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id fj3-20020a05600c0c8300b00416b2cbad06sm31028131wmb.41.2024.04.25.04.02.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Peter Maydell , Richard Henderson , Jean-Christophe Dubois , Andrey Smirnov , Jason Wang , Alistair Francis Subject: [PULL 08/22] hw/misc/imx: Replace sprintf() by snprintf() Date: Thu, 25 Apr 2024 13:01:41 +0200 Message-ID: <20240425110157.20328-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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=unavailable 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 sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developer experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-Id: <20240411104340.6617-6-philmd@linaro.org> Signed-off-by: Richard Henderson --- hw/misc/imx25_ccm.c | 2 +- hw/misc/imx31_ccm.c | 2 +- hw/misc/imx6_ccm.c | 4 ++-- hw/misc/imx6_src.c | 2 +- hw/misc/imx6ul_ccm.c | 4 ++-- hw/misc/imx7_src.c | 2 +- hw/net/imx_fec.c | 2 +- hw/ssi/imx_spi.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/misc/imx25_ccm.c b/hw/misc/imx25_ccm.c index d888966014..faa726a86a 100644 --- a/hw/misc/imx25_ccm.c +++ b/hw/misc/imx25_ccm.c @@ -91,7 +91,7 @@ static const char *imx25_ccm_reg_name(uint32_t reg) case IMX25_CCM_LPIMR1_REG: return "lpimr1"; default: - sprintf(unknown, "[%u ?]", reg); + snprintf(unknown, sizeof(unknown), "[%u ?]", reg); return unknown; } } diff --git a/hw/misc/imx31_ccm.c b/hw/misc/imx31_ccm.c index a9059bb1f7..125d4fceeb 100644 --- a/hw/misc/imx31_ccm.c +++ b/hw/misc/imx31_ccm.c @@ -89,7 +89,7 @@ static const char *imx31_ccm_reg_name(uint32_t reg) case IMX31_CCM_PDR2_REG: return "PDR2"; default: - sprintf(unknown, "[%u ?]", reg); + snprintf(unknown, sizeof(unknown), "[%u ?]", reg); return unknown; } } diff --git a/hw/misc/imx6_ccm.c b/hw/misc/imx6_ccm.c index 56489d8b57..b1def7f05b 100644 --- a/hw/misc/imx6_ccm.c +++ b/hw/misc/imx6_ccm.c @@ -85,7 +85,7 @@ static const char *imx6_ccm_reg_name(uint32_t reg) case CCM_CMEOR: return "CMEOR"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } @@ -224,7 +224,7 @@ static const char *imx6_analog_reg_name(uint32_t reg) case USB_ANALOG_DIGPROG: return "USB_ANALOG_DIGPROG"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx6_src.c b/hw/misc/imx6_src.c index 0c6003559f..3766bdf561 100644 --- a/hw/misc/imx6_src.c +++ b/hw/misc/imx6_src.c @@ -68,7 +68,7 @@ static const char *imx6_src_reg_name(uint32_t reg) case SRC_GPR10: return "SRC_GPR10"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx6ul_ccm.c b/hw/misc/imx6ul_ccm.c index bbc0be9921..0ac49ea34b 100644 --- a/hw/misc/imx6ul_ccm.c +++ b/hw/misc/imx6ul_ccm.c @@ -143,7 +143,7 @@ static const char *imx6ul_ccm_reg_name(uint32_t reg) case CCM_CMEOR: return "CMEOR"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } @@ -274,7 +274,7 @@ static const char *imx6ul_analog_reg_name(uint32_t reg) case USB_ANALOG_DIGPROG: return "USB_ANALOG_DIGPROG"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx7_src.c b/hw/misc/imx7_src.c index b3725ff6e7..d19f0450d4 100644 --- a/hw/misc/imx7_src.c +++ b/hw/misc/imx7_src.c @@ -75,7 +75,7 @@ static const char *imx7_src_reg_name(uint32_t reg) case SRC_GPR10: return "SRC_GPR10"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index cee84af7ba..8c91d20d44 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -41,7 +41,7 @@ static const char *imx_default_reg_name(IMXFECState *s, uint32_t index) { static char tmp[20]; - sprintf(tmp, "index %d", index); + snprintf(tmp, sizeof(tmp), "index %d", index); return tmp; } diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index d8a7583ff3..12d897d306 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -53,7 +53,7 @@ static const char *imx_spi_reg_name(uint32_t reg) case ECSPI_MSGDATA: return "ECSPI_MSGDATA"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } From patchwork Thu Apr 25 11:01:42 2024 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: 792035 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320234wrq; Thu, 25 Apr 2024 04:04:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWRAb8RYfW4eTp9ORhyFEm6eXq/PGUtPi8zD4GdEBiWfMQXaP6iNlay2LAut4/8Z149MIN3mBtFzkm8PTBFW3vQ X-Google-Smtp-Source: AGHT+IFA4hOaJuM46la00fFMzXWVGtRqZ3LdTXm5lCVnS/WbZlHK4mZhsXv+IKCa3u2wWCmyqql+ X-Received: by 2002:a05:622a:50e:b0:43a:1d94:c573 with SMTP id l14-20020a05622a050e00b0043a1d94c573mr3828118qtx.22.1714043082943; Thu, 25 Apr 2024 04:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043082; cv=none; d=google.com; s=arc-20160816; b=siYmgilBIzjEqhx/vqT463syKV27NVKTeaWX28z/sJWprRgVCqibW6AYudMdrnL7v1 /3xzIN5Hwt0Pg4Nxe8NAGnGYyzF9smJ8ams4be3DbeU32THdbJVtqyn9C9bIuDW51G4A dzLKvmuFBgUCAhEx/2vRBUHfBaa/AQfLKj8deiBvpvfK5dcXvsyWgiyR+bYukncYhiSm Ehzg9Z3wXvT1Q5QeaAVAckK8LCvGXswDvCDJdJHFvWe3cl/KXSdkdkiDpfMPwEwygcFU FOBHJs9CTTrqFpO08tp/2fhn1yOEPC0uE6N48L1xMK1EmsaLWZoO8gPOraPlskgqE0JF pgbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=Rf1txhvOtU9A895EpVlfVLIui0ISU1TQahG+lZi6+b0=; fh=AjJiCaOEq0bW3CFUfoWHOyxbijSvAbMfggVIeNtEb5U=; b=AB6390AglcsZLW7U2czDOC9HLl2+HzPhslgn/P93MnSGhuwtbuB0am2nGFWd2IwD5v yWMo7+7iWQD8rPS3BAQfFNK4DB+xypVcHOVgIt+8UsX8tFMXD6J49cMtoway02OlpjJd 6IgLgvyiGe2kwPiBRfZwN+zQBJEeae+8kFDEIEUg944v0sTqFisiZ/+VyZZviK0U4AKP +TfBcuHW44w8FevHm84CFSopvUrc4s010NJBzu/A1yJY3A0JjqLDkELnfnNM2WE5J1+2 b0n5KCSV1WcPeWJlt5JOg9NBuFh8MPmCqxDh/k2KdGiJemNe2BNkDwWk8//n2+jv5UsP /RTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PR5ClGRq; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h9-20020ac85e09000000b004373d1346d5si17480293qtx.666.2024.04.25.04.04.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:04:42 -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=PR5ClGRq; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwtw-0001dQ-KL; Thu, 25 Apr 2024 07:04:28 -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 1rzwsS-0008DM-NX for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:58 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsP-0008No-VT for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:02:55 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-41b5dd5aefaso1540755e9.2 for ; Thu, 25 Apr 2024 04:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042972; x=1714647772; 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=Rf1txhvOtU9A895EpVlfVLIui0ISU1TQahG+lZi6+b0=; b=PR5ClGRqgiiosD0JZPWcJyUawvI/ODaN7ZRYcLTZK25JoSDmN77cwLSCk3vgFT3icb rKIrpjor+xpY43qJFwdZp6sV86OTYz6J5RqnB/1/QQqwUzvJMjo4iWlCvqNgrKZrv+cX VMg8MtpQV+r/3SERfoQ4b8dqFox6QTZmMkUGZw7Z2UfaWUmSJB1YUirw7UvrTtvN8rm9 tNfifvy9h13SIE8NRef3T8UwD5UKshoBLO7CEFSB/Zyj68F9oK7K3ZVB4XNQlGCC8JJR YWzHph8ohRhGMlhx2937TxhMWxwS+p+aSzHOAQEjXi2QMZpweYU9jHzton+saQYbcU7m s9ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042972; x=1714647772; 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=Rf1txhvOtU9A895EpVlfVLIui0ISU1TQahG+lZi6+b0=; b=ivAQM0MiOy5fVDbXn8JYIuXcwisT70XAgFH4r0HqK1cGVPouMT08xC5ZIj+Zl2O5Df XXThUSJlw99vzSKAMJo+T16kTbxnHxj0JMSlz3CJmuco0mNn/6MpNSibqRU/nAQ6OGu6 L76JX8yszRDKgCKTQmY9rVd5MY+DVjSuKlfTXgIZ3CI/TqyhBD4rPLJ6FR68rebQkMup RTIAWTWM88sS8F62dSRP4dCjrqs+VjJPITxY7W4BrgR7ZQajuVk35MXttnBhLx2q+IHT g4TtR0UuG8rcf2xpNAopJt/8UrQimNcEPNqpo8MupbYs8/uTWQgerkPAPs/Ri4Wyt3j3 uiQw== X-Gm-Message-State: AOJu0YwHgov8w0/YY5jWLwA5XczQHLcAQS/6pNctgwCc+lN5C1wXAT9s N4UghdG3Us5lCeFGuh2zrBuIWcvGvt7fdWJTiUfTxWW3dWJXUQrgdkDDpTEcq1QJP+b6MSLpZ9x M X-Received: by 2002:a05:600c:4ec9:b0:41a:bf5d:c30a with SMTP id g9-20020a05600c4ec900b0041abf5dc30amr5646980wmq.18.1714042972013; Thu, 25 Apr 2024 04:02:52 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id c9-20020a05600c0a4900b0041b43d2d745sm2089435wmq.7.2024.04.25.04.02.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Richard Henderson , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Subject: [PULL 09/22] hw/riscv/virt: Replace sprintf by g_strdup_printf Date: Thu, 25 Apr 2024 13:01:42 +0200 Message-ID: <20240425110157.20328-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1. Use g_strdup_printf instead. Signed-off-by: Philippe Mathieu-Daudé [rth: Use g_strdup_printf] Signed-off-by: Richard Henderson Message-Id: <20240412073346.458116-26-richard.henderson@linaro.org> --- hw/riscv/virt.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index d171e74f7b..4fdb660525 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1617,10 +1617,8 @@ static void virt_machine_instance_init(Object *obj) static char *virt_get_aia_guests(Object *obj, Error **errp) { RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); - char val[32]; - sprintf(val, "%d", s->aia_guests); - return g_strdup(val); + return g_strdup_printf("%d", s->aia_guests); } static void virt_set_aia_guests(Object *obj, const char *val, Error **errp) @@ -1741,7 +1739,6 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev, static void virt_machine_class_init(ObjectClass *oc, void *data) { - char str[128]; MachineClass *mc = MACHINE_CLASS(oc); HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); @@ -1767,7 +1764,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); #endif - object_class_property_add_bool(oc, "aclint", virt_get_aclint, virt_set_aclint); object_class_property_set_description(oc, "aclint", @@ -1785,9 +1781,14 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) object_class_property_add_str(oc, "aia-guests", virt_get_aia_guests, virt_set_aia_guests); - sprintf(str, "Set number of guest MMIO pages for AIA IMSIC. Valid value " - "should be between 0 and %d.", VIRT_IRQCHIP_MAX_GUESTS); - object_class_property_set_description(oc, "aia-guests", str); + { + g_autofree char *str = + g_strdup_printf("Set number of guest MMIO pages for AIA IMSIC. " + "Valid value should be between 0 and %d.", + VIRT_IRQCHIP_MAX_GUESTS); + object_class_property_set_description(oc, "aia-guests", str); + } + object_class_property_add(oc, "acpi", "OnOffAuto", virt_get_acpi, virt_set_acpi, NULL, NULL); From patchwork Thu Apr 25 11:01:43 2024 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: 792034 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320178wrq; Thu, 25 Apr 2024 04:04:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU2ptiDlhlPeQcLbFIJkLvECDcVkzvS5KZo2cjo8qdG/pburGhWe19Zf7R64cnPZSCCgDuZ0F7y5Bl229OdXjS5 X-Google-Smtp-Source: AGHT+IEpgMVx4VKgX0lFfwPX5/K/8cANHLQ2N3DI7NSMgTMeOgaSchSZEOUBbAqZIMzijdMBNUbG X-Received: by 2002:ac8:58c6:0:b0:437:9dab:60d0 with SMTP id u6-20020ac858c6000000b004379dab60d0mr3634091qta.25.1714043077771; Thu, 25 Apr 2024 04:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043077; cv=none; d=google.com; s=arc-20160816; b=kx33fH8j+rRhhYmJSbgcT9KqzIm+zbRPMBr13khwggM5VvKkatsBS+wa5es/9ZTteF Bhok/vtGWvPB7p5nd0IgG2hjCE/kNCZcvOGOutOsN6big2/MX4qMU5KYjcL125WzDIAY VNDEJu6EvUuQ/f4ucKRYJZs0QBBgMy34uuXveictdPJVfni376oluJcCSLsAk3mF04mp 8Y1gyibK+bO4wWZeVtugPOX8uEiKIFGau3DN1JN4Njzfelz5h1dGM7XISdgSsbxryYOZ LjV7bXkxU+Ya4aOPaC9RNXfaAomxfh3uVUFwVkUIZtQYQqpIE7jKG1JgODGwfrOGy3Ww FE2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=BdAyeGYkrzEliXsZ63G9PrJ5ByexuubM31tow2m95nM=; fh=h17kuZhamjfEEGWPC/y72GG+LhTE2MhfIxvC3YZs/QU=; b=I4n+sRaidMGW1FzIWOejsh6JbC7ZHGixd/mtxCHuGxSWLFKAXYUJgNZmvS37ryD4wh eve+Fd8ZUVI0MkCHVN2dt7KePGXZvScHxAtbEA6qL8GWJSEH5Sy8Jv1E3UMItKeVMpMx PVhlPS8heIAkApkvcNQQYC2KQCw3bygt1p9b2wA9AC0uMKMz5abt7aK/XamULJgTASRW ykaTIx/zJyc6+puJj4Z04LQUFxlsJloLpu2e1FjETyhT079LTSOIrut2ZHThAECTOr9T ax91HT2KxoWOQHAoGQPdzzznQYj4uin2UlMlPi6HW2EmwD2IB52z7IbwjLgQPDwOShkL 4yDw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fHYlOULT; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 10-20020ac8590a000000b0043697289955si17398143qty.354.2024.04.25.04.04.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:04:37 -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=fHYlOULT; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwtn-0000ij-No; Thu, 25 Apr 2024 07:04:19 -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 1rzwsa-0008Ot-B6 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:14 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsW-0008TK-CN for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:03 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-41b5dc5e0d6so1749735e9.0 for ; Thu, 25 Apr 2024 04:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042977; x=1714647777; 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=BdAyeGYkrzEliXsZ63G9PrJ5ByexuubM31tow2m95nM=; b=fHYlOULTE2a3fsprAAta1qZ2ezY1pfD4k4EXW6g1tW/+LwQ65TJGGdnhuLJYqvfAgX aICle9981skz+Jnn8Cw0Lxp52xaZICqC9g1Ad27mEuONz0ICz8IHmzsGH2on+6oPUfRE PQebi7rXgU5reXb4kferau3jlWdS4d96dyZk99psuTVjObzaR+/J2xZhBBmymJOqF1DY tHOfzp56SEYb58KS/qB0IdJ8fFVmgrIiDZF1wfAFo9KlAW1xi07fKeLUcuCu6LGzuK5w f1SAgVSJ6i3sbeQyv9nhuI1EZrpDY4/uKi3VROvH286YMNrOqz48LSRJR0TBl4NcUG36 1b7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042977; x=1714647777; 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=BdAyeGYkrzEliXsZ63G9PrJ5ByexuubM31tow2m95nM=; b=fw1p4ZwF/HdbIZJqG68UeNqj7C9+18owzdizJ4v6Q4xMoqfpaJInAKbg3U/ODiZz1W FIdbTBn2H0J4O+GjJ91NCZ6UNZ3LeQCBdlcrCUwzb+POiapf06h8dSf/pO+MC0NyjWNF H0vAExSPhaD7dk2JN/ExjfVpTdaxEY8mh8/u31J4i3pFn1QXz8QmwQrFuY/Jt8DGZzgf sJXPo6b3EFCWEHgk1KahZcuH1fpgAUhqAPpzuQnDTudkctNJnkx/I2vx3WZ67K72hkTV pWYQtJYEsBon0MrvMF87OVwmrFp9KvpIujJvRJh3hRlM5Vh/FyfIR7HCLYZt95kZ02uP veKA== X-Gm-Message-State: AOJu0YyW81UVVMYo5A2dIulbAmj1C7/NYyw+qzo0T8W/zVc0ZTPGVrUH iP5HIuTOVVixec1WZAf4l/bpYtDN2ilBUqqHucwDvSjHAj3BCfmfHMBS+u9IaA1+qIpD5ghkDJc p X-Received: by 2002:a05:600c:3143:b0:41a:afe1:6d77 with SMTP id h3-20020a05600c314300b0041aafe16d77mr3643130wmo.11.1714042977351; Thu, 25 Apr 2024 04:02:57 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id u17-20020a05600c19d100b00416b163e52bsm30648723wmq.14.2024.04.25.04.02.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:02:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Peter Maydell Subject: [PULL 10/22] hw: Fix problem with the A*MPCORE switches in the Kconfig files Date: Thu, 25 Apr 2024 13:01:43 +0200 Message-ID: <20240425110157.20328-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=unavailable 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: Thomas Huth A9MPCORE, ARM11MPCORE and A15MPCORE are defined twice, once in hw/cpu/Kconfig and once in hw/arm/Kconfig. This is only possible by accident, since hw/cpu/Kconfig is never included from hw/Kconfig. Fix it by declaring the switches only in hw/cpu/Kconfig (since the related files reside in the hw/cpu/ folder) and by making sure that the file hw/cpu/Kconfig is now properly included from hw/Kconfig. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Message-ID: <20240415065655.130099-2-thuth@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/Kconfig | 1 + hw/arm/Kconfig | 15 --------------- hw/cpu/Kconfig | 12 +++++++++--- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/hw/Kconfig b/hw/Kconfig index b1cc40d6be..f7866e76f7 100644 --- a/hw/Kconfig +++ b/hw/Kconfig @@ -47,6 +47,7 @@ source watchdog/Kconfig # arch Kconfig source arm/Kconfig +source cpu/Kconfig source alpha/Kconfig source avr/Kconfig source cris/Kconfig diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 893a7bff66..d97015c45c 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -678,21 +678,6 @@ config ZAURUS select NAND select ECC -config A9MPCORE - bool - select A9_GTIMER - select A9SCU # snoop control unit - select ARM_GIC - select ARM_MPTIMER - -config A15MPCORE - bool - select ARM_GIC - -config ARM11MPCORE - bool - select ARM11SCU - config ARMSSE bool select ARM_V7M diff --git a/hw/cpu/Kconfig b/hw/cpu/Kconfig index 1767d028ac..f776e884cd 100644 --- a/hw/cpu/Kconfig +++ b/hw/cpu/Kconfig @@ -1,8 +1,14 @@ -config ARM11MPCORE - bool - config A9MPCORE bool + select A9_GTIMER + select A9SCU # snoop control unit + select ARM_GIC + select ARM_MPTIMER config A15MPCORE bool + select ARM_GIC + +config ARM11MPCORE + bool + select ARM11SCU From patchwork Thu Apr 25 11:01:44 2024 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: 792047 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1322701wrq; Thu, 25 Apr 2024 04:09:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXplfnMGgI1yzDwVbMzKyO6KsJMcW+24v4Pl2Anx9VG5gkhS6hx4MiKCpEEFKAEpK3swHB9SA/TNQH4HvMdF4CO X-Google-Smtp-Source: AGHT+IEwpf4B6QxodfxdloSXyY2ouvthudIUxqAdJteb2jA/2W6JsZg6i/S8BvW96/1/90fX1F71 X-Received: by 2002:a05:620a:1082:b0:790:6519:c60d with SMTP id g2-20020a05620a108200b007906519c60dmr5923187qkk.1.1714043398441; Thu, 25 Apr 2024 04:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043398; cv=none; d=google.com; s=arc-20160816; b=rFiyknucYE2ywCBYn6zvQxo/2JQQB7z7FONOiHHBwRJgvQhYpGMjlsT3hQcYU6qjIh ty1KrqiFP6PwPDkaAZCe0TJ3r+YPE9cEstxuRDrj/zKrnApsM5sNs4wqUmYXZCbgCWbY piSPvDYBpBFQt2D4gUihV3BDh+omJQdcF/KHxlGXueGEaLFRlIXO5qfumZa49K8azJ5L GMDvAuDUoBUFxpE1vNA3YT7NbMZankT0MtEZad9iTsiAaDlLUUasSjBllvcK6IsyfWOb nWHRqSl8ySzl+V+x4UzqFvsN+cbok7gjhCIlRWq9aE7KeM28HTV/nclPQFM+o+RWbIQA 64Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=LbAs9YmrS9dSJaP9YCdhZk5wTEYcOSkfG+YJap7/m1c=; fh=nd9F8vZqf9f3DRxj9Ux/M0C8+0xI9oKSj5Zm4Vmbrgk=; b=RJWSpmr1eH+AoMxefExlSHovrecJwkNU8muDq5EQ3l3aMtaRCK+yXOqT92vNfUI3Db RHlLaBBk+0Hb5AobTz8SKQg5hn+52fA4etHk/2LYMcdR4nFG5bajQrAPrIafVe1U3dNa yDaYh+Kj1iOue3yoBLqJPDhRZajxzIJfREnBRN7kiQr6KEmudVN2HrsL9ZBCwuXD8GfG fuq0CxXB2fT3n5c/Jc3MMO16ggq7G5tpU3twrjsOseu7GuxuG/FRR4FUUAGFM5dIXKHV k4rV7mCfGYi1j2XFP6gt8PAGXAkk3iQUB7nbUi1uJMEpdAUJIMhTkJSKc6XTqhiPSHoQ wUAw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=upb2cCJu; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dt35-20020a05620a47a300b0079086be37c3si5364787qkb.356.2024.04.25.04.09.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:09:58 -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=upb2cCJu; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwuK-0002vj-G1; Thu, 25 Apr 2024 07:04:52 -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 1rzwsj-0008UP-3M for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:38 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsb-00005s-E2 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:07 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41adf155cffso6384055e9.2 for ; Thu, 25 Apr 2024 04:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042983; x=1714647783; 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=LbAs9YmrS9dSJaP9YCdhZk5wTEYcOSkfG+YJap7/m1c=; b=upb2cCJutQ4RH6YHzzcoh/SDNJoih4pUuQVugFQuUw/SYzlRKtBXLJVkLUhTaWhD12 86gxQHirJvp/zOls6O3rP7PURSM3hSXhbz4aoIAS98Fgb5+sO17E2uiD9bisXYPPXwzv jUX1Q+etUnPzPnCmjMj0smUZngnFNRI3rXlLDlsgEk10YDwtaKkNQ6Oz+vUvQoYTd7YZ IvnAmQuDN//McM+FdPzTKIeOkHSOOarysxBBhea3gdeJtDtcuTZfqildmjRlt4e0rTD8 FPt0LvRxeSUWNCr6ixC5z6UqlBa/Ro1mRi3szVPepMUPmhHg6syJNqr5MTJIV9AhxKAz W8+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042983; x=1714647783; 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=LbAs9YmrS9dSJaP9YCdhZk5wTEYcOSkfG+YJap7/m1c=; b=ibNPqwXVnGq157gapBD6lellJsdmIFRqWf5oGuc8huBsdRNWQ0zZPt/K8KPHT1t9rf Q+MsujH0VKssLuo35XahUC/KDGxhsrkR5lW0KqsahD+3ATPQHXy3GW0G3bxY0In8aQom 7DJ9pR934bOZcu+iRJNmdTrIJb9NqVlAkSoH6mXCXJ967xA3z9PA44sKyuwVAfdVSpGu Fr3om1209b412g6koWDG7WSCPqxZbXi30O9Ifdp3pcPCcu32vXyEN0+vZfSFNaAQzDeq /g26uOdlfEUdmlUh1uTUxbTL/9RJJemII74L6t7mYstNk1JuVMYKqswzYgyXqL5G80GV TTgQ== X-Gm-Message-State: AOJu0YxIjlpOJCJHb8s1gjGltFvKCDLvaVsNx8JxjOzs+dmbbQO8o4hC BAz/RBZx6Ep0WX3W4G6SwxZqIcF5MVC51lQ0t4VERx4P/UkAIFMaolQycMhVx1Z4hxPP1z6SfOr S X-Received: by 2002:a05:600c:154f:b0:418:e08c:817 with SMTP id f15-20020a05600c154f00b00418e08c0817mr3681618wmg.32.1714042983172; Thu, 25 Apr 2024 04:03:03 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id p9-20020a05600c1d8900b0041b13c5c9f9sm4678586wms.17.2024.04.25.04.03.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Peter Maydell , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Subject: [PULL 11/22] hw: Add a Kconfig switch for the TYPE_CPU_CLUSTER device Date: Thu, 25 Apr 2024 13:01:44 +0200 Message-ID: <20240425110157.20328-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=unavailable 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: Thomas Huth The cpu-cluster device is only needed for some few arm and riscv machines. Let's avoid compiling and linking it if it is not really necessary. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Message-ID: <20240415065655.130099-3-thuth@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/Kconfig | 3 +++ hw/cpu/Kconfig | 3 +++ hw/cpu/meson.build | 3 ++- hw/riscv/Kconfig | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index d97015c45c..5d4015b75a 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -485,6 +485,7 @@ config XLNX_ZYNQMP_ARM select AHCI select ARM_GIC select CADENCE + select CPU_CLUSTER select DDC select DPCD select SDHCI @@ -503,6 +504,7 @@ config XLNX_VERSAL default y depends on TCG && AARCH64 select ARM_GIC + select CPU_CLUSTER select PL011 select CADENCE select VIRTIO_MMIO @@ -688,6 +690,7 @@ config ARMSSE select CMSDK_APB_DUALTIMER select CMSDK_APB_UART select CMSDK_APB_WATCHDOG + select CPU_CLUSTER select IOTKIT_SECCTL select IOTKIT_SYSCTL select IOTKIT_SYSINFO diff --git a/hw/cpu/Kconfig b/hw/cpu/Kconfig index f776e884cd..baff478e1b 100644 --- a/hw/cpu/Kconfig +++ b/hw/cpu/Kconfig @@ -12,3 +12,6 @@ config A15MPCORE config ARM11MPCORE bool select ARM11SCU + +config CPU_CLUSTER + bool diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build index 38cdcfbe57..9d36bf8ae2 100644 --- a/hw/cpu/meson.build +++ b/hw/cpu/meson.build @@ -1,4 +1,5 @@ -system_ss.add(files('core.c', 'cluster.c')) +system_ss.add(files('core.c')) +system_ss.add(when: 'CONFIG_CPU_CLUSTER', if_true: files('cluster.c')) system_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c')) system_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c')) diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig index 5d644eb7b1..fc72ef0379 100644 --- a/hw/riscv/Kconfig +++ b/hw/riscv/Kconfig @@ -9,6 +9,7 @@ config IBEX config MICROCHIP_PFSOC bool select CADENCE_SDHCI + select CPU_CLUSTER select MCHP_PFSOC_DMC select MCHP_PFSOC_IOSCB select MCHP_PFSOC_MMUART @@ -68,6 +69,7 @@ config SIFIVE_E config SIFIVE_U bool select CADENCE + select CPU_CLUSTER select RISCV_ACLINT select SIFIVE_GPIO select SIFIVE_PDMA From patchwork Thu Apr 25 11:01:45 2024 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: 792045 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1322489wrq; Thu, 25 Apr 2024 04:09:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXX5oWi3M8y+iuZte8gqKFzMpmDhaP9ph4yidxQfNem4zSi0FFHnSEGOs4g//N+8b3XuG1gul2Ca2zLSoCponyT X-Google-Smtp-Source: AGHT+IF69lz2Y0xKJubIXodIn71lxglFmfVuDvvnyGQ+GRIRSjXET019fUDECSJZT25vU4/pI6ve X-Received: by 2002:a0c:fcca:0:b0:69b:5c93:524a with SMTP id i10-20020a0cfcca000000b0069b5c93524amr6555871qvq.23.1714043367796; Thu, 25 Apr 2024 04:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043367; cv=none; d=google.com; s=arc-20160816; b=hvY40niiK6WACsJIcqMQxe2e+mmz65xa3Hd2Wyt7pe94mhiMST8yEvr0UFp3pOOEEu 1S9aBv0EF81/8oPoWs9Ke2+OrhR5Uxnfh9yWQV2LCvHXt/r/JEjrExyGUiRLulV3PuJx drDwHFftFSYWNyV6NTN0PueleW25oYtI/P8sdDazr/XceJcNOVcorAAl5bun07vy5zMg pgcwc51W9Uw41P0ZZMjbvLYyMLnGG7uTFrcJbbtMvwXEvS1qyhGTnNDO57BoBH5kWRc3 GWR1q6Z8MUYO8DmXS6gCqXPUGpb7rM+xCzBnE2PBfeHW97Q+7W7mSQ6jXBrKeCHxUl5g s0pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=LU/r9zSSWOAgtXVFmIxCt1qMAeFSfB+B8bTVtMRUbL4=; fh=0/JVPH+45iPmEYqun5BjBLfJZs9+cI7lPo8sZDfCyNA=; b=h3BhFrjhTHx3ihjj1ZX7Fv5N2+wYZfp7wrD6/mABPFDoFqvCd2Z6WlNxZY+uu+whjr 8adwMiPy5oNFbUBrucSIej0WF/BUdrT9qc4GVuUO7FaI+c65qhs/LS9UIajhxGdYgOsg cX6jqAcsNGCFDVEUtt1Vy+U9YILHtP4k2wDjYX6qlfH/56nY0gOqtdlTNEVUEIZza5GK UzILd7K7fTCkRWj/Kz/9LSk5qUuFo73h5LwJzGgM4Hluuw0XGNbY6yyiYccwqyKyHqwf aX5lHVqjdTq2zduMRa78mKzNuXcWSV6c2pgyg0yp0Agqk8DEfFb6JHAQ1647k3niy64S h0OA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WrXR9xds; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y7-20020a0cec07000000b006a09702cdcdsi2788388qvo.485.2024.04.25.04.09.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:09:27 -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=WrXR9xds; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwtv-0001UA-Am; Thu, 25 Apr 2024 07:04:27 -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 1rzwsn-0008VP-MQ for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:38 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsk-00007H-AO for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:16 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2def8e5ae60so4591341fa.2 for ; Thu, 25 Apr 2024 04:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042989; x=1714647789; 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=LU/r9zSSWOAgtXVFmIxCt1qMAeFSfB+B8bTVtMRUbL4=; b=WrXR9xds2luym4J6tztK66DnJaf/wuj2yu2EDa583PaxoSFJwEWk1s2L1aNchIx+/r bbR9UZz7iFtrCvMuaaKDwy3TZsSwGW9zzUFnkKUtVogRlNYkQ18amTlZR9yb/pPExQ2j fjGvhqmzFGItbBbAjuHVlaCBQNbmXskDV7Snl6aLxO67SwCZGLsYvUI6KWzLAQQ/obJ8 MeQ9254Ek3cXhnTeh1ApAZ9/J5mkzleH+K9rKInF3B7Y1sQ4VXjXN0HdV+sqQ7CRQsXS xsVN1HokLi5KiqQA+3m7jZXt90Xy2TAVok0I9hsD2cFYXLzuWsODMcI6TuDobnVQOdTP 5GAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042989; x=1714647789; 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=LU/r9zSSWOAgtXVFmIxCt1qMAeFSfB+B8bTVtMRUbL4=; b=nu2s1F0tXocxlkW19Um2yfxIqYJA9NKxfyGXv/B+AQvLbg+7x6k8AufPBtR0/3AswP usT0hPoR0qx8jl+L51fCJecDxzd9+/JriR6vcNR8OnB0qklxnf294IAcK6ePZZlym65b gAHw3ONgkxcLvkAGBe6zhXfHU0FaXbEMVJgGTXITR2A6wrhC175MtRQPiMz2Ggx88LLA QKlg4WeiyFYm4ee7oynGRzYJIo7HqbN2/ckjQjOyu+5NoULjUq6L8gt15TP1MqtPdyOg JAOpq7gDBW2uI/zfDaT4Fxvv923evef6gZO4xT2s9rA4vqZO/zIUZbykZsPiF2Oj26Er nKCg== X-Gm-Message-State: AOJu0Yx0dEjt7tKZ93PjPrSS53yX2mzHUmCJGY8xW4J62Ozk6LF9riWn xU0Azd2WSeKDZlri3jU+xAwwlI5i2glaLHyzl+8zlFHMvDrqDsa13A5V4y3VguMAyjIqlwTFQlI x X-Received: by 2002:a2e:954f:0:b0:2de:81c9:14b3 with SMTP id t15-20020a2e954f000000b002de81c914b3mr2837508ljh.35.1714042988935; Thu, 25 Apr 2024 04:03:08 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c511400b0041a49b10a13sm14955302wms.11.2024.04.25.04.03.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jonathan Cameron , Jonathan Cameron , Fan Ni Subject: [PULL 12/22] hw/cxl/cxl-cdat: Make ct3_load_cdat() return boolean Date: Thu, 25 Apr 2024 13:01:45 +0200 Message-ID: <20240425110157.20328-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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=unavailable 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: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make ct3_load_cdat() return boolean, and this is the preparation for cxl_doe_cdat_init() returning boolean. Suggested-by: Markus Armbruster Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Acked-by: Jonathan Cameron Message-ID: <20240418100433.1085447-2-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/cxl/cxl-cdat.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/cxl/cxl-cdat.c b/hw/cxl/cxl-cdat.c index 551545f782..b3e496857a 100644 --- a/hw/cxl/cxl-cdat.c +++ b/hw/cxl/cxl-cdat.c @@ -111,7 +111,7 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp) cdat->entry = g_steal_pointer(&cdat_st); } -static void ct3_load_cdat(CDATObject *cdat, Error **errp) +static bool ct3_load_cdat(CDATObject *cdat, Error **errp) { g_autofree CDATEntry *cdat_st = NULL; g_autofree uint8_t *buf = NULL; @@ -127,11 +127,11 @@ static void ct3_load_cdat(CDATObject *cdat, Error **errp) &file_size, &error)) { error_setg(errp, "CDAT: File read failed: %s", error->message); g_error_free(error); - return; + return false; } if (file_size < sizeof(CDATTableHeader)) { error_setg(errp, "CDAT: File too short"); - return; + return false; } i = sizeof(CDATTableHeader); num_ent = 1; @@ -139,19 +139,19 @@ static void ct3_load_cdat(CDATObject *cdat, Error **errp) hdr = (CDATSubHeader *)(buf + i); if (i + sizeof(CDATSubHeader) > file_size) { error_setg(errp, "CDAT: Truncated table"); - return; + return false; } cdat_len_check(hdr, errp); i += hdr->length; if (i > file_size) { error_setg(errp, "CDAT: Truncated table"); - return; + return false; } num_ent++; } if (i != file_size) { error_setg(errp, "CDAT: File length mismatch"); - return; + return false; } cdat_st = g_new0(CDATEntry, num_ent); @@ -185,6 +185,7 @@ static void ct3_load_cdat(CDATObject *cdat, Error **errp) cdat->entry_len = num_ent; cdat->entry = g_steal_pointer(&cdat_st); cdat->buf = g_steal_pointer(&buf); + return true; } void cxl_doe_cdat_init(CXLComponentState *cxl_cstate, Error **errp) From patchwork Thu Apr 25 11:01:46 2024 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: 792039 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320979wrq; Thu, 25 Apr 2024 04:06:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX+ywWpH+j7sBdt3LzoMJVmcmPEOIet8ukF7xYyvZElAwS44YT3DAvE+EipBfFVequZuk4s9VOq0I/x/qUs++ck X-Google-Smtp-Source: AGHT+IHqy3QRnmegoAhEmvTlnJjVXEj2XkGFriVfNDawGiNl1UiNMsHeDnUDnanUvzZ2obX2Rulj X-Received: by 2002:a05:620a:45a7:b0:790:98cd:647e with SMTP id bp39-20020a05620a45a700b0079098cd647emr2351864qkb.11.1714043171545; Thu, 25 Apr 2024 04:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043171; cv=none; d=google.com; s=arc-20160816; b=Bq1xb97eRL5G8MX4mZVGac0uRWZwHAOJUPIAixRupRDqMbGW4QUU3sxNt51fZJ/sNU 7/tgIWbOQvD4AyB4zQTrEi+Ocyr8i/kuvkRpwxjs0sXZOjFIU7xnruyRormdqP+oAZuV sjJg8h7Gl7Jigqrd8MVvHW6mr6wCDT+bGBlMhEUcv+elNdBsMWviA9xpQgl4tpNrXSin bBSt7RX+l4KR3EN9+8/n6BXFhi60eeUdA7CTYrng+u2IHWZIz+F7V5N7uHKVfJhvgu0p bqpMXZM7kCs9bXbazngUavuBYlY9KqJMxz8uWQKGCMQK3M2AcAjSMEd/cO5bX9tKA1uf 68Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=8bJ1N9o6y+S8lNsIITbhbB1Udo8RPNY/z42IZN8n3uY=; fh=0/JVPH+45iPmEYqun5BjBLfJZs9+cI7lPo8sZDfCyNA=; b=P83N92iMWm38GiPA9O/FvqfiwVxL66GRzqfhB+g664Zy2OF3msLkTkC0E7Z7TTs9Uh I51gWe53ClCUjHf0kqQLhIPcxtn3+570tOPzrxwyjRapkG10hUpMKkAITJB/J7OVG1jX enK+z+RCCS6nqFl1yREZNhw8pZOhjP4rmvwOOhkP8XGEx17uVc+4hwFGIHV8HcVe82YF 84JNGaiN4t2jO2/wRfnQkvRZJ/RZGrOeKvzUYZE1zFxYw/2OvfxTUPm7z9n/v/YfU7EV APRGdJ2SNUYUaGqwuHrP7FRA+yDX8yodXiuTsH20e6vnR7why7Mix0AaRao7RqB5kGSQ W5Ow==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o9e2Jvch; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y20-20020a05620a09d400b00790667bbfbesi11809903qky.493.2024.04.25.04.06.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:06:11 -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=o9e2Jvch; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwtz-0001p4-Cc; Thu, 25 Apr 2024 07:04:31 -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 1rzwsq-000057-3r for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:38 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwsn-0000AB-Fr for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:19 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-41a77836f16so6566255e9.3 for ; Thu, 25 Apr 2024 04:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714042994; x=1714647794; 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=8bJ1N9o6y+S8lNsIITbhbB1Udo8RPNY/z42IZN8n3uY=; b=o9e2JvchHg5dfWSh/z2SQMfNy0QkVIe91WIGmoHqe2VYBytEsQZxCyuy43VUT0Cvqg BOgDlE/7pATxN5NYjfW62/PeVsTPMm9SlQT4ksgbfOo5RRSGINZQBeMEx8al0LBuegIM SVc5Vd0glybBwHQjgzkjJqsznfmrj/z7Hmn0+obklXI2F8iShdJeskrCdmvX6cfaoabm R6eLWEA6UcsMFBjiIf8Bfjh1WN2Xhw6dVB3sjfhBYupFiJPtBipofJpW97qjmybVBf9O +9NPuqaXFYYQ+TiIj+v4OIsqTZEGbeqIVpD5t0YH3YN+Cpvt+RYx1K41qzhwL1ior+OY Sdrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714042994; x=1714647794; 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=8bJ1N9o6y+S8lNsIITbhbB1Udo8RPNY/z42IZN8n3uY=; b=l8Z+WVCvL7X5pPgTBSgm1CwRWEPo9v5ttnqxpZFFfGvgPFWC01zDONOEbp8rxzAwNb QKR4bZ0uU0pR2TO4m66+VPtaaJ7G8V+LtCRmVM5WwsnVowiScp7Pbk2VtsitcHSTc3U5 PHGH6hJ1Zz/eZWQgw7SDehMoFLYn7twseR0twFB3ZebSOkbzRHtZSMM+KPQbg5nbDZ3n 4GALWihaQc6mCot52MrchUpfIppz84cA2irCvOVHUwN1YWhKEbShz1rBJeg2KGIZ/nfN JivmTixVb06sYc9RXlQ/+KBEJ3mmZOB2Tjwt4MjusqulW0m1tz9xCTy5oPORnOgAfStE +w7g== X-Gm-Message-State: AOJu0Yy9l/E6q38fXm9DZ27lWKoeuZAuLgNp+iScC1EtKO9hFj0bT6uA LtJeej1XbKSuZqby/FcAEDKHyrGdNWu15c9JCACwALBABEJHwW89gCxRvBCOvTnnBjP9f5K5DtV p X-Received: by 2002:a05:600c:35c7:b0:418:a7a7:990f with SMTP id r7-20020a05600c35c700b00418a7a7990fmr4300251wmq.13.1714042994514; Thu, 25 Apr 2024 04:03:14 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id fc19-20020a05600c525300b00418981b59d4sm31049322wmb.10.2024.04.25.04.03.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jonathan Cameron , Jonathan Cameron , Fan Ni Subject: [PULL 13/22] hw/cxl/cxl-cdat: Make ct3_build_cdat() return boolean Date: Thu, 25 Apr 2024 13:01:46 +0200 Message-ID: <20240425110157.20328-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make ct3_build_cdat() return boolean, and this is the preparation for cxl_doe_cdat_init() returning boolean. Suggested-by: Markus Armbruster Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Acked-by: Jonathan Cameron Message-ID: <20240418100433.1085447-3-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/cxl/cxl-cdat.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/cxl/cxl-cdat.c b/hw/cxl/cxl-cdat.c index b3e496857a..e7bc1380bf 100644 --- a/hw/cxl/cxl-cdat.c +++ b/hw/cxl/cxl-cdat.c @@ -44,7 +44,7 @@ static void cdat_len_check(CDATSubHeader *hdr, Error **errp) } } -static void ct3_build_cdat(CDATObject *cdat, Error **errp) +static bool ct3_build_cdat(CDATObject *cdat, Error **errp) { g_autofree CDATTableHeader *cdat_header = NULL; g_autofree CDATEntry *cdat_st = NULL; @@ -58,7 +58,7 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp) cdat_header = g_malloc0(sizeof(*cdat_header)); if (!cdat_header) { error_setg(errp, "Failed to allocate CDAT header"); - return; + return false; } cdat->built_buf_len = cdat->build_cdat_table(&cdat->built_buf, @@ -67,14 +67,14 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp) if (cdat->built_buf_len <= 0) { /* Build later as not all data available yet */ cdat->to_update = true; - return; + return true; } cdat->to_update = false; cdat_st = g_malloc0(sizeof(*cdat_st) * (cdat->built_buf_len + 1)); if (!cdat_st) { error_setg(errp, "Failed to allocate CDAT entry array"); - return; + return false; } /* Entry 0 for CDAT header, starts with Entry 1 */ @@ -109,6 +109,7 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp) cdat_st[0].length = sizeof(*cdat_header); cdat->entry_len = 1 + cdat->built_buf_len; cdat->entry = g_steal_pointer(&cdat_st); + return true; } static bool ct3_load_cdat(CDATObject *cdat, Error **errp) From patchwork Thu Apr 25 11:01:47 2024 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: 792038 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320955wrq; Thu, 25 Apr 2024 04:06:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCURowdwtxapLRxTJ1zFuXu4sG8cZbtK0jNk78lD6czWYXPK+04btDxvOjwWuPtONzrU2FSLQQRQoIqtLt/W3wPo X-Google-Smtp-Source: AGHT+IHvkNF0D8NMOi8xHHqrkAT/sBm7ZjIgHyevbr1spVkN7dWQDWxVKz7HL+A+mP6l1UQLiG+W X-Received: by 2002:a05:6102:11e5:b0:47c:abf:385 with SMTP id e5-20020a05610211e500b0047c0abf0385mr6047296vsg.4.1714043169860; Thu, 25 Apr 2024 04:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043169; cv=none; d=google.com; s=arc-20160816; b=RKS3ZeRBzgr7dDQxHn6xNPMCI47PsglKn7iDqfHO+sD1jO3VKY4srYrg5ZcuFGuTw7 1qs9uSNJv8Yd7PRdDZCeYN7qPyUtalXysi/aYptiA0uGKNAB/5cU4PCuei4ySPpT1bwE zMgkR1NQkBhSQRQ5r2N7vMAnkhCqF76jd7skOgquo+jvM7JWCcyYaRsNhYro1hyEZ0uh isi/UDAffjeL/mUfnbYO79eg0YZyWO88BkU2QcjAzu7jhnccaN7idaG+2Jwg1GlEs7zG 9Gj+MW60r6k6JNDuK3V045kIn08J0A2A94e/sqkBDOFb+2ckIu5DdBVblGjfcndgM0UL f24A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=pvunkSj/8Waxads7PhZ8ZQlWRsJ6KI6vMAUvxRYx65M=; fh=5LOWqTNvnFRd1twfDZuFQ28UZFUxKcuuynE60ceoAJg=; b=MxyQubxHidHnfT/Q3rlc04Dxn0ncxDa6I8H3wUhrG9Z+NNF4sX66D3yCyT+mUH4WPu 6poXuTgg0mlWasjKF3+8xekPiqM/N6tAhO5zqSKv2dPXYW7OfqzuyBfBOz8JhGmeJPnE hSWsijlVV1XLPY4uiUE2Dc/aHEB4erm5zubSMq41P7RpgokzqGa91TXY4VPsGXC4aJex i7qTGWlR5BvPGXoFWGysbKmV8AqRarWq7sq9NGTtYdk8Bm+hHREQduuZxMHC2g5Adm/G hddgd01yGMx8HBdlRieBLK6vua0huGOWuLCKv1bu9oZCZqqF4b5I3T5FRif+L8XAQQr1 0BNw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gL9a3tea; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id if6-20020a0561022c8600b0047bcba2f1b6si2547640vsb.757.2024.04.25.04.06.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:06:09 -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=gL9a3tea; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwtw-0001c3-FK; Thu, 25 Apr 2024 07:04:28 -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 1rzwtB-00009T-2S for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:57 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwss-0000DG-7b for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:26 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41adf3580dbso5031725e9.0 for ; Thu, 25 Apr 2024 04:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043000; x=1714647800; 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=pvunkSj/8Waxads7PhZ8ZQlWRsJ6KI6vMAUvxRYx65M=; b=gL9a3tea7yE6jcdX6zkmxwDmR6RkxmQKGR0W8cbgks1HpM55Kl2q+Fh5rDjzchqYhY ibf6gTSzByxXyHNx3UMizX1IL+oJfoPpgfewwNEdFKYZRg6DDQgrJ/yQlBA/QOFsOT30 mPK+d1+VuHN3r3++vGimHOahyjN386AlBBbee1h9kn3SpQcpFESm/DIQ2CK8kNho5nJp 24zHp3k6m2azSmBCFVEiiXKCNsLNVXUwhFGki3EhncgbEJir3NyRHAhCd1U1V8o6lkEQ 70rEdMd1hXHJQieDioZs0cKc08yQlROsxMFvwpfcpDfkKuMuvWWevUqvtOohZZGXyXHp nHHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043000; x=1714647800; 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=pvunkSj/8Waxads7PhZ8ZQlWRsJ6KI6vMAUvxRYx65M=; b=QQdsw8uMFram+rWtSsd2xHY5tLXOhcqonDaDahwOrbol0Fu/T443cS02g/JjsiSRp5 QuhS7O1Oge2Qz4lCt522wPKJyfjH/aYqQFT9CXRICqdWt8DLxSkuYrLVzWeQQcz0iF/L oVIxNqhR09y3sNl+5YfJ/Vk76//YGz+M1sYXOoiJ1KH8fugmWdKdz6w9lmEDwjMaZJun awx7dIeVVV5LfqW4PqrlkyxYzhN783ujna2MswwdJECS59yl2Ml0mXdF5T6C1kuxCQuh 3bNDP00rk9ioyZxBHbeN+sgPh9hG9ta4CqxxiMi9/QyTNPv0hCM4i+dd9RwcL1Sqbxwm KgUw== X-Gm-Message-State: AOJu0YwAulEvWGbCiWP690K3rXoUrr8+FB2n+U2Ze48OcsWoZKTFaL3Y IcPgQvJ43tcs1f7cxtDAC6ZfNgnvbb+KFDqdwo9qirDyufiMNnd2d6QQ1AWyOA8NdESGJ2eLS41 J X-Received: by 2002:a05:600c:3554:b0:415:ff48:59fc with SMTP id i20-20020a05600c355400b00415ff4859fcmr2033033wmq.8.1714043000386; Thu, 25 Apr 2024 04:03:20 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id k41-20020a05600c1ca900b00417e8be070csm27334682wms.9.2024.04.25.04.03.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jonathan Cameron , Jonathan Cameron , Fan Ni , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 14/22] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean Date: Thu, 25 Apr 2024 13:01:47 +0200 Message-ID: <20240425110157.20328-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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=unavailable 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: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. With returned boolean, there's no need to dereference @errp to check failure case. Suggested-by: Markus Armbruster Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Acked-by: Jonathan Cameron Message-ID: <20240418100433.1085447-4-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/cxl/cxl_component.h | 2 +- hw/cxl/cxl-cdat.c | 6 +++--- hw/mem/cxl_type3.c | 3 +-- hw/pci-bridge/cxl_upstream.c | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h index 5012fab6f7..945ee6ffd0 100644 --- a/include/hw/cxl/cxl_component.h +++ b/include/hw/cxl/cxl_component.h @@ -273,7 +273,7 @@ hwaddr cxl_decode_ig(int ig); CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb); bool cxl_get_hb_passthrough(PCIHostState *hb); -void cxl_doe_cdat_init(CXLComponentState *cxl_cstate, Error **errp); +bool cxl_doe_cdat_init(CXLComponentState *cxl_cstate, Error **errp); void cxl_doe_cdat_release(CXLComponentState *cxl_cstate); void cxl_doe_cdat_update(CXLComponentState *cxl_cstate, Error **errp); diff --git a/hw/cxl/cxl-cdat.c b/hw/cxl/cxl-cdat.c index e7bc1380bf..959a55518e 100644 --- a/hw/cxl/cxl-cdat.c +++ b/hw/cxl/cxl-cdat.c @@ -189,14 +189,14 @@ static bool ct3_load_cdat(CDATObject *cdat, Error **errp) return true; } -void cxl_doe_cdat_init(CXLComponentState *cxl_cstate, Error **errp) +bool cxl_doe_cdat_init(CXLComponentState *cxl_cstate, Error **errp) { CDATObject *cdat = &cxl_cstate->cdat; if (cdat->filename) { - ct3_load_cdat(cdat, errp); + return ct3_load_cdat(cdat, errp); } else { - ct3_build_cdat(cdat, errp); + return ct3_build_cdat(cdat, errp); } } diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index b0a7e9f11b..3e42490b6c 100644 --- a/hw/mem/cxl_type3.c +++ b/hw/mem/cxl_type3.c @@ -705,8 +705,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp) cxl_cstate->cdat.build_cdat_table = ct3_build_cdat_table; cxl_cstate->cdat.free_cdat_table = ct3_free_cdat_table; cxl_cstate->cdat.private = ct3d; - cxl_doe_cdat_init(cxl_cstate, errp); - if (*errp) { + if (!cxl_doe_cdat_init(cxl_cstate, errp)) { goto err_free_special_ops; } diff --git a/hw/pci-bridge/cxl_upstream.c b/hw/pci-bridge/cxl_upstream.c index 783fa6adac..e51221a5f3 100644 --- a/hw/pci-bridge/cxl_upstream.c +++ b/hw/pci-bridge/cxl_upstream.c @@ -338,8 +338,7 @@ static void cxl_usp_realize(PCIDevice *d, Error **errp) cxl_cstate->cdat.build_cdat_table = build_cdat_table; cxl_cstate->cdat.free_cdat_table = free_default_cdat_table; cxl_cstate->cdat.private = d; - cxl_doe_cdat_init(cxl_cstate, errp); - if (*errp) { + if (!cxl_doe_cdat_init(cxl_cstate, errp)) { goto err_cap; } From patchwork Thu Apr 25 11:01:48 2024 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: 792040 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1321357wrq; Thu, 25 Apr 2024 04:06:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUEowMEq6V2XcxyFIJ6USWS3Ev7fTlWAc8tI0TQjlrpeAGHXDUvLtQdqTUP6nSrifqN8owuzpE5jdasR2WX5sKp X-Google-Smtp-Source: AGHT+IGIwFMqAaImkYG9eu1fc0UHZG05McMCO/zZvxF0iuDDQOWYDdpC7yNh/Q3mzyXYUWO3N4S/ X-Received: by 2002:a05:690c:fd1:b0:61a:e42e:685e with SMTP id dg17-20020a05690c0fd100b0061ae42e685emr6077750ywb.0.1714043215559; Thu, 25 Apr 2024 04:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043215; cv=none; d=google.com; s=arc-20160816; b=BD1kmd1iQBUfO6EaLGTd9s4cqIwMaSJ+vIHSlNI79DbFdlgh243FwFWF7roUnvIFR2 R/xv2DMlYvSQ46ilAfShc0Bd/KEc/fI0r2Mbfe9XtOhOTUnQZXfFWFOdNrP5DXDJdnfi z96AgQdxNL2N2eWPRNIkUI2dvjfpQB6XTPouOaSoKK8T2E01dE+xAxtBp2l1dJwIAkbq vhrWPTWFdN4jdoXpjH4Duml7KYRycrGZYnq9WjwLSuNRyzPKwrF0cykQ/BSz7fVPYHjk lJHpwlkshlkcCykZeztIfQZJp/pZusMdNm7QeOVAE33REVaTnnLnyotsRXfhWWdiQS+P e9DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=AM4wpjhaRu1VnbLScsMczsVnLF9tLEy5hd6kj7QFVIE=; fh=UHy6wn6deYeel3rxfPEcAf/E8JgVUWtp9/D/O/RzSHA=; b=LhlCgVshAX4oRjHyl6Xu+xa04CgAGcQGRlJJeMli2KFm35su8xienWwoXCldLgir/l nCYAvFKJasICN/jRlyoLO9Nc/SOnFo+aAUyC/q8yUWW54TRQH6+1v/zmhFNjTnntLUfh sPXnegXeom8qPi1lmy14xWYZwyj7OlylTJ4G2E15bWZFWnrDG1hMBJDdbKUoaMUnmVJE UsqQau5pVuvwh8QlGI3zGRETiTu3FZi2GwC64g6T4CZaIoxvlm4PBGyCWne681hXRbRf zxptjTyhMdNA+BPW3QEVmdcluBG/yTLYs3f8y8acrw0XmgKPiYMdJ+OyGfF60U261xZI DcEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DRP/e7hm"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q29-20020ab054dd000000b007eafff0d821si2534495uaa.218.2024.04.25.04.06.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:06:55 -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="DRP/e7hm"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwuM-000322-FM; Thu, 25 Apr 2024 07:04:54 -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 1rzwtE-00009y-6k for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:03 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwt9-0000G4-I1 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:42 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41b5e74fa83so1814755e9.0 for ; Thu, 25 Apr 2024 04:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043006; x=1714647806; 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=AM4wpjhaRu1VnbLScsMczsVnLF9tLEy5hd6kj7QFVIE=; b=DRP/e7hmF6iTP+67jZNGAZC5bdVnFmP3bDeqkkvXVRtNO1QVv9eP+1BQ51xeN1OnO7 GrQgB+KpD9aKhDRUDjNILD++QhzOgAoyQo8ZV2wS16RW7tPR+z9QYb4viTK4x6Tv3tOf PJn0lKmm26v30ffqOJfJkntUbhMQN6/WZqaOTMQyaNG5DpTPxDWZx+2xj3ZuAmZx4rWZ 53j8HNEgGjxvtECCQ5LQ+OPHXbHisNkuBtdoCc8+NbausmdY4/8V0bMH29qz8ZrME+2D BR2kWIENkCnd41O60ynhaXnLwMEJqjUYvwqt8ORwK6XzUuaraxXQQRa4oPp8YIxglKm+ 1UFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043006; x=1714647806; 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=AM4wpjhaRu1VnbLScsMczsVnLF9tLEy5hd6kj7QFVIE=; b=pajwHbasfcXPaAhindbfoIlB7f0BQlOCex0TRtfo9z+Za3MxG4tjOa2R1vBtEgs1Q3 /E3aRGZqNGJ+bODNo7rxQXiSWxawZZIrH9OSB4+3QI8nYN/w4W5WVXBzOJpb+a2L1e3/ LhV4qDjhUoAq1SQGwtYpZZSyl8rfmMePGGS9kKVHYu9ws7mC/JGdL3B+6eQztR5xEDjs ODCu736Q/xGJcBDyYXM0SWsqWY11jblmZHZRDFkKcmYNYuo8gMX6rm844xtLn7wFZVJO Z9XrCTLwAt1NsfQcQoBa9z7I0ZhxG+mmP3NZLcauTmUcTLowXKuSpmtP3T5lsLxIV0fV Lqgw== X-Gm-Message-State: AOJu0YyyuI/7yfjf7uncyuQnMiFAanOt2Oa6pE+t90a6MUr6Vn4fJT89 4fzOuIhAXkkevgIKpCir3cRRDsOi3yA0RMuTvulajnAMQrhVio8cqsuzGLic2JYtfiMQRKqgW1t V X-Received: by 2002:a05:600c:4508:b0:418:f991:8ad4 with SMTP id t8-20020a05600c450800b00418f9918ad4mr4383715wmo.6.1714043006094; Thu, 25 Apr 2024 04:03:26 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id l37-20020a05600c1d2500b004186f979543sm31187720wms.33.2024.04.25.04.03.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Richard Henderson , Warner Losh , Kyle Evans , Laurent Vivier Subject: [PULL 15/22] hw/elf_ops: Rename elf_ops.h -> elf_ops.h.inc Date: Thu, 25 Apr 2024 13:01:48 +0200 Message-ID: <20240425110157.20328-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc. Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented in the Coding Style: If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion. Therefore rename "hw/elf_ops.h" as "hw/elf_ops.h.inc". Signed-off-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson Message-Id: <20240424173333.96148-2-philmd@linaro.org> --- include/hw/{elf_ops.h => elf_ops.h.inc} | 0 bsd-user/elfload.c | 2 +- hw/core/loader.c | 4 ++-- linux-user/elfload.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename include/hw/{elf_ops.h => elf_ops.h.inc} (100%) diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h.inc similarity index 100% rename from include/hw/elf_ops.h rename to include/hw/elf_ops.h.inc diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index baf2f63d2f..833fa3bd05 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -383,7 +383,7 @@ static const char *lookup_symbolxx(struct syminfo *s, uint64_t orig_addr) return ""; } -/* FIXME: This should use elf_ops.h */ +/* FIXME: This should use elf_ops.h.inc */ static int symcmp(const void *s0, const void *s1) { struct elf_sym *sym0 = (struct elf_sym *)s0; diff --git a/hw/core/loader.c b/hw/core/loader.c index b8e52f3fb0..2f8105d7de 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -305,7 +305,7 @@ static void *load_at(int fd, off_t offset, size_t size) #define elf_word uint32_t #define elf_sword int32_t #define bswapSZs bswap32s -#include "hw/elf_ops.h" +#include "hw/elf_ops.h.inc" #undef elfhdr #undef elf_phdr @@ -327,7 +327,7 @@ static void *load_at(int fd, off_t offset, size_t size) #define elf_sword int64_t #define bswapSZs bswap64s #define SZ 64 -#include "hw/elf_ops.h" +#include "hw/elf_ops.h.inc" const char *load_elf_strerror(ssize_t error) { diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f4a0b78c75..a0999dac15 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3572,7 +3572,7 @@ static const char *lookup_symbolxx(struct syminfo *s, uint64_t orig_addr) return ""; } -/* FIXME: This should use elf_ops.h */ +/* FIXME: This should use elf_ops.h.inc */ static int symcmp(const void *s0, const void *s1) { struct elf_sym *sym0 = (struct elf_sym *)s0; From patchwork Thu Apr 25 11:01:49 2024 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: 792043 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1322099wrq; Thu, 25 Apr 2024 04:08:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXW1+RGv+bXB6IHWPVXSvfRqKP5V1NV2AuYtBCth/X+0LfjidqZplaPkAJgfCBCD2mwVo9XoXXYAZrOrLGmExCA X-Google-Smtp-Source: AGHT+IHPiwG4F4Op3bAqdcpsoUXdHQekaKNlnb6nhVcWY9ymJ9apgTH/yBPF7SmebFa9WXrREzNH X-Received: by 2002:a05:620a:478e:b0:790:7fe3:9fe1 with SMTP id dt14-20020a05620a478e00b007907fe39fe1mr5235694qkb.68.1714043317066; Thu, 25 Apr 2024 04:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043317; cv=none; d=google.com; s=arc-20160816; b=tiAeWnZsTFKTsrD0qk+vXCV6jY/2iEy9ZlZRhCPLYesNNLuxq9hh98z2PMJM8hpI2K 476t8rth3viFmvWcLb+26pvSlAPoDsKq9OOyaiSE6g3ZF3NFr5+Wa9v/zcenrfm38MLb 86KxpnTLzwaxrO8W/AJeaAMoYpY38dw6PChGOFNRE+KrAITMBDt3jcRb+Yh/orA3gVQg gvLIDMHjWgpHmhNmJOEm/71rOPAqxyjwKQB5BL3lSj5esObT+GCQ7K8ATybB5dgt/x8D 0fxb1MausQk6OXSCvrPYlJs6ttinGX8WShZKYJZ2JMz2hvX02m29VTCoTcCnoR8oytDZ KJKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=2PQHJ5tsa1+Iw7rGUJbqHRL8DwWj2o26FTHLneT25lU=; fh=j2Fq9BaE9ATK3sJq+zlJNeaS2ahI1zKJ8A0KQe8IA3o=; b=MDSM+YEt9mwACkUNa/d0pXTbTi5fzpED+eoWiCYisd71hpXfkprOXwUhCAK2AOhOEs 1S6Ih2Z1G0N6fFSBg5nP8O3IlSsdSUg0WFHq87ee+Y6ZpSphzihC1vBaDKdtcKWDRZk+ 9IT0qkZDe3qVglYVcU54QKAgQSCzvyFKQqF9rt2ffdb4iblNaBUMkWhFOc6/kqLptH9k eVRuRduBYcKD/6rPGTL2wDfQOdYyZBxOklm2r7CJ+pCUkUz1Jys06we/FD7b02R+RJc6 Jv22b46ZAsfDTu3q3VBRB6H/D/5qqqbtsU6xmSfC48kuLUtXLNfF+YqYHOVWUhkva+AT ITfA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qF5vPcOk; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id vy15-20020a05620a490f00b0078ef8c97619si16842172qkn.626.2024.04.25.04.08.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:08:37 -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=qF5vPcOk; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwu4-0002K9-LE; Thu, 25 Apr 2024 07:04:36 -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 1rzwtJ-0000B0-T9 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:03 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwtA-0000I3-Sq for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:44 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2de233961caso7891981fa.3 for ; Thu, 25 Apr 2024 04:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043011; x=1714647811; 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=2PQHJ5tsa1+Iw7rGUJbqHRL8DwWj2o26FTHLneT25lU=; b=qF5vPcOkQSHZM1NLwAfCBQMhgKN/jwiR9NQS6Ch89FK9VZIjHtD/ZTHN1U1oybFX9/ j8km1Ge599RgH2hYhdMMQ/9FzK9rsJHIXk5WHMmT8xx79+NQvbvqp5RLY1B27ZBbLhsR E45oDsbfz2XHLQloCcYrmAb5HSOCzmCIUypH5bGamARXwIYgz02OqGSD6sFYcSxnIu0O nFAApaf1RT58vkwUKnTcdFQ4dEHldFNiO4Kffc2BISTerJOpHnHPdnFE0AyaIa4UhO5/ x7u5Jrz2uRTFxoE08ZqEIvE44frv9LSbx6Wd1fQU6PgRYJbq817/YvCTEYUE8sXv3918 GWFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043011; x=1714647811; 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=2PQHJ5tsa1+Iw7rGUJbqHRL8DwWj2o26FTHLneT25lU=; b=CW+2pwd07fyF+AOcDJ1u0LQb0PXIMzJjiJseJWGJfm18gjcwtUAsnRptDkD75BaPo4 gwY4KZ6bjpdQ5FUmI7RH7Hgmdt9fy8yqp8yr5/r2BzaDQD9HIahniWnAFsMwN67lZRx+ LNbVI9XVj2KJImO3ZM5LSUFYegczNvN/6DlGoIu9hCLFqaM7i47a+OphuoKONZJZdswG L2Q4hSJX6ZoyMbpx3ekxp8X5bN0kZkqkLT7WnT6Hb75tGJNutAhvjNTajqHVQB2Nx5Rk zKVESalVnj3tyI8Tw/vPHQOr8CzlmQJO82dOx4iVj0eKnruCHvysJgPotoGpTZjmFMS9 tCSA== X-Gm-Message-State: AOJu0Yxt7KNJPw4jQR8dem6nJymdQO++FKYLc50joCw3ytmi0F/PfLF1 +M9r8WbtvV5V4QOhqGy+L8U7ObXq3USDHikQs9o/XFeDRQZyWRGq8zC716+9bAvr+KXvN724+cm Z X-Received: by 2002:a2e:b353:0:b0:2d8:3e07:5651 with SMTP id q19-20020a2eb353000000b002d83e075651mr4356960lja.34.1714043011391; Thu, 25 Apr 2024 04:03:31 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id bd25-20020a05600c1f1900b00419f7d6879dsm18832137wmb.8.2024.04.25.04.03.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Anton Johansson , Max Filippov Subject: [PULL 16/22] hw/xtensa: Include missing 'exec/cpu-common.h' in 'bootparam.h' Date: Thu, 25 Apr 2024 13:01:49 +0200 Message-ID: <20240425110157.20328-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.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 cpu_physical_memory_write() is declared in "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20240418192525.97451-21-philmd@linaro.org> --- hw/xtensa/bootparam.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xtensa/bootparam.h b/hw/xtensa/bootparam.h index ade7891ec5..f57ff850bc 100644 --- a/hw/xtensa/bootparam.h +++ b/hw/xtensa/bootparam.h @@ -1,6 +1,8 @@ #ifndef HW_XTENSA_BOOTPARAM_H #define HW_XTENSA_BOOTPARAM_H +#include "exec/cpu-common.h" + #define BP_TAG_COMMAND_LINE 0x1001 /* command line (0-terminated string)*/ #define BP_TAG_INITRD 0x1002 /* ramdisk addr and size (bp_meminfo) */ #define BP_TAG_MEMORY 0x1003 /* memory addr and size (bp_meminfo) */ From patchwork Thu Apr 25 11:01:50 2024 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: 792044 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1322477wrq; Thu, 25 Apr 2024 04:09:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU4ItqZfJWmdu1NGDUaisIzDgc7ArkAj6DyDG7eFD/ahAbhd1jF7Q5QBpkUpk1p9xg4RpXH4syyp799RaA9T6vp X-Google-Smtp-Source: AGHT+IHziXgve9eSy00pD3QMdz7aG2C7dDG/t13hTAmPCk054FNnKeDEAH3Gnz+DcXvgBNebnibE X-Received: by 2002:a05:6214:d48:b0:6a0:9472:c67f with SMTP id 8-20020a0562140d4800b006a09472c67fmr5529938qvr.54.1714043366789; Thu, 25 Apr 2024 04:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043366; cv=none; d=google.com; s=arc-20160816; b=m0aGR+DItqFf4H7xYBQb7OSyu+Kp0QN5Nf7JhyM4xfOfHlxv2tECaVFpQR85fEtIJS 05fcANgaPqHIsRFyHRSRyN9NOnNkJY+qm1fyvNHIEFfyGBRBqcV/Bdpb7LL0ANJwxVaL h6ukTsh1D2kSR66Rj+uURXUOM8X+a/xl8CDlSl3aqEyWHu9GdZAbuBRDz7TptqzkWE4V bsBTQ3aE0Wv+VV0njVcxGo9+A6Vpj6Fp/Ev0zxg56FvCLZE7OQm8zFyRwXL8NNb7FwtN 0DFVosJ8P4pI9Ve7KVhpTi8mMI8Rvw4EYJatAc3OLVywQmUIgcW2x+q2XwWV9nmiHL1u IYXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=q5xgdXCGND9O0mxiiZCYBTt0WDd2teRijPgGqLuPJXs=; fh=PfSl/WpLbbL1ifJgzo/FGrFCnHrMaG0ZnIQaKpTl/bQ=; b=SRMSjT48EYTL7Dnn/U1ft54XildTymW0tSXGuApRQBDtsrGXYfdU7SNSxddrlWNIqN TDdvZgEjCO6mCHxvmV8z52zHaVemaSrhUT7VRLF9HcxNqq0t4UvuhNeBSqDwDEcdPcWO 8UkL5JHO34Y2Qx1bRx0d7/8r0wgb1FPrNfiE4Lz8a4nn6xnUhzJAvTWJzvouS2wqL3rP vegDWyaaJaUZYFyGDSEDGLbi0PXE1NvB1sqtHU6V60s1dK8rigwnSlHdZW1JOhuGm16Y HRoYGCw2i2dgOop+7rK51gOa7t0CTCST/s043yibfDKmmU9wimLWXy+twCTLzZCRWR0O WJoQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KLiWuHsU; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gf10-20020a056214250a00b0069b8256d994si16798090qvb.67.2024.04.25.04.09.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:09:26 -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=KLiWuHsU; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwuK-0002u4-0Y; Thu, 25 Apr 2024 07:04:52 -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 1rzwtJ-0000Az-So for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:01 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwtA-0000Ia-SM for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:44 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41a72f3a1edso6922155e9.2 for ; Thu, 25 Apr 2024 04:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043016; x=1714647816; 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=q5xgdXCGND9O0mxiiZCYBTt0WDd2teRijPgGqLuPJXs=; b=KLiWuHsUAeuPx4sl4ND4n1oy5qSZ+UIdFxCcJey6GEAV02TWen3HmX6Tb5RcYbDIRU 5Zes31VVjrwyd487fvDRHZ38g7tFP+xqrf16DtPLJJfzITgoAQoPcfKUPLmwHn3Ae4FM 2FgqqNOv5ernMV70wfkFg+oVOXTF/y3gmPJ3ZaC3+vgY/5zN+oJJDLYdosCbHxAk7wNe HJhG9pSmv2EPUN0Z1wInparDlwG+HMrCgmSj3wrj1D6Zvgd6CCsDpn2xrWZzzZ5cPA+z 2JJgXhrdQM7NbxE2Xv+79vOmTwWqu77cHQVpiAlMtRjadSMx6mC4NgKmBwuZgaZ36msP i31g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043016; x=1714647816; 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=q5xgdXCGND9O0mxiiZCYBTt0WDd2teRijPgGqLuPJXs=; b=Uk0T8iZCSMJYoF3oVAkId5WkQUJKnXMUgnCgyv1SEyaur7XYufm29/0acWNKR0c/x+ HVoT2jhwNekIsa674jYCZRiIdPQTTU5CZ6YpChpFalIsT2A4uCyfTDNEsyjf9sOFvKOh VTAY51LwfhglnR/IIF2KsD8bTQca3p2Y5jOmDthZszynY2btzdUaanEA9WfMyzcG6VVw SWHFvi/QNsGb6hpvQ1G2bzR5aH9X1ysY14XuJNIrQVCl6EJHbJDHzPzsxCMiCsSa0yzU KIOZs8ACPrdmjkKIs1oS1FLr3Dl2+lNHPmQWe/BwlOHbk6qrNGd3daIdZEApjC3KfM9x LEcQ== X-Gm-Message-State: AOJu0YwCk/YTshnfUICUioSjN62ffRRrKEMn9fFjQNNqFgCZ9SIGjmRn TrvmILOaxEipb4NezEyHJ0a02RsezCnJ+3E5purXQp3VNcHQ5A53kUONxGxenJnIbPp+kPe4Wh2 T X-Received: by 2002:adf:f146:0:b0:343:b686:89a0 with SMTP id y6-20020adff146000000b00343b68689a0mr3968839wro.13.1714043016769; Thu, 25 Apr 2024 04:03:36 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id x13-20020a5d54cd000000b0034335e47102sm19464539wrv.113.2024.04.25.04.03.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?In=C3=A8s_Varhol?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Arnaud Minier Subject: [PULL 17/22] hw/misc : Correct 5 spaces indents in stm32l4x5_exti Date: Thu, 25 Apr 2024 13:01:50 +0200 Message-ID: <20240425110157.20328-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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: Inès Varhol Signed-off-by: Inès Varhol Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240421141455.116548-1-ines.varhol@telecom-paris.fr> Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/stm32l4x5_exti.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/misc/stm32l4x5_exti.c b/hw/misc/stm32l4x5_exti.c index 9fd859160d..5c55ee4268 100644 --- a/hw/misc/stm32l4x5_exti.c +++ b/hw/misc/stm32l4x5_exti.c @@ -59,22 +59,22 @@ static const uint32_t exti_romask[EXTI_NUM_REGISTER] = { static unsigned regbank_index_by_irq(unsigned irq) { - return irq >= EXTI_MAX_IRQ_PER_BANK ? 1 : 0; + return irq >= EXTI_MAX_IRQ_PER_BANK ? 1 : 0; } static unsigned regbank_index_by_addr(hwaddr addr) { - return addr >= EXTI_IMR2 ? 1 : 0; + return addr >= EXTI_IMR2 ? 1 : 0; } static unsigned valid_mask(unsigned bank) { - return MAKE_64BIT_MASK(0, irqs_per_bank[bank]); + return MAKE_64BIT_MASK(0, irqs_per_bank[bank]); } static unsigned configurable_mask(unsigned bank) { - return valid_mask(bank) & ~exti_romask[bank]; + return valid_mask(bank) & ~exti_romask[bank]; } static void stm32l4x5_exti_reset_hold(Object *obj) From patchwork Thu Apr 25 11:01:51 2024 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: 792046 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1322579wrq; Thu, 25 Apr 2024 04:09:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWE8p1ASFKbya7L0I0btF7CnjZpgwJUKsA/FJvTF+DalTZAV2wkRRSTRd4Nc79XC5RPkqOsSVn/RMFtCXv6U2cZ X-Google-Smtp-Source: AGHT+IHzrlk2BnBvDWt+3BhPE16P1r6ACrYLfVXSbFRxJqlcOMMkmola3a9npneONRb9d2MRoasL X-Received: by 2002:a05:6214:88e:b0:6a0:582e:1a3f with SMTP id cz14-20020a056214088e00b006a0582e1a3fmr5402544qvb.15.1714043380986; Thu, 25 Apr 2024 04:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043380; cv=none; d=google.com; s=arc-20160816; b=ecnY5QEK/XEPFpnBF+EvFLjWpI4Y2QrZqvt5pU2oH19cs9Un6wL47DYrPlSeKldB5G bRUxvXAdd1+XqH+mFvRosV7/qu8w5hh3GWssSmq8ST6TQHaKuQfi/3tIEfJGR4hjZIol HnO/4B34IQwswAUCan4aYQmi4EgWTkdYdAAD/KMgpM/5LntWh61T6MamFsuwxGCPcQ7C W9Q3QWkg1p3WWCbMnMBmnBN0G4JmKhv3mOtdI9dgoP9FK4ut1SGR8b0XU84jZI8g6Bld o2BaqCzvC0Os4vOOCDz/Npl2kyl2C2HU8qMWvaLItX0A9PDnjrdN2UQA7P/WivL4TiEE ib+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=3jM66TtA9+JPWnnaJ/wdkFyoBPGKJrTnB7XlYnSXjfw=; fh=rQHGcQ/eapkDC7nta91rxErix5SC6+OpapNrU2W5BZU=; b=P5tV6E1Fh1jwG7W0mwb1Lsmpff7rGFzC2QfsKzQy7IgO6ICv1UpkmAh5i6LLqRfVw0 aic7+s/VM6X9cDZRLuJwxTEmjFoH8y90RMJL8lPrRzVRdQNXYVTEsWbacrrzrFn4rfhb uwqbWxVoViFO803jhbUKWzolMTIsWhnctytFEkylh2dvzVYc5DlFiRBApoC0R/18iNrb hmhe0NxxB3IYuWCVgufLjdI7ZmoLCrv+NATzmZfu30MZzgC8EcBf0lxV+FjcfRDpKzn+ 024kX1CgczzNpDGDVk6f0zsP5/xpN2lnfGgXZyUUnq14dlGNKW9ObYJ2msIk9dTcDtLd yy7g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q67tIChe; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ib13-20020a0562141c8d00b006a069eaccbfsi13561858qvb.205.2024.04.25.04.09.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:09:40 -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=q67tIChe; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwuJ-0002rz-CK; Thu, 25 Apr 2024 07:04: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 1rzwtN-0000Du-M8 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:03 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwtH-0000Jz-Lk for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:52 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-41b3692b508so6091645e9.1 for ; Thu, 25 Apr 2024 04:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043022; x=1714647822; 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=3jM66TtA9+JPWnnaJ/wdkFyoBPGKJrTnB7XlYnSXjfw=; b=q67tICheuqQtUFBIwqS8xdmp9ZjCnwej4ObCq0rfBW0NnQ5jxQfOibhMOdM4cS/LZO 7uEqp3eN7KJ/f6mHWt0GgKd4kvOj8bCevQQIsTWS4PDAgRVEmw/JWezo/nUIlZCDleWp lPlHGABqys96bi7bcWl/Baf6f5EW3jNOhUcNwmrFBj/pLdJ+BcS+V4RB8VTY4X/b+ti5 a4ZNF4Sc7vaIwUXU7DedWrG1qF9SG8ty02pFOLgjKUZnkecwOxCWWJ5Y5jQlgRwxFcYG uUQhoPrnbf3PSDWRrSG/RhlgDYK5kXAhZvVj86moZEn003H0yMemIislAARfYsVmG8uR Hbkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043022; x=1714647822; 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=3jM66TtA9+JPWnnaJ/wdkFyoBPGKJrTnB7XlYnSXjfw=; b=MBvshvN+3TEyZF207hQSpIV0u134DHOj7jYMY1DdMGrCEcZplqMr1JDa9HDpHTpEix 91G2qoA7ZyNGjplMh3GHLkGFUgRKfs89xzXo0BPW4XYfoJRMmvxFe/1O1dgx/M/12Yeq 6bN4kvXgCA1pxc/eC24RwGHhZfUw/zKLufwbwwYbV65wZa0NpzIrl8q2xIJeSA7O1B95 UrkWgF8vANrvcHCcEI2uLvQy4JPPdjTv4L8BIZQyEpZw+AHfarH81kDav1JN8LIo2BzN 05q6tca96Sn40riTTtMa0B/ozODxJliuhdmrciQICpShj4EuG4qnoIgTg9Mr2PIE6SNQ E9xA== X-Gm-Message-State: AOJu0YzyhRznqnFYNgylpA8NuOG5Xl/+tb0+rsUBsnIaGlx6M1xUtIlp ag7sQJ77fjere6oQDtk1jmlGm1G6JdPB41hmV6M92M8esr1yFxFH3Ml2ktUsJNuIIZISBu02nRi k X-Received: by 2002:a05:600c:4ecb:b0:419:ed35:e312 with SMTP id g11-20020a05600c4ecb00b00419ed35e312mr4210635wmq.21.1714043022268; Thu, 25 Apr 2024 04:03:42 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id u11-20020a05600c138b00b004187450e4cesm30787552wmf.29.2024.04.25.04.03.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 18/22] hw/i386/pc_sysfw: Remove unused parameter from pc_isa_bios_init() Date: Thu, 25 Apr 2024 13:01:51 +0200 Message-ID: <20240425110157.20328-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=unavailable 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: Bernhard Beschow Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240422200625.2768-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_sysfw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 3efabbbab2..87b5bf59d6 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -41,8 +41,7 @@ #define FLASH_SECTOR_SIZE 4096 static void pc_isa_bios_init(MemoryRegion *rom_memory, - MemoryRegion *flash_mem, - int ram_size) + MemoryRegion *flash_mem) { int isa_bios_size; MemoryRegion *isa_bios; @@ -186,7 +185,7 @@ static void pc_system_flash_map(PCMachineState *pcms, if (i == 0) { flash_mem = pflash_cfi01_get_memory(system_flash); - pc_isa_bios_init(rom_memory, flash_mem, size); + pc_isa_bios_init(rom_memory, flash_mem); /* Encrypt the pflash boot ROM */ if (sev_enabled()) { From patchwork Thu Apr 25 11:01:52 2024 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: 792048 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1323273wrq; Thu, 25 Apr 2024 04:11:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/W+WEwLxsfsjoMlmjBZ4e8xsJpaLzvHptbKkr3ha1eAxLc9T/XWdr6LBmOt/5+yAOPLV5oTyHPMn7r1/jGi7s X-Google-Smtp-Source: AGHT+IGINC7ZGWVlYetgpLivOs296sufAx/j4r8JaVjV6JhMwv/ZAuPXuqvgB8DQrKvocZdyCJd5 X-Received: by 2002:a05:622a:109:b0:436:865f:323e with SMTP id u9-20020a05622a010900b00436865f323emr5776933qtw.24.1714043474867; Thu, 25 Apr 2024 04:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043474; cv=none; d=google.com; s=arc-20160816; b=ziKq/4OvrvRTJukE9ktxF1KpTLQNjvqEPkqDwVcwxcPSUl7Wmak3Yh+Bo7eGYgoW2X 4COFcOJp7kE2XBMjO253iogiYrA1mn5TgO0CH1t6uqudSwL/vG5yua+ZoPADiNeSj9Lz 992F8MECx4SvQRiyDa092HPRCJ2GngnCBfMgQjlsf5V5URpkwCD1BDGR2B+XHbeLO5BX veCMOUKAqE5Vcae0Y6wqblHN8H9GJPbJ1crd7pyotXC2paMKEwqnsmLplKs4Ny5yYY5i pYrwaRu5O94nC9r/0EamVyE7P9kHGdGgHdvzIWfzhJbgmKzFC5a902vMr7NkRPvY10Yp fgEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=W7uwePuX3rPWTRA+fw+W1FX6Shl9Ifmx73up+GoZgb0=; fh=jKYqiy7C+dDEru12ui+4Hl0e061VAGh7hE6jAPvcCvw=; b=brsLRYRM+hOC5ZM86bubEv8EstTf/YlVcwNImPENDQs1FlQTXigW6vb36BHlhz2gqi ljBXClKBvX29UxkVudTVIsPtRWhXWdrB2OKcFhQfqtHCHxV/5Sr4ejOUAj+ChuWGcYAS 15LAOnJ9zbVGCVbxzUGmJ92k8NoOqxo7VeaF3bJR4OfmZ/deaoYN4rGnpLYBd4yeEE9b S+HERN36awDshzJSq8rJJWE80au/UNJtOud88JJdNVswcBvrtWzwY8gt4RRiswjP7ruy fpyPmz9QS/bg258yrPJHoEoPEU5ZJw6EbHcWN/1hrEyVYNUaGSJqt6dagoOWo2acqabR IW5Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CFwqAPvF; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dr17-20020a05622a529100b0043709c6ab8fsi15621395qtb.535.2024.04.25.04.11.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:11:14 -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=CFwqAPvF; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwuW-0003JF-Qa; Thu, 25 Apr 2024 07:05:06 -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 1rzwtX-0000IJ-HN for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:09 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwtN-0000Ky-B3 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:03:55 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41b3692b508so6092365e9.1 for ; Thu, 25 Apr 2024 04:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043028; x=1714647828; 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=W7uwePuX3rPWTRA+fw+W1FX6Shl9Ifmx73up+GoZgb0=; b=CFwqAPvFeUPkhH4JNVmmXc9RzcanHFPge6GaaXeL2rXurKpilMQmpVqVsGz32mxv6v pGWBI3PACyXx3XAKNi5uBH7D6+5BAiP5Z7GNBCfu2hidZx6UDASwjZIuS7yXeEK31Zag F3mokBzLLIgZcEste0+Y+dV5FAVJKYp7OLNyHJPDxI54AqSPLZaT1shztRSONi7pvBDz fN5+Ew2IS2A/T9Rwe/CT9LPzXd/+i43LDx36X9FimFBzIzk6kAvYDI9Lfze+2tHN+03B IO4pYV5t/PVtQ1rKsxqZXV1IfYz+SX00FS5yACi7Nbyc0uqxVHX3o3k1xpjCWK8UiUhf L9cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043028; x=1714647828; 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=W7uwePuX3rPWTRA+fw+W1FX6Shl9Ifmx73up+GoZgb0=; b=V7mYkam3QXfpO+3JbnXBqXdOV8JnxxqrqykgCylHKF86KqzPrRhvCzj7518ZLefbwT VDA79d5UQBB1/XDK5/3xQ3KttqVRVXEEokKLUnHcxqK4g0UEr4KU9C7J67wQaOk0FLYj LEyG96VE0/ETdKJglF7uZ25WuYUXpjbA3Y0R5u4A+NLndNaSKkb7QXE3JcZsihTdyi3/ rg0n8vH+iAgC4ll6uqoSVa6gs0KCi8LkLVjFAtOKbVfCp4FP/ucX5S7k+s+d5husVgvL VgUvt6ZNYd+sHA8v36XHRXOTyzfT5gav+lJc5Bz3/CuAXvvcy4kRxJf+2qL3Az6jtTe4 OTrQ== X-Gm-Message-State: AOJu0YzHKzY6bP7q8vSftzNUKsbT2vVYi3PhtQcO1ppGxeys9VvZ5Bex eJxjA19YAJlAz8/FISpZJi6cdXyT8ozFg4yeyt+eEJytmjLTWOvizLnfNxTgqO0zfm3AUqbCz7b e X-Received: by 2002:a05:600c:3502:b0:41a:fe41:80e4 with SMTP id h2-20020a05600c350200b0041afe4180e4mr3402391wmq.0.1714043027837; Thu, 25 Apr 2024 04:03:47 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id jg1-20020a05600ca00100b0041b25a70a85sm3623801wmb.30.2024.04.25.04.03.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoyao Li , Yongwei Ma , Babu Moger , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 19/22] hw/core/machine: Introduce the module as a CPU topology level Date: Thu, 25 Apr 2024 13:01:52 +0200 Message-ID: <20240425110157.20328-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: Zhao Liu In x86, module is the topology level above core, which contains a set of cores that share certain resources (in current products, the resource usually includes L2 cache, as well as module scoped features and MSRs). Though smp.clusters could also share the L2 cache resource [1], there are following reasons that drive us to introduce the new smp.modules: * As the CPU topology abstraction in device tree [2], cluster supports nesting (though currently QEMU hasn't support that). In contrast, (x86) module does not support nesting. * Due to nesting, there is great flexibility in sharing resources on cluster, rather than narrowing cluster down to sharing L2 (and L3 tags) as the lowest topology level that contains cores. * Flexible nesting of cluster allows it to correspond to any level between the x86 package and core. * In Linux kernel, x86's cluster only represents the L2 cache domain but QEMU's smp.clusters is the CPU topology level. Linux kernel will also expose module level topology information in sysfs for x86. To avoid cluster ambiguity and keep a consistent CPU topology naming style with the Linux kernel, we introduce module level for x86. The module is, in existing hardware practice, the lowest layer that contains the core, while the cluster is able to have a higher topological scope than the module due to its nesting. Therefore, place the module between the cluster and the core: drawer/book/socket/die/cluster/module/core/thread With the above topological hierarchy order, introduce module level support in MachineState and MachineClass. [1]: https://lore.kernel.org/qemu-devel/c3d68005-54e0-b8fe-8dc1-5989fe3c7e69@huawei.com/ [2]: https://www.kernel.org/doc/Documentation/devicetree/bindings/cpu/cpu-topology.txt Suggested-by: Xiaoyao Li Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-2-zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h | 4 ++++ hw/core/machine-smp.c | 2 +- hw/core/machine.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 69c1ba45cf..2fa800f11a 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -144,6 +144,7 @@ typedef struct { * provided SMP configuration * @books_supported - whether books are supported by the machine * @drawers_supported - whether drawers are supported by the machine + * @modules_supported - whether modules are supported by the machine */ typedef struct { bool prefer_sockets; @@ -152,6 +153,7 @@ typedef struct { bool has_clusters; bool books_supported; bool drawers_supported; + bool modules_supported; } SMPCompatProps; /** @@ -339,6 +341,7 @@ typedef struct DeviceMemoryState { * @sockets: the number of sockets in one book * @dies: the number of dies in one socket * @clusters: the number of clusters in one die + * @modules: the number of modules in one cluster * @cores: the number of cores in one cluster * @threads: the number of threads in one core * @max_cpus: the maximum number of logical processors on the machine @@ -350,6 +353,7 @@ typedef struct CpuTopology { unsigned int sockets; unsigned int dies; unsigned int clusters; + unsigned int modules; unsigned int cores; unsigned int threads; unsigned int max_cpus; diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 27864c9507..2e68fcfdfd 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -266,7 +266,7 @@ void machine_parse_smp_config(MachineState *ms, unsigned int machine_topo_get_cores_per_socket(const MachineState *ms) { - return ms->smp.cores * ms->smp.clusters * ms->smp.dies; + return ms->smp.cores * ms->smp.modules * ms->smp.clusters * ms->smp.dies; } unsigned int machine_topo_get_threads_per_socket(const MachineState *ms) diff --git a/hw/core/machine.c b/hw/core/machine.c index 582c2df37a..9966641159 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1157,6 +1157,7 @@ static void machine_initfn(Object *obj) ms->smp.sockets = 1; ms->smp.dies = 1; ms->smp.clusters = 1; + ms->smp.modules = 1; ms->smp.cores = 1; ms->smp.threads = 1; From patchwork Thu Apr 25 11:01:53 2024 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: 792036 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1320741wrq; Thu, 25 Apr 2024 04:05:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNOzkOuAf3rfPUykCNCXoqhEBBPNqelZBvgGYXJIPdnukBs212HHDtiiEy6sTLH9VJBMb7hGmcv9i1I6rDPm43 X-Google-Smtp-Source: AGHT+IHclAGMpR8UIhzt6pAxgAbVFaN1qhRAwVCb49vp9qHx8H1umXoI0S2bUb7ykXp4i06GJOpq X-Received: by 2002:a05:690c:dd0:b0:61b:34b0:ff04 with SMTP id db16-20020a05690c0dd000b0061b34b0ff04mr6318500ywb.32.1714043141426; Thu, 25 Apr 2024 04:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043141; cv=none; d=google.com; s=arc-20160816; b=XW66uwLrjV104LRNjx1xHFJ+eYZ9hAgc+nvaH5UeRsr/jVtTiH6IRiiyz5FUiuFErS KSBbJDckVk8fnf/Gmrq9f6qQriKdbywRuUAMYV9OIjkr1HQa2fgynQD34HtWXiTOv7FH Dyw+OefP2Il7SBiNqyZa453XGpVc25l01bC2JGskjF6U9tg8omlEmn93yg6As7ddWvnq c9ltcgREJGyy5G9CWmd1jzRJt5Lwi1bvdefSpIqZLmN1TVN3FhY4MYx+2sNgSbNU/NoI 6gqJqdxV07pXTqUCK2IgcP+9JA10TXpuNgiJ6kAejbwwVrloFtFJS0b6gIn6P0DEiuvU cYLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=g96vdGUPlIMAMR0tgpTdGd3qjyGWYgQDQCU+2PoDhEA=; fh=TBL3Mx94G/aelIedW540hDZQNsCgt/bV9I/HuyB/87o=; b=v2NPcFnOay/Y8wCStsUCyPFlAycYoFVj3lCJPwcvf/+0YFok9Vmenn2N6qxwXZkQgZ 4CkZrGdVWBOxzGUsltldfgNlKbCsZ7UHBKT1TepGqaafKx2W01ZXZickXVe9gpYeZkfV 5z/gBxKCW7Sd11FT5GPmOZ8fSMGyMeNRMxStT/wv1CdQbHzicu37claw/LXe5L4yaZ11 1FEbqOWTWdI9YHJeiESyV1a4PRfpBkC7dmf3VIXt0rU0Ub/IYBsg0AJfP8EITLlE9pTK +f5hmuV3S4hiQsGnvmDy8uh7csOezKEEYYYH/CT9ClK2kLLG038FmsX2KKV1wzObiSXr OAbw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lXLKlDz+; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v4-20020ab05584000000b007de0dbdb9fbsi2614687uaa.89.2024.04.25.04.05.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:05:41 -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=lXLKlDz+; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwu4-0002Ku-SB; Thu, 25 Apr 2024 07:04:36 -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 1rzwtd-0000LH-PR for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:11 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwtZ-0000MP-9W for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:08 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41b51ee24f9so2088585e9.1 for ; Thu, 25 Apr 2024 04:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043034; x=1714647834; 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=g96vdGUPlIMAMR0tgpTdGd3qjyGWYgQDQCU+2PoDhEA=; b=lXLKlDz+kj0vrE/FQpclKomG+nbgEYsQfQzMsUyDCTJwlryROR7hW3iY179ObPbiyP t0vI9mCSNlAvvhHTG1DaqPrtPOqqKNyTsbOGxJy8S7wV4+T+yBdZpGGWkME0UenRJwNj oxJ+ofX5FPu1k2s/pVt9xcvmbAATR/osfMBI1v73u8LhKyjtpfVQhGXX/Hdr3zAm7ptE pQPHpXJWUaeZ+FXm1bMKop5BsgdPXYKR2imr/AHiZ5a1/NWyoxc5tFYN0vSl2vBomU5W 9hMaeuepLAz+95qUq3H0T7MlR7848nP5uD7EH9WTb6FidI1/iGVUgZHBpVERx440mi+a HvuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043034; x=1714647834; 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=g96vdGUPlIMAMR0tgpTdGd3qjyGWYgQDQCU+2PoDhEA=; b=t99PqGslavUEw9/zZlfptwwHfON+gCONro1ttPwl1Yz0vIuQUdGCRVJgVwzdo7mKJQ slQnjecVtcmKTq3LDoM0WBkIdTQzW5by1H5bhpw5vPl0luxcGxUXlL6uXKfaK5yBlE9o izDjafCU9cJ6YvfGW6tF8pQpNOxeMoez8cII/KP0qei87m6LPJRYRIuuwlNydDlV8n0A z4+hELKM5LUL/tFMtPt/BIkhJlDaw6WoC7w5k48zV7Uxrq8WrYs5/3s/csApMoRY/e97 qR6lVWLNfqgNDIv2AWrO4uIUNbMHW2cHrgnc6ydsG4Kuk829qRPsXl+0aCg4MdjvyDWg BTpA== X-Gm-Message-State: AOJu0YyGHeGX+U/Md3Qi7AOocSX+q6i2YHYEroFIoc4NLacrVpsoFdZa y9u8IwTAJUmszaZO4oEYoJoEi/2wJc4hIM/k+HzRa+JO4SqSaEFettYq+D3ZulwsoTjbdAwtfLK 8 X-Received: by 2002:a05:600c:4fc6:b0:41a:3369:61a3 with SMTP id o6-20020a05600c4fc600b0041a336961a3mr2073458wmq.5.1714043033731; Thu, 25 Apr 2024 04:03:53 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id q6-20020a05600c46c600b0041892857924sm27165769wmo.36.2024.04.25.04.03.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoyao Li , Yongwei Ma , Babu Moger , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Eric Blake , Paolo Bonzini Subject: [PULL 20/22] hw/core/machine: Support modules in -smp Date: Thu, 25 Apr 2024 13:01:53 +0200 Message-ID: <20240425110157.20328-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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=unavailable 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: Zhao Liu Add "modules" parameter parsing support in -smp. Suggested-by: Xiaoyao Li Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Acked-by: Markus Armbruster Message-ID: <20240424154929.1487382-3-zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 3 +++ hw/core/machine-smp.c | 39 +++++++++++++++++++++++++++++++++------ hw/core/machine.c | 1 + system/vl.c | 3 +++ 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 3e9cc3f17d..48f98e7d9f 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1696,6 +1696,8 @@ # # @clusters: number of clusters per parent container (since 7.0) # +# @modules: number of modules per parent container (since 9.1) +# # @cores: number of cores per parent container # # @threads: number of threads per core @@ -1709,6 +1711,7 @@ '*sockets': 'int', '*dies': 'int', '*clusters': 'int', + '*modules': 'int', '*cores': 'int', '*threads': 'int', '*maxcpus': 'int' } } diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 2e68fcfdfd..2b93fa99c9 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -51,6 +51,10 @@ static char *cpu_hierarchy_to_string(MachineState *ms) g_string_append_printf(s, " * clusters (%u)", ms->smp.clusters); } + if (mc->smp_props.modules_supported) { + g_string_append_printf(s, " * modules (%u)", ms->smp.modules); + } + g_string_append_printf(s, " * cores (%u)", ms->smp.cores); g_string_append_printf(s, " * threads (%u)", ms->smp.threads); @@ -88,6 +92,7 @@ void machine_parse_smp_config(MachineState *ms, unsigned sockets = config->has_sockets ? config->sockets : 0; unsigned dies = config->has_dies ? config->dies : 0; unsigned clusters = config->has_clusters ? config->clusters : 0; + unsigned modules = config->has_modules ? config->modules : 0; unsigned cores = config->has_cores ? config->cores : 0; unsigned threads = config->has_threads ? config->threads : 0; unsigned maxcpus = config->has_maxcpus ? config->maxcpus : 0; @@ -103,6 +108,7 @@ void machine_parse_smp_config(MachineState *ms, (config->has_sockets && config->sockets == 0) || (config->has_dies && config->dies == 0) || (config->has_clusters && config->clusters == 0) || + (config->has_modules && config->modules == 0) || (config->has_cores && config->cores == 0) || (config->has_threads && config->threads == 0) || (config->has_maxcpus && config->maxcpus == 0)) { @@ -115,6 +121,20 @@ void machine_parse_smp_config(MachineState *ms, * If not supported by the machine, a topology parameter must be * omitted. */ + if (!mc->smp_props.modules_supported && config->has_modules) { + if (config->modules > 1) { + error_setg(errp, "modules not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here modules only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported modules parameter mustn't be " + "specified as 1"); + } + } + modules = modules > 0 ? modules : 1; + if (!mc->smp_props.clusters_supported && config->has_clusters) { if (config->clusters > 1) { error_setg(errp, "clusters not supported by this " @@ -185,11 +205,13 @@ void machine_parse_smp_config(MachineState *ms, cores = cores > 0 ? cores : 1; threads = threads > 0 ? threads : 1; sockets = maxcpus / - (drawers * books * dies * clusters * cores * threads); + (drawers * books * dies * clusters * + modules * cores * threads); } else if (cores == 0) { threads = threads > 0 ? threads : 1; cores = maxcpus / - (drawers * books * sockets * dies * clusters * threads); + (drawers * books * sockets * dies * + clusters * modules * threads); } } else { /* prefer cores over sockets since 6.2 */ @@ -197,22 +219,26 @@ void machine_parse_smp_config(MachineState *ms, sockets = sockets > 0 ? sockets : 1; threads = threads > 0 ? threads : 1; cores = maxcpus / - (drawers * books * sockets * dies * clusters * threads); + (drawers * books * sockets * dies * + clusters * modules * threads); } else if (sockets == 0) { threads = threads > 0 ? threads : 1; sockets = maxcpus / - (drawers * books * dies * clusters * cores * threads); + (drawers * books * dies * clusters * + modules * cores * threads); } } /* try to calculate omitted threads at last */ if (threads == 0) { threads = maxcpus / - (drawers * books * sockets * dies * clusters * cores); + (drawers * books * sockets * dies * + clusters * modules * cores); } } - total_cpus = drawers * books * sockets * dies * clusters * cores * threads; + total_cpus = drawers * books * sockets * dies * + clusters * modules * cores * threads; maxcpus = maxcpus > 0 ? maxcpus : total_cpus; cpus = cpus > 0 ? cpus : maxcpus; @@ -222,6 +248,7 @@ void machine_parse_smp_config(MachineState *ms, ms->smp.sockets = sockets; ms->smp.dies = dies; ms->smp.clusters = clusters; + ms->smp.modules = modules; ms->smp.cores = cores; ms->smp.threads = threads; ms->smp.max_cpus = maxcpus; diff --git a/hw/core/machine.c b/hw/core/machine.c index 9966641159..494b712a76 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -881,6 +881,7 @@ static void machine_get_smp(Object *obj, Visitor *v, const char *name, .has_sockets = true, .sockets = ms->smp.sockets, .has_dies = true, .dies = ms->smp.dies, .has_clusters = true, .clusters = ms->smp.clusters, + .has_modules = true, .modules = ms->smp.modules, .has_cores = true, .cores = ms->smp.cores, .has_threads = true, .threads = ms->smp.threads, .has_maxcpus = true, .maxcpus = ms->smp.max_cpus, diff --git a/system/vl.c b/system/vl.c index c644222982..7756eac81e 100644 --- a/system/vl.c +++ b/system/vl.c @@ -741,6 +741,9 @@ static QemuOptsList qemu_smp_opts = { }, { .name = "clusters", .type = QEMU_OPT_NUMBER, + }, { + .name = "modules", + .type = QEMU_OPT_NUMBER, }, { .name = "cores", .type = QEMU_OPT_NUMBER, From patchwork Thu Apr 25 11:01:54 2024 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: 792041 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1321532wrq; Thu, 25 Apr 2024 04:07:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXdDxElALqJ90lFr7nNj0nwm5PjL1rGP74vwMg7IOGJyYYQtz3jXOBuD50NIbvEN8V36t7P00x8yB/MLpb05VaI X-Google-Smtp-Source: AGHT+IHOGdm+c6tyu2HI0VOSpNwKmhvoEH4SY9Vrg45o+cfWeeEcTDqkNOZccbxW0Q7kzeeuzPwv X-Received: by 2002:a05:620a:2495:b0:790:8e96:783f with SMTP id i21-20020a05620a249500b007908e96783fmr5110498qkn.38.1714043235897; Thu, 25 Apr 2024 04:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043235; cv=none; d=google.com; s=arc-20160816; b=XS7XTwefGX3g6dRvTwn4zBkyBtHFOu9dbOjKOJQBA95kulvTdm6BKc/ngFidFWX8zV umv9yD7x2YKR9Qeydm145QHrK5H8JJB69bAskyAFVI9BVndaHeGAAnh55N5PZwaSNu28 jldbqx2WHX1Mq52mJgbyQc+HD0IUW5Xyc87e80ZwzJ88Y6NR1M7PPhq2Jcbyi8GkwxfC OkrrWHJodo7oYKp9YZN/eEM1exmmR3FnP9UGWeRnea18l01MBYUVaHPnJqM6CDMBVnVj GdB9UAm5nkMcyBg52Iflbg8L/beEOSxJ2eLPjoGFMuR+9spxFPwWQYr/v+6uvy8Aa9R+ 3KBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=vykN0pIt49J3GEMpH2YakbfFLS9d+NOdnblTzedh0DY=; fh=G1w1Z/AdEW8uKPFwD/CK+dtKWGZqsbdf+axt/DkbHfo=; b=dPLmDuEIu/UJw7r3psFDmg6Yxfn2hNNaguMCNFvzdxSgaTwAKbgmiC4ZEKQjWbG5zX DiniCLyQaJ5kZWP4NmGNqPhecf0e+qcVMqSQDr+Bcd26JA2fX4JwXVfDC7vuU01UXXYV CmBUZH2Cy8xWjZfgw480L81wYKKpH7/vrt433DsHif0Ux2uZB9zARzX1h6Y3tAIIOsoc wWAXnhR1H02wLBEITnkQRUpCkhAqCHLug8ry4yvwAreeV2OW7iakdOn04zjQ4CslMPx7 PUG0a/UtzJhhJZwfNMzuljmseqzvqHqNz7zBvwNfB1QQ2v9h3QqU0Qi9toDOyyo3jN3h nXHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ge/5W1Z5"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s28-20020a05620a081c00b0079086db14cdsi5381368qks.16.2024.04.25.04.07.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:07:15 -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="ge/5W1Z5"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwvZ-0004Ty-VN; Thu, 25 Apr 2024 07:06:10 -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 1rzwtd-0000LG-P3 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:11 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwtZ-0000Mw-9g for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:08 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2dd6c14d000so9581821fa.0 for ; Thu, 25 Apr 2024 04:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043039; x=1714647839; 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=vykN0pIt49J3GEMpH2YakbfFLS9d+NOdnblTzedh0DY=; b=ge/5W1Z5UVX3PPgyKn4UHFd9nbESU5wtOTP5095Bm6afywSeBiHPR5htX1M130Qno2 XaV2Y+Sal3luYptmwrG+oNOxp/JMTvsZL9PjQhgsiqozUKtxQ3qymfYVfIsL1hnp+w7U 3WP+c3tsTB9UmQ7oAh1nI1HXpLX52wAkmUmoB4mMKULchs7HLoE/PJRl9ZhUBrgEJVcb kRxsZ/RV/ShdXmv4b+vXS42eZFWq8RBOhH54OrSuD+FCQsDlv8IoJ9ryvWzD1rvYp4Tt dRt6r0yr5VmCD+4kCgfU08vUV06QEsJcJ7vFG+xj0q+Yk/9nNNtLsa/pMHUbNssLhWd/ 7hyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043039; x=1714647839; 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=vykN0pIt49J3GEMpH2YakbfFLS9d+NOdnblTzedh0DY=; b=wFh0wdH2E4MzO+j7VZA9fpWLC1G0QKfIUvbEmqolVrhHbMlVIXce1dE9JJc6MpLCfq MGjLILMiwyq+2BfnDm4ljUdyYfVHZ/g5pee8tkgGAvlHmwSqGtjj2QPwcTBPiCQM+hfB bBvGlhW+ngWiIA7RNwt818arg6uWukEyEhZBLLrGENIxD9OM/wXaozIkHCMSWR7dEOl8 +nUouZXVZaSjQEqKUoJO70NJeL0ImiMgIe59s7v94HjcvntRN6TTskAlIocpka8PN1an TnSCKIdYiKDj6os9jBV/K5Tv+6IbyDaJLn+WQLdXMJ2GZW69GILdNtfnyBCg7awep6dZ Vkxg== X-Gm-Message-State: AOJu0YwAZbTP9Hng+h6JhUnmIFfkLaLF09MNCI6ASxElsf7P6gw8HST2 Mn7v2BzxqZHDN38YYVcZbNnTh/biVdqesRusAfQqksAwj3DL+dS0CNgxb2cL/BL4J0xdb2XLx3z M X-Received: by 2002:a2e:bb83:0:b0:2d8:901f:7f45 with SMTP id y3-20020a2ebb83000000b002d8901f7f45mr3356811lje.13.1714043039569; Thu, 25 Apr 2024 04:03:59 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id e4-20020a05600c4e4400b0041b0f10fc7asm5000576wmq.31.2024.04.25.04.03.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:03:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoyao Li , Yongwei Ma , Babu Moger , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Eric Blake Subject: [PULL 21/22] hw/core: Introduce module-id as the topology subindex Date: Thu, 25 Apr 2024 13:01:54 +0200 Message-ID: <20240425110157.20328-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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=unavailable 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: Zhao Liu Add module-id in CpuInstanceProperties, to locate the CPU with module level. Suggested-by: Xiaoyao Li Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Acked-by: Markus Armbruster Message-ID: <20240424154929.1487382-4-zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 4 ++++ hw/core/machine-hmp-cmds.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qapi/machine.json b/qapi/machine.json index 48f98e7d9f..bce6e1bbc4 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -988,6 +988,9 @@ # @cluster-id: cluster number within the parent container the CPU # belongs to (since 7.1) # +# @module-id: module number within the parent container the CPU belongs +# to (since 9.1) +# # @core-id: core number within the parent container the CPU belongs to # # @thread-id: thread number within the core the CPU belongs to @@ -1005,6 +1008,7 @@ '*socket-id': 'int', '*die-id': 'int', '*cluster-id': 'int', + '*module-id': 'int', '*core-id': 'int', '*thread-id': 'int' } diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c index a6ff6a4875..8701f00cc7 100644 --- a/hw/core/machine-hmp-cmds.c +++ b/hw/core/machine-hmp-cmds.c @@ -87,6 +87,10 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict) monitor_printf(mon, " cluster-id: \"%" PRIu64 "\"\n", c->cluster_id); } + if (c->has_module_id) { + monitor_printf(mon, " module-id: \"%" PRIu64 "\"\n", + c->module_id); + } if (c->has_core_id) { monitor_printf(mon, " core-id: \"%" PRIu64 "\"\n", c->core_id); } From patchwork Thu Apr 25 11:01:55 2024 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: 792049 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1323595wrq; Thu, 25 Apr 2024 04:11:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXKa2NqQjBu0Fq4zpmoJaqseMVAMqNtdlWXzWgamh7eYh8bfHa8AtMK286RbM57eHwZJRs0i5J3F8Bgjg59uEGX X-Google-Smtp-Source: AGHT+IEOriGbw3gz5dq8re0ARi2O4Pvnv2vbfmSxE6sfcElWbyaM+dXRvDRKliC+wKYItCVkfnTC X-Received: by 2002:a0c:e38a:0:b0:6a0:5652:31e4 with SMTP id a10-20020a0ce38a000000b006a0565231e4mr5184071qvl.54.1714043512795; Thu, 25 Apr 2024 04:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714043512; cv=none; d=google.com; s=arc-20160816; b=td+YDdTHdpA9MR1xktoJxGZJQbziMSFrxlCFityaeGcyLT77p990IpTgNg5GDaPjvR SVCPz0jjuKMvu9wPgApJFd84/1rJAMmzqOKwWISWCVqyiJthVrCoEcjZ9NzaBczhT2xZ iPLYl1QqpDludwn3Tl2W4Ss34B8jp4CGPlJb11eWeZDR7Q/wDmIqjdSox9GnrGuuW6gi vdneTUW9JwLvY7NOJOFfmN1aH6qHS5w4wiWbaANMOVWYj27HGAiOgzEVeaHfyUCop0vf PgCNCh3J0nuAAKmeKxtO6YAUYYqJdnHJnjxn8FkSnExE+s7uWjl8aKKzgVaMKiaKIRex D6pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=DtMNR1ZQjJCcNYkkejZVBvEmwe3F+2PjUE+kGb5DBZI=; fh=qWH8hi8k7lowjcxuGdV/j0Tpa+WdX4+Tzn8cqzSXFCM=; b=E+pdFPE+ohaUdj3pwcbtqb7E1EX6/MEJZKtKD2cciV9NIxz2TW4nJnAdHB7bepNLgw xyCYPNIgna+7cfBlzApDXQI9EOzyvUlLFPW6MIsA4IMQolRniAHmWmoVUbYs6EOUkOO0 1nutvU0V0548a80erGk0v3PHYLOuEkGEXObnNog6itgqfej4ARnj3bROfoD93+qgRxAQ iBQuMvLWrw+QJVPv5HVTFKiMtMwIfr3tQ8ssyCsW+BuL4fQpgaFhNIonXJgiez9K/QuM aZaCmIfm20VdgO60pe05+zvTZ9JgdzJazHL6/YqrYBYwm5BUztpgqK67cBuDou8eK9AQ xFvw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qQ8XGqfK; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id hf21-20020a05622a609500b004346094de7dsi17059583qtb.338.2024.04.25.04.11.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 04:11:52 -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=qQ8XGqfK; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwvx-0005cY-Bb; Thu, 25 Apr 2024 07:06:33 -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 1rzwte-0000LM-NY for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:11 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwtb-0000OF-5o for qemu-devel@nongnu.org; Thu, 25 Apr 2024 07:04:09 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-347e635b1fcso639962f8f.1 for ; Thu, 25 Apr 2024 04:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714043045; x=1714647845; 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=DtMNR1ZQjJCcNYkkejZVBvEmwe3F+2PjUE+kGb5DBZI=; b=qQ8XGqfKyttfqQ17Re/ThAnwmjlzoPq9rO1qUq/w6yY5A71wbKOdIN8SCHl2A22jjN O3Ae6fIwtJcAmvtIPr+PWUTPutzI9jMKQUlnFwIn07K3Opu7hDSqeutdoL3IuvTezjfe w7Zaj9ygGl+95fhQp5yK5FccE0OIqDUzyDquhlVEjXl4LUWEisOqxkUHAYZ2UzZQFKOI wGUhgGJ4iXsdmXhGQI7OBpqaja9wS8FtgYvrQEX2ozOdl0CEIuy6GWLT4SMAciIytFX8 4zDk06SRM5R7w9+5w7PtcIkke8e5Opl7BonYK3n+J2J0WfUuIQp5tmX5sPaNoS5kF4CX WzLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714043045; x=1714647845; 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=DtMNR1ZQjJCcNYkkejZVBvEmwe3F+2PjUE+kGb5DBZI=; b=lmzBaij28V5PGGBJ/U2NwieYF1ew1nIl1rZUK3l2A7E7b5LiShRmROqIsxJQoc5F3b IfwbzVarGD5KdQjxYz8uFzcXNliz3HTG8mBPXc0ZjOQx3NX5VziI2Us9YuwQg1xsQx8o AuqoyGGj9b2IHbeWNSdGIyBfRJ3noFgYVrRQXaQPP7wmaAjLPODqhLk3ehmq/04/XWb3 uDBKSIFKqGLIN0oKwIY0aHRzbX072Hklv5a1NLJsCirTcA5k87nRFKLS0p13DfgWClmE IoFQHhcKClMQMA3Z7x5f/NWSzVATtAXL0V3lOx2K5O7rxTTmvJP8ibDaUiJkKoY5zNtm mq1Q== X-Gm-Message-State: AOJu0Yyygah4TkJYtf8RhyrVOaVVF7e89IRiZKaLZnDBx3htGOpxdz1x Yv9sCgoiS4tzBhlPaL1mgZlr6W9KaSplC+hcosb2fxKpkWwqyALBtETf2cSU3b5RtrCbaPICzk7 D X-Received: by 2002:a5d:6e5d:0:b0:34b:1f34:9c06 with SMTP id j29-20020a5d6e5d000000b0034b1f349c06mr3712985wrz.24.1714043045068; Thu, 25 Apr 2024 04:04:05 -0700 (PDT) Received: from localhost.localdomain ([92.88.170.77]) by smtp.gmail.com with ESMTPSA id u17-20020adfeb51000000b00347321735a6sm19543079wrn.66.2024.04.25.04.04.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 25 Apr 2024 04:04:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Yongwei Ma , Babu Moger , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 22/22] hw/core: Support module-id in numa configuration Date: Thu, 25 Apr 2024 13:01:55 +0200 Message-ID: <20240425110157.20328-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425110157.20328-1-philmd@linaro.org> References: <20240425110157.20328-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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=unavailable 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: Zhao Liu Module is a level above the core, thereby supporting numa configuration on the module level can bring user more numa flexibility. This is the natural further support for module level. Add module level support in numa configuration. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-5-zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/core/machine.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 494b712a76..0dec48e802 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -800,6 +800,11 @@ void machine_set_cpu_numa_node(MachineState *machine, return; } + if (props->has_module_id && !slot->props.has_module_id) { + error_setg(errp, "module-id is not supported"); + return; + } + if (props->has_cluster_id && !slot->props.has_cluster_id) { error_setg(errp, "cluster-id is not supported"); return; @@ -824,6 +829,11 @@ void machine_set_cpu_numa_node(MachineState *machine, continue; } + if (props->has_module_id && + props->module_id != slot->props.module_id) { + continue; + } + if (props->has_cluster_id && props->cluster_id != slot->props.cluster_id) { continue; @@ -1226,6 +1236,12 @@ static char *cpu_slot_to_string(const CPUArchId *cpu) } g_string_append_printf(s, "cluster-id: %"PRId64, cpu->props.cluster_id); } + if (cpu->props.has_module_id) { + if (s->len) { + g_string_append_printf(s, ", "); + } + g_string_append_printf(s, "module-id: %"PRId64, cpu->props.module_id); + } if (cpu->props.has_core_id) { if (s->len) { g_string_append_printf(s, ", ");