From nobody Sat May 18 21:26:37 2024 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=1658509633; cv=none; d=zohomail.com; s=zohoarc; b=CgRvThj8SBCl16ZoT33tHaF/+a5jccN65g7crkPx9tJaGEdKkJYxv2qoCC8G+EXBC9p0/G4pgGpttv+j/UGJmIGgnZ9/Kunsjm5Dm/TEnTzHbqPryCMKoNOZGaWRH/xhjGFdU0Z1NSW7Ye2dqwHNojyUaavnleHLGjPsa01h/K0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658509633; 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=Ugc1hwPJ+25coRFan8mBht5Cm+wloGPU0OXvJUoLqK11LfLcZLGnmV53yXAgmCXoH+hXhXNguGI5Vr8QRxyJu9NSiJnrPN/5XLfcTTePFzciKGyCAanjEu83Uxoi1ycqJW36FrdB0g2srq9XjllubQHaStUxvluhve3DE4Eaxjs= 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 1658509633449681.8897721891253; Fri, 22 Jul 2022 10:07:13 -0700 (PDT) Received: from localhost ([::1]:58114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEw7L-00050s-1l for importer@patchew.org; Fri, 22 Jul 2022 13:07:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5H-0002Ip-DW for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:54548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5A-0000fH-Fp for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:02 -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-561-yTAQHXa-M1iRvinUay5wlA-1; Fri, 22 Jul 2022 13:04:54 -0400 Received: by mail-ed1-f69.google.com with SMTP id z20-20020a05640240d400b0043a82d9d65fso3200983edb.0 for ; Fri, 22 Jul 2022 10:04:54 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id t3-20020a1709063e4300b0072b4e4cd346sm2190332eji.188.2022.07.22.10.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509495; 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=exwAPwFKalaOn40JjWCam0m8UTRkD+WFBvqNEyWiVpfM8fYY+eTrMOedjgfu3p1mHrU8PQ 8WuelPA6tWFJOUiVRMH0v8YUKhMxgkJUJrCHSqFqYSoXSa/qlKpzTtqzZUNeVbfTMwEGep JAAFwXU3+C/+EfT2xKjbjqUhrT3bK6M= X-MC-Unique: yTAQHXa-M1iRvinUay5wlA-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=hdm/oweSyhxKIQQ0L3sAbwFL5Jse8Zs05J6XSjp1FdcAeZSGDDJHVDuBj9PrNZATYw DLjQrWIgt6AAbcRTqMIkdytEILnBfHMlbpLoQkajhm7vC1h6srRT7IoWB36fX75UQtrC 89P/BZCVUFcCISTNKoeoxg5mlWgsgH0fr9Ye30eT9wtlZrtI8ICyu8EZIBoad4QhPEoo AmR9b5SisXMYbPnnlM1q+VaAPr4rp5f4qnPtQ68cxtq8dWalFnCU8hoOFfJrt2952/PK 8X4b8wINTN1KbBNOlJmZmPJ5/SjGp5S3bV4yr7YJr0P1KsyCJXMKB+qTbHDvrQGUpKKh QJcQ== X-Gm-Message-State: AJIora8JCqdHd4L1w68b613nX5AON58DjQRRlL7cilyXt4aUeSDRh6PQ 3MaLg0JZLK9dQB4DSHOrjc5W10KYdbRjOu2JK7XyfCgfBQZ5vdtLuMlDfDou3IRQD/9gaJbJYA+ JbHndLgFC1KZaUkWVOR1AmS0572PTSLGZkCsfcOM/QnMYtKuVe02g8iogR7X/PEz0xoo= X-Received: by 2002:a05:6402:3553:b0:43a:dba8:9f65 with SMTP id f19-20020a056402355300b0043adba89f65mr784873edd.323.1658509493161; Fri, 22 Jul 2022 10:04:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sGD3lUrF5ST8YAMdio7NvUg5OBdxXxAeZOn7+MYuzvSZRVfTb8DbT4gZ7qLrWoinPoWQYd+g== X-Received: by 2002:a05:6402:3553:b0:43a:dba8:9f65 with SMTP id f19-20020a056402355300b0043adba89f65mr784852edd.323.1658509492926; Fri, 22 Jul 2022 10:04:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Bin Meng , Stefan Weil , Akihiko Odaki Subject: [PULL 1/8] docs: Add caveats for Windows as the build platform Date: Fri, 22 Jul 2022 19:04:42 +0200 Message-Id: <20220722170449.853222-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658509635906100001 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 Sat May 18 21:26:37 2024 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=1658509640; cv=none; d=zohomail.com; s=zohoarc; b=NMutl2gNTC19+3nhNh4lZFVerY7ImXLCHJGjCboIVU7Qx10HmBvJVHdcF47drRzb2GplRDqPa0swxu5cQY3S7ClS0n4XPAZXlVhhDS9fyX1x6vaZSPr14wTmeQ2/kVBeFPd8IBzafKvLVkV9eb2Z7yiWQm7DigaevGcNj6LwE1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658509640; 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=iSUM2NDNv4NaibUEm7aBjFt1X3em6iClOIhPAVNOYu8=; b=Wea2OQ7pFVT3Q66LGdKpcQ6rJ/SEXxUPRJQP7YIIMChQFB+f6WQV+BvWczXx3DA64/N4i0chaJ7tY4xLOY7qp/T7b18MRoYlJul3+YATnt07mDXO7Hhq3/KmO82IzdnNTkW7iP64KbY4fGf6URrqlEKbtM7J4t4kw5o4DPuV164= 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 1658509640801286.95323442015854; Fri, 22 Jul 2022 10:07:20 -0700 (PDT) Received: from localhost ([::1]:58382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEw7T-0005CK-54 for importer@patchew.org; Fri, 22 Jul 2022 13:07:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5N-0002J7-Sr for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5K-0000r7-Ak for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:07 -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-486-xvYVDGY1NSmnc4_VXx6LnQ-1; Fri, 22 Jul 2022 13:04:57 -0400 Received: by mail-ed1-f69.google.com with SMTP id l16-20020a056402255000b0043bbb1e39c3so3239330edb.11 for ; Fri, 22 Jul 2022 10:04:57 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id j10-20020a17090623ea00b0072ab06bf296sm2223294ejg.23.2022.07.22.10.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509505; 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=iSUM2NDNv4NaibUEm7aBjFt1X3em6iClOIhPAVNOYu8=; b=A02b6fB2cHqa+XGDG3j++6aggnQk0DM5Omdsple/AG1r+FhI5Uof63lmsl7obV5NC4/8rJ eSjygYpaijFPX8wD2JkKmOoRBwbNXVD3423/rdq0vPyD2GIhMPC/j6fY3jF/AxuI4xtI9+ UT7TrBP7rdeHjK8i9aTYFG8iuJnEj+s= X-MC-Unique: xvYVDGY1NSmnc4_VXx6LnQ-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=iSUM2NDNv4NaibUEm7aBjFt1X3em6iClOIhPAVNOYu8=; b=C6a2+Hn06OZpeB+EN0ThBcGNZj37nS897bwDN9zNX2EUzjGn48ZiFJXM7cK2+/LFFa 6uGvUJmJ7w19oJu9UA1T3eF9CEmG00vuUnIIR954x2VBXumQnzgwJwtkqQqsqM9/KUn9 4KnvnJmP15xzqIJB7OLS/8szEAKOsX0UxGdyJupTJdbLf++EoLPi+s8XvQVbYAcDv+DX E1nr+IkLiL6hUniWUO4TtGQS95HopA4X34gvicpRMuNQbIPoCOBIs6msMRA5PQsEpPUi B+a4WE1bR9zf9mxVd24qC01fAA7a1Wic6UPOiBm0A6c9iAdbl+CCCQprrXEAa54whCOx C2Aw== X-Gm-Message-State: AJIora9CqkrOGiqy2yU2IYNWiuH3O0IfQ3v6+gfkRrxDEaADXAfv7G0v 3lETwVYvXf4ZEtsS4CHK/idyqtkm4RAAMmz7KRLUy1se0cb4MLo4Gw1NnfyJazl+8ux1KWK+6tf 0qmCKVL0roQiHfXZiq74UkTWZOeUC1QSpI4NkA+UIU3BnBuk2wPpNSnYlPYcHW3+gnWg= X-Received: by 2002:a17:906:7e43:b0:72b:52de:b039 with SMTP id z3-20020a1709067e4300b0072b52deb039mr665216ejr.198.1658509496189; Fri, 22 Jul 2022 10:04:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tkJcbgpisA42oX98fQTKg26RV8hMqp4ZjPqy0ksqUjDB1tbtVrkSR0sWoAVrjGRh82h+deYg== X-Received: by 2002:a17:906:7e43:b0:72b:52de:b039 with SMTP id z3-20020a1709067e4300b0072b52deb039mr665197ejr.198.1658509495840; Fri, 22 Jul 2022 10:04:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 2/8] accel/kvm: Avoid Coverity warning in query_stats() Date: Fri, 22 Jul 2022 19:04:43 +0200 Message-Id: <20220722170449.853222-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658509641713100001 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 99aede73b7..f165074e99 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -4014,7 +4014,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 Sat May 18 21:26:37 2024 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=1658509768; cv=none; d=zohomail.com; s=zohoarc; b=S/vin4prpDbNgoaJxPZ0QuxWXQziKg+wtCASMs8Btx32ltAawz39LNpypxOr2KkQWqZmO8xmIQo3uMStdwQOTQqlZfxDtxsjJ3yvmW0vIUEXbpXvCgdr2FcxzFI3xStuIutMD+L/1iFf7MAUd/1q1Nj0k2qFSR/atISpe7iDYrA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658509768; 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=nksCcRtnkAmvR8kyt50RsIqIvPzxw819BH+UZjoSNSpoquRfbFoOVRfpEGwRe24ZSKR/iG3SEmDhzOS2UB9+d3JAT/wKVuDwF1l5q2YqIxpMZFOJeirVSc1vXZ098JHctsHyP/WqslwqRtx42Brk54F70E6f9/4HIK/WQcxjzsU= 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 1658509768121415.6038269748642; Fri, 22 Jul 2022 10:09:28 -0700 (PDT) Received: from localhost ([::1]:37482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEw9W-0001tb-7E for importer@patchew.org; Fri, 22 Jul 2022 13:09:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5I-0002Iz-Vo for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5H-0000fi-4K for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:04 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-212-taDpcqScPA-qFQT1UAKA-g-1; Fri, 22 Jul 2022 13:04:59 -0400 Received: by mail-ej1-f71.google.com with SMTP id ji2-20020a170907980200b0072b5b6d60c2so2142572ejc.22 for ; Fri, 22 Jul 2022 10:04:58 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id kx6-20020a170907774600b0072b3182368fsm2198701ejc.77.2022.07.22.10.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509500; 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=c99W640u0+EF+2cTKt/GkUb8lqVSMLrAxVJ55QlTLLjT+VZVPYWKw6+ZSxLgo6ZdYD86QS pLJpPZYgEDtBFYR0Lwb2bMw9XreBjGsT9SzG+JG4L2y2D9tWtf91QzH8i5ym8ZRJRbOpMx vgfAv1jOwkDXOupd+6M4XYbU0pj3plE= X-MC-Unique: taDpcqScPA-qFQT1UAKA-g-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=Je6OWQm8cD0AbGNbOaXaNLQDsHgT9G7lN5/TothdLZ5cQ1Erp2kEMb352grTWiEzJ5 zbBm7ThsNGtNvtrE3FDyaCA+fjVfsIVejnAJSVFrYSCRFzOqyhFtPHU73tuSF/ujq8qU Tii+138dhWshmuWaJQrWzDEcDSwNbWTstN6ZIMvsz2AtEqV7ISTBS8sVvf852TxF6caa TJZpKoGKkUQEl3h2bXURw0RJRsO9OYjB9wkYb/OYIbyfWPqIdqwR8cXxhXguFXnWqMt3 tRxNdSgOvcEEjPU7cm1vGHhKnAgVzOlK0U0ClDM/m+gcFMTOmMl61915AuAWFgyqAxWe FFWg== X-Gm-Message-State: AJIora/ydpv96vS99T2SMRuC4CpSCcyjvGsxrY3a2IbZ171SybHPf3VP 1UZx9Cx7588F/kQAsF+ErsKIujirCW+XL9U+NMJ63Sr7sl7QxBBkZ2yqmT3t36C7yy4xp1YM8Fk QlNjaRthJsIj/MhlY1G9epcdFY1ADMOQtSCrWEG4er7EbCsrWkC0bq/xzgJmCaSeYL2g= X-Received: by 2002:a17:907:60cc:b0:72b:40a8:a5b with SMTP id hv12-20020a17090760cc00b0072b40a80a5bmr624632ejc.379.1658509497293; Fri, 22 Jul 2022 10:04:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vBKP52JveUe93H/JHjs6AGifaaaxQXuZtwWrug1lbvlLzFGXkJtk5jyvsvic+errKTwMYGsA== X-Received: by 2002:a17:907:60cc:b0:72b:40a8:a5b with SMTP id hv12-20020a17090760cc00b0072b40a80a5bmr624608ejc.379.1658509496986; Fri, 22 Jul 2022 10:04:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Alexander Bulekov Subject: [PULL 3/8] oss-fuzz: remove binaries from qemu-bundle tree Date: Fri, 22 Jul 2022 19:04:44 +0200 Message-Id: <20220722170449.853222-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658509770211100001 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 Sat May 18 21:26:37 2024 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=1658509932; cv=none; d=zohomail.com; s=zohoarc; b=g39wHZLKbeFO9HMFfmRf28f7+UkRWnF6YrksJLinHiRs8OhKCv4mGwJ1t8KDHzCFHnkBANclV2YpgxZtWKucTbdSWD3RsiaZmsA217qDl2qIMSOOzO2kFKtWBYflJT1Rox4dejL/qOyz7HjZBqu8HYEHEwDZXSW0yq6AHNZdyZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658509932; 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=A+ggxAFiEuxheCFpIId61OFv+zKmZna/owJHV8zf+/qsc6AJ9T2pRFrw1k28LfWDg5k65xIT7j3rvKyhq/I985aQos8lkaAeC4h4tLjOIi6pgLqphvUofpjXI9k1zJqQnzaKho3+gvozzqJBsZcbgeu33P2DBqpK0c0szHkF75E= 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 1658509932159172.26300926175622; Fri, 22 Jul 2022 10:12:12 -0700 (PDT) Received: from localhost ([::1]:42446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEwCB-0005Jy-4M for importer@patchew.org; Fri, 22 Jul 2022 13:12:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5J-0002J5-P1 for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39901) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5H-0000gD-Nl for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:05 -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-216-ttOTIuniOsCZJMUMzKS11w-1; Fri, 22 Jul 2022 13:05:01 -0400 Received: by mail-ed1-f70.google.com with SMTP id b7-20020a056402350700b0043baadc4a58so3207906edd.2 for ; Fri, 22 Jul 2022 10:05:01 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id e11-20020a056402148b00b0043a43fcde13sm2809577edv.13.2022.07.22.10.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509502; 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=DGhVBF0fEHZGJkMbNUEC8YcEXqfvMStMrVHNn6lVrmFRLFQYFtJDCd/BMu9Jma1YznE9/2 12N5ARaW7PTSZOJcOlucQJjC3ykSKGzQXvuf2VZSvjWpUAOt3ZDbBJrp6BRFojYmrTdAGx /x10qMvTBwhYdL5wYWgUOLeNGsGWTSQ= X-MC-Unique: ttOTIuniOsCZJMUMzKS11w-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=bjX1Vt3B2Gf5Lbpe8xT1w3MV66qz8hK5LRYaMWCAfABDh+K/9/wU8aJ8zUvIuyluVd U6G9qsATOjqSMcndX26NZuA+7DFRiG9MfapUaGKvCrUIevkRrnn52JMMFvx8dc95Q+Qv 4ydUtcu6Crmi03SxmDmMheCWbXe4zDUVQCURqKHoAU7Mt1j+XpQPo2dkpSiIAuHQFVYN Lv9xk+v4IVN8smtHNCzZO819gxSD1vmRndYrKkLa1ZtnALZWccCiGGhgTdSx7Zr58x8R bCtIgXdy/1VTPPTANmyL/gtIwWkDlfUKLomiAKvpSoGE++S1bqAT94om2R/yHNPeUA6P yWRQ== X-Gm-Message-State: AJIora/SXwHoxQ8qm+2p9yIlZXJEz/LpVu68fJA9inkvsXHDUSRpNO2N vb21/Yy5MukH0pMdppFOci4yzmpvV56ecvUfX0T9xN2bMjffNDRWxALdlKZQl3ZBXDoKUPmmKW2 qE1+6iRXoehklE8oYo4T7eYAzieou0rcshVWlKfH94FMxivw5MpA6kOHk1j8cixf3Ekw= X-Received: by 2002:a17:906:cc4a:b0:72b:863e:ef7c with SMTP id mm10-20020a170906cc4a00b0072b863eef7cmr637891ejb.686.1658509498940; Fri, 22 Jul 2022 10:04:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vVK/kyx0S61nQJ9nLSqcESzj6LwZQpHg66nWlnQ678cqhuSOqGLtKgdrnu+ys09RUFVTH+Lg== X-Received: by 2002:a17:906:cc4a:b0:72b:863e:ef7c with SMTP id mm10-20020a170906cc4a00b0072b863eef7cmr637872ejb.686.1658509498605; Fri, 22 Jul 2022 10:04:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Alexander Bulekov Subject: [PULL 4/8] oss-fuzz: ensure base_copy is a generic-fuzzer Date: Fri, 22 Jul 2022 19:04:45 +0200 Message-Id: <20220722170449.853222-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658509932706100001 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 Sat May 18 21:26:37 2024 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=1658509769; cv=none; d=zohomail.com; s=zohoarc; b=OsJtbCjpIqyYaDGnrSLmrCFmhjpicxhxG6uzCvSmF95LMmcy3ZvQiLNdejpVmbFKqlsA4a1Pvh+Pe4gP2zNm1tWCcEe6nrQfbAUyti/LfuFF+gJPkaOstejwOiNaxwiIjhiv3lL7OUAGus5fl1RaELHsEnpP90MOMwvXYxMVwBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658509769; 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=gxau6O6/5+x5JQvIbBy5M8Zz6YGEaJX22tf46n9d4rjLx6cXB7eLEcpH2vERJg5AvfNrodSZa3xOVJ2ryP35xVUyVacupM5F5Hi3bThfu2yCTBQSj3op9/V7xowbI0f8BbFQXDqOvyOrhbiGCVtR57z+68ZAo1UVN2jHydBPdTg= 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 1658509769897482.37343092847914; Fri, 22 Jul 2022 10:09:29 -0700 (PDT) Received: from localhost ([::1]:37634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEw9Y-00020j-S0 for importer@patchew.org; Fri, 22 Jul 2022 13:09:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5P-0002Nb-O9 for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5J-0000qm-HO for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:11 -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-539-brZc078KPyuGkxRL90MOAA-1; Fri, 22 Jul 2022 13:05:03 -0400 Received: by mail-ed1-f71.google.com with SMTP id q16-20020a056402519000b0043bd73ad1baso648332edd.3 for ; Fri, 22 Jul 2022 10:05:03 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id l10-20020a1709060cca00b0072b2ef2757csm2188186ejh.180.2022.07.22.10.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509504; 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=OpELdgICa0ZXBD8D+wsLCpuMuK7pcycegUhFapiQytLKmcLU178Tq5UyLL4qFNMWcwDQPe G43KeJPM+OnSn1j3znAIOt/tgD5MZRjFDw2qnE7vVsmCdmFQUzB4V0qaRXSKcsDco23ink GhjpVEiEanbPHqQRMfvbcYDmTVM+/cI= X-MC-Unique: brZc078KPyuGkxRL90MOAA-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=DV6pBuxuRO1rO9BV2uLGOO9ndaowO3+w2OloEgzFACMYM6XkKVdw5a/rZwyUUDglGJ ud1yI0vytx8L+Ax+hyvMOo7gwTbuDP2VkR/C+77HCyIwf4MG9igKRclBu7s40yuGqZjS x77AU9wgksapTUQhjzBALww+KozpAloEgGfIfvXJS2wueEtwZaA9vvCW4ahkGlfAH1Cd 8mgSwWUKw6YrOoFuEfnGji9Z2Z5oRcOzTcSwA594aIQ7yDcFXv1M/qMnEUXSLyU0X62b xCqxiTPkZufyDlCcuPxXoBQXDHoc4/erHbpMqm8cReKQbwxddvBQ97OQCavPBrMtUFwF 45HQ== X-Gm-Message-State: AJIora8CwV11o+N/yXG/oSIzUuZeaCIpuDuwR6+34oHkWNOQckMAfeCZ eJDn1JQ7IQU85cyG1PpjdAvJKYVAXqMhW8n5CIMFRRI6IugfNcDYnJBKyx4s9Kz+UfiaLSwDH6U fWorXbJvyIpRYQs0LCFDI1eCzLLjgF6GAGnj36wgsOOg/p1JWnJhhrE4r+YFafd8QA78= X-Received: by 2002:a05:6402:5412:b0:435:5997:ccb5 with SMTP id ev18-20020a056402541200b004355997ccb5mr780976edb.167.1658509501888; Fri, 22 Jul 2022 10:05:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sM+/GSVhA0wsY1rbfunQuFU5Ddc2Wq/ncfSg+5wEWX9UJ3kbPiED1BRAr31ZjFZAotQbMM8w== X-Received: by 2002:a05:6402:5412:b0:435:5997:ccb5 with SMTP id ev18-20020a056402541200b004355997ccb5mr780946edb.167.1658509501580; Fri, 22 Jul 2022 10:05:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A. Donenfeld" , Chris Wulff , Marek Vasut Subject: [PULL 5/8] hw/nios2: virt: pass random seed to fdt Date: Fri, 22 Jul 2022 19:04:46 +0200 Message-Id: <20220722170449.853222-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658509770286100003 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 Sat May 18 21:26:37 2024 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=1658509648; cv=none; d=zohomail.com; s=zohoarc; b=AV1InBNBObYYCeCeVE8oKN9QITOHm74j8MimXeVtMWqQx3o/F5nSbp79ER40aI685tB7ec53ismLOzxhuH6PwTFWpHZO384CIHgaCZdTYx2co0SVfRB7/Bn0NKdvxh7PtLBviElgXCusBg09L4lPREAlsAAQtVZJE8uOzjQFafY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658509648; 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=JTOjl29++BJDR3f2lohJr/7JFB/7Mqo5T+8gOIlexT70oWLD6LMNi/tjkQGrbDQC6Tz4mJoKwy22knzlwSsqWt4ZVAVExE3Z1VpLUS7LAZ0dSmCoBFiTRwdPDHsI9Qh3B4tSJOS5b4Qq8bEoLRv9Hy68BIVXCnyWWy0sES6XUeI= 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 1658509648685518.4186880589937; Fri, 22 Jul 2022 10:07:28 -0700 (PDT) Received: from localhost ([::1]:58478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEw7a-0005FX-JD for importer@patchew.org; Fri, 22 Jul 2022 13:07:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5S-0002Rp-VP for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41643) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5Q-0000sQ-3G for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:14 -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-626-XbaSrozzNG67ZUBlfeck0w-1; Fri, 22 Jul 2022 13:05:07 -0400 Received: by mail-ed1-f70.google.com with SMTP id b15-20020a056402278f00b0043acaf76f8dso3246887ede.21 for ; Fri, 22 Jul 2022 10:05:07 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id q6-20020a056402032600b0043574d27ddasm2741818edw.16.2022.07.22.10.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509511; 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=Khcvzuf5sa3YO4or91YDAv74xo+DmuKEjlO70lva4tnnLNXp56dNkDFWfb00hQv5wDwPHh zldhZ9WCll/F22WLGu6o0jJkNBoj0Jrb7XjEcnCohbqoaovwgYrBChwJk9NhV87hzvvaUG fW7Qua0acZfnhh/8dYRNYs6yx/G7BHM= X-MC-Unique: XbaSrozzNG67ZUBlfeck0w-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=27M/7kWXhLDcMEb81b7cj5L7AmtCslKv3nMZF4lkeS6dNCTxMqJFJUH2x3B1DerIfq IWgp5XtRRrAN1qmgjgeik0TKzIi+pTzWFD+H/wiO2pmhrTryNHnHi/VVd9Azjy7/DsUK jDmgmnctBTKi2cV2rg0vIzHxBYHrsh3X+VsQtYEZNdBCj26fvatPgCnnI+TEh3DybIOf rBSlJEL4BXmOvna5Oc8Y7KUPLD3sbeNQDojwRw3CR77h/uVZDDA4wKYp8nugqDDs5GxF sIcoa78uNiucphU2ZGxAtvFB6OF1LdENGXEDRgIlm4wxMVPDy+3XWub0lIJxoOAgTa6S TyQw== X-Gm-Message-State: AJIora+NOWira8TG6xVdv+OO75x/zYl+v6fXqjAd8PIX+/RUQeYXxdPI Ik8+xLuq/2Wl28KQfqv0wjZj0CYdF3TTHZhSEvAiJrMkbY7BoskCFbqTn8tXHCyhW2UYlyXC/yN Uv7MdTdGY1g8HxnLbhUG6yfZ5XIHh/gERqCEwI76XBnBwBySvvk3/096kVFydMV7Nv1Q= X-Received: by 2002:a17:907:a042:b0:72b:4fac:1ddf with SMTP id gz2-20020a170907a04200b0072b4fac1ddfmr660182ejc.285.1658509505318; Fri, 22 Jul 2022 10:05:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uYa9NTEbbaLl5zmu2VIvZ57j5Ex1bsuLWci2EeBr6EclpRiTDLBpGYVNx+VoXZoqkqw5yQwg== X-Received: by 2002:a17:907:a042:b0:72b:4fac:1ddf with SMTP id gz2-20020a170907a04200b0072b4fac1ddfmr660159ejc.285.1658509505003; Fri, 22 Jul 2022 10:05:05 -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/8] hw/mips: boston: pass random seed to fdt Date: Fri, 22 Jul 2022 19:04:47 +0200 Message-Id: <20220722170449.853222-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658509649607100001 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 Sat May 18 21:26:37 2024 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=1658510071; cv=none; d=zohomail.com; s=zohoarc; b=eBTmsL6TnNxdV7ck+W7KA16guMT5QMAVupBSQatsfxIJbdlaOG5bbcaV5uk+Bn//SPgR25wE2xtlUqQinpH5WWkWh21sdBJQe00jnxDoy21XPnTLCQNuxZty8NThW7lBlrptJkAvUSZIRETKMsEybHfMyp59HWg1cCEkQpsb65o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658510071; 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=d7QHJGI3vgQJRv8h5bTWcYYaccAE4/8eS8L4DPORw4KKDnBJWgTX5cAsOr833W3EAU2AOiqJTDpXiHd33gy9cpipeYHQnbc27VfbbeNSLEJE2ZTCJ24aLSMr2gbVM39u8dJkmsmxqzLfutWe2WPumSt8mzB47YExT2DlpvSyvQM= 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 165851007098985.32626113863785; Fri, 22 Jul 2022 10:14:30 -0700 (PDT) Received: from localhost ([::1]:46642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEwEP-0000EH-QB for importer@patchew.org; Fri, 22 Jul 2022 13:14:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5R-0002Nl-7T for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5P-0000sI-O7 for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:12 -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-211-fg8qzzR9N9G5bCx_qGL3tg-1; Fri, 22 Jul 2022 13:05:09 -0400 Received: by mail-ed1-f70.google.com with SMTP id y8-20020a056402358800b0043bcb538b85so1954621edc.10 for ; Fri, 22 Jul 2022 10:05:09 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id c14-20020aa7d60e000000b0043b240ce57bsm2834771edr.82.2022.07.22.10.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509511; 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=aXzXkcLkflvTaTPbxBnTOLjNgXCIqtmf0PzOGSDyAGcm5MhUjZSxE8nMy+GKLttyGfiqyI Ta2vAlOhrW493kulcgGe3ntkmaDVWXNG8Q5e1qROCkuwqTcdPbRH9qhYg1aJ3vPXBV7yee j9eVBTXUdGxGYR90YSK7rc6CaMMXp8I= X-MC-Unique: fg8qzzR9N9G5bCx_qGL3tg-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=1swZY1TXI+IhZ8GTV+I/bmdZXdYYoZhjUdLyoCeND3wkKO3oDyhqkYyz8BDiWE+Rpg mSgiw/R2K0Id6Ec4j9rzBtMEGZFKxthRwy9GKl1ByhZCyqMKF4vijJiQzVZXkyxcc1Ap Ia++FehZwrWJhN72DehrnSSJdPHcQgLDvBtP4sHi5BpC+7n1JvmgzNxg/kZdX1VQmRlZ ZxzbBrb3i3HoaF0RMAUWWkv7ngaiYyngoJS5jkH2ViqZlFFxMoZiRIBwEpvmVTo5Zqcw 0mtd/0Ml5w+QYj5gYZIOZPHcD3GjSBd0hyJpLypxJuKJaDHv3ueAZ6o+7rwfsYOr4eeu QBpA== X-Gm-Message-State: AJIora+crWFrajw5TfW6F/qReb6UKs4PKqROa2eUqFPtnuT/IDTsvMBC Fu7NH4w29agrD2DZtCisYfFtZvu/SEGPT6bc+Hs0CpDRHvjSo4cL1zAtfta9FVwJ80tH3WOv7dz 3c0iXsjOdEwfgdqUMrG7HIMbxTDiiIngTvtC7zCnTicAPQS+bwjMP139PixHrZkkf4tg= X-Received: by 2002:aa7:d9d3:0:b0:43b:c457:fb06 with SMTP id v19-20020aa7d9d3000000b0043bc457fb06mr804851eds.5.1658509507727; Fri, 22 Jul 2022 10:05:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u5op6bUtaiArTdHq8pylbBCGtodePuA9oJmavgnC7d1wkpWE19KpYAV/0zz6gbSLAilg4VKg== X-Received: by 2002:aa7:d9d3:0:b0:43b:c457:fb06 with SMTP id v19-20020aa7d9d3000000b0043bc457fb06mr804836eds.5.1658509507505; Fri, 22 Jul 2022 10:05:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A. Donenfeld" , Yoshinori Sato Subject: [PULL 7/8] hw/rx: pass random seed to fdt Date: Fri, 22 Jul 2022 19:04:48 +0200 Message-Id: <20220722170449.853222-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658510071873100001 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 Sat May 18 21:26:37 2024 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=1658509769; cv=none; d=zohomail.com; s=zohoarc; b=bP4AhzBRlxeNKEb3izvLyIDrxzKbDCEnU65vxkMSbkej6Tn08oJXY0wLS87Bd3ezunkcJ+ZNRn+hBjHSFbVM0iKjqMii7JrOZ9T90KR/XzjwTVAOed8ynxGtenTgfFJzcx2K6OWhcqPw5VVKSLre9Ua/k0scQIdTGOZ4hTlGxLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658509769; 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=GYuqkOWNaFaZVYJ4+k457AjLg+vNW7/Y3XOOXYFCQ33b4ArXTxKe3a9uQxFEznyK2vAgKPCJXQmLY2J2COBgaOsEy2eVMPXeUkRdzL+oGniBCMBmtYKrh7iHwyJnjdOZ/vBVMPUtCLhmzDc61pu6ynX8d2h0mPSlfX4c+LsH7LE= 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 1658509769002220.2274203773369; Fri, 22 Jul 2022 10:09:29 -0700 (PDT) Received: from localhost ([::1]:37598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEw9X-0001zN-Uw for importer@patchew.org; Fri, 22 Jul 2022 13:09:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5T-0002S1-4m for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEw5R-0000sc-1c for qemu-devel@nongnu.org; Fri, 22 Jul 2022 13:05:14 -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-222-M9lKLAgDN1O7anxrvp4YpQ-1; Fri, 22 Jul 2022 13:05:11 -0400 Received: by mail-ed1-f69.google.com with SMTP id l16-20020a056402255000b0043bbb1e39c3so3239647edb.11 for ; Fri, 22 Jul 2022 10:05:11 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id 11-20020a170906310b00b00722fc0779e3sm2170948ejx.85.2022.07.22.10.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 10:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658509512; 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=NmtstjDD5tByPWzFznabpO/SIfcgus3Hrut6pIOSanBvRnkXAT6YvszvZk9bHP3kOkQn6X XShZ+Z+HwkL+Iut8IExAYNBpOk++WfLtmjQ/xURq9wvEnOlCrma210a7Dgq8F7dTO2ZoKG 5jZSNcZsF/NluFs3CL/9H/4bJg9qN20= X-MC-Unique: M9lKLAgDN1O7anxrvp4YpQ-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=qRRS30kMt9rn+j/ugh4TL9cSHPC+kyUBLMVr3FtKSIQjowds6aQpm9Kj5D2dhzNcfr WyBQrOYoZ+6ndnT3aewCiwxmtRZDuyxzYy41j27uweEF+bnnmaU15o21P8u5p+/7l3qS P6m2s5bXZCyN+YKSme8Qt/gYR+k/R9sN1vsDiemsMzDDYQ5Rf7pFcpcpqua4VX9w+H6J lFvY2Bf04TqljzmFsDLglTyzUiMGVii21CJ2q+uftDuaBGq+ZM7f+ZykeZDLoqzIlcf3 ADA8xFL3/pC8hh8J0cWtn5dssOWy0culNu+Ph+utfRHB4/3jszJA8WeTszR7iPCxQBrb ST/g== X-Gm-Message-State: AJIora/MALHG71kd+LJUOmYq/PcinfBi7Ugy5dqMQhbTBq5K+AcOSRWx UveUQB+lNIrwQPrbgOiRbVrNOGq37M05XwPd7FlNuu/P6UxSEbZ6nJgqsPJ03mePhpfefWamgA5 Ic8KEp56b1QqKHr+TrF0ot1Gh+ebK5bnoem4S2Spad52D7P3AAAYs9JNhX5Q0yOH7W1I= X-Received: by 2002:a05:6402:5518:b0:43a:9e32:b6fc with SMTP id fi24-20020a056402551800b0043a9e32b6fcmr872310edb.252.1658509509490; Fri, 22 Jul 2022 10:05:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uMPYyafNxbTUSggS8cnq6rE5HkvnEjGTLKM7AOQoBCXQuEv+HwG/zrZBcmQ3VKBSjQXQA5Vw== X-Received: by 2002:a05:6402:5518:b0:43a:9e32:b6fc with SMTP id fi24-20020a056402551800b0043a9e32b6fcmr872273edb.252.1658509509085; Fri, 22 Jul 2022 10:05:09 -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 8/8] hw/i386: pass RNG seed via setup_data entry Date: Fri, 22 Jul 2022 19:04:49 +0200 Message-Id: <20220722170449.853222-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722170449.853222-1-pbonzini@redhat.com> References: <20220722170449.853222-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: 1658509770306100004 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