From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658421835; cv=none; d=zohomail.com; s=zohoarc; b=VjSd7GHRz2jdhDmSZq0lFyPcIDKZiaAZypGDxdjEGBvjktjkCC0Q48LMsu48hpmn64rwmNQ9QK3D79geLnBaBW7mWRXNVGeTOF9qzICGof8JxRBB+NpzGERMF6AgbI1/kRJVY7PGXy4gPxD357fcjP24LxvleQBb8cKyAF285Ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658421835; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9ke5vqcgkudsqCwZBZaVUTP9XipH1T55BwyTUX5P4f4=; b=XspSHh2G1ghu2C1w+pQVbznwKt8jZnoCJXOSoiyNJ3DCkiycOndmFSC2OV4H8nq4CIqgALhnSGQ7V1PTw50YOGQphjZ8fWHppFEumnG0h/IwzhkMbsXfG+PNVjjdLDiPbE6t3Y87c07ys+IhDoqTqNmY8ao5AOP2Or0QKAvUnNM= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658421835132691.1121179912227; Thu, 21 Jul 2022 09:43:55 -0700 (PDT) Received: from localhost ([::1]:43574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZHG-0001Eq-1D for importer@patchew.org; Thu, 21 Jul 2022 12:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAE-00072r-SQ for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAA-0007g0-Kg for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:38 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-222-Jk_H96WhPjS-A5GaUGClFw-1; Thu, 21 Jul 2022 12:36:26 -0400 Received: by mail-ed1-f70.google.com with SMTP id w13-20020a05640234cd00b0043a991fb3f3so1440533edc.3 for ; Thu, 21 Jul 2022 09:36:26 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id u1-20020a1709061da100b00722e50dab2csm1017972ejh.109.2022.07.21.09.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421393; 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=9ke5vqcgkudsqCwZBZaVUTP9XipH1T55BwyTUX5P4f4=; b=GnbM2NY7Gc3N/S5sTiaWj9LqwCxdDSMPSr5vp85njUUnuSejGvIXg2Pcy15UV2K7CdnxRn l3MxROSsunVvqK0MmqKoxmEZM9DQjCuhFK/DVmOy3j7TuoVXSCBLP0xzSfuA2J9cwY9G7l gYMkVdQISjfmRs8Vt1w+ddSMYfbRZp0= X-MC-Unique: Jk_H96WhPjS-A5GaUGClFw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ke5vqcgkudsqCwZBZaVUTP9XipH1T55BwyTUX5P4f4=; b=xSml7wcySEMSMsMfjdAr1YgJW48ec1gQDjZLut5dcHle+g8ENRodqiOtzaR3AJ6G5i L+2SJyliBSnb8V9B7GI5NFY+BmmT3cUxrFikB3ctfpwSXiNPUDy3qiX+vhSVhQKTNs+h TPusQ3SND/d0RsQEDakkmBYbia3PwKVoJl9nV4thcVfhP3tBicJqGuTEdLObqPP4rhxV Y/Ii7+OGjLcC3yLOiJbkmWYWG9i5wGkp3a0xVUpqaCIiaKiLJOvERM97c6rjAxrgfEnw hIq211FGwRAE/jIblVpjllEzdtvhluB9SvsU9Ft4ben1U0PYNVGBCMjZUxo/3mF2Bio5 yHrQ== X-Gm-Message-State: AJIora/U12pmoVeqo+YpD/BjPDoI1YJ2OPb91n8K4vqMtQOQgitaPWYL DW0CjLLr1+0fJFtWDMkuFqxvho6zrs8U/H/KTb6bTIyvUMUtEFaDYocZpblx4pL7ay6i4Z7iJnF 9TnRT0Bj8L/+IXo7hNChHq8NZxwHILaVb3ev+EUt+FZiwM6EDmHZGIbGqr4rnGSS1Jns= X-Received: by 2002:a05:6402:3681:b0:43a:7c29:466a with SMTP id ej1-20020a056402368100b0043a7c29466amr57623796edb.367.1658421385042; Thu, 21 Jul 2022 09:36:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vrR67aaERgCV8K/IGg/kMVVYfDc281Z+cW6giJ0r3R76zzpBw9oVw4vRKK4CbabOVwm5Li7A== X-Received: by 2002:a05:6402:3681:b0:43a:7c29:466a with SMTP id ej1-20020a056402368100b0043a7c29466amr57623758edb.367.1658421384739; Thu, 21 Jul 2022 09:36:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Bin Meng , Stefan Weil , Akihiko Odaki Subject: [PULL 1/9] docs: Add caveats for Windows as the build platform Date: Thu, 21 Jul 2022 18:36:13 +0200 Message-Id: <20220721163621.761513-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658421836065100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Commit cf60ccc3306c ("cutils: Introduce bundle mechanism") introduced a Python script to populate a bundle directory using os.symlink() to point to the binaries in the pc-bios directory of the source tree. Commit 882084a04ae9 ("datadir: Use bundle mechanism") removed previous logic in pc-bios/meson.build to create a link/copy of pc-bios binaries in the build tree so os.symlink() is the way to go. However os.symlink() may fail [1] on Windows if an unprivileged Windows user started the QEMU build process, which results in QEMU executables generated in the build tree not able to load the default BIOS/firmware images due to symbolic links not present in the bundle directory. This commits updates the documentation by adding such caveats for users who want to build QEMU on the Windows platform. [1] https://docs.python.org/3/library/os.html#os.symlink Signed-off-by: Bin Meng Reviewed-by: Stefan Weil Reviewed-by: Akihiko Odaki Message-Id: <20220719135014.764981-1-bmeng.cn@gmail.com> Signed-off-by: Paolo Bonzini --- docs/about/build-platforms.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst index ebde20f981..6b8496c430 100644 --- a/docs/about/build-platforms.rst +++ b/docs/about/build-platforms.rst @@ -94,8 +94,16 @@ not tested anymore, so it is recommended to use one of t= he latest versions of Windows instead. =20 The project supports building QEMU with current versions of the MinGW -toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on Windows. +toolchain, either hosted on Linux (Debian/Fedora) or via `MSYS2`_ on Windo= ws. +A more recent Windows version is always preferred as it is less likely to = have +problems with building via MSYS2. The building process of QEMU involves so= me +Python scripts that call os.symlink() which needs special attention for the +build process to successfully complete. On newer versions of Windows 10, +unprivileged accounts can create symlinks if Developer Mode is enabled. +When Developer Mode is not available/enabled, the SeCreateSymbolicLinkPriv= ilege +privilege is required, or the process must be run as an administrator. =20 .. _Homebrew: https://brew.sh/ .. _MacPorts: https://www.macports.org/ +.. _MSYS2: https://www.msys2.org/ .. _Repology: https://repology.org/ --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658421559; cv=none; d=zohomail.com; s=zohoarc; b=KZ2rqkSXVfkK50+uU6TvfmB3Vhp+jeyD9a/MmXPAUnoiMJ+H2aWKqZCyQq/s2WZaKfI+KE3fmtrZW+lvx4xwfYR+WF/MX5la+uQO9HHEDax1954NdagA1AowBD2Mcf3f2iIGJ2QLEkG9iD14kmSbwrPC2zp0FD3m6srvoX0tWpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658421559; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xBu5tHYZdH4qg2e4NKv+20LCbKvedmiAv3FHARj7E+c=; b=oEMJSLDBJIGn3PL/RgxXcDVOuKaDONBvzi9G31WwbjzM8x9liy5Y8N1YcKalAQZwYf8juJiMHjHJ4aDfvShOEd5HQLpC6iCz/Y62oMvaKT9rj3cl17xhQQYsKcPrWRGwpZ+pNdStOzQV3t7/97NOZMt1+DFM7MCVLXPNGpfvQKs= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658421559471820.4744077038569; Thu, 21 Jul 2022 09:39:19 -0700 (PDT) Received: from localhost ([::1]:59360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZCn-0000ze-5r for importer@patchew.org; Thu, 21 Jul 2022 12:39:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZA9-0006xE-MU for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZA6-0007fa-Qv for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:32 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-290-8_NBZV2VMli4BFlsKootrw-1; Thu, 21 Jul 2022 12:36:28 -0400 Received: by mail-ej1-f70.google.com with SMTP id hb41-20020a170907162900b0072f044ca263so980152ejc.15 for ; Thu, 21 Jul 2022 09:36:28 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id a18-20020a170906191200b0072ee9790894sm985334eje.197.2022.07.21.09.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421390; 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=xBu5tHYZdH4qg2e4NKv+20LCbKvedmiAv3FHARj7E+c=; b=cp/OQhhCG3h9xuSCwnmZN/N6ecyFC9dQlgHc2/GzUG5O4C/C7+P7q7BUNUc4dZYLjjDVvI mey0et+EeCB4LCvjEhO2ziNDaRkbJ9DCW4nC/z53YMFQtdrzurrO+wIPrNRF/yRcGWFsRT L/uSD9rgbVhbbnLO0mCC0KXeSTTFrMo= X-MC-Unique: 8_NBZV2VMli4BFlsKootrw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xBu5tHYZdH4qg2e4NKv+20LCbKvedmiAv3FHARj7E+c=; b=CygRwmNIpQbkVqWv08x2lyemo32qdzSnDGpzZ0iL63rwmsBcFewgnSA2+4FJ/fqz++ 80UznA8pMMcOYz8nbf15ZvUlmOQymAy56ppi6MTK0VVBPdu4fLcCldAHMx+Ep8OgNjsn 8FQMwSfj8oSXzLxx8JA2H1ipoD3PcPGhz+Ny8sY7M/fgEYzrBu1WmlOAn3bXKREpwdUM //qlJjlqUTU/j45Sy3WLNDkop6o10PMDJ0VkDhRAItqiO2n+iSzGtGovAL8SgrNXA1rN ix9bEDEhKmHzG3EVYkqYGzWvVEGRhuc5lodAEBOyUcsdUhq7YYCPQg8LWuWwJc4Mzsiz NtIw== X-Gm-Message-State: AJIora/nx//8Cv9WwYCZuFy0Q1+ws2eovKMdh8Zez2hPrTHFTKBJDAK1 eeYBuJAMJhYSyy1btjqR0ksjJ3HCjj5veVBC6NE/LvK2OxfyqtiZIqF0YqGDSC7fp2Hj+5TDwex y1ZGt4Zjrh1zx4U6Q40T7V/2ZCdF0/kjRbfC1kbhkN/i/D+dmqv+q8iZp4MdyukY2xQo= X-Received: by 2002:a17:907:1c8a:b0:6e9:2a0d:d7b7 with SMTP id nb10-20020a1709071c8a00b006e92a0dd7b7mr40351288ejc.572.1658421387280; Thu, 21 Jul 2022 09:36:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uKrjJ30MY4FB1Z1QbwohiKQ/rnVwG4gEnDRY9w9E+SuQGrjBJHSAYGmwP4mDGFXu3AcV4R3Q== X-Received: by 2002:a17:907:1c8a:b0:6e9:2a0d:d7b7 with SMTP id nb10-20020a1709071c8a00b006e92a0dd7b7mr40351274ejc.572.1658421387030; Thu, 21 Jul 2022 09:36:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 2/9] accel/kvm: Avoid Coverity warning in query_stats() Date: Thu, 21 Jul 2022 18:36:14 +0200 Message-Id: <20220721163621.761513-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658421561840100001 Content-Type: text/plain; charset="utf-8" From: Peter Maydell Coverity complains that there is a codepath in the query_stats() function where it can leak the memory pointed to by stats_list. This can only happen if the caller passes something other than STATS_TARGET_VM or STATS_TARGET_VCPU as the 'target', which no callsite does. Enforce this assumption using g_assert_not_reached(), so that if we have a future bug we hit the assert rather than silently leaking memory. Resolves: Coverity CID 1490140 Fixes: cc01a3f4cadd91e6 ("kvm: Support for querying fd-based stats") Signed-off-by: Peter Maydell Message-Id: <20220719134853.327059-1-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index ed8b6b896e..eb7fceb336 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3980,7 +3980,7 @@ static void query_stats(StatsResultList **result, Sta= tsTarget target, stats_list); break; default: - break; + g_assert_not_reached(); } } =20 --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658421684; cv=none; d=zohomail.com; s=zohoarc; b=E0DAAIZmNlrOcKakB2HVec/vxsCirZyuCDNXeri7AHhubSF0q+9BhadB0fALJxawJNNd9TJDSjzUuNb1QUNFAxnFa0Sh799b+0JowoAdmS+rihTwNmqQmfYpRqOlX0TBA8on4wfDMYJq+aNeqAbmXlU8CWoIqXJFf4NAtTwv9sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658421684; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QIe3GqZfn4ySK6BpRC1oz1OEETJCzYLqg2tOgkwe3oM=; b=Sx62lM0KVE2teVe2SCFywkLBmIQxRgRoElKM2eUD+uqjR6TG2PTn97hnlve4ZQRGFSQY/NPpgO5zmac65c4Rh/Cr9Z2frLaBRFi1+qs/geCKfFx2tJMe4pqyZ6loKIrBiBDZE9Qwou5o0YOyWfd+Cc+OfGrbzS9SJjhJiVBoHDY= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658421684373946.5770190645482; Thu, 21 Jul 2022 09:41:24 -0700 (PDT) Received: from localhost ([::1]:37514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZEo-0005S8-W5 for importer@patchew.org; Thu, 21 Jul 2022 12:41:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAB-0006yu-4w for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:31375) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZA8-0007fn-MT for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:33 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-313-5PK6X94VMxKPd3amZvEWXQ-1; Thu, 21 Jul 2022 12:36:30 -0400 Received: by mail-ed1-f69.google.com with SMTP id o13-20020a056402438d00b0043aa846b2d2so1436241edc.8 for ; Thu, 21 Jul 2022 09:36:30 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id m15-20020a50ef0f000000b0043a2b8ab377sm1278348eds.88.2022.07.21.09.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421392; 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=QIe3GqZfn4ySK6BpRC1oz1OEETJCzYLqg2tOgkwe3oM=; b=QzmL1nefM/ZmYAK4ASBR+RHT4UAX2gB1VDxp7rqY3ZfFD15/9Pg2iaYOncP4J8ulcsDT4i f8aV1/djPNkWEOdwcgpXXviesYCTiUgdvpAezAQxtQ8XkgLOoZEHS3FS0oAKaCXixXONN2 tN1HdlW2KvC6fehuxmUMRLShIq3jeJE= X-MC-Unique: 5PK6X94VMxKPd3amZvEWXQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QIe3GqZfn4ySK6BpRC1oz1OEETJCzYLqg2tOgkwe3oM=; b=vwM3xKRvK8FZlAxu1hdnPj9jNjobVBUG6vK7gGK2ZjA88jyqbJH6Vr4q9kCn5h3tMN wrPMXROWrMK0Wb9nOXA9q0SWLb8PmhL68ZGEYw1hNcgr8ykhKGWwgGKxCKDiDEfPqyYW C9nyMjNTaiBb9K7lRBV5cFJ5WmeTMQAKW74mRAEucn7PnFhsPuqc6kbH2yhRvCN3QF02 RGlknOkFPMy4aedmmowE4pqkp9YB8g07+p2kQRB68OSa2ZTP5sufF5D9UpLhA7zz3+K2 HR7o47HH4KwQR8Exewvus0mkdPkYFcWDQYayuYeBd8R8ePC8h4KVOGcHbk+gQSGn4nNg 5Xzw== X-Gm-Message-State: AJIora9b6a15DHGzdOqJvEzMhfpz+MtUuuA6UCdyi1biMgQOQAG4QZNW EHGrj7392dASn33PWC3r4HaO4ULRbTvd08t/6FaCfk1ISrkDyUZAAxfvRSiPTDlHNjMf8z+NvI7 NuJlsuYmfZFSPxR0tLvpX1RsFeLee4p5U3akvKtwTqxH9rBY1nO56RiaLQQBIY09rNxk= X-Received: by 2002:aa7:de85:0:b0:43a:d89f:1c7b with SMTP id j5-20020aa7de85000000b0043ad89f1c7bmr58500095edv.17.1658421388929; Thu, 21 Jul 2022 09:36:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tjwaQxT6SiByzy/g4oiiKLJxMe9F+s5bXbg1sROfvctAL3VDdrTA5zbVKPpwgFRnxZzWcG9w== X-Received: by 2002:aa7:de85:0:b0:43a:d89f:1c7b with SMTP id j5-20020aa7de85000000b0043ad89f1c7bmr58500075edv.17.1658421388750; Thu, 21 Jul 2022 09:36:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Alexander Bulekov Subject: [PULL 3/9] oss-fuzz: remove binaries from qemu-bundle tree Date: Thu, 21 Jul 2022 18:36:15 +0200 Message-Id: <20220721163621.761513-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658421686352100001 Content-Type: text/plain; charset="utf-8" oss-fuzz is finding possible fuzzing targets even under qemu-bundle/.../bin= , but they cannot be used because the required shared libraries are missing. Since the fuzzing targets are already placed manually in $OUT, the bindir and libexec= dir subtrees are not needed; remove them. Cc: Alexander Bulekov Signed-off-by: Paolo Bonzini --- scripts/oss-fuzz/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh index 2656a89aea..5ee9141e3e 100755 --- a/scripts/oss-fuzz/build.sh +++ b/scripts/oss-fuzz/build.sh @@ -87,8 +87,10 @@ if [ "$GITLAB_CI" !=3D "true" ]; then make "-j$(nproc)" qemu-fuzz-i386 V=3D1 fi =20 -# Prepare a preinstalled tree +# Place data files in the preinstall tree make install DESTDIR=3D$DEST_DIR/qemu-bundle +rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/bin +rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/libexec =20 targets=3D$(./qemu-fuzz-i386 | awk '$1 ~ /\*/ {print $2}') base_copy=3D"$DEST_DIR/qemu-fuzz-i386-target-$(echo "$targets" | head -n 1= )" --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658421703; cv=none; d=zohomail.com; s=zohoarc; b=MJmixe9cjFHk/wMgLAVb/2O2N3ZKFCw2j+7yN5xtPufcTUqkLKalKEIh9guP4Oz/jI8BjbpehUC2Agk7gKPMcDAgqkfKnSSH0/pWgU4wVEklI6bGHSE/qrTvLYSiZ8xK38VqabTQGYYc3Gm/PwGErZHFGiOBPwQEX/f7ZySlm0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658421703; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OsjHDI91sKDaO7jtr73uSZ6ojIq5100HvLrmIMADMIc=; b=ObXEHnsVissCDcK4U/G8tFBcH5+XKIMI0YEbPVaEwwP5VOE4xyczomP8OkgV8t33IW7GGp523idO+ghCfeTbecy4SE5wUTawbeo2pq51cZAHqv93GYFa5l7KIxusleXXrgOs/m5ljl2farlOlhKI5PN+nNnBZ3SNVA/Zg6rSq/E= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165842170322226.737631710295318; Thu, 21 Jul 2022 09:41:43 -0700 (PDT) Received: from localhost ([::1]:37764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZF6-0005cM-Fn for importer@patchew.org; Thu, 21 Jul 2022 12:41:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAO-0007C9-6x for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAB-0007g5-HT for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:47 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-204-eRbBdzfCOdq1wUvtPFb7xw-1; Thu, 21 Jul 2022 12:36:32 -0400 Received: by mail-ej1-f70.google.com with SMTP id oz11-20020a1709077d8b00b0072f2f17c267so967821ejc.16 for ; Thu, 21 Jul 2022 09:36:32 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id op9-20020a170906bce900b00722e31fcf42sm999024ejb.184.2022.07.21.09.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421394; 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=OsjHDI91sKDaO7jtr73uSZ6ojIq5100HvLrmIMADMIc=; b=EbKOgAkF9dlxKxVjLN+S5jF6KZOM+KpZgAU7NaEPGOQnG/m0FzEmmYVJnALxJWEfPuXNtQ lDD2hDY8oE0Rpc7AEkw5jhZMBlZGJQekYFoHd9eHWn1KV+vssRa04iGzRYBQuK9UabkjVq TkT/BVW3KgQ4ec5efSRSLVe1vJU1GEc= X-MC-Unique: eRbBdzfCOdq1wUvtPFb7xw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OsjHDI91sKDaO7jtr73uSZ6ojIq5100HvLrmIMADMIc=; b=XwfkzXgTbdWcP0Ypw9i8CNtkstvzuJJ6QaBK4URiA/g4e2le3dpx4VkJ6r44ZQ1Cja Ah1GkY0FnQ5rzrqKLa8dbmTT/69Tm21riRfW16fFo1WH7d3lMXeAnZTwuTP3IsaRTy6f rECTkwpu4taD/PG0VaivmekaV5wybP6OATF1aaKrHSkSDMU5IbFRD/O3FVHLY/d+oe4Q wNBoWcakp3HOKB2QSZBXFB0nv1pQiXSGFz0ivv1hmREAY2VrXBsfroNSu8j3/THnfbcK REx6Ero7uhkcKCFIDUNlnq7X1j7akB9DOFYbVRAUhMWMaS5DfwT0KU5vHrgUQa69htFI PQJw== X-Gm-Message-State: AJIora8jVYOmZP+98FMm6yLhbOZ/f54qKemllbO8JzMO6q6kzcnRq4+C rsAyumJbiw6Lf7sGOm9ELWiklbXsVdfrTsp3vFiXw5OvdDStuPjBzAaaLk4JiQvSOWgYgK4Dt1Z itfkDiN2BeqVsXyYoIW4NQ1BvzYwLi11shksczV4Ly99n3xJ+XDvxVLYyHTM7EUKrlrc= X-Received: by 2002:a05:6402:1b03:b0:43b:c8df:bc43 with SMTP id by3-20020a0564021b0300b0043bc8dfbc43mr3021814edb.174.1658421391172; Thu, 21 Jul 2022 09:36:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tIpfDdMyqmIuMOpE0pZAg96GE/qF7joPMDCrdKUIhghZ28Yx02Do6DNdcyAT+LkcpqTxcsBg== X-Received: by 2002:a05:6402:1b03:b0:43b:c8df:bc43 with SMTP id by3-20020a0564021b0300b0043bc8dfbc43mr3021767edb.174.1658421390650; Thu, 21 Jul 2022 09:36:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Alexander Bulekov Subject: [PULL 4/9] oss-fuzz: ensure base_copy is a generic-fuzzer Date: Thu, 21 Jul 2022 18:36:16 +0200 Message-Id: <20220721163621.761513-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658421704665100001 Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov Depending on how the target list is sorted in by qemu, the first target (used as the base copy of the fuzzer, to which all others are linked) might not be a generic-fuzzer. Since we are trying to only use generic-fuzz, on oss-fuzz, fix that, to ensure the base copy is a generic-fuzzer. Signed-off-by: Alexander Bulekov Message-Id: <20220720180946.2264253-1-alxndr@bu.edu> Signed-off-by: Paolo Bonzini --- scripts/oss-fuzz/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh index 5ee9141e3e..3bda0d72c7 100755 --- a/scripts/oss-fuzz/build.sh +++ b/scripts/oss-fuzz/build.sh @@ -92,7 +92,7 @@ make install DESTDIR=3D$DEST_DIR/qemu-bundle rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/bin rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/libexec =20 -targets=3D$(./qemu-fuzz-i386 | awk '$1 ~ /\*/ {print $2}') +targets=3D$(./qemu-fuzz-i386 | grep generic-fuzz | awk '$1 ~ /\*/ {print = $2}') base_copy=3D"$DEST_DIR/qemu-fuzz-i386-target-$(echo "$targets" | head -n 1= )" =20 cp "./qemu-fuzz-i386" "$base_copy" --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658422292; cv=none; d=zohomail.com; s=zohoarc; b=KdX/ntx6wT9yLMBFvI3wVKFN6MvBHE8NsIbn0XmnfZ755dMuYQgHx1FjwAopztJ+vB9686NeTuUe1w1caVHjNVosBgHV5Klq8E4YZVpQKEBoXsbjyGYQi+mAG2t49L+hUrWSJR5Tie+axpl4wzMvcLtIRHI4lQH/iG0Uo3bbNBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658422292; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VrhJSXJvP21ZKY3MLFzDpxyPH0MrTn07yHLUULeWY6o=; b=XXH+yE8MPeZt2QgqyO2WNSRruuH+VjYPC/DJ9Qbwqr/tSbdoiOw72tcabQe/sWILR4Sti0iLvk7CTgEC1sXdleCENrRDS9wiQ8PoOIWmDtPEI4ngYtNZSk93+BuDIJehMP4R0EhtS+SCiBGnWKxw4v08SPDUaTANqnJ9BhQVKvY= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658422292918916.27507361017; Thu, 21 Jul 2022 09:51:32 -0700 (PDT) Received: from localhost ([::1]:59964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZOd-0004Kn-SI for importer@patchew.org; Thu, 21 Jul 2022 12:51:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAu-0007pI-Ny for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:37:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:59264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAs-0007rQ-KR for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:37:19 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-321-ND5cQVaENj6XPJxjMff02A-1; Thu, 21 Jul 2022 12:36:46 -0400 Received: by mail-ed1-f69.google.com with SMTP id z1-20020a05640235c100b0043bca7d9b3eso530988edc.5 for ; Thu, 21 Jul 2022 09:36:34 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id gn36-20020a1709070d2400b007262b9f7120sm1001564ejc.167.2022.07.21.09.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421437; 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=VrhJSXJvP21ZKY3MLFzDpxyPH0MrTn07yHLUULeWY6o=; b=cQZLa0EriQcCb0dzKmLD/azawR6HwIPJ6/b/c6/SwS+WS0Ee0W300xjIcNnNGBfuNZYbT9 X6VWoo+9Nap7gsrkrn/rT3B0Y9dze89jld1XjohDqm8aWDoKva2mnr1nqPxBcujKO2mxiN BKTgPpBfx9DS8Ja1skeD59CUTRYiRtg= X-MC-Unique: ND5cQVaENj6XPJxjMff02A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VrhJSXJvP21ZKY3MLFzDpxyPH0MrTn07yHLUULeWY6o=; b=kp8XKZHJW7eLkB65TwO6sTq3uW3bp/15ZMqm/RgnHYJ+cc6UlxNxfMGvEiy+IC95tC YU5tdPalW5nEoOl1Fzj8s88f5QO+ruOys3Pr0yhotXN1ZhkN43Ugr2slTMjJ9BPQ+e3B OozebFhDS6uBaAEy6+zER8mrHxO8SRT7cSE3ZbzAY5rWjr8ySuBOv2v65Y4K9XA9xsKC 6nQ+RH/3C41lkT3tlvRLgQOM+csx3TKirGSJQhpTRwyMhnvOj4AzH5+uSGYVsAKYomSj /l2R4cKMyMGDiJzUKUKDQwe+5jtR5bN+bG7EsKckoIyY0bcvc14Nn8VTcuKfEvE3SCk0 Em0A== X-Gm-Message-State: AJIora+iiudVAl7CVCHanzZAu2Ne/WK1jf9GpWyuaqkWK/P1BDPdc49C EOnJLq0PYCphKi2ZsXWM43xJoc+v62cQBAh2PpVCTqdPdJ+7w2f1/UylohBjMLA9rmtLoolIx9y oQQr48k5DsDytyaTva1NEbytu3R5SF0uY4mUrhARJoJU0UJXQaoeJEMKiMkgK5zGtfP0= X-Received: by 2002:a17:907:1dca:b0:72b:3cb2:81f7 with SMTP id og10-20020a1709071dca00b0072b3cb281f7mr38965598ejc.567.1658421393243; Thu, 21 Jul 2022 09:36:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tsECSeVTp3UGbHqYdS9CqQvDXmJmpIR7oiDbMK1Ew0HfQJ/s0xvaBFxZx13k3JJjYSKWz4SQ== X-Received: by 2002:a17:907:1dca:b0:72b:3cb2:81f7 with SMTP id og10-20020a1709071dca00b0072b3cb281f7mr38965567ejc.567.1658421392750; Thu, 21 Jul 2022 09:36:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A. Donenfeld" , Chris Wulff , Marek Vasut Subject: [PULL 5/9] hw/nios2: virt: pass random seed to fdt Date: Thu, 21 Jul 2022 18:36:17 +0200 Message-Id: <20220721163621.761513-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658422294854100001 Content-Type: text/plain; charset="utf-8" From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This FDT node is part of the DT specification. Cc: Chris Wulff Cc: Marek Vasut Signed-off-by: Jason A. Donenfeld Message-Id: <20220719120113.118034-1-Jason@zx2c4.com> Signed-off-by: Paolo Bonzini --- hw/nios2/boot.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c index 07b8d87633..21cbffff47 100644 --- a/hw/nios2/boot.c +++ b/hw/nios2/boot.c @@ -34,6 +34,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/error-report.h" +#include "qemu/guest-random.h" #include "sysemu/device_tree.h" #include "sysemu/reset.h" #include "hw/boards.h" @@ -83,6 +84,7 @@ static int nios2_load_dtb(struct nios2_boot_info bi, cons= t uint32_t ramsize, int fdt_size; void *fdt =3D NULL; int r; + uint8_t rng_seed[32]; =20 if (dtb_filename) { fdt =3D load_device_tree(dtb_filename, &fdt_size); @@ -91,6 +93,9 @@ static int nios2_load_dtb(struct nios2_boot_info bi, cons= t uint32_t ramsize, return 0; } =20 + qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed)); + qemu_fdt_setprop(fdt, "/chosen", "rng-seed", rng_seed, sizeof(rng_seed= )); + if (kernel_cmdline) { r =3D qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline); --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658422066; cv=none; d=zohomail.com; s=zohoarc; b=CXjsnQsAgUpzE4QtJc8LvXVTdAUn+EED/igIiihsW1v9fvmdM7gCGagBxos+azgkHerp7aw1L2QuQgUwQYOCole9uJc3dvvTNGJdh53GN6fbofQL/uSt0mwIY7N+bcdGQMr1AaLqoebSHlUMj+iNAH/f/+3J9R616+pPiFiUdaw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658422066; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PD1btTBpC+qgQ2KTNV4mkb/zSVhV+xxH1LBouvq89cE=; b=Fo6HGILRBjujf6zdyR0hSg77alg2ZLIVE/gfX0IkPClnvbDmQkUw3v2UbuP0ezeIHr6aVhU1VsChlrC/8XeJWyf24yfq5AeybVCN+AiMK4kVJM43BR5b+przPLd4tC9RkNUaXO/xyChTWpyhe0HP8SU0Fg01+SjmGYR23iBCvW8= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658422066709196.57005334212602; Thu, 21 Jul 2022 09:47:46 -0700 (PDT) Received: from localhost ([::1]:51304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZKy-0006gQ-R2 for importer@patchew.org; Thu, 21 Jul 2022 12:47:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAF-00074u-Sy for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAE-0007gN-EO for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:39 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-588-3sEdAX2EMGaz1zFmzZGQ-w-1; Thu, 21 Jul 2022 12:36:36 -0400 Received: by mail-ed1-f70.google.com with SMTP id x21-20020a05640226d500b0043abb7ac086so1427252edd.14 for ; Thu, 21 Jul 2022 09:36:36 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id 27-20020a170906329b00b007081282cbd8sm1015503ejw.76.2022.07.21.09.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421397; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PD1btTBpC+qgQ2KTNV4mkb/zSVhV+xxH1LBouvq89cE=; b=QFKktT8PJyb96/eItcvaFSdVECxJAh9Q94mYAhyzkYLh2U+ldHdVcn2FOb8EgvJAO8fUgy Zp3CaL0FUqLCbtocRlEGx510w0WNXxp2NeSawCkX9yTadcpBhl4K3OZo2yYyE1KiodaZua gxfurJuvvMkz05QRcXIwU8Q9ralByd8= X-MC-Unique: 3sEdAX2EMGaz1zFmzZGQ-w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PD1btTBpC+qgQ2KTNV4mkb/zSVhV+xxH1LBouvq89cE=; b=HS5i2WVfqXfNxAlggVoXlMBJidrRXnKwmYV2SN4U3fjkZFbYq3eyQKDdv1fXeelu+V W5t34w5VNHHVvVF1Xb6zvg29xNW2KPZ5MpskI14WP7H7U6rUev5X8JDTH/Ma6GvTbK7Y hC2UCWrAlQoZ0cq1WgI+GWCqYfUZxV3KGPYkPYSsn2q/JeaevWBJEpdp1xIpBhYG8VTO YFYfFzn4Q5n+1kss7jBuyF9UjbYLdUb2FEBWZebjV1zNAYeoQwOO6S8Ae63lPQfFTO+u DgHAQjGs+Ob0XfN68Q//cih9miMEJg5rxM3/m+8UHAZISqXwfSjdxi+/X4mItAFvusLV 90NA== X-Gm-Message-State: AJIora8LfYn/A3REfJSIa61Wl0myxdGpwvm13L3zddgEO/DuRshwAofg u3qbB9qN1TiEwym5p2QL2Cv4OGc8li2AiXADkw6oGa6V3Ex0SnRbiG6YqyU98waK40L4RUP8J3B 7Ot4LJVxSLg7HTtSQN+xIIEuo/nKuGnI22gw9VqmwA/S6Sxu1zqqZcP80gndabLPOQb4= X-Received: by 2002:a17:907:87b0:b0:72b:9f0d:3f89 with SMTP id qv48-20020a17090787b000b0072b9f0d3f89mr39680778ejc.734.1658421394513; Thu, 21 Jul 2022 09:36:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tIlXFeb2wC+F0aGnfbaJEgU6PuQ+QzQuqhpqamSBfDnc7ipcibbNxwmqZD+ecSIjU98cpvkA== X-Received: by 2002:a17:907:87b0:b0:72b:9f0d:3f89 with SMTP id qv48-20020a17090787b000b0072b9f0d3f89mr39680746ejc.734.1658421394164; Thu, 21 Jul 2022 09:36:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A. Donenfeld" , Paul Burton , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 6/9] hw/mips: boston: pass random seed to fdt Date: Thu, 21 Jul 2022 18:36:18 +0200 Message-Id: <20220721163621.761513-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain 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: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.999, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658422067486100001 From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This FDT node is part of the DT specification. I'd do the same for other MIPS platforms but boston is the only one that seems to use FDT. Cc: Paul Burton Cc: Aleksandar Rikalo Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jason A. Donenfeld Message-Id: <20220719120843.134392-1-Jason@zx2c4.com> Signed-off-by: Paolo Bonzini --- hw/mips/boston.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 1debca18ec..d2ab9da1a0 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -34,6 +34,7 @@ #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/guest-random.h" #include "qemu/log.h" #include "chardev/char.h" #include "sysemu/device_tree.h" @@ -363,6 +364,7 @@ static const void *boston_fdt_filter(void *opaque, cons= t void *fdt_orig, size_t ram_low_sz, ram_high_sz; size_t fdt_sz =3D fdt_totalsize(fdt_orig) * 2; g_autofree void *fdt =3D g_malloc0(fdt_sz); + uint8_t rng_seed[32]; =20 err =3D fdt_open_into(fdt_orig, fdt, fdt_sz); if (err) { @@ -370,6 +372,9 @@ static const void *boston_fdt_filter(void *opaque, cons= t void *fdt_orig, return NULL; } =20 + qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed)); + qemu_fdt_setprop(fdt, "/chosen", "rng-seed", rng_seed, sizeof(rng_seed= )); + cmdline =3D (machine->kernel_cmdline && machine->kernel_cmdline[0]) ? machine->kernel_cmdline : " "; err =3D qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658421774; cv=none; d=zohomail.com; s=zohoarc; b=munFjHRnV+W3CUV0iDWYLZ1/RRX0H/8v89yaRMkJyLxP2i0cumwo8smGn8rsAOoyQxEMAfOh38Er6Pab72najVU+3JKER2+7IYI+b4L+ZULdfqMePdCFkjOO/dRXXjPRbXA/zIvpcrEwc/kTn2Ikv29CL9BjQb7V5FVr4qEVvi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658421774; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Vxh38mWSPh8489SXhYvyAkZTxocGKTqcmPB6SFN787s=; b=WwJR9jiMC//vPMBYQyM+ZDtdjwRboFoy50PGCdHl4eq0gKHZtasiXriUYapsjJvEGJttZlfRP1TfTFWIzE4vhD1KIYX/9fU//Yu13+GuoN0Y2gfvHMY/c8i1mf32dNZ17gPogVyHDffddRtyLtkuK1Mb9SEnllNxd1m+WYS3OM4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658421773952318.8131335490891; Thu, 21 Jul 2022 09:42:53 -0700 (PDT) Received: from localhost ([::1]:42006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZGG-000073-U8 for importer@patchew.org; Thu, 21 Jul 2022 12:42:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAH-00075M-9a for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:42954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAF-0007ge-Nx for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:40 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-bjgSAPARPXC4GxTrRDs8Lg-1; Thu, 21 Jul 2022 12:36:38 -0400 Received: by mail-ed1-f69.google.com with SMTP id b15-20020a056402278f00b0043acaf76f8dso1441615ede.21 for ; Thu, 21 Jul 2022 09:36:37 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id c16-20020a170906695000b0072b40cb28a8sm1021475ejs.29.2022.07.21.09.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421399; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vxh38mWSPh8489SXhYvyAkZTxocGKTqcmPB6SFN787s=; b=J8EGjoXtMuv/MivIqKHxvhCuoBv2h9GzKP9MjV43T5LFgbjQo62dEQs+YvCZyM2tHZrRNm xkme9g5P09kaoXMEiBXgdSIAg3jM/GedBB2w3Q3jlzOzzkds3fRAPk+u+XmyST0uxqI0TR sR8ry2tIYkJeFwXh1C+H36R8W5LmAC8= X-MC-Unique: bjgSAPARPXC4GxTrRDs8Lg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vxh38mWSPh8489SXhYvyAkZTxocGKTqcmPB6SFN787s=; b=dVbfsDWtUP3A0S3MJMHBHM6N3rxa+viXQum3yeTjLFafnR540d4qm69mFAKm5Ztz5x 8GHJA3T0xxGm68QimnCUPfFQrUq2AAjxj5V0wsoQKVds9DN4927K6vqi+bFfOMti8TGa EMeiNSREWhiVfTu74WNcEDf+tGw0bsc9URyvRau5mgUYT8aeUYy/eA2PbtuQoOVSlkGX S9aKiJFhU8+l/+8IOJ6E2Ms5UVqrq2xjoRhtW+3K5tvXitktcg1ozlNqvoFanAOW6jsT 7xC5Io9PKf98SAcX+5u2Ts5RPB5o6FsgW7Hhm3Uy5NwDFXrilDM69cBG3/oGKfZHrjy7 hvIQ== X-Gm-Message-State: AJIora/Z5+5mC4tc5EAjIpdUgleGpK36RfLC/xzmY91cLC1WvYwiqMa4 z/NTce9d8HbJpdypGJoKiHFiIkRx1oJnqiNEdfqieSlVv2MdKqSdTgu2btoZ5s5SUcQ8rrY7/hX n4uiiAvLB0+/uaQC6Pn3kPuXjopHiJhGqFNdZ9Bc48SDzvVV6vCndTCAUJkR7+ZKd8D4= X-Received: by 2002:a17:907:1c8a:b0:6e9:2a0d:d7b7 with SMTP id nb10-20020a1709071c8a00b006e92a0dd7b7mr40351848ejc.572.1658421396492; Thu, 21 Jul 2022 09:36:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vrXIbl+jW1U03b+BUadHWSYRerU2f5vdIcTdSypfRZN0lGS7LUvOuVLvugMMPLdYWZm4ktkw== X-Received: by 2002:a17:907:1c8a:b0:6e9:2a0d:d7b7 with SMTP id nb10-20020a1709071c8a00b006e92a0dd7b7mr40351827ejc.572.1658421396260; Thu, 21 Jul 2022 09:36:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A. Donenfeld" , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 7/9] hw/guest-loader: pass random seed to fdt Date: Thu, 21 Jul 2022 18:36:19 +0200 Message-Id: <20220721163621.761513-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.999, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658421776436100001 From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This FDT node is part of the DT specification. Cc: Alex Benn=C3=A9e Signed-off-by: Jason A. Donenfeld Message-Id: <20220719121559.135355-1-Jason@zx2c4.com> Signed-off-by: Paolo Bonzini --- hw/core/guest-loader.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/core/guest-loader.c b/hw/core/guest-loader.c index 391c875a29..4f8572693c 100644 --- a/hw/core/guest-loader.c +++ b/hw/core/guest-loader.c @@ -31,6 +31,7 @@ #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/guest-random.h" #include "guest-loader.h" #include "sysemu/device_tree.h" #include "hw/boards.h" @@ -46,6 +47,7 @@ static void loader_insert_platform_data(GuestLoaderState = *s, int size, g_autofree char *node =3D g_strdup_printf("/chosen/module@0x%08" PRIx6= 4, s->addr); uint64_t reg_attr[2] =3D {cpu_to_be64(s->addr), cpu_to_be64(size)}; + uint8_t rng_seed[32]; =20 if (!fdt) { error_setg(errp, "Cannot modify FDT fields if the machine has none= "); @@ -55,6 +57,9 @@ static void loader_insert_platform_data(GuestLoaderState = *s, int size, qemu_fdt_add_subnode(fdt, node); qemu_fdt_setprop(fdt, node, "reg", ®_attr, sizeof(reg_attr)); =20 + qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed)); + qemu_fdt_setprop(fdt, node, "rng-seed", rng_seed, sizeof(rng_seed)); + if (s->kernel) { const char *compat[2] =3D { "multiboot,module", "multiboot,kernel"= }; if (qemu_fdt_setprop_string_array(fdt, node, "compatible", --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658422016; cv=none; d=zohomail.com; s=zohoarc; b=dtZZ9gDcipXIhp8erebPjKtQLXm1BbAsrT+EPbVTdsHX7UB5ieULv1Z0oLi82zOPoj0fZtLMy229Sc9acKORc3EZjKN6mkHUfgc3W80IcgPuyPaM49dGuBGgij7U5ybJvny7s9fIii177+ivOKlXHptQuBxrqwcwUR/9CxwFi90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658422016; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LYGYSZ/ViMUNXuMyvj+UnhkpUrIpVeF9nrlgNYf68qo=; b=nc0Z/WfU6CYtFglhFhHWJPWaTkYnC84RpLB619oYtasI/b7OnJBGAqPcTBOucH9u4D2QhvSs+jCKiSCe+19YBzwY6K4h5uzYt4cGuk7rjhe5XDxut0Ucz1WGNFSV9yRrySq41WpMdI9Pj8IdoEeIkx5ifKcMvzf4Zfvx9/VZiEE= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658422016000600.0796788718962; Thu, 21 Jul 2022 09:46:56 -0700 (PDT) Received: from localhost ([::1]:48722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZKA-0004lp-WD for importer@patchew.org; Thu, 21 Jul 2022 12:46:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAJ-00077A-BE for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAH-0007gx-Qx for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:43 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185--cffi3eZMKy7rA9JcSKbYg-1; Thu, 21 Jul 2022 12:36:39 -0400 Received: by mail-ej1-f72.google.com with SMTP id hb41-20020a170907162900b0072f044ca263so980335ejc.15 for ; Thu, 21 Jul 2022 09:36:39 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id y10-20020a056402358a00b0043a8f5ad272sm1296282edc.49.2022.07.21.09.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421401; 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=LYGYSZ/ViMUNXuMyvj+UnhkpUrIpVeF9nrlgNYf68qo=; b=ejCRYvF62S7qD9hdJmoo20k1o/vGY672vdtV2SWJOySbkLoumKqUh3CsPV/a5xbc4fzSEB EYZPRJQDGw7awDDL4T9QkB1pNbq0q1hUEDU+5eeswBFmkY5aYdSivl1TPo9MYN82oLQynL GsHUdkFspm1I111a5ZgMYvVXQ7rRJ5Y= X-MC-Unique: -cffi3eZMKy7rA9JcSKbYg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LYGYSZ/ViMUNXuMyvj+UnhkpUrIpVeF9nrlgNYf68qo=; b=XIvSqY2j8F4WGbkyEoY/Ln4RePm7M2/X2lL3VJBArxldOB3BHmg1wgaKBe7r8JZLut t30MAD5aaOghRTDzXe8r6yLyC5TGPEP5mwOv80Ig19yJILsEJQ+9hw8QuBsa037rQsE0 0IiBLidrxUnifiyOUKTl193UiS93ThijqQBNyfBArqo9x5MtfdTTfwGp0w4iNkABc/it rrKeFdE4Pc5SXay4/qgUWdzCEKcuLvyrn9gMs6AJ5TtLsM5U8ZtXjx3Z7EVL3UKRWV5z HIR6yiWtfvkxIIbpZlDb3+fjCwB8DqWrqbeNIXtOi6+J3smjP/TZJrUQRq4hUAJDza7K 0sFA== X-Gm-Message-State: AJIora9DoW07UUQNw0YGK9jtClGiTxKjsbOPtsTkL3DRs63Z7zewxNi1 LZ89gXMZIhKe44SrYzIBNAzUAB5vO5erOsMmJcGABlTFcjuUuYUAWxizaeATDHzz1/eJksEp0Uz HxXjPBjJdTmTBScNiuld3wwvY3bSAjhz9iROOtEB1Y9BV5qrUo59mNPVs/XgrsLRDc14= X-Received: by 2002:a17:906:5d08:b0:6ff:8ed:db63 with SMTP id g8-20020a1709065d0800b006ff08eddb63mr41618519ejt.408.1658421398566; Thu, 21 Jul 2022 09:36:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQlUagquuX4Q/c8Oj9Vcjslnt1yRVJKaA33R1sPtmmkPwAChBH4Q37sbsRS86ISt73wyWfuQ== X-Received: by 2002:a17:906:5d08:b0:6ff:8ed:db63 with SMTP id g8-20020a1709065d0800b006ff08eddb63mr41618495ejt.408.1658421398257; Thu, 21 Jul 2022 09:36:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A. Donenfeld" , Yoshinori Sato Subject: [PULL 8/9] hw/rx: pass random seed to fdt Date: Thu, 21 Jul 2022 18:36:20 +0200 Message-Id: <20220721163621.761513-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658422016963100001 Content-Type: text/plain; charset="utf-8" From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This FDT node is part of the DT specification. Cc: Yoshinori Sato Signed-off-by: Jason A. Donenfeld Message-Id: <20220719122033.135902-1-Jason@zx2c4.com> Signed-off-by: Paolo Bonzini --- hw/rx/rx-gdbsim.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c index be147b4bd9..8ffe1b8035 100644 --- a/hw/rx/rx-gdbsim.c +++ b/hw/rx/rx-gdbsim.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" #include "qemu/error-report.h" +#include "qemu/guest-random.h" #include "qapi/error.h" #include "hw/loader.h" #include "hw/rx/rx62n.h" @@ -83,6 +84,7 @@ static void rx_gdbsim_init(MachineState *machine) MemoryRegion *sysmem =3D get_system_memory(); const char *kernel_filename =3D machine->kernel_filename; const char *dtb_filename =3D machine->dtb; + uint8_t rng_seed[32]; =20 if (machine->ram_size < mc->default_ram_size) { char *sz =3D size_to_str(mc->default_ram_size); @@ -140,6 +142,8 @@ static void rx_gdbsim_init(MachineState *machine) error_report("Couldn't set /chosen/bootargs"); exit(1); } + qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed)); + qemu_fdt_setprop(dtb, "/chosen", "rng-seed", rng_seed, sizeof(= rng_seed)); /* DTB is located at the end of SDRAM space. */ dtb_offset =3D ROUND_DOWN(machine->ram_size - dtb_size, 16); rom_add_blob_fixed("dtb", dtb, dtb_size, --=20 2.36.1 From nobody Mon Feb 9 08:19:23 2026 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658422228; cv=none; d=zohomail.com; s=zohoarc; b=ZokpNUnZy9EFEhwZx7EJuamgUHe/Qark5STsZfXmL+wMHkozS+w/POFGatUVQYlhgoEpTRbN+x4tRUabBkxQc9XfeBEsDsqihrTNiJeS424SBTYhAHuYR9p5D4P3fv1IGJ+j1d5PqL1GwZ0SVgmu1GL945mdMgnlFIaWsk5xGUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658422228; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o37c5iKXF9oD1uwTbUiDSCSU97u2DwwJin3hFWlrpsk=; b=YB9sbok0a5HbFXd8Ed2X+KJtnHQOQX+i7gVMRFvDwoW6izDa2QM7kBSAvxmkNLljwcZzt2fP4wKrTE9M4D4Of7OzqmHIBpzOwi3+IkS5Z9vz7G7B78pHrMDZOW1flNl9j1hGJlKzmig2YvqVURGaaKH3zksQjtYm40gGGP02EOc= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658422228858412.6880146063386; Thu, 21 Jul 2022 09:50:28 -0700 (PDT) Received: from localhost ([::1]:57502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEZNb-0002XF-Pe for importer@patchew.org; Thu, 21 Jul 2022 12:50:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAK-00077G-Pg for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEZAI-0007h5-Vu for qemu-devel@nongnu.org; Thu, 21 Jul 2022 12:36:44 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-551-2xyqqzhIPtyJCprpOMRP6Q-1; Thu, 21 Jul 2022 12:36:41 -0400 Received: by mail-ed1-f71.google.com with SMTP id m13-20020a056402430d00b0043ac2f27d83so1447195edc.20 for ; Thu, 21 Jul 2022 09:36:41 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id l7-20020aa7d947000000b00437938c731fsm1265047eds.97.2022.07.21.09.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 09:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658421402; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o37c5iKXF9oD1uwTbUiDSCSU97u2DwwJin3hFWlrpsk=; b=CeeAHEBqusxOiNOoH4orDgleT3oyAYjbmBab+qLq6Yky2nyc2dZtIH1Fcujp1NHcLcgMMZ cpzfamDDqe31Kvgm5L4vGVG0+g+FA4ZCqRPA5RfmZA2k5t8WAZDDEoRuLSXQsHvFqwr1LA CZ4u3l8hnplWyZG4qlexAgGnoteo878= X-MC-Unique: 2xyqqzhIPtyJCprpOMRP6Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o37c5iKXF9oD1uwTbUiDSCSU97u2DwwJin3hFWlrpsk=; b=jsolikFAqOcjmWLN85UhaBeV11Ejjx4y3+adM1a7iMNXhmrt36PrIXUzY6UGL1EeHa ZnGs6Qvjcuug7yqZL6UdKMn+R7dKG+uVtizWO1gGMZ5c3RSWthgWA9jvEByqDKhzKR1R c25DRywY50YlDySWiPeAo4RLwjKXQtXfq0NZsdBu1XQr7idT5CbGfXMzNtK1IsyL+82V Wy6rU4mayDIaALe94n6TxmsK/yAhFBfJI2dqcdJ3wpSU7woLnUl0niNF2A8GAuZRNKYF A98Wg3Pc5qvi4oLGYq3tDm/jtv1I/qR8eD8H0p3Psj/eTa/I/y93kUoFq7OU9Q3+pl74 uxHA== X-Gm-Message-State: AJIora/gJD1pdiC/9Q7gdDDeeIa8/golBF/veFyu+KpdBf3rwUgcMaI/ FovElMUFSBgYpjhKf8djhGElprQu/wOagPGNi69t8mXz/LP6U7VwR0+36Va4lXJCywQlwZ9rSYL DrIjQPerGyj+Ol0LGVY/EmV20i8vZGKvFKbqDYmpLYzzUIXLfPSB8qGktDmH11LchdTQ= X-Received: by 2002:a05:6402:510c:b0:43a:e041:a371 with SMTP id m12-20020a056402510c00b0043ae041a371mr56872096edd.424.1658421400097; Thu, 21 Jul 2022 09:36:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uDzMQHbAizCAt91N/nnX6dDTSlQnhGaLCowCfS/iUCzOL9eX4Qj/aUjCGKu5iH1QbHLzZBbg== X-Received: by 2002:a05:6402:510c:b0:43a:e041:a371 with SMTP id m12-20020a056402510c00b0043ae041a371mr56872057edd.424.1658421399803; Thu, 21 Jul 2022 09:36:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A. Donenfeld" , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=83=C2=A9?= , Laurent Vivier , "Michael S . Tsirkin" Subject: [PULL 9/9] hw/i386: pass RNG seed via setup_data entry Date: Thu, 21 Jul 2022 18:36:21 +0200 Message-Id: <20220721163621.761513-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220721163621.761513-1-pbonzini@redhat.com> References: <20220721163621.761513-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.999, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658422230282100001 From: "Jason A. Donenfeld" Tiny machines optimized for fast boot time generally don't use EFI, which means a random seed has to be supplied some other way. For this purpose, Linux (=C3=A2=E2=80=B0=C2=A55.20) supports passing a seed in the s= etup_data table with SETUP_RNG_SEED, specially intended for hypervisors, kexec, and specialized bootloaders. The linked commit shows the upstream kernel implementation. At Paolo's request, we don't pass these to versioned machine types =C3=A2= =E2=80=B0=C2=A47.0. Link: https://git.kernel.org/tip/tip/c/68b8e9713c8 Cc: Marcel Apfelbaum Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Peter Maydell Cc: Philippe Mathieu-Daud=C3=83=C2=A9 Cc: Laurent Vivier Reviewed-by: Michael S. Tsirkin Signed-off-by: Jason A. Donenfeld Message-Id: <20220721125636.446842-1-Jason@zx2c4.com> Signed-off-by: Paolo Bonzini --- hw/i386/microvm.c | 2 +- hw/i386/pc.c | 4 +-- hw/i386/pc_piix.c | 2 ++ hw/i386/pc_q35.c | 2 ++ hw/i386/x86.c | 26 +++++++++++++++++--- include/hw/i386/pc.h | 3 +++ include/hw/i386/x86.h | 3 ++- include/standard-headers/asm-x86/bootparam.h | 1 + 8 files changed, 35 insertions(+), 8 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index dc929727dc..7fe8cce03e 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -332,7 +332,7 @@ static void microvm_memory_init(MicrovmMachineState *mm= s) rom_set_fw(fw_cfg); =20 if (machine->kernel_filename !=3D NULL) { - x86_load_linux(x86ms, fw_cfg, 0, true); + x86_load_linux(x86ms, fw_cfg, 0, true, false); } =20 if (mms->option_roms) { diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 774cb2bf07..d2b5823ffb 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -796,7 +796,7 @@ void xen_load_linux(PCMachineState *pcms) rom_set_fw(fw_cfg); =20 x86_load_linux(x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); + pcmc->pvh_enabled, pcmc->legacy_no_rng_seed); for (i =3D 0; i < nb_option_roms; i++) { assert(!strcmp(option_rom[i].name, "linuxboot.bin") || !strcmp(option_rom[i].name, "linuxboot_dma.bin") || @@ -992,7 +992,7 @@ void pc_memory_init(PCMachineState *pcms, =20 if (linux_boot) { x86_load_linux(x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); + pcmc->pvh_enabled, pcmc->legacy_no_rng_seed); } =20 for (i =3D 0; i < nb_option_roms; i++) { diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index a234989ac3..fbf9465318 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -438,9 +438,11 @@ DEFINE_I440FX_MACHINE(v7_1, "pc-i440fx-7.1", NULL, =20 static void pc_i440fx_7_0_machine_options(MachineClass *m) { + PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); pc_i440fx_7_1_machine_options(m); m->alias =3D NULL; m->is_default =3D false; + pcmc->legacy_no_rng_seed =3D true; compat_props_add(m->compat_props, hw_compat_7_0, hw_compat_7_0_len); compat_props_add(m->compat_props, pc_compat_7_0, pc_compat_7_0_len); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index f96cbd04e2..12cc76aaf8 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -375,8 +375,10 @@ DEFINE_Q35_MACHINE(v7_1, "pc-q35-7.1", NULL, =20 static void pc_q35_7_0_machine_options(MachineClass *m) { + PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); pc_q35_7_1_machine_options(m); m->alias =3D NULL; + pcmc->legacy_no_rng_seed =3D true; compat_props_add(m->compat_props, hw_compat_7_0, hw_compat_7_0_len); compat_props_add(m->compat_props, pc_compat_7_0, pc_compat_7_0_len); } diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 6003b4b2df..ecea25d249 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -26,6 +26,7 @@ #include "qemu/cutils.h" #include "qemu/units.h" #include "qemu/datadir.h" +#include "qemu/guest-random.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "qapi/qapi-visit-common.h" @@ -766,7 +767,8 @@ static bool load_elfboot(const char *kernel_filename, void x86_load_linux(X86MachineState *x86ms, FWCfgState *fw_cfg, int acpi_data_size, - bool pvh_enabled) + bool pvh_enabled, + bool legacy_no_rng_seed) { bool linuxboot_dma_enabled =3D X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma= _enabled; uint16_t protocol; @@ -774,7 +776,7 @@ void x86_load_linux(X86MachineState *x86ms, int dtb_size, setup_data_offset; uint32_t initrd_max; uint8_t header[8192], *setup, *kernel; - hwaddr real_addr, prot_addr, cmdline_addr, initrd_addr =3D 0; + hwaddr real_addr, prot_addr, cmdline_addr, initrd_addr =3D 0, first_se= tup_data =3D 0; FILE *f; char *vmode; MachineState *machine =3D MACHINE(x86ms); @@ -784,6 +786,7 @@ void x86_load_linux(X86MachineState *x86ms, const char *dtb_filename =3D machine->dtb; const char *kernel_cmdline =3D machine->kernel_cmdline; SevKernelLoaderContext sev_load_ctx =3D {}; + enum { RNG_SEED_LENGTH =3D 32 }; =20 /* Align to 16 bytes as a paranoia measure */ cmdline_size =3D (strlen(kernel_cmdline) + 16) & ~15; @@ -1063,16 +1066,31 @@ void x86_load_linux(X86MachineState *x86ms, kernel_size =3D setup_data_offset + sizeof(struct setup_data) + dt= b_size; kernel =3D g_realloc(kernel, kernel_size); =20 - stq_p(header + 0x250, prot_addr + setup_data_offset); =20 setup_data =3D (struct setup_data *)(kernel + setup_data_offset); - setup_data->next =3D 0; + setup_data->next =3D cpu_to_le64(first_setup_data); + first_setup_data =3D prot_addr + setup_data_offset; setup_data->type =3D cpu_to_le32(SETUP_DTB); setup_data->len =3D cpu_to_le32(dtb_size); =20 load_image_size(dtb_filename, setup_data->data, dtb_size); } =20 + if (!legacy_no_rng_seed) { + setup_data_offset =3D QEMU_ALIGN_UP(kernel_size, 16); + kernel_size =3D setup_data_offset + sizeof(struct setup_data) + RN= G_SEED_LENGTH; + kernel =3D g_realloc(kernel, kernel_size); + setup_data =3D (struct setup_data *)(kernel + setup_data_offset); + setup_data->next =3D cpu_to_le64(first_setup_data); + first_setup_data =3D prot_addr + setup_data_offset; + setup_data->type =3D cpu_to_le32(SETUP_RNG_SEED); + setup_data->len =3D cpu_to_le32(RNG_SEED_LENGTH); + qemu_guest_getrandom_nofail(setup_data->data, RNG_SEED_LENGTH); + } + + /* Offset 0x250 is a pointer to the first setup_data link. */ + stq_p(header + 0x250, first_setup_data); + /* * If we're starting an encrypted VM, it will be OVMF based, which use= s the * efi stub for booting and doesn't require any values to be placed in= the diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index b7735dccfc..2a8ffbcfa8 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -127,6 +127,9 @@ struct PCMachineClass { =20 /* create kvmclock device even when KVM PV features are not exposed */ bool kvmclock_create_always; + + /* skip passing an rng seed for legacy machines */ + bool legacy_no_rng_seed; }; =20 #define TYPE_PC_MACHINE "generic-pc-machine" diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 9089bdd99c..6bdf1f6ab2 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -123,7 +123,8 @@ void x86_bios_rom_init(MachineState *ms, const char *de= fault_firmware, void x86_load_linux(X86MachineState *x86ms, FWCfgState *fw_cfg, int acpi_data_size, - bool pvh_enabled); + bool pvh_enabled, + bool legacy_no_rng_seed); =20 bool x86_machine_is_smm_enabled(const X86MachineState *x86ms); bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms); diff --git a/include/standard-headers/asm-x86/bootparam.h b/include/standar= d-headers/asm-x86/bootparam.h index 072e2ed546..b2aaad10e5 100644 --- a/include/standard-headers/asm-x86/bootparam.h +++ b/include/standard-headers/asm-x86/bootparam.h @@ -10,6 +10,7 @@ #define SETUP_EFI 4 #define SETUP_APPLE_PROPERTIES 5 #define SETUP_JAILHOUSE 6 +#define SETUP_RNG_SEED 9 =20 #define SETUP_INDIRECT (1<<31) =20 --=20 2.36.1