From patchwork Thu May 8 12:25:21 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: 888580 Delivered-To: patch@linaro.org Received: by 2002:a5d:4683:0:b0:38f:210b:807b with SMTP id u3csp858627wrq; Thu, 8 May 2025 05:26:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU2f6iwiy06kGvQR2DHjKA9KJ0PD80MCGVc9011jws1hBxM3/sqtrV8Z2J8K/LvvWuv9EW3QA==@linaro.org X-Google-Smtp-Source: AGHT+IG/Sv90Gb9BEAyH6XAO4VAV6syzFFFOqQyAA0EK+wxAAwQzYPcMKWc7UttvUf8G7Fgih5el X-Received: by 2002:a05:620a:3186:b0:7c5:5670:bd77 with SMTP id af79cd13be357-7ccf9eaddc3mr581654285a.55.1746707196396; Thu, 08 May 2025 05:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746707196; cv=none; d=google.com; s=arc-20240605; b=Q4HOjxOvJfFNzq8xHoIt9Wtn91aL2yTmlSxvCJEtrbG8exRK9CzFiLoVLQSOsL2k3V lUkfYL7RJdFbVnMRRbJjKHj1QVML0zcwxaruVlSxvIW4kh7A35Zy53kUVJqfZPaMJwcy KL2O6417OUIK/sVtmo1bLW7jzGaKnhCHCtHewILuO7yhq23Y1oygpem67E/0eEH+R05J +hpEgZwkdg3W0JK3NTtRoiuCJD3WKANDaWSbZFwapoKUigK2Xd/+BF9xPc8cwPiaWMUu Q5NtmahIZ3RBWHxm3FST5W/cN5sePMXUIAB3ZLAoJDM/voXlKYfpANzwT+Kl8bHK+G8E jxXQ== 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=pU/ZxDhCJzHZz6avlpYz2FzUTOirixtvN1XU436tyf4=; fh=qq4ZpjGlFjtZyIGKJdNX5yqwWhQTAU0N3AtiMWAXz2c=; b=bWvg1giQDSDMPNKWQ5s1OOdzB51SYq4d+tWOk+QA4nfPcT66qpAmkL2MKTilPGMSHA qp60/XCW48cikWADGN0VEV7DJJQvsrOfWtf2x+bYiE9SFT8yRg1VYA3Vj9cYs/BnbFYu uU7otY4oyifT3nonvK997OSyW7okuqsNtJ15ex6VT4TL7eDhnFd1Ac0R5woFdbZKnxuS gM7Hyp6naaxKQAZaK7jRy0wzlNlk96ED6At0gdEP8hBZwJ8VGh96CpkwbU77MiCo7I+O O4nTSRo0/UlvxUWBrFB0kMvsPUoZPOzckTHlmaw4PJ9XrlbwtugsBGXNPI/KqM/3/fIr lmHA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Y/1hikpa"; 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-7caf75ac6d8si421557485a.346.2025.05.08.05.26.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 May 2025 05:26:36 -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="Y/1hikpa"; 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 1uD0KJ-0006K9-8L; Thu, 08 May 2025 08:26:11 -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 1uD0KB-0006Ab-W0 for qemu-devel@nongnu.org; Thu, 08 May 2025 08:26:04 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uD0K7-0002nN-6X for qemu-devel@nongnu.org; Thu, 08 May 2025 08:26:01 -0400 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-30a99cff4feso1094151a91.0 for ; Thu, 08 May 2025 05:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746707155; x=1747311955; 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=pU/ZxDhCJzHZz6avlpYz2FzUTOirixtvN1XU436tyf4=; b=Y/1hikpaUMRazW5ZyhfwlpCZFtd8ZA40eAqRP5r5pd0ABksVrdWbmjuMuyjmK++0wL fLlK3ClyG7BwpfVAzv7qA0g2d8W2CjxZaL2RuvoGFTAZmxIlbKjnJmifRNaJEA6TPcAL gjfPK8kKzI9mSilBncUgClixMHR0KGQVgj/vb2nz0nC9XQfaJzX+XmmkBMG4KO0RiQ0H HBQTpzMt+nYMISI4fUKaR+wOhypgMyhPkMNDJeOSJPDIFGRT6d+iDw1McVYI2MCHGOZf iG/dJC9X+G7w3Ile2+VicGVSVDhd7XysrqXW40/QnB5HbwZrCb2KNkSeCD3mIzdlCBE7 fMHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746707155; x=1747311955; 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=pU/ZxDhCJzHZz6avlpYz2FzUTOirixtvN1XU436tyf4=; b=XlM2l2r60SvQNxFvw6aYghyTGQ2kGvQj/IwI12jdmYo5Wd1KCCHqxA3FivvC+CweIO TGOfJwcKWVbfvdWXK8EmNXpD4ZBPFwRd9jYUqMLyAyKUxG+G3s3lVwv1jiL3CL1rYegK 845yby8qnq1TxJOatuag1XJLThNICF0r5izQv5z5vvnu8CqnI3x3OShM0Sf1M6IPdOsT KE9KY4hcftGFoErLaKkS4YpjqvkXmWAttns/oZsE7Ya3a+QIMypEUzyVQiB+o8lXoT80 41EluYGFES2Ng4iJZhJaPNS94vfwTFrscCW13JZmor4q/LxS/5QyuzhFnhB5r1IzrI4A ta7A== X-Gm-Message-State: AOJu0YxFjEpSjyAAhw6dPQw/aTYLgomdQ58hQLHLNAyx7A6m+K6bQM/W taWvC7wtYVmVwhv3J7Auz4KSXTDvSmRdNVFMTwBLYeQNj0Y7Cwi8zcaxt/ERaJMBIawEuRDd9L3 jf7eg9A== X-Gm-Gg: ASbGnctb1ai1uw30Oejdf9i2G+efuzZYdE9JL32H7FKl9MkKEpVIUkgZt7PHDQv0EOi tkCuZdM2RL+1qIUUGIgZk1wDKZAiFuL9CEIgDFA3Bj8UqtxU1QSDlhxhmSjd6AssjeWb6zD0V9+ 4okuSxd00EhCHpim9CtYHN62n6YL3t5LBXszPXWlTMVvC1+WKrrG9msJL7zMfMHcNzqlSeGuqz3 hDOnlfouTFdQDlZuLclI/1rJWm/DGwDixTz+a/29Q7yyqWDK0YdDrBWs/ifKOljbMN3mmeXsIXf JO/azzMwS68Cbyloouo71vWPWYTESRgB33YBdGbQFZSoO8pxh4yBs26lqffXlmSrydiBu8gjhpX urd3DBHnCot7MTS0= X-Received: by 2002:a17:90b:314e:b0:2ff:6fc3:79c3 with SMTP id 98e67ed59e1d1-30b33105a54mr4704588a91.9.1746707143546; Thu, 08 May 2025 05:25:43 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30ad474a0b0sm2087085a91.3.2025.05.08.05.25.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 May 2025 05:25:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mads Ynddal , Stefan Hajnoczi , Pierrick Bouvier , Mads Ynddal Subject: [PULL 04/19] accel/hvf: Include missing 'hw/core/cpu.h' header Date: Thu, 8 May 2025 14:25:21 +0200 Message-ID: <20250508122522.73786-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250508122522.73786-1-philmd@linaro.org> References: <20250508122522.73786-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=philmd@linaro.org; helo=mail-pj1-x102c.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 d5bd8d8267e ("hvf: only update sysreg from owning thread") hvf-all.c accesses the run_on_cpu_data type and calls run_on_cpu(), both defined in the "hw/core/cpu.h" header. Fortunately, it is indirectly included via: "system/hvf.h" -> "target/arm/cpu.h" -> "target/arm/cpu-qom.h" -> "hw/core/cpu.h" "system/hvf.h" however doesn't need "target/arm/cpu.h" and we want to remove it there. In order to do that we first need to include it in hvf-all.c, otherwise we get: ../accel/hvf/hvf-all.c:61:54: error: unknown type name 'run_on_cpu_data' 61 | static void do_hvf_update_guest_debug(CPUState *cpu, run_on_cpu_data arg) | ^ ../accel/hvf/hvf-all.c:68:5: error: call to undeclared function 'run_on_cpu' 68 | run_on_cpu(cpu, do_hvf_update_guest_debug, RUN_ON_CPU_NULL); | ^ ../accel/hvf/hvf-all.c:68:48: error: use of undeclared identifier 'RUN_ON_CPU_NULL' 68 | run_on_cpu(cpu, do_hvf_update_guest_debug, RUN_ON_CPU_NULL); | ^ Cc: Mads Ynddal Reported-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Mads Ynddal Message-Id: <20250507204401.45379-1-philmd@linaro.org> --- accel/hvf/hvf-all.c | 1 + 1 file changed, 1 insertion(+) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 3fc65d6b231..8c387fda24d 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -12,6 +12,7 @@ #include "qemu/error-report.h" #include "system/hvf.h" #include "system/hvf_int.h" +#include "hw/core/cpu.h" const char *hvf_return_string(hv_return_t ret) { From patchwork Thu May 8 12:25:22 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: 888581 Delivered-To: patch@linaro.org Received: by 2002:a5d:4683:0:b0:38f:210b:807b with SMTP id u3csp858859wrq; Thu, 8 May 2025 05:27:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXt0Q3oo8H0Ur0ADhLqcBVOtAX38LMuTFTRLmbAbnLrgjWBIdURx3+p/iGGcbtTn+glpsTeMg==@linaro.org X-Google-Smtp-Source: AGHT+IFoK7KWVOb8rQabPuiNkEANW64AKi9CqhYUmk48TqI+prjdtW+6BWK9Ph4jOk/gJmWc661D X-Received: by 2002:ad4:5dc3:0:b0:6e8:fee2:aadf with SMTP id 6a1803df08f44-6f542ad1713mr133909296d6.31.1746707220621; Thu, 08 May 2025 05:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746707220; cv=none; d=google.com; s=arc-20240605; b=iJ+cWRR4EGPceqL+mFOAnR7XXCGKQWek6Y9paEASxO1miZbJ9rTrg2Q0Zwm8HJUY6v eX0dzj+cmJmtWBbnazCS3XwvvqsxSQ7MSIQK7+h6+YAhI0XM7pFQTOGA9bmOr9iSSnI0 KWPAFcH5OGVA7eacUpQ5OGVatJNYVtylop+20ZBkWHxgyHcZow2uHzF0d4nV5G2ILqbJ u7F7BaQlHI6It9raifdfar9V2yQMDTy6n9/1Jm47JpTewZ4n0JXLp3in1hYEJGIiBF0z 3vsgZQbkdnWMwzC2hzoWJrjsYUhvX0h4bmyCrCi8hek7dPOHo2b7TzX9h4N088zgq+Gw qnyA== 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=YPZMshn98yoJiqlJorSwXssaa0xtfmw+pcoeQEvQkF0=; fh=TSSVkScH/UWXGYK9Urby9J4lA8W4AIpZEPhg5ugPFY0=; b=krqkca9rsCTkLlQONVxjTlKJoeFS36b2Y+GrU7evCXwPily2ALLtd7yyMTxttUoE77 ESt4BZ9eH/0BiSJ9qKhKPnb0PbLkk7iz2x3NnO66SSQCfkrDEZt3Uiu520JXbbuqG7xN 8eCh3Mpjg5MxhP8t7qxWxu72XcubA66xD+AYQbpp8hNyDT/Q3Cz0aSzY9zr4eIr5GaS5 nDLNuD8hEx/eEpek9yrfQn4NW77AVPDa8ZE1o2Ius2al/nbYrn+2ydf77NyNONrd8Y72 Rt5asgF9YoIp8AZ9ozN2b/4fwA3u0cMxg2vLQJFSIQpfst3Jz0H/AExHzeOXUugvqkBn qoyQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kUF53B1X; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6f54278bf2bsi42239376d6.170.2025.05.08.05.27.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 May 2025 05:27:00 -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=kUF53B1X; 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 1uD0KK-0006OP-GD; Thu, 08 May 2025 08:26:12 -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 1uD0KC-0006B9-IP for qemu-devel@nongnu.org; Thu, 08 May 2025 08:26:05 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uD0K7-0002nZ-6i for qemu-devel@nongnu.org; Thu, 08 May 2025 08:26:04 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-7fd35b301bdso894936a12.2 for ; Thu, 08 May 2025 05:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746707156; x=1747311956; 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=YPZMshn98yoJiqlJorSwXssaa0xtfmw+pcoeQEvQkF0=; b=kUF53B1XkARftKHq6QXz8xhIid2UyHUTI1++UsJe88PjKajIsqY0yqqNLyBVgMNAfa KYWLTIdQ4vzwnPvVcRScp2+Viilvt0c8Bni0LxhS9198ehHwau8JgUf4S+Xr9W0Xg9PO IBzzKN2IPSdRZerNtfU/znnZ7VyBUUGqlxLY/YEFrgCJ5SJhcCvyu39zsU6TwW2nomoc pc8IbXcVNGMivshHz0yxPQZ/zVcJngci0YQFX5pM1CeRxII7UcAzw+hpTmOVz+f5NH7P XKcz/Q0M5hfj2iFVPgE7I1BsPR9MjFlNIS1lyGX7p2zJC38DhTqmofELSUUt1YdD8zB5 gC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746707156; x=1747311956; 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=YPZMshn98yoJiqlJorSwXssaa0xtfmw+pcoeQEvQkF0=; b=mpChz2uZbtiOiCGByUJg78ZRCUEtDaFT+ES1AZ9fqS1gWB2hv13TVttSEVsRw4URtX MLNlMYsRQty3bnYk806LKxP4wSslJWbMdC4ilhH9I/vTuPeGaA/1dzmeRv+QrxKIdHqF CHC6Gy5SCa2tvGHedYRICkeeai54HtwJ4XfLav8HHtpxm9UW/Wu/KdIEOsvhzq8YyNr0 ZP+1WEvGWSEpPt0MKxJH7CLQfS8rLu7JxswDl2tlpAIgUtWtwVny2ketae9UkWpXLkHm huZYcYxzdca4JkLavfQQ6ZpHyLeBrSlmfxtooDxgAq4WOFeUhNBdgBJnvmD+20sJ/C2v vTXw== X-Gm-Message-State: AOJu0YzRsT1v6rvCW5kXHL6RtJbIG+N0ov7i+WgbN/0wQBQG9KadqnRo Kzt8wATQ07GXm6F0/J9M39JMtDPrfAOiT+sDkMP2C7rIAjzjMDb5uMx+9fsCSN8Z5IQUxn3AuW4 IVQKI7g== X-Gm-Gg: ASbGncsKBuLw/EPs5NQ8igSst+Ulj0LjmBm6HTlWg0xJeL2Hu1FyFjyM7YRlF+zZ/W3 +5MczVO9ssR1j+KRW/KOuiUWa4vpqG9RFRHGBgG8HXgFKIMYbkuosNIDAQwfZIv3Oo29vaU+oaa 5g14RxVRhDNBJFKbEHiBFjhpPxz3kTdGTTxxVcWzvXkWbfrX4Rr4L4kYvC3HTxJ62sjV/2w3rwQ lcTnGsc+9BPbW09P4atehdk0JNSk+KfD8OLf1eHCMrhiguuXN8AvTsKxzv6NJ4MtH/80tjFoaU1 tv8eGXvVckPNNweneY6piFYcc7L4bPdDhhtRX3702rM42xRtrmjF9Iq6o1mvuQOtVngI8a+co/m wdxRpWlx6994Mll4= X-Received: by 2002:a05:6a20:c907:b0:1f5:790c:94a with SMTP id adf61e73a8af0-2148be0e4fcmr10505247637.25.1746707156160; Thu, 08 May 2025 05:25:56 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b213ae23b0csm549325a12.35.2025.05.08.05.25.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 May 2025 05:25:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , qemu-stable@nongnu.org, Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 19/19] hw/i2c/imx_i2c: Always set interrupt status bit if interrupt condition occurs Date: Thu, 8 May 2025 14:25:22 +0200 Message-ID: <20250508122522.73786-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250508122522.73786-1-philmd@linaro.org> References: <20250508122522.73786-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=philmd@linaro.org; helo=mail-pg1-x531.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 According to the i.MX 8M Plus reference manual, the status flag I2C_I2SR[IIF] continues to be set when an interrupt condition occurs even when I2C interrupts are disabled (I2C_I2CR[IIEN] is clear). However, the device model only sets the flag when I2C interrupts are enabled which causes U-Boot to loop forever. Fix the device model by always setting the flag and let I2C_I2CR[IIEN] guard I2C interrupts only. Also remove the comment in the code since it merely stated the obvious and would be outdated now. Cc: qemu-stable@nongnu.org Fixes: 20d0f9cf6a41 ("i.MX: Add I2C controller emulator") Signed-off-by: Bernhard Beschow Acked-by: Corey Minyard Message-ID: <20250507124040.425773-1-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/imx_i2c.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c index 91f84c2ad7d..d26177c85df 100644 --- a/hw/i2c/imx_i2c.c +++ b/hw/i2c/imx_i2c.c @@ -79,13 +79,12 @@ static void imx_i2c_reset(DeviceState *dev) static inline void imx_i2c_raise_interrupt(IMXI2CState *s) { - /* - * raise an interrupt if the device is enabled and it is configured - * to generate some interrupts. - */ - if (imx_i2c_is_enabled(s) && imx_i2c_interrupt_is_enabled(s)) { + if (imx_i2c_is_enabled(s)) { s->i2sr |= I2SR_IIF; - qemu_irq_raise(s->irq); + + if (imx_i2c_interrupt_is_enabled(s)) { + qemu_irq_raise(s->irq); + } } }