From patchwork Thu Apr 3 20:40:23 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: 877955 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp3469064wrs; Thu, 3 Apr 2025 13:44:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV8V/gl4oos90g9ib/Wer1gaH+7irIvxCOKdXsP16RePqNA+Fy77EobdFG9gSEzhPS11fw19g==@linaro.org X-Google-Smtp-Source: AGHT+IGV3ohL3UY0f/nZIWsHJtDQ5Fid/cp/QibptqDbopY+zBxXb4Enh0nJSGmLDMSvMdd4BKgW X-Received: by 2002:a05:620a:254e:b0:7c5:538f:ae4a with SMTP id af79cd13be357-7c774d6f830mr88506385a.26.1743713059010; Thu, 03 Apr 2025 13:44:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743713058; cv=none; d=google.com; s=arc-20240605; b=YRWPeWjV9SJLKMcrGniBdtI+gpCDdBv7ds8y+6OP7/8Mt5u0ROE0DfDj/+O0OYdcpS rZkwziY5/EPtkiYdVHrlxcVIdiWhZ1FIBnibT5VcK6utFSEsgCAMuGECA5l6BNaig3xr mhzEP2khROp455qQdP8eIJ2MkUje5u4cb31lqemHLuui8VnzTNfnDxtZ6vdtZqyYIzPo D6zEgbdvewUdN6lePdJ2iIRP2oLZ8thEKk7g9qxPg3hDdb7YLaoH3C2HbVPHxRJwy8vf ybfh4GM4QjR83dUvJqiA2Ja1fLaR5D7x36DlhJRwSl0JrkXem5hnxEBWARSfZJPgptzw dbZg== 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=SuT3rRChRQlFqOt9wOfD9dqVNsRbmscUvrlQveNmeCQ=; fh=MyqIMCjZFHy0NzBnvXc8KFcCapThoPogDzLe5J0FgH4=; b=atAzgKf9PLt3rm976+bth1ffztjRvDMo10t3J2j+lujHNNN2X2oK0y20sSHR6jCTic 9tcuX4PVPpiUPp1hSqz+xMBrOzjRLj9n0kLavUEZxJ7K6CYPQ/poglXifmC9jk86qfDC 26w3BQ8CoQF/Cc64D6Cbxffa6Cqx+RWrRuIDG9h6LjW/YfgnrbcHf9Lwy0Lnvnsffh7d 8yZiYi9OucKv5tO6OZZKwbGwTnO4RdgOLsRRMmOE2r0Fm5jC+1yQuYnmW0QH1RV2ZX4D YJ9VzWE4CeS7Qn9WMf3AF8lnX3sjpFBKwzxGkS1s5EK/b33MqSMFjgGb40V4f40Zi6us Ba9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uOUHGa3n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c76ea914d0si179615985a.373.2025.04.03.13.44.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Apr 2025 13:44:18 -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=uOUHGa3n; 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 1u0RMs-0000SD-2v; Thu, 03 Apr 2025 16:40: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 1u0RMq-0000R1-1y for qemu-devel@nongnu.org; Thu, 03 Apr 2025 16:40:52 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0RMo-00052s-Cs for qemu-devel@nongnu.org; Thu, 03 Apr 2025 16:40:51 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-39c14016868so1184009f8f.1 for ; Thu, 03 Apr 2025 13:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743712848; x=1744317648; 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=SuT3rRChRQlFqOt9wOfD9dqVNsRbmscUvrlQveNmeCQ=; b=uOUHGa3nAzLCCBRWwun+Yrye/hWW/2ZHX8limWayTJqOttULKcl83zIrSX2WtZKTu+ 8eUOiABT9JBx5SCUMNLKBPX+UVmL/rcW3+2vqkN5HMHf+9qM1LjeDZqRk4gquqUcd2eR CWdGUQo7CpepaBzxqslGAwIuJhwILeo+xVrJDDwHHLVSfjXRgZSXUgB+1d/vn63m7hnI fmqLPRYnf6p+i+ylmz41mWq1MBNQOSbLbsCN3sBKEejM1fBjhx6ftrAnB/Zn9IbwgpnI 8Wh0Qup97CxyPmtZX3hsAHIAWxgTGpG2V7c7Qd9IvXb54zJTtSh5gkbNoozsfMyEkOhe Fp/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743712848; x=1744317648; 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=SuT3rRChRQlFqOt9wOfD9dqVNsRbmscUvrlQveNmeCQ=; b=YqkL2IBfZHVqqPWaRMcDJBNLmGBUblenH18VYbq9//i3ST1DVae+cHUgKR9Wt80GXE R96k509sdLopxjYOCbJFLEnTYHFVTasajZySkbh5TXbgC7UByGCB6KygrwII+LllIqXz esh3pe/pRATBYlEcrykNpR6yGpqIC2vZx45ipq0PGjG/XuvEqbx+yztP8MilNytz085C BsF/dGWcoCsz4AV4wVAU94zjfgXASSJ+nLquaDk81A8vxPJB8wv+QoHBrL1zLHIqmI+U 5Fh90CEFlz302bB7S9GWuEc1PwsjMhn8udRTm49+mbflUBVOUtJAcoBPbd/o1GX9myiD FhSw== X-Gm-Message-State: AOJu0YxTS46MajFjOPM/fapfK/zgerJk9YncCZm+1ZevY7sV3GYxf8KI ZmMQEJ5AxNp1iJZJM0MX5Wkokbr7TAl9vDu61g4HtJMzguijp6K/ddaLlDnDSCNwyWvqoljAUqM w X-Gm-Gg: ASbGnctWp//zV/uUIVDRv3jF52xBzJgMKKP0ts1qAjAiFlDeosY+EWu8n5ZiD/a4hRA 2SRZ/xrqgn8zPYi/H7pCuHcX3kgn8ijIQz+QjhR+skjOPITtm9uqYSc0+r/byaYQCDRYCwkbm7d i/3gUvv77onzad1jw7iOO9VxPGkzQUIvmJ4Nm7PZoc+m3tKf4wAEdQo7q24UUTFvOS/gf2BBiQ9 Uego/VoUWBZ1OQjzPizZ2H1Rnhe/x0GpltMp1EBCgGKX4UwN/kHmMzVxoB8u6mM6Gij3x7i0MF7 qdRAR2eiJWnnAvBjHCQpWL1wZjnCI5IMvOHnVpJ7pmMFrXkwFHIO+rNz3ZP+ry/m/SuAEHdXbPG 8HrYNzQraX9PWOrg2la5kfVvt X-Received: by 2002:a05:6000:4402:b0:39c:1257:cd3f with SMTP id ffacd0b85a97d-39d14663264mr123060f8f.57.1743712848318; Thu, 03 Apr 2025 13:40:48 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec34a8d67sm27667955e9.12.2025.04.03.13.40.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 13:40:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Andrew Jones , =?utf-8?q?Alex_Benn=C3=A9e?= , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Udo Steinberg , Shannon Zhao , Gustavo Romero , Igor Mammedov , Peter Maydell , Ani Sinha , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH-for-10.1 v3 3/9] hw/arm/virt: Simplify create_its() Date: Thu, 3 Apr 2025 22:40:23 +0200 Message-ID: <20250403204029.47958-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403204029.47958-1-philmd@linaro.org> References: <20250403204029.47958-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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 No need to strstr() check the class name when we can use kvm_irqchip_in_kernel(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Gustavo Romero --- hw/arm/virt.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 177e9e0eadb..326986deb16 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -711,21 +711,15 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms) static void create_its(VirtMachineState *vms) { VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); - const char *itsclass = its_class_name(); DeviceState *dev; - if (!strcmp(itsclass, "arm-gicv3-its")) { - if (vmc->no_tcg_its) { - itsclass = NULL; - } - } - - if (!itsclass) { + assert(!vmc->no_its); + if (!kvm_irqchip_in_kernel() && vmc->no_tcg_its) { /* Do nothing if not supported */ return; } - dev = qdev_new(itsclass); + dev = qdev_new(its_class_name()); object_property_set_link(OBJECT(dev), "parent-gicv3", OBJECT(vms->gic), &error_abort);