From nobody Sat Nov 15 06:33:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1753448227; cv=none; d=zohomail.com; s=zohoarc; b=ZS5rPIcUhFLOBpgJV0M/XjaRpbcUoQKBD6zqIApgEfrvv6jpi3HIaJZFmuoprOHQLnfAfBDxgNIYjyCW/FgCckSQ4bN0m/nkOpmnqb07B1TOGY44MhSnIbJ/DtmR3T0MPSfmqIaTEcMvXYuY3YQCEWMs1i7+sTTIymge563sTVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753448227; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=SKZhYrhLklT7wy5r7XGVHBie6wvhRMRWF/tewAfL1Jk=; b=b2xdoC0cGAG5A+JHeyJJ2/uvTqNncdIBA3/s6kxbLUYVxGLXBmApyHxDQeRi3qODnOBfxsbQYEwPG3PWTI+1FyX+T64mt8eTCuytUIeGBfU1qmbz5w8u6ilD7+1coaFyS8XGi99ak6UKgGKfLJCy1fooS3udH99vLRs5mIldj8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1753448227969931.3200998639397; Fri, 25 Jul 2025 05:57:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ufHwn-0006lR-NV; Fri, 25 Jul 2025 08:54:49 -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 1ufHwO-0006IF-P9 for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ufHwN-0007w4-1X for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:24 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-140-d3CVZcplOK-8Hp3hU_6giw-1; Fri, 25 Jul 2025 08:54:19 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-451d2037f1eso12768305e9.0 for ; Fri, 25 Jul 2025 05:54:18 -0700 (PDT) Received: from [192.168.10.48] ([151.95.154.122]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45870532baesm53712305e9.1.2025.07.25.05.54.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jul 2025 05:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753448061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SKZhYrhLklT7wy5r7XGVHBie6wvhRMRWF/tewAfL1Jk=; b=N+vuv0nl0uvwMJJA+R7MbDx9EPx36Ncqjgq1yJnIi31bUOWf/7QeAlu4tDRPt9gMQW/kCB cr8Rd6q52D1aSe1B32Ggg5gudpxIOA2lcoQ2EKwL2pQRZl86kEKiymR4dtnRjAK3o/Hgv/ 0Y7kI5oh99IohnVD7Qc8VvSZbmedVuM= X-MC-Unique: d3CVZcplOK-8Hp3hU_6giw-1 X-Mimecast-MFC-AGG-ID: d3CVZcplOK-8Hp3hU_6giw_1753448058 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753448056; x=1754052856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SKZhYrhLklT7wy5r7XGVHBie6wvhRMRWF/tewAfL1Jk=; b=kR1HnbjfMhRUCyegoliBtr3BY4V4pdh9UPWOmQeZQoIOSGtGvCYk4Z31pbYmtr9YdN VW3zVN5oKpLbgPrU/4gmMsSF5E0CViz8zoGfnlp2AFqVISbQP5SW0BZPUy4wa9x13nR0 8KjLhx59dHnbSdJkl09WFULQxaBp5YF88rhgLecRwnUcxQS0mND3Lnv7RJN/DthKoLQs /TgriruxKRJZQD4vKNsoeN54GMCdUj0k8bEGNroH7v0j4J8oo/tCXjcgXKlN/C2kd2+X Y5gdLgo9CxZ9eUHGFHyVVdLcjVEp21fwsB5LRkBhl7egKjYssn6vyWALVpHLYVWMsSZ7 /oMg== X-Gm-Message-State: AOJu0Yyp3I5OfhvIKrSGgjY05/fuw+8qlhcAOuS/dvk5t0eeCs4bKRqK gOTC89q6VtmvRReC6YyKAfwsCv7H0vLJMfNgNSEHuL+LXIpA7bPbeGDHe+cHVi/Z9kNu6Qt/Aab z/L0DHSQ0qXZHvSJBPAaSjnRT8wiaHKy9Dh6GuRCFr0oTbFjpCnr7N69ETSaR08hxPUrlfH7iQu PpAnglyqUlsUVbPyyrRg1yOvwKGcx4NlLTDbU8kgi/ X-Gm-Gg: ASbGncvt10Xd/OzxGb13gNHhbm+BEBdG6AttdAZUVlwW3bwUYQSacO67YzbxjlSAMSU 865NxdMLaZxDpuNUO8RlaixkA9//y4akf04pRazi3WMv+iaGnE4gReIQ/heqpITwDjpv1+rgSgo Zp/V0SZowOY8TBeNqwi07BzMPc+psOId+ry/u+JECMmoWqZUqcYsMIb5eUx86JIxfS8Unen0g3m yHKKZBoBmE7kt8g5iMTvE1/oi6fPSoo5RxLvX3WuSHr62bva4LqUDKEr58TtWDG7KS8AXSv8wTM Jbmi8u3uFUt8lH3E2Afdpk6kdDNsxrZ9sQ2b5093PIjs X-Received: by 2002:a05:600c:529a:b0:456:c48:491f with SMTP id 5b1f17b1804b1-458763117f3mr20134055e9.10.1753448055736; Fri, 25 Jul 2025 05:54:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrkZVgPj7areL+BjU/gsayfQGBhJmb4UEYKxaDz/IBcyEC8ujD8THpECqG8T2sHGP49H3xAg== X-Received: by 2002:a05:600c:529a:b0:456:c48:491f with SMTP id 5b1f17b1804b1-458763117f3mr20133725e9.10.1753448055225; Fri, 25 Jul 2025 05:54:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 1/4] rust: devices are not staticlibs Date: Fri, 25 Jul 2025 14:54:00 +0200 Message-ID: <20250725125412.1128617-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250725125412.1128617-1-pbonzini@redhat.com> References: <20250725125412.1128617-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.175, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1753448229513116600 Content-Type: text/plain; charset="utf-8" This is only cosmetic for now, but hopefully later on Meson will parse more of Cargo.toml. Devices are linked into a staticlib but are not staticlibs themselves. Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/Cargo.toml | 3 --- rust/hw/timer/hpet/Cargo.toml | 3 --- 2 files changed, 6 deletions(-) diff --git a/rust/hw/char/pl011/Cargo.toml b/rust/hw/char/pl011/Cargo.toml index 003ef9613d4..88ef110507d 100644 --- a/rust/hw/char/pl011/Cargo.toml +++ b/rust/hw/char/pl011/Cargo.toml @@ -12,9 +12,6 @@ license.workspace =3D true repository.workspace =3D true rust-version.workspace =3D true =20 -[lib] -crate-type =3D ["staticlib"] - [dependencies] bilge =3D { version =3D "0.2.0" } bilge-impl =3D { version =3D "0.2.0" } diff --git a/rust/hw/timer/hpet/Cargo.toml b/rust/hw/timer/hpet/Cargo.toml index 6f075027843..ac5df23c1d0 100644 --- a/rust/hw/timer/hpet/Cargo.toml +++ b/rust/hw/timer/hpet/Cargo.toml @@ -10,9 +10,6 @@ license.workspace =3D true repository.workspace =3D true rust-version.workspace =3D true =20 -[lib] -crate-type =3D ["staticlib"] - [dependencies] qemu_api =3D { path =3D "../../../qemu-api" } qemu_api_macros =3D { path =3D "../../../qemu-api-macros" } --=20 2.50.1 From nobody Sat Nov 15 06:33:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1753448153; cv=none; d=zohomail.com; s=zohoarc; b=dgWWsO/93bXSiGWyJ0Rc2o7GYhuawM3THXd8RJ21UXojlfo3hHO0gP/FyBEFCJvfgs4FssfFqBF7F7WXJ0XNXqi9l1DlZ005vUfpcrOiROgZ1zJupZlhPhZUhC001EzaUi4cZeZ72uZCeEsC6OzdMLeINW+XAYFNohCTBLTCg+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753448153; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2jO7BQduqFPUM/wSkRuI1L6TOFWqvNqtxtv6cfTXpJM=; b=TSottxj71lV8aoE9Vre6azsO3rcP6CX7O7E0ebnM4wKmT0UTP1474INLZ6xnf2CJfYNY8+HvAyXxqLE1hSBoqTKBe3OPW9R0CtOXYl5b7iqlA65gX5QCrG3XYtEnE6G+GVGz4QamErvO3rAx3MCYDcx7Ukx+UxA6a7F4mgNr+Po= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1753448153844972.9465991712145; Fri, 25 Jul 2025 05:55:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ufHwm-0006j0-Fg; Fri, 25 Jul 2025 08:54:48 -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 1ufHwT-0006TT-08 for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ufHwO-0007wc-GC for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:27 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-WqdRHMXAM--9Fu2AqWZBSQ-1; Fri, 25 Jul 2025 08:54:22 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3a6d1394b07so1262779f8f.3 for ; Fri, 25 Jul 2025 05:54:21 -0700 (PDT) Received: from [192.168.10.48] ([151.95.154.122]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-458705bcbe8sm56044665e9.17.2025.07.25.05.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jul 2025 05:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753448063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2jO7BQduqFPUM/wSkRuI1L6TOFWqvNqtxtv6cfTXpJM=; b=Rag5OP4SyE4nFORtEgng2QQfqviktTlUMoFYoJ5f234Gm5Hx266feePPS1tR52QAv8KlDC v7fvWqiJtXKuNq00Ao2lTFBiXKyHoEJRj6g59vB8GCn95PztmqUFjB3IDXyn29jL90LFEJ vysYP01SWds3b3Ngel0RpnqMvAqWC0o= X-MC-Unique: WqdRHMXAM--9Fu2AqWZBSQ-1 X-Mimecast-MFC-AGG-ID: WqdRHMXAM--9Fu2AqWZBSQ_1753448061 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753448060; x=1754052860; 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=2jO7BQduqFPUM/wSkRuI1L6TOFWqvNqtxtv6cfTXpJM=; b=EWki3YzZ+SfRu3R0UonsyL7o8pQW6PeWRmVAGZx1p4sY9K15hXa1+IK+zmT9VwQd8J 158iwaFxIEhZJ2J80KtMlSy/WIXWQefY4efkbHHbzwvbkhcfszbshMgGhMQV+w/bhyaE wJRiz0hjIVAr1Ov3B6w33nxjIOv68B9NMmmV92VxYFbJ0V5zzkXrsu9hFhrYUwIT89Tm dlijjOPpjvShxkmBUyPe1JyJVduXtH7DVU8HYMYml5yV2zVOTW0bluYt6HLYozh225SY X6XjbuXXGcahNnPF3C9z99l9LzdoZ0zW4kE4JtiYEM19gvkOVjswLqFqwNoT+JuVpwnn YnBg== X-Gm-Message-State: AOJu0Yx2uR1ltLDhRtLpu8h98bGfL9Zxll9Et18xERQFsu3iPHxmM9ox Pq7DK4PQcdKNMC2kSWbRWvSQ+MYNnH99NuWApqBmndu3slRhjPZ9X7xnoE25onjYIkBXu/kKFqA LlPm5BPPah0etLbwcgYEPwqq+RwExQ4mQZTgh+Jsde/FNYrFjIJsgPOVpBW4tGEvvBBKUtmTWwX 5KsIBZKcTGG+PSTkUWY940z50zVsfwN1LIAQTHMRXN X-Gm-Gg: ASbGncsiH2PxOUXDk/EP0ppxFtOj668uQk4jZvtMipC3Waq8Id+8cN8jpPrik69W4oZ fjoexOQDO9JLjXSkSdbPKIa9HCUAJQoCrKDdDyTrXB3wt/qy2MkdgQGbT5POpn1Vp22XOFyrutq ySKMqAGllGijzVEptyl6VT+u5dhLviJk6+2owKPWtvzZ0KsU6V9t+DmEtXeWowFG8Yxk06iY0rK gTyOewPRVC/ag1jcdMBv1EbQrxWZnHg3GtT4Fa4+8xGBYkjP3Td6mJjdITg2MUvKrnBOw6+idnF rio9lbAiEvvelPlZD8fajVsPiYDXbKoee6Qz5BfZyMrn X-Received: by 2002:a05:6000:4a1b:b0:3b7:78c8:9392 with SMTP id ffacd0b85a97d-3b778c89859mr70183f8f.19.1753448059576; Fri, 25 Jul 2025 05:54:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPNZ8V2vpphxMjHeheOcBuLzg2WmLEqab90Oj5UDaO09V3wh2/jJweBJ2Tm6zrUcprUTLM+g== X-Received: by 2002:a05:6000:4a1b:b0:3b7:78c8:9392 with SMTP id ffacd0b85a97d-3b778c89859mr70149f8f.19.1753448058887; Fri, 25 Jul 2025 05:54:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Manos Pitsidianakis Subject: [PULL 2/4] rust/pl011: merge device_class.rs into device.rs Date: Fri, 25 Jul 2025 14:54:01 +0200 Message-ID: <20250725125412.1128617-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250725125412.1128617-1-pbonzini@redhat.com> References: <20250725125412.1128617-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.175, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1753448154730116600 Content-Type: text/plain; charset="utf-8" From: Manos Pitsidianakis The split was a relic of early development and is not necessary. Signed-off-by: Manos Pitsidianakis Link: https://lore.kernel.org/r/20250718-rust-pl011-cleanup-v1-1-c71b1d6a69= a5@linaro.org Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 103 +++++++++++++++++++++++-- rust/hw/char/pl011/src/device_class.rs | 103 ------------------------- rust/hw/char/pl011/src/lib.rs | 1 - 3 files changed, 96 insertions(+), 111 deletions(-) delete mode 100644 rust/hw/char/pl011/src/device_class.rs diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/devi= ce.rs index 5b53f2649f1..ceb71dd99b6 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -2,9 +2,14 @@ // Author(s): Manos Pitsidianakis // SPDX-License-Identifier: GPL-2.0-or-later =20 -use std::{ffi::CStr, mem::size_of}; +use std::{ + ffi::{c_int, c_void, CStr}, + mem::size_of, + ptr::NonNull, +}; =20 use qemu_api::{ + bindings::{qdev_prop_bool, qdev_prop_chr}, chardev::{CharBackend, Chardev, Event}, impl_vmstate_forward, irq::{IRQState, InterruptSource}, @@ -18,12 +23,11 @@ sysbus::{SysBusDevice, SysBusDeviceImpl}, uninit_field_mut, vmstate::VMStateDescription, + vmstate_clock, vmstate_fields, vmstate_of, vmstate_struct, vmstate_sub= sections, vmstate_unused, + zeroable::Zeroable, }; =20 -use crate::{ - device_class, - registers::{self, Interrupt, RegisterOffset}, -}; +use crate::registers::{self, Interrupt, RegisterOffset}; =20 // TODO: You must disable the UART before any of the control registers are // reprogrammed. When the UART is disabled in the middle of transmission or @@ -173,10 +177,10 @@ impl ObjectImpl for PL011State { =20 impl DeviceImpl for PL011State { fn properties() -> &'static [Property] { - &device_class::PL011_PROPERTIES + &PL011_PROPERTIES } fn vmsd() -> Option<&'static VMStateDescription> { - Some(&device_class::VMSTATE_PL011) + Some(&VMSTATE_PL011) } const REALIZE: Option qemu_api::Result<()>> =3D Some(Self= ::realize); } @@ -712,3 +716,88 @@ impl PL011Impl for PL011Luminary { impl DeviceImpl for PL011Luminary {} impl ResettablePhasesImpl for PL011Luminary {} impl SysBusDeviceImpl for PL011Luminary {} + +extern "C" fn pl011_clock_needed(opaque: *mut c_void) -> bool { + let state =3D NonNull::new(opaque).unwrap().cast::(); + unsafe { state.as_ref().migrate_clock } +} + +/// Migration subsection for [`PL011State`] clock. +static VMSTATE_PL011_CLOCK: VMStateDescription =3D VMStateDescription { + name: c"pl011/clock".as_ptr(), + version_id: 1, + minimum_version_id: 1, + needed: Some(pl011_clock_needed), + fields: vmstate_fields! { + vmstate_clock!(PL011State, clock), + }, + ..Zeroable::ZERO +}; + +extern "C" fn pl011_post_load(opaque: *mut c_void, version_id: c_int) -> c= _int { + let state =3D NonNull::new(opaque).unwrap().cast::(); + let result =3D unsafe { state.as_ref().post_load(version_id as u32) }; + if result.is_err() { + -1 + } else { + 0 + } +} + +static VMSTATE_PL011_REGS: VMStateDescription =3D VMStateDescription { + name: c"pl011/regs".as_ptr(), + version_id: 2, + minimum_version_id: 2, + fields: vmstate_fields! { + vmstate_of!(PL011Registers, flags), + vmstate_of!(PL011Registers, line_control), + vmstate_of!(PL011Registers, receive_status_error_clear), + vmstate_of!(PL011Registers, control), + vmstate_of!(PL011Registers, dmacr), + vmstate_of!(PL011Registers, int_enabled), + vmstate_of!(PL011Registers, int_level), + vmstate_of!(PL011Registers, read_fifo), + vmstate_of!(PL011Registers, ilpr), + vmstate_of!(PL011Registers, ibrd), + vmstate_of!(PL011Registers, fbrd), + vmstate_of!(PL011Registers, ifl), + vmstate_of!(PL011Registers, read_pos), + vmstate_of!(PL011Registers, read_count), + vmstate_of!(PL011Registers, read_trigger), + }, + ..Zeroable::ZERO +}; + +pub static VMSTATE_PL011: VMStateDescription =3D VMStateDescription { + name: c"pl011".as_ptr(), + version_id: 2, + minimum_version_id: 2, + post_load: Some(pl011_post_load), + fields: vmstate_fields! { + vmstate_unused!(core::mem::size_of::()), + vmstate_struct!(PL011State, regs, &VMSTATE_PL011_REGS, BqlRefCell<= PL011Registers>), + }, + subsections: vmstate_subsections! { + VMSTATE_PL011_CLOCK + }, + ..Zeroable::ZERO +}; + +qemu_api::declare_properties! { + PL011_PROPERTIES, + qemu_api::define_property!( + c"chardev", + PL011State, + char_backend, + unsafe { &qdev_prop_chr }, + CharBackend + ), + qemu_api::define_property!( + c"migrate-clk", + PL011State, + migrate_clock, + unsafe { &qdev_prop_bool }, + bool, + default =3D true + ), +} diff --git a/rust/hw/char/pl011/src/device_class.rs b/rust/hw/char/pl011/sr= c/device_class.rs deleted file mode 100644 index d328d846323..00000000000 --- a/rust/hw/char/pl011/src/device_class.rs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2024, Linaro Limited -// Author(s): Manos Pitsidianakis -// SPDX-License-Identifier: GPL-2.0-or-later - -use std::{ - ffi::{c_int, c_void}, - ptr::NonNull, -}; - -use qemu_api::{ - bindings::{qdev_prop_bool, qdev_prop_chr}, - prelude::*, - vmstate::VMStateDescription, - vmstate_clock, vmstate_fields, vmstate_of, vmstate_struct, vmstate_sub= sections, vmstate_unused, - zeroable::Zeroable, -}; - -use crate::device::{PL011Registers, PL011State}; - -extern "C" fn pl011_clock_needed(opaque: *mut c_void) -> bool { - let state =3D NonNull::new(opaque).unwrap().cast::(); - unsafe { state.as_ref().migrate_clock } -} - -/// Migration subsection for [`PL011State`] clock. -static VMSTATE_PL011_CLOCK: VMStateDescription =3D VMStateDescription { - name: c"pl011/clock".as_ptr(), - version_id: 1, - minimum_version_id: 1, - needed: Some(pl011_clock_needed), - fields: vmstate_fields! { - vmstate_clock!(PL011State, clock), - }, - ..Zeroable::ZERO -}; - -extern "C" fn pl011_post_load(opaque: *mut c_void, version_id: c_int) -> c= _int { - let state =3D NonNull::new(opaque).unwrap().cast::(); - let result =3D unsafe { state.as_ref().post_load(version_id as u32) }; - if result.is_err() { - -1 - } else { - 0 - } -} - -static VMSTATE_PL011_REGS: VMStateDescription =3D VMStateDescription { - name: c"pl011/regs".as_ptr(), - version_id: 2, - minimum_version_id: 2, - fields: vmstate_fields! { - vmstate_of!(PL011Registers, flags), - vmstate_of!(PL011Registers, line_control), - vmstate_of!(PL011Registers, receive_status_error_clear), - vmstate_of!(PL011Registers, control), - vmstate_of!(PL011Registers, dmacr), - vmstate_of!(PL011Registers, int_enabled), - vmstate_of!(PL011Registers, int_level), - vmstate_of!(PL011Registers, read_fifo), - vmstate_of!(PL011Registers, ilpr), - vmstate_of!(PL011Registers, ibrd), - vmstate_of!(PL011Registers, fbrd), - vmstate_of!(PL011Registers, ifl), - vmstate_of!(PL011Registers, read_pos), - vmstate_of!(PL011Registers, read_count), - vmstate_of!(PL011Registers, read_trigger), - }, - ..Zeroable::ZERO -}; - -pub static VMSTATE_PL011: VMStateDescription =3D VMStateDescription { - name: c"pl011".as_ptr(), - version_id: 2, - minimum_version_id: 2, - post_load: Some(pl011_post_load), - fields: vmstate_fields! { - vmstate_unused!(core::mem::size_of::()), - vmstate_struct!(PL011State, regs, &VMSTATE_PL011_REGS, BqlRefCell<= PL011Registers>), - }, - subsections: vmstate_subsections! { - VMSTATE_PL011_CLOCK - }, - ..Zeroable::ZERO -}; - -qemu_api::declare_properties! { - PL011_PROPERTIES, - qemu_api::define_property!( - c"chardev", - PL011State, - char_backend, - unsafe { &qdev_prop_chr }, - CharBackend - ), - qemu_api::define_property!( - c"migrate-clk", - PL011State, - migrate_clock, - unsafe { &qdev_prop_bool }, - bool, - default =3D true - ), -} diff --git a/rust/hw/char/pl011/src/lib.rs b/rust/hw/char/pl011/src/lib.rs index 5c4fbc9d148..2b70d2ff560 100644 --- a/rust/hw/char/pl011/src/lib.rs +++ b/rust/hw/char/pl011/src/lib.rs @@ -13,7 +13,6 @@ //! the [`registers`] module for register types. =20 mod device; -mod device_class; mod registers; =20 pub use device::pl011_create; --=20 2.50.1 From nobody Sat Nov 15 06:33:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1753448335; cv=none; d=zohomail.com; s=zohoarc; b=FeVpmvRhH0hr/Fa15OAhEXj/sYDZEN0/8AHjsvEaLTaHfYNYGHlXgdlRPWXSJSKmNT0Mx8uO7p1u8q+F2bTBfFA3J/8GcvenUTqLnDWBKS5iWzd+ub+sUjZJEiLdov5zn5JiiQK3J1q2fpEvpvdrM7gX6e7GhrSRXm1uCKSBYl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753448335; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dnLgfod2RcfwvaSBs3sSVuBsFw0Zk9c9E3+FLy9lX7I=; b=dJ0UBcV3J1lH5wzoL4+wmxNRjlfYKaFw/QN4rcnFBuRXnR7Qpkmv438ArxfyAyowBUdLSFbVFHTtO65V0mAvi81UmN/yewQqOHK0q+ruGdgun3vrIS5FZlRuD4M9vMDRijL0VknsJhaezf849vmlgIl/LcTEFafmfejGVksi10I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175344833583159.605372248275444; Fri, 25 Jul 2025 05:58:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ufI0P-0002P1-K9; Fri, 25 Jul 2025 08:58:34 -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 1ufHwZ-0006Xe-CG for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ufHwS-0007xi-R1 for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:34 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-213-YY9bCL0uPWy1x5uZdAOxoQ-1; Fri, 25 Jul 2025 08:54:23 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-45359bfe631so11516405e9.0 for ; Fri, 25 Jul 2025 05:54:23 -0700 (PDT) Received: from [192.168.10.48] ([151.95.154.122]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b76fcad301sm5037758f8f.51.2025.07.25.05.54.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jul 2025 05:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753448068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dnLgfod2RcfwvaSBs3sSVuBsFw0Zk9c9E3+FLy9lX7I=; b=SNS42DXV+VNO542klNGKAr4OGeu2MasH1xfBMbr9UES5ZZzKEDu+KoIhuzIgouujbekkDM YkYqXgngHCjBr92OiEwG3mukM0c5MglyqWVcRoVjlEi3SPu19V8oOlzRb8pbzp8cNexPFP lgJ59Xx+goWA7sVXDdLx4nu12Cf12mQ= X-MC-Unique: YY9bCL0uPWy1x5uZdAOxoQ-1 X-Mimecast-MFC-AGG-ID: YY9bCL0uPWy1x5uZdAOxoQ_1753448062 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753448061; x=1754052861; 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=dnLgfod2RcfwvaSBs3sSVuBsFw0Zk9c9E3+FLy9lX7I=; b=ctM0ggLtJBlVj2y4m3UQCB09UDVsAFnhZisQn9SJMFr8jowEiGMB69MForLPHCL8+s 3uA031wBsrN4eg78PW4SaivUkOkZ9rZs9UncitHInn4KL7Z13Nnpv1bm7HFUIrTRryHG LhEFwnQM1xDJTYlYU/nOUGbcK/8xhmKxEdOckO759abrMyc76rTrkAGcS17Sek6QqErS rpJOYH7ENuAVxROXpe1Vp+tAKO+KEGzWoARILPiYpB/lfogGoJl9VWI4IrBfWSGdj5di 7h/MHIHCEbrJFImMHh1PNy5GTpdTbnR6QMj2uYOgCUijdBDShscClrjrIMqEJ9MN+AHs HCyQ== X-Gm-Message-State: AOJu0YwpyAXB5XuOlaf1n4QOFZu0zvTGkkuGRc0sPWKkndQ5KL45+IXQ 1iX+pviL4nNbaKWv/BpoOzAuGwAUJy1mFFcZwDR25QjwEg5KrPF4hGkXC75EPZrXXdGIqpHgeZT aGyr7yn8KDTZ+EZGv8UEUm5ojAjgXT2VuwrTcgiLOvrOMTs3X6ETBx/ZfJRoMDFd4Vg54rETsL5 +zP40GWNUjLXbDKNbQT5lb+ZMa/8uFGjcM0j7skLjn X-Gm-Gg: ASbGncvsWQrF7YWMDBfzL5PSv6vIXimbrtfkksbwf+eE+W2hHLG2eAWYkgDrOfbsPig O7WOoU5lOBFhg0C4cotDdGSURPYlwNIkMQxx5AMJQDC1R4ZNmfzw/lMToY/jrelk17op1CyDzhy ZyWmgzr++AJk4EJezsyY+lIvlR/05zBRHo+qiZ8mcP1nWRM1mXb1TxgmA7qqn13Dwsip/z39C0y Ep2l6Owk1xOVAODk4XIrXRZE3UvNNVJlQbRI/MWffh1qHfa+C0UN63GJITHu8Z6I7ykY9ixY8ll 8oTtJD4Sk+YwAy5QAXuBqdX0atF36pqF5Ykd5IrD3toH X-Received: by 2002:a05:6000:2083:b0:3b7:662a:b835 with SMTP id ffacd0b85a97d-3b77671d144mr1603008f8f.6.1753448060871; Fri, 25 Jul 2025 05:54:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEu1tEYGgIJvte3P8x/Ilps16IgoP6s93rQaBSQI+7qtcyU8zNvRPFh0Qmjc0MrXrE7SGuyBQ== X-Received: by 2002:a05:6000:2083:b0:3b7:662a:b835 with SMTP id ffacd0b85a97d-3b77671d144mr1602978f8f.6.1753448060144; Fri, 25 Jul 2025 05:54:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Neal Gompa Subject: [PULL 3/4] scripts: add script to help distros use global Rust packages Date: Fri, 25 Jul 2025 14:54:02 +0200 Message-ID: <20250725125412.1128617-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250725125412.1128617-1-pbonzini@redhat.com> References: <20250725125412.1128617-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.175, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1753448336716116600 Some distros prefer to avoid vendored crate sources, and instead use local sources from e.g. ``/usr/share/cargo/registry``. Add a script, inspired by the Mesa spec file(*), that automatically performs this task. The script is meant to be invoked after unpacking the QEMU tarball. (*) This is the hack that Mesa uses: export MESON_PACKAGE_CACHE_DIR=3D"%{cargo_registry}/" %define inst_crate_nameversion() %(basename %{cargo_registry}/%{1}-*) %define rewrite_wrap_file() sed -e "/source.*/d" -e "s/%{1}-.*/%{inst_c= rate_nameversion %{1}}/" -i subprojects/%{1}.wrap %rewrite_wrap_file proc-macro2 ... more %rewrite_wrap_file invocations follow ... Reviewed-by: Neal Gompa Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + docs/about/build-platforms.rst | 8 + scripts/get-wraps-from-cargo-registry.py | 190 +++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100755 scripts/get-wraps-from-cargo-registry.py diff --git a/MAINTAINERS b/MAINTAINERS index a4623456183..1604f3dfc1f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3511,6 +3511,7 @@ S: Maintained F: rust/qemu-api F: rust/qemu-api-macros F: rust/rustfmt.toml +F: scripts/get-wraps-from-cargo-registry.py =20 Rust-related patches CC here L: qemu-rust@nongnu.org diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst index 8ecbd6b26f7..8671c3be9cd 100644 --- a/docs/about/build-platforms.rst +++ b/docs/about/build-platforms.rst @@ -127,6 +127,14 @@ Rust build dependencies (or newer) package. The path to ``rustc`` and ``rustdoc`` must be provided manually to the configure script. =20 + Some distros prefer to avoid vendored crate sources, and instead use + local sources from e.g. ``/usr/share/cargo/registry``. QEMU includes a + script, ``scripts/get-wraps-from-cargo-registry.py``, that automatically + performs this task. The script is meant to be invoked after unpacking + the QEMU tarball. QEMU also includes ``rust/Cargo.toml`` and + ``rust/Cargo.lock`` files that can be used to compute QEMU's build + dependencies, e.g. using ``cargo2rpm -p rust/Cargo.toml buildrequires``. + Optional build dependencies Build components whose absence does not affect the ability to build QEMU may not be available in distros, or may be too old for our requirements. diff --git a/scripts/get-wraps-from-cargo-registry.py b/scripts/get-wraps-f= rom-cargo-registry.py new file mode 100755 index 00000000000..31eed5c2dd4 --- /dev/null +++ b/scripts/get-wraps-from-cargo-registry.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python3 + +# SPDX-License-Identifier: GPL-2.0-or-later + +""" +get-wraps-from-cargo-registry.py - Update Meson subprojects from a global = registry +""" + +# Copyright (C) 2025 Red Hat, Inc. +# +# Author: Paolo Bonzini + +import argparse +import configparser +import filecmp +import glob +import os +import subprocess +import sys + + +def get_name_and_semver(namever: str) -> tuple[str, str]: + """Split a subproject name into its name and semantic version parts""" + parts =3D namever.rsplit("-", 1) + if len(parts) !=3D 2: + return namever, "" + + return parts[0], parts[1] + + +class UpdateSubprojects: + cargo_registry: str + top_srcdir: str + dry_run: bool + changes: int =3D 0 + + def find_installed_crate(self, namever: str) -> str | None: + """Find installed crate matching name and semver prefix""" + name, semver =3D get_name_and_semver(namever) + + # exact version match + path =3D os.path.join(self.cargo_registry, f"{name}-{semver}") + if os.path.exists(path): + return f"{name}-{semver}" + + # semver match + matches =3D sorted(glob.glob(f"{path}.*")) + return os.path.basename(matches[0]) if matches else None + + def compare_build_rs(self, orig_dir: str, registry_namever: str) -> No= ne: + """Warn if the build.rs in the original directory differs from the= registry version.""" + orig_build_rs =3D os.path.join(orig_dir, "build.rs") + new_build_rs =3D os.path.join(self.cargo_registry, registry_nameve= r, "build.rs") + + msg =3D None + if os.path.isfile(orig_build_rs) !=3D os.path.isfile(new_build_rs): + if os.path.isfile(orig_build_rs): + msg =3D f"build.rs removed in {registry_namever}" + if os.path.isfile(new_build_rs): + msg =3D f"build.rs added in {registry_namever}" + + elif os.path.isfile(orig_build_rs) and not filecmp.cmp(orig_build_= rs, new_build_rs): + msg =3D f"build.rs changed from {orig_dir} to {registry_nameve= r}" + + if msg: + print(f"=E2=9A=A0=EF=B8=8F Warning: {msg}") + print(" This may affect the build process - please review th= e differences.") + + def update_subproject(self, wrap_file: str, registry_namever: str) -> = None: + """Modify [wrap-file] section to point to self.cargo_registry.""" + assert wrap_file.endswith("-rs.wrap") + wrap_name =3D wrap_file[:-5] + + env =3D os.environ.copy() + env["MESON_PACKAGE_CACHE_DIR"] =3D self.cargo_registry + + config =3D configparser.ConfigParser() + config.read(wrap_file) + if "wrap-file" not in config: + return + + # do not download the wrap, always use the local copy + orig_dir =3D config["wrap-file"]["directory"] + if os.path.exists(orig_dir) and orig_dir !=3D registry_namever: + self.compare_build_rs(orig_dir, registry_namever) + + if self.dry_run: + if orig_dir =3D=3D registry_namever: + print(f"Will install {orig_dir} from registry.") + else: + print(f"Will replace {orig_dir} with {registry_namever}.") + self.changes +=3D 1 + return + + config["wrap-file"]["directory"] =3D registry_namever + for key in list(config["wrap-file"].keys()): + if key.startswith("source"): + del config["wrap-file"][key] + + # replace existing directory with installed version + if os.path.exists(orig_dir): + subprocess.run( + ["meson", "subprojects", "purge", "--confirm", wrap_name], + cwd=3Dself.top_srcdir, + env=3Denv, + check=3DTrue, + ) + + with open(wrap_file, "w") as f: + config.write(f) + + if orig_dir =3D=3D registry_namever: + print(f"Installing {orig_dir} from registry.") + else: + print(f"Replacing {orig_dir} with {registry_namever}.") + patch_dir =3D config["wrap-file"]["patch_directory"] + patch_dir =3D os.path.join("packagefiles", patch_dir) + _, ver =3D registry_namever.rsplit("-", 1) + subprocess.run( + ["meson", "rewrite", "kwargs", "set", "project", "/", "ver= sion", ver], + cwd=3Dpatch_dir, + env=3Denv, + check=3DTrue, + ) + + subprocess.run( + ["meson", "subprojects", "download", wrap_name], + cwd=3Dself.top_srcdir, + env=3Denv, + check=3DTrue, + ) + self.changes +=3D 1 + + @staticmethod + def parse_cmdline() -> argparse.Namespace: + parser =3D argparse.ArgumentParser( + description=3D"Replace Meson subprojects with packages in a Ca= rgo registry" + ) + parser.add_argument( + "--cargo-registry", + default=3Dos.environ.get("CARGO_REGISTRY"), + help=3D"Path to Cargo registry (default: CARGO_REGISTRY env va= r)", + ) + parser.add_argument( + "--dry-run", + action=3D"store_true", + default=3DFalse, + help=3D"Do not actually replace anything", + ) + + args =3D parser.parse_args() + if not args.cargo_registry: + print("error: CARGO_REGISTRY environment variable not set and = --cargo-registry not provided") + sys.exit(1) + + return args + + def __init__(self, args: argparse.Namespace): + self.cargo_registry =3D args.cargo_registry + self.dry_run =3D args.dry_run + self.top_srcdir =3D os.getcwd() + + def main(self) -> None: + if not os.path.exists("subprojects"): + print("'subprojects' directory not found, nothing to do.") + return + + os.chdir("subprojects") + for wrap_file in sorted(glob.glob("*-rs.wrap")): + namever =3D wrap_file[:-8] # Remove '-rs.wrap' + + registry_namever =3D self.find_installed_crate(namever) + if not registry_namever: + print(f"No installed crate found for {wrap_file}") + continue + + self.update_subproject(wrap_file, registry_namever) + + if self.changes: + if self.dry_run: + print("Rerun without --dry-run to apply changes.") + else: + print(f"=E2=9C=A8 {self.changes} subproject(s) updated!") + else: + print("No changes.") + + +if __name__ =3D=3D "__main__": + args =3D UpdateSubprojects.parse_cmdline() + UpdateSubprojects(args).main() --=20 2.50.1 From nobody Sat Nov 15 06:33:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1753448253; cv=none; d=zohomail.com; s=zohoarc; b=U4rP/1nA+rKmWFRiWa8Fjm5eRqNbFQsAigXYlmsJh5kdk3+8xKj+vd898OW9SvahzUG4OUpp7Ct2S/liF5krGMLmYC2P/p18FX5RcOzfo1AX/RKsoWKoBve5B57k7zqpk4iHM+/zBwwyann2iEcT46mr/Gc2PrpCJLFvNhhQvkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753448253; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EbTMLHA3rj3U1tHOFnDcGjbFJRKDBX4Jln5VLvOEkGU=; b=RChrfmQ5RssZKZhtO9eRnDKwalyMRjkGWGQdKyskRAX9QIUJeMF4x6aktJXvvJlp4OuhYAbGfKUpUhh+OxbRJKUvKRy16GVFnaEBSL6qrDBbGxafiEzYKxt/tU/Tw4kL23K3o244XdHQ9S1I7XKpN0GduL8Sm0B/pDeZN6HRuTk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1753448253006480.89260829988916; Fri, 25 Jul 2025 05:57:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ufHxp-0007v6-D6; Fri, 25 Jul 2025 08:55: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 1ufHwV-0006VQ-M1 for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ufHwS-0007xV-Oj for qemu-devel@nongnu.org; Fri, 25 Jul 2025 08:54:31 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-fsgKrMR8NZCrTXavlHXPpQ-1; Fri, 25 Jul 2025 08:54:26 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3a4ff581df3so1033029f8f.1 for ; Fri, 25 Jul 2025 05:54:25 -0700 (PDT) Received: from [192.168.10.48] ([151.95.154.122]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b76fcad219sm5011326f8f.39.2025.07.25.05.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jul 2025 05:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753448067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EbTMLHA3rj3U1tHOFnDcGjbFJRKDBX4Jln5VLvOEkGU=; b=MyODRDybzgqBSnjSp7Tf6ThUkaJeeXakhg3PfDuJ7RX8emG7gTS1A4JwdjGWEHd2EufCKA rLOCXhRDia7bhnTejtnj6Arzt9iN455Dub/FBkFd4owoEKVBdivVmYwc6Y1gPGFSAh2gZH SUvjYndXORwVFocEcmBM+v1w/cm6yi0= X-MC-Unique: fsgKrMR8NZCrTXavlHXPpQ-1 X-Mimecast-MFC-AGG-ID: fsgKrMR8NZCrTXavlHXPpQ_1753448065 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753448064; x=1754052864; 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=EbTMLHA3rj3U1tHOFnDcGjbFJRKDBX4Jln5VLvOEkGU=; b=B/TkTri7a/83vilfJHSuJp7pwS9sAUFv++t3Y/+gP4V2P/Ak7q6LJQWthYTRgQCC1l tTLEpmajRu22GFw0zrHruy/t8nKsFh6sSX1PDvv4P3nY1ckJRLD+4SyfwMTC3SRQcsfN 0VjcDTKQpagAnqHFRv9fC3EGdnYLobhlqyUfKk/aEV5XzFyDBPR718zODynmX1Q8sQho wBAO3nyj/T2Hnm5OhB9AWdtP1ZLG664r3sD4ajKqs6g57MXb28XNx+d2MqDnvudZHXtc eSmxLVpz3BmRLGz1ucCHQluULRN+G/5wPp2TyKCwBl3DSVRjnY48b2r+IxQG3nPs1z9+ MPug== X-Gm-Message-State: AOJu0YwrZLNOnFV6HjAbgRRo48ajdqCkI9N+93oAcZgYQzloxTYlPGGz q3yyA+AS1z9ujualWfUNwuylNazJZJrlV81FDpyjJwyQCLtYRq0h+DDKLH5lk8VsKrn7cByVHB7 XcLIlndLT4Di6IhW7hfoSfmiufK9JTxWX3BInCpSGGcDFbZYHO6fgV+PwiDEIZTFdIdWPo7Z7Xt VaBzBfv34/5Kc8JlCa0UPal5wS8AtUw6etJgcOogAs X-Gm-Gg: ASbGncviO1LRwHge+TM1Egk5tO0VaPk+XYGxS4XjXGrHk4fen9MFS0/ihgRv0m+KC5V Ri4zPhCmAFPBAZSTFFMO/Ft6b8ctZpMLxa6IM3oWQa/IVJvRYCCCuITbd1hleCwyKbz0/YQwdpo kV1gjk8OKtX6QA9+17Vo8UwI2yWh0baAHlCco1gVB0C69ptixBx+HYmIBTyMbt8FaDX8HomXkJG EFKTwYDF6fjGqYYMulP05pauv4TfoFUTogTfL30CGqFyc5YM8s74Bq5K89dcLGCWYd+H7qPMFAp BHGwHbtTq7Ta3xxwZhuLGqJj83pTLnaLDPaLlqGgdmRF X-Received: by 2002:a05:6000:401e:b0:3a5:6860:f47f with SMTP id ffacd0b85a97d-3b7765e6070mr1925554f8f.6.1753448064060; Fri, 25 Jul 2025 05:54:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/M1TFfzcdD4CRVZ2W8B2Vy1QSjMjmCjznguokabjxaGRosDg9c4USOB4VdYWaiMY90593yQ== X-Received: by 2002:a05:6000:401e:b0:3a5:6860:f47f with SMTP id ffacd0b85a97d-3b7765e6070mr1925526f8f.6.1753448063573; Fri, 25 Jul 2025 05:54:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Eric Biggers , Ard Biesheuvel , "Jason A. Donenfeld" , Guenter Roeck , qemu-stable@nongnu.org Subject: [PULL 4/4] target/i386: fix width of third operand of VINSERTx128 Date: Fri, 25 Jul 2025 14:54:03 +0200 Message-ID: <20250725125412.1128617-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250725125412.1128617-1-pbonzini@redhat.com> References: <20250725125412.1128617-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.175, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1753448253954116600 Content-Type: text/plain; charset="utf-8" Table A-5 of the Intel manual incorrectly lists the third operand of VINSERTx128 as Wqq, but it is actually a 128-bit value. This is visible when W is a memory operand close to the end of the page. Fixes the recently-added poly1305_kunit test in linux-next. (No testcase yet, but I plan to modify test-avx2 to use memory close to the end of the page. This would work because the test vectors correctly have the memory operand as xmm2/m128). Reported-by: Eric Biggers Tested-by: Eric Biggers Cc: Ard Biesheuvel Cc: "Jason A. Donenfeld" Cc: Guenter Roeck Cc: qemu-stable@nongnu.org Fixes: 79068477686 ("target/i386: reimplement 0x0f 0x3a, add AVX", 2022-10-= 18) Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index 853b1c8bf95..51038657f0f 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -878,10 +878,10 @@ static const X86OpEntry opcodes_0F3A[256] =3D { [0x0e] =3D X86_OP_ENTRY4(VPBLENDW, V,x, H,x, W,x, vex4 cpuid(SSE4= 1) avx2_256 p_66), [0x0f] =3D X86_OP_ENTRY4(PALIGNR, V,x, H,x, W,x, vex4 cpuid(SSSE= 3) mmx avx2_256 p_00_66), =20 - [0x18] =3D X86_OP_ENTRY4(VINSERTx128, V,qq, H,qq, W,qq, vex6 chk(W0) = cpuid(AVX) p_66), + [0x18] =3D X86_OP_ENTRY4(VINSERTx128, V,qq, H,qq, W,dq, vex6 chk(W0) = cpuid(AVX) p_66), [0x19] =3D X86_OP_ENTRY3(VEXTRACTx128, W,dq, V,qq, I,b, vex6 chk(W0) = cpuid(AVX) p_66), =20 - [0x38] =3D X86_OP_ENTRY4(VINSERTx128, V,qq, H,qq, W,qq, vex6 chk(W0) = cpuid(AVX2) p_66), + [0x38] =3D X86_OP_ENTRY4(VINSERTx128, V,qq, H,qq, W,dq, vex6 chk(W0) = cpuid(AVX2) p_66), [0x39] =3D X86_OP_ENTRY3(VEXTRACTx128, W,dq, V,qq, I,b, vex6 chk(W0) = cpuid(AVX2) p_66), =20 /* Listed incorrectly as type 4 */ --=20 2.50.1