From patchwork Fri Jun 6 16:44:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 894473 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615481wrb; Fri, 6 Jun 2025 09:48:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVjmKoS4mt9bcBF5OT69EuqJIMPAoSko33EwibAIJFup7+cE5QW9eIP/aSsTpVN5Vjr+/+yGw==@linaro.org X-Google-Smtp-Source: AGHT+IF2VJYpozjf4vMGxHxX9l7MABOwwFlMkfXv6uW1momHlOI2i+Ka1MYhKkTePe1RZoYCDFDm X-Received: by 2002:a05:622a:d1:b0:4a6:ef74:fe45 with SMTP id d75a77b69052e-4a6ef7504b0mr71291cf.42.1749228505716; Fri, 06 Jun 2025 09:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228505; cv=none; d=google.com; s=arc-20240605; b=gtwAut5AB3LQqgJZ+wGPoaUr5qJl1rgkWYbVO2HV59aYSZ2Pup9iTvSTFeQwMUo/B3 +HgDottrbsqY8RR4w+y8fgVVsgd+RoBEWbpLoBFfEIz3nQNcroVZIznlb7d89GvvZ2F+ GWeFfx6IWVUBBOlmNpcxVhwM46oOOKxH9zkPLAQUpKpX6lzH3KYO+wUDDDrY3fuLbd+v AaHDuAWZ6VC0atQ1uUL8ZYqntVmpNYVamkTOnKHDvGXo03ClD6a+dsUpfKkwwursq+BQ JjE/79vgSjNhTQ6mFWM89DVKdgGZyPBa17LAzFPcPtMxOXVALUxb+vdFWyBuJRaUnWNF ovBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=za4OfKA+ZM6zV60/HKnwP61V+8x3zdpeOiThEah6L0g=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=fdFFrxnClhfbsyI3YTzrlBD4XJFvfROEURZfMjlr2bIBQyf51RbI1YmfMs0tLyieWf JiKvE6IANCYaA9mf++Di4j7AF/fy8jTljOcmgWP6XoUxxJ4FmCic0vJ25TkpA6GyXDMZ ZpS5uDUEnya6FFKSWCh7eVbpZ6mYgd+TtO2aPgCBhJ4dFbBYj+28GFqRXcIKqNrq+C2x jxbpfTvlwGFQY5J+B5bqyYsflxd4XZ21G6lS30pc+IJS7/yXy/isrPFqswVXN9OtZP8m KJKx0EnF3f2LY9AN0+kMzjoc+b4KNlenTo/Iyb4OjYR/bjDqa6tL1yz6wrsNMPZARQyk 1bkQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GCoQGPp+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4a611169f9fsi19995441cf.58.2025.06.06.09.48.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:48: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=GCoQGPp+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uNaC2-0004xB-AT; Fri, 06 Jun 2025 12:45: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 1uNaBz-0004tQ-LU for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:21 -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 1uNaBx-0003Nu-7g for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:18 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-451d7b50815so20351675e9.2 for ; Fri, 06 Jun 2025 09:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228314; x=1749833114; 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=za4OfKA+ZM6zV60/HKnwP61V+8x3zdpeOiThEah6L0g=; b=GCoQGPp+QGNlneZQg8feSdT0IO5VTZqr0KjMrK1CWQ2f1Y8aaO9BqBy0lgGMUIONXb G2o3hyevlV2UCUHBZteNKEfYi4lVNjBHPXSwjUW7sVZwG1s+lWtYvrOYell6EshLDiSn Hpw+7N3BHorE7Zw5FUqqThKpLQYlwOEW3bIpJzNTSq5UJVq/Kx6eHI6o9Lj1fPCSIQuP m7uCYP1FeSHh9hync7vfnFyuJUqpR94owtIS6UplegRatqc9PQ6gy6ygNGfCgRDehAAT jvNySmcHoC7tqtyemt8Q6xXScdTPtmV6rKdNBJSYTZlsoaFrXtoD0Id+zLEDn8QhUk8y ouwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228314; x=1749833114; 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=za4OfKA+ZM6zV60/HKnwP61V+8x3zdpeOiThEah6L0g=; b=EMVDKXoK09EysVHVa4WDr0yO0WPj5I5C/ahdcPrtuAAYcBcpIrwC/Rsb9uqAI4sp+X 3J3/irpMViUy/Q9WoKC71Po/YjRZ3y1UoFcC8NJpaHD0bQHh9fV0HC2PHLA5BiomOQ4w UDh1D3O8OqN6HOkzPYTihdHXxnC4oG1gvgiXZkSToymmWdN5nUHnc1jyINRhcOWHCp9l qPo2HaZ7/Jm0Rbd/V3YNQdZbg6A6zdSj8dHX8PLVvDoEvgseUGAngmbMPA+jYEMKg/CA k3H2Xe04vIzp3Jrwg2CmuremxhLcOwCy6MmdL7bUUcwWIRSDdwCib5l9D43IUzCVintO 8fVg== X-Gm-Message-State: AOJu0YzEw5r0WC2Cbmd5lxIGIpHcXOwCSLizaeySeuj98CiIZCX3QpWm W64SYn/NSJfZUHA2HMWkJVzkIx9XJ9r43ZNri0k8l4LeQwyYAu4JN89nKvyPvrn0jgYXUipy0Qh KgAYw0UZoBw== X-Gm-Gg: ASbGncu3J1t9JkNQfWErNiey83JcGNsbKQKdBSc2PaWTbQ7OGXDJZy9o+iBHEDNce0S Gn17fuVxsRcsjaKtePePLD0Gxy1I/Ls0GHmEctVQE+JPeDc4uABHiBs0iF0oppzleJ/QNVKgvs9 75Flvd+nM9JCfmaa4CNmTZ86TfLBM3/ux1+veUEM3kTrvGNzmS0olRl3mVf3udnKQqy2x8xlmvt 0M6/K0OvI6yyqYMckBKCtgpRTwjZXJ6+KsT94tbENqwusxrMu4HTIlsydbbA6fLMfwDnLN9LmIl E/TvR8l7JQ+3jjw6h27wj5m2PEwWH1AACAXBZ9iJ5FTMQvOqxHdotc6sZuLIHfzkIe0VHcup5Vf Ah8dqf1hrIsjFBV2B5HXy+M0vyqAIXOLRPwvWPg== X-Received: by 2002:a05:600c:1c90:b0:450:d01e:78ee with SMTP id 5b1f17b1804b1-4520140b8b5mr42932815e9.24.1749228313673; Fri, 06 Jun 2025 09:45:13 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229dea7sm2431121f8f.12.2025.06.06.09.45.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 07/19] accel/hvf: Re-use QOM allocated state Date: Fri, 6 Jun 2025 18:44:06 +0200 Message-ID: <20250606164418.98655-8-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/hvf/hvf-accel-ops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 808ecea3816..f4a983d1328 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -319,7 +319,7 @@ static int hvf_accel_init(MachineState *ms, AccelState *as) { int x; hv_return_t ret; - HVFState *s; + HVFState *s = HVF_STATE(as); int pa_range = 36; MachineClass *mc = MACHINE_GET_CLASS(ms); @@ -333,8 +333,6 @@ static int hvf_accel_init(MachineState *ms, AccelState *as) ret = hvf_arch_vm_create(ms, (uint32_t)pa_range); assert_hvf_ok(ret); - s = g_new0(HVFState, 1); - s->num_slots = ARRAY_SIZE(s->slots); for (x = 0; x < s->num_slots; ++x) { s->slots[x].size = 0;