From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876026; cv=none; d=zohomail.com; s=zohoarc; b=OYclHcgHa5MGcF54f7ejJNISgHGY85ugEMSObYMeqtC/Hz78FeUe9B5vL2wzsN1Kd96RlfbRsHh5dRERgPa4/ypexSQEGoWpVQqh4LqM8sQpNmw1ReUWfarmNlJ8O9o0IMa3bgfLRQGK82ra+7sgGAsH/m8JZKEGZTGJGvVXDgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876026; 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=5tP9XZkZCa+TFNyC9cMy34jaLrb1FV2M8KBhC9kwnjY=; b=cMOcbz8r1HAhfyMsrmfiiEXNMVFS/BS84/tEpG8XVyFKjWawIuZ5au5iEkNtJJo1QhJo7Gd7nSS+qsYZ21XQB6UO3eLW+mDdcrV4GbNIJIuRB6v6pP8rroXKDWrcI5SI+GcQE7N3FmlWtTVHyWfoX+zizEWvUcPYxyAMXDNX5ww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876026106591.66254713619; Mon, 24 May 2021 10:07:06 -0700 (PDT) Received: from localhost ([::1]:57262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE2i-0002Sf-U6 for importer2@patchew.org; Mon, 24 May 2021 13:07:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeT-0004z8-4r for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:01 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:40901) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004Kx-4L for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:00 -0400 Received: by mail-ed1-x52d.google.com with SMTP id t3so32710118edc.7 for ; Mon, 24 May 2021 09:41:34 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5tP9XZkZCa+TFNyC9cMy34jaLrb1FV2M8KBhC9kwnjY=; b=EkoVZ3tjFPFnNTqH4xU4OQN9ufpMRE8+BYch5YkQwvvcKiNE9GO6CTwE895iU8Nc3j Z3LlHAxTzfCF94BngzubjrJqelfneSYqs1trzU+yTYSw88diRt2a4ObWcz15+0X5kREm OIOdpR7Qpm+DjPBAmPknV24J/KhC9nQEWDz08D0KAwCzfjCmcPNS6XCJBm9N5PkYNo0P 0xtLD0U1uxACqYahyK/gRvDiAwUAMcV27Ie81xGIDvNAf9fwe3kpJAJMeQJ/L27zv6+l DhZE1rPb8wsJ2bEwFIkui5uQmTYKItz61AZgozb6QgEW1hX7d/JFwRqy5ADLPYyY1DKo /YdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5tP9XZkZCa+TFNyC9cMy34jaLrb1FV2M8KBhC9kwnjY=; b=QgSBA/2wG/wbh+67Vx+zhJZzruVpNlu58mbRJqilhjqG1g1rVBNrjAksH1NBno9Efc ZvuDFFljv5H5JFgirche9BU+nbjtY1bB+Uxq8uvzUeQGMbDriDaowHv1zrMivHfi22VD tPCCX8RfOmrJZQS2RJEd9ln6RRzorFKeIHlUS3WzViZBnIsmxWWEvcVR/WIsjTMNPMgA QOG4aFQ7nJMUV0Tk2Rlm4yelUIkr5AgGHpqou7nnFYysQpxuO70dWlIdPBOd9qpHd+Ew iLT08zgs1ueXOK4QWqSfgOgU4H8Vi9MVW4fzmVZ727G+Ca5HmVuE/TL6GZAYnxY3mT53 9p1g== X-Gm-Message-State: AOAM531bBggdqtCMsP6bXketjQ9nBPtCDQtoQjYKSmk9S2DfGFcb0hVD bKn6CA/8VNAX5iv6SUuNOS+iDr261JA43A== X-Google-Smtp-Source: ABdhPJz70RnlDXEdcqkZ+3HOUcrovFbJJnbCb1FL8I6gdqanP8tFtQyKk3jk7KpKJeTZrZPhHruo7A== X-Received: by 2002:aa7:df11:: with SMTP id c17mr26908650edy.317.1621874492859; Mon, 24 May 2021 09:41:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/28] configure: Only clone softfloat-3 repositories if TCG is enabled Date: Mon, 24 May 2021 18:41:04 +0200 Message-Id: <20210524164131.383778-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210512045821.3257963-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 676239c697..808874cb31 100755 --- a/configure +++ b/configure @@ -257,8 +257,6 @@ if test -e "$source_path/.git" then git_submodules_action=3D"update" git_submodules=3D"ui/keycodemapdb" - git_submodules=3D"$git_submodules tests/fp/berkeley-testfloat-3" - git_submodules=3D"$git_submodules tests/fp/berkeley-softfloat-3" else git_submodules_action=3D"ignore" git_submodules=3D"" @@ -2281,6 +2279,11 @@ if test "$solaris" =3D "yes" ; then fi fi =20 +if test "$tcg" =3D "enabled"; then + git_submodules=3D"$git_submodules tests/fp/berkeley-testfloat-3" + git_submodules=3D"$git_submodules tests/fp/berkeley-softfloat-3" +fi + if test -z "${target_list+xxx}" ; then default_targets=3Dyes for target in $default_target_list; do --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876641; cv=none; d=zohomail.com; s=zohoarc; b=jGozAXyU6+XuCXYVqH2/da79e7ewaKSeITZHg+P6qcKdvx5146YOs9HUQywPVhZwBOOrvW63/8AAnBOeCcJ2wRMuUVzxdVLpb/aZPTZ2GkppeA2ay7WyfvJN+eAdYXoOhn75Z16t7fW65IA5tWUvx3Plli92QBXO0oT7zUjuhd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876641; h=Content-Transfer-Encoding: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=iF4RcJLaBA+Tsqd+K4Whv/EKE42LwUvWQnMGDTznbsc=; b=Z7xk+zJAAAksgjDU0llVGF+TkCwb82qq8xeyliB2PNF8Msm/sSeqDYvkiCGYZp+N0wy43vlffRk/0O8s/kJlZ/kQrc0kUxZIZXrAaft7E0PJkwe5e4dtdg4B+NTZwhuKJnZ7FIFNTlpGNLy1ota5+105DLKWikUktLqmV6kNanU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876641643988.6273142585396; Mon, 24 May 2021 10:17:21 -0700 (PDT) Received: from localhost ([::1]:54802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llECe-00040t-J5 for importer2@patchew.org; Mon, 24 May 2021 13:17:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004oa-Dk for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:37683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004L4-Eo for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:56 -0400 Received: by mail-ed1-x530.google.com with SMTP id g7so20567875edm.4 for ; Mon, 24 May 2021 09:41:34 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iF4RcJLaBA+Tsqd+K4Whv/EKE42LwUvWQnMGDTznbsc=; b=XEWjRHwqpLjvzxHRFHqoOOmvXTtAWB0aAPxxPb08YRiPpdeMjX8hSDA6/sMMpUR/Ag Rh7GOrHNSieiw53R6J3LC2toscxDn476ybpLYNztGKJ6RVPMrBuFTUF2SXeCG2KdTnzz tRiUdtdTUvKvJ3O3VVsUIa5aPWzDmdjiUVl+vcQyjwjfy8qXJ3/BtjD7stSOFP2e/B8A 38GVtm4SrHDt5J0V/AmZPU2qdTj2PZCXHwyUVRBqUYc4vori0gKChQ53RVJwR9g6hRBU SgXAF/t8jFuP8tuyJuQNAv0Y4O9tPx4eWnaIQ3FRdJntyaRb5gK4S76sO5toBFjBrgj0 Mdqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iF4RcJLaBA+Tsqd+K4Whv/EKE42LwUvWQnMGDTznbsc=; b=Uj7vHV0W3blm++jT0OMpf6X+5601h0mE21Yo7d6/df/xd4fMhporThlcehVc1IK/Fn 6FpqgjPVtN6XWcu96FXv45+u/ydAHEB37coL4aRlqB9ystCR4rskC5QsBVBhk2OtR+OD biK9kycdkP9XTOsnzVHkRtYvTIyu8yo0sAatkKT32wgY/miVhUHzdvG7KXDtUxHll9Nb ZFN7et0vwynujj3ou7Q+uTWYTWidmI5MMeO1wSjp/d0xjgFPmLXdMvkpi+wgOUuIt2kT y+u23kCzgOczHQiIhDAo7G7PRfkks7OWJuK25snVUEiprUMnGgMT/1LJ6QBp4W67vDN0 9KcQ== X-Gm-Message-State: AOAM532dpZ18SVhDkSmUJpwXVaGD03qZZULTQTKc+ukbQKhyd6PqBp5s Qw04hlJW88aNUrmKDGHsJCTu5M2fvVdfRg== X-Google-Smtp-Source: ABdhPJw4lfT0skGk65IwU4X1cD1ZqDIy2nVKz5R+ItYEQIJO4t5f2mMn2Wp/uJtrGXRlNBpiee01lw== X-Received: by 2002:a50:fc91:: with SMTP id f17mr25971641edq.201.1621874493701; Mon, 24 May 2021 09:41:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/28] configure: check for submodules if --with-git-submodules=ignore Date: Mon, 24 May 2021 18:41:05 +0200 Message-Id: <20210524164131.383778-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Right now --with-git-submodules=3Dignore has a subtle difference from just running without a .git directory, in that it does not check that submodule sources actually exist. Move the check for ui/keycodemapdb/README so that it happens even if the user specified --with-git-submodules=3Dignore, with a customized error message that is more suitable for this situation. Signed-off-by: Paolo Bonzini --- configure | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 808874cb31..f32c6f1a26 100755 --- a/configure +++ b/configure @@ -260,24 +260,6 @@ then else git_submodules_action=3D"ignore" git_submodules=3D"" - - if ! test -f "$source_path/ui/keycodemapdb/README" - then - echo - echo "ERROR: missing file $source_path/ui/keycodemapdb/README" - echo - echo "This is not a GIT checkout but module content appears to" - echo "be missing. Do not use 'git archive' or GitHub download link= s" - echo "to acquire QEMU source archives. Non-GIT builds are only" - echo "supported with source archives linked from:" - echo - echo " https://www.qemu.org/download/#source" - echo - echo "Developers working with GIT can use scripts/archive-source.s= h" - echo "if they need to create valid source archives." - echo - exit 1 - fi fi git=3D"git" =20 @@ -1591,6 +1573,28 @@ case $git_submodules_action in fi ;; ignore) + if ! test -f "$source_path/ui/keycodemapdb/README" + then + echo + echo "ERROR: missing GIT submodules" + echo + if test -e "$source_path/.git"; then + echo "--with-git-submodules=3Dignore specified but submodu= les were not" + echo "checked out. Please initialize and update submodule= s." + else + echo "This is not a GIT checkout but module content appear= s to" + echo "be missing. Do not use 'git archive' or GitHub downl= oad links" + echo "to acquire QEMU source archives. Non-GIT builds are = only" + echo "supported with source archives linked from:" + echo + echo " https://www.qemu.org/download/#source" + echo + echo "Developers working with GIT can use scripts/archive-= source.sh" + echo "if they need to create valid source archives." + fi + echo + exit 1 + fi ;; *) echo "ERROR: invalid --with-git-submodules=3D value '$git_submodul= es_action'" --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875802; cv=none; d=zohomail.com; s=zohoarc; b=CCAkp7y4BFnhdZp8Kn/nZ9EK1mjJr1myR7ad9DJ3fKPIZ5aRIS5hebkZhUOySqeWnEi1gucCVlRJ+DwQ6DbtjCVR5zwYpSRq2F7fJsDwZlJ4/x5/D9KTabyGzZULoorW55FW6mYvYLQBbTkc1OnkfEuGGmbf9SoYQ6FMNkdsrzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875802; h=Content-Transfer-Encoding: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=XYlIy29CAzsIXn+NuTHdzNwJB0PZQ/8OlU0zYweURUw=; b=bv6NuYJpGNDifpe65bizMQNTDddmZ6IyD0M7Q5CHWAyUnP1BKdzvfvyjav58NTmSHNXpZXgBqjvwk7Dj9Zz7AR2iF4Y+MdFC6B4lraMBofmp8h0v9Hw7uKlo43JuDzFsUnBnPLroEwzLAMF7uvIroNKSJiuV7Y7aB4QvnlDDhe0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875802324843.4938998974797; Mon, 24 May 2021 10:03:22 -0700 (PDT) Received: from localhost ([::1]:48636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDz7-0004px-6H for importer2@patchew.org; Mon, 24 May 2021 13:03:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeK-0004jI-OX for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:53 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:42840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004LB-Em for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:52 -0400 Received: by mail-ej1-x631.google.com with SMTP id lg14so42763877ejb.9 for ; Mon, 24 May 2021 09:41:35 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XYlIy29CAzsIXn+NuTHdzNwJB0PZQ/8OlU0zYweURUw=; b=hNS95ZkktK1O3RqVjEyvbJ8PBs8RvofKVZehbU11tRrw2ncopnG2ZyQONRI4hCDJbs QVvr5YPCWO4/7rZCU+n9YnCvxthy9rZvU1ivze2jlNQg4jNhzrssOENPEgOO820sYbGD LCivuJmBXH5jw0CnbAlGB7OVtUCTnWIxRf2xaOfNyrJYEJwTx8AFdgiAX4vlp38+4vbr 6Y+G8nxd+fgYddlGcFlO1Dqqd+UMg/4RfNKRTXLxb8p8n/d4ak/C93hO546yJ0EN5oRI Xi4cA0LkLF1ez/0BcBoPROc2/nGjF4IVnCRSHSfZhqVBdkdrCYaLehmeg1RXONPDPNkj OkHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XYlIy29CAzsIXn+NuTHdzNwJB0PZQ/8OlU0zYweURUw=; b=D6KiybS8tGlf/RkSTO0gH1rIKM1ML8KZO4gQlvIdzBYp8PCl1ZLMo+aVcXn0eWuRgq prJYpBBXwd2vagSLFU1o6Zyv701P4ED9wo61SWwf0pRSeprUbGsPkuVOlUjWlFQNbzxP brYN4pxVdpDkn3wmhibv9lYQdGGB+cfVPoKV/tNIGFB8Rq+065YiSOIIkk7PrBdpIwHt SzWz3RXCl9ZRylMBtQlDVgl5Ca7T26t8AezY+TNtw5T7/WDzxU4WM1xxPBNBsZrLIp6V Qv+JdK9gM6jLW271W1B89xZoHkpKyG7lcXHyjo6UWAkYpxHIGAKw+cjSj8bzWS1pzOr8 KcgQ== X-Gm-Message-State: AOAM5307lQzxchQ//3r7Yr7VO+O4gDedcuAb7l4jwiWCZp8Mnos7pBEX N5XS7+yoi8chnP4p01dYkcIn9jaErQ6VKw== X-Google-Smtp-Source: ABdhPJyYKwnD95jW0OCBRnd5fGiY5+qWQvVoTLt2sKtDDIBmrPCEhfgwEHv/pTrsOrLtQyFdctREtw== X-Received: by 2002:a17:906:7f0d:: with SMTP id d13mr24531044ejr.60.1621874494288; Mon, 24 May 2021 09:41:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/28] configure: simplify assignment to GIT_SUBMODULES Date: Mon, 24 May 2021 18:41:06 +0200 Message-Id: <20210524164131.383778-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Do not guard each assignment with a check for --with-git-submodules=3Dignor= e. To avoid a confusing "GIT" line from the Makefile, guard the git-submodule-= update recipe so that it is empty when --with-git-submodules=3Dignore. Signed-off-by: Paolo Bonzini --- Makefile | 2 ++ configure | 20 ++++++-------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 4cab10a2a4..30f19d33bb 100644 --- a/Makefile +++ b/Makefile @@ -48,9 +48,11 @@ Makefile: .git-submodule-status =20 .PHONY: git-submodule-update git-submodule-update: +ifneq ($(GIT_SUBMODULES_ACTION),ignore) $(call quiet-command, \ (GIT=3D"$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_= ACTION) $(GIT_SUBMODULES)), \ "GIT","$(GIT_SUBMODULES)") +endif =20 # 0. ensure the build tree is okay =20 diff --git a/configure b/configure index f32c6f1a26..cca532bb0c 100755 --- a/configure +++ b/configure @@ -256,11 +256,11 @@ gdb_bin=3D$(command -v "gdb-multiarch" || command -v = "gdb") if test -e "$source_path/.git" then git_submodules_action=3D"update" - git_submodules=3D"ui/keycodemapdb" else git_submodules_action=3D"ignore" - git_submodules=3D"" fi + +git_submodules=3D"ui/keycodemapdb" git=3D"git" =20 # Don't accept a target_list environment variable. @@ -3627,9 +3627,7 @@ fi case "$fdt" in auto | enabled | internal) # Simpler to always update submodule, even if not needed. - if test "$git_submodules_action" !=3D "ignore"; then - git_submodules=3D"${git_submodules} dtc" - fi + git_submodules=3D"${git_submodules} dtc" ;; esac =20 @@ -4351,9 +4349,7 @@ fi case "$capstone" in auto | enabled | internal) # Simpler to always update submodule, even if not needed. - if test "$git_submodules_action" !=3D "ignore"; then - git_submodules=3D"${git_submodules} capstone" - fi + git_submodules=3D"${git_submodules} capstone" ;; esac =20 @@ -5283,9 +5279,7 @@ fi case "$slirp" in auto | enabled | internal) # Simpler to always update submodule, even if not needed. - if test "$git_submodules_action" !=3D "ignore"; then - git_submodules=3D"${git_submodules} slirp" - fi + git_submodules=3D"${git_submodules} slirp" ;; esac =20 @@ -5477,9 +5471,7 @@ if test "$cpu" =3D "s390x" ; then roms=3D"$roms s390-ccw" # SLOF is required for building the s390-ccw firmware on s390x, # since it is using the libnet code from SLOF for network booting. - if test "$git_submodules_action" !=3D "ignore"; then - git_submodules=3D"${git_submodules} roms/SLOF" - fi + git_submodules=3D"${git_submodules} roms/SLOF" fi fi =20 --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875262; cv=none; d=zohomail.com; s=zohoarc; b=mKAEjdN9F+Bl8NqgSHArIDXVo3rWOc/4RDnkhh3pAmDbQjGWxWUzEqnxbI5JXxGLplPCaufaru3N7iP93yBOPYEsQ48Il3GKd8jvE8WU5bLOHPd6zbjSXEFSGXiF7w99JmUVEPvtFqVGZB0th6TLptmyGRCbGykMzYGhx92/4xk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875262; 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=LJ7zb0d3J9pbQsFoNs7yYsC3rg5PuI/z4b6K7acxh+A=; b=CdFev0VhFOXSf4lCQa7JTHMygYWMZ3MRRJoumDH9oqFgcDMlWiOfuyvQHENhiwicedmE3DwZ7lLykb1yEbHQ3IqEa34WR9kaT6RRc3w2k9EvTPCeqqkvpaI3as4v/j+lPX7q6GxmPTorYHZPQMJxwuX8Ggejt+uL07fSassxJGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875262359809.2934343375128; Mon, 24 May 2021 09:54:22 -0700 (PDT) Received: from localhost ([::1]:53810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDqP-0005fH-9W for importer2@patchew.org; Mon, 24 May 2021 12:54:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004o5-9U for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:41945) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004LE-IN for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:57 -0400 Received: by mail-ej1-x629.google.com with SMTP id gb17so24764531ejc.8 for ; Mon, 24 May 2021 09:41:35 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LJ7zb0d3J9pbQsFoNs7yYsC3rg5PuI/z4b6K7acxh+A=; b=V6CfDxkYYmU9OvyXNHsBWh6TRNHdFnRNGxSBpnnPFj1yrp/bExY9leENV5U3FZeO/D laDavgzRD42khTRkNCaYyECh+X+PZ7/f5iCy3z57tUUQh+C6zRt0lf1zHKZWSkJ1VPSr dsHbSC4gCiZBisEeVJnGjbMSn0zUTMto2KZrDqmSwebKKHhIwo9y2ZiaiHrPoB2YdPK/ PrqyPEQ4B7LhGiaR0xPAsClRUaOvyvXMx0xuAW6POftv5OdPDYJbQfn7otMH8DtDIIHp nzp4SF8t1vpYcgNyiO25TRC34ZLQcA/ehQjy3BFPTyVDSuO4sv4VB6eIyxThA9szuBCT wl/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LJ7zb0d3J9pbQsFoNs7yYsC3rg5PuI/z4b6K7acxh+A=; b=IzosBIm9XIz0fsc212U6u9rmQ3hv8SqGalEZyRcn5D4B8GIvcGj1uJZ5/av6ZM45hI dzbV2cbkiKclmASAYTSept5u9iNxm8zY4jUkhwtK2I1u4DEbAJPmTULdyvGqCgYYsLCH 26aPIZIXiygXnQtUtSUed9oZxDYnCYIVpmyJayA+N6rAIrnN6Qb+y6KZ2KMKbcA04ra/ RJckyYxDTpHBF4+JXZpK5mtrFj5EBpk/ux0jV5ccgyDBn3SFihL089MGPpKd6Bg3NF3C GTXWwomz5vrUCGuM0/ya9Yzn5RNBQXs2iUa+vyejYLRkMWGNgZUlbFXU9HUTVDLTgo2l H4hQ== X-Gm-Message-State: AOAM533fnMzAf4Mmv7zPC1fLCdpA90rzrFZkB0Y1clmNKscPZJjXMONT voNmzYBtwPYS6QD2VJeI6YPtHs3wn4cZfQ== X-Google-Smtp-Source: ABdhPJxznLT8GLajZsvRx/NW1WR46XmbjfdrlLzNN8BoBlACdR4yXFLMesMmFgusqco9AFNXVQxuPg== X-Received: by 2002:a17:906:11cc:: with SMTP id o12mr23784789eja.547.1621874494971; Mon, 24 May 2021 09:41:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/28] hw/mem/nvdimm: Use Kconfig 'imply' instead of 'depends on' Date: Mon, 24 May 2021 18:41:07 +0200 Message-Id: <20210524164131.383778-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Per the kconfig.rst: A device should be listed [...] ``imply`` if (depending on the QEMU command line) the board may or may not be started without it. This is the case with the NVDIMM device, so use the 'imply' weak reverse dependency to select the symbol. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210511155354.3069141-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- default-configs/devices/ppc64-softmmu.mak | 1 - hw/arm/Kconfig | 1 + hw/i386/Kconfig | 1 + hw/mem/Kconfig | 2 -- hw/ppc/Kconfig | 1 + 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/default-configs/devices/ppc64-softmmu.mak b/default-configs/de= vices/ppc64-softmmu.mak index ae0841fa3a..cca52665d9 100644 --- a/default-configs/devices/ppc64-softmmu.mak +++ b/default-configs/devices/ppc64-softmmu.mak @@ -8,4 +8,3 @@ CONFIG_POWERNV=3Dy =20 # For pSeries CONFIG_PSERIES=3Dy -CONFIG_NVDIMM=3Dy diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index b887f6a5b1..67723d9ea6 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -6,6 +6,7 @@ config ARM_VIRT imply VFIO_PLATFORM imply VFIO_XGMAC imply TPM_TIS_SYSBUS + imply NVDIMM select ARM_GIC select ACPI select ARM_SMMUV3 diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 7f91f30877..66838fa397 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -23,6 +23,7 @@ config PC imply TPM_TIS_ISA imply VGA_PCI imply VIRTIO_VGA + imply NVDIMM select FDC select I8259 select I8254 diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig index a0ef2cf648..8b19fdc49f 100644 --- a/hw/mem/Kconfig +++ b/hw/mem/Kconfig @@ -7,6 +7,4 @@ config MEM_DEVICE =20 config NVDIMM bool - default y - depends on (PC || PSERIES || ARM_VIRT) select MEM_DEVICE diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index e51e0e5e5a..66e0b15d9e 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -3,6 +3,7 @@ config PSERIES imply PCI_DEVICES imply TEST_DEVICES imply VIRTIO_VGA + imply NVDIMM select DIMM select PCI select SPAPR_VSCSI --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875461; cv=none; d=zohomail.com; s=zohoarc; b=n5nQ6tmiVeFrYQGQlIXozBSp7g1oKv9b4mrDXDxI7wYg5+maIPmO+pYCq1WTXOXbFd3EEzUP/a3/l+kHAgahRfLODbJ2ZomjmCbHgYdGA+K6QWYbCPPJF8NQXyUtV3M90m/+HNm/ZYRBJDHViXoncAC4z6WNt8wSP5VQiXEtHzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875461; h=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=ITpiHeu1IxA8t2wdEdec6BcjzxnU/v/+ssiPkXMtCSE=; b=ib9FM7G9wSjOPAjdYqjwBjcXOEN/UDM76YrIvWfcqQfZuNyMMq6Oa1tnnNKI9vdEgsk2Q8yirxCn3IlB4u5HDwcjwiwgKcOcxpe857hTngkWH0EO3A1fRN0xvkPORdnuNtCebOZkIJMW70d/8lkKzmCEHgYJ0G4DxzCMoO0eNFk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875461449162.1520146821391; Mon, 24 May 2021 09:57:41 -0700 (PDT) Received: from localhost ([::1]:34008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDtc-00035u-6e for importer2@patchew.org; Mon, 24 May 2021 12:57:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004oK-D2 for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:34701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004LO-JO for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:57 -0400 Received: by mail-ej1-x62c.google.com with SMTP id p24so41549120ejb.1 for ; Mon, 24 May 2021 09:41:36 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ITpiHeu1IxA8t2wdEdec6BcjzxnU/v/+ssiPkXMtCSE=; b=D+eyxZ9GkHmfbweXrBZ0DHXqcDBq3vomgVr1ZM1eAu3u/STB4jGbPwzPx16pWie70/ obdi1PDXIx/a4HEeqBb+G75REWChdBRXXfZa3eATYxuwOw7p9iSREyQQN7xQKF4+K4uU u53dfQ62GVttuSd22OImggpfVX4ipNG10CJlLcVHIin8g/H+qho6aVkOKagu2ZYgtWCy iODCBw0PV3BiYr8EJLJ321CbmS9hPd4Uup6gDnlFQV/bsgLhtAm1kr4vMGrbqB49bDri LwGn2bYfSwP/iaMv0p5GzeY+n292HNshtDrExGIA9YXg9T2T3h1L3Wt0/LrPBCKWWvTa lgTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ITpiHeu1IxA8t2wdEdec6BcjzxnU/v/+ssiPkXMtCSE=; b=t38P4cMKgvEAoBlGBSQhQh6IHMwloQ3SU+7XwL7GwKaWiXbLFXwUYYXpveaSMScXiM 6tGRKXpOFOtVX0w1KR7p3RHRhhsax9nmpfCAgPxguuLe+h7jNwpe1YlUTNCZYkV1rafl 67FORGgid6bfl5jdqsooDT1/47jO1a+zYNDVNSG4xus4FRp1kiHHWg3YSZsd5gWe4GSF pDLEBfIzy1UpJd0t9qA2NzKqpdcdMfOTSUXbLtk1SiCBQTGC6U05fRjLjS7rncyx4tDU RqxAmyLwCU/02PkBKTPBf1XROmM2Gp5/q8rU2dSnZo1z0uohe+coDrUSluZ463yZ6/Ae DwOQ== X-Gm-Message-State: AOAM532QhQCAdTn0u5ESYEcZCUF8yLTdVImcbWZjzHkZAmZ2HBgzEUOY FJDHZ22RYRQfmM8L+/x51oyjSQWKZLkpLA== X-Google-Smtp-Source: ABdhPJxJdAfqziQsaGLO7uOo3x62MmG43/kCu42+Ty9chI0JQbUhRDlGhkmk7z77w8TZytLQ+bHfcg== X-Received: by 2002:a17:906:bc43:: with SMTP id s3mr24578675ejv.76.1621874495709; Mon, 24 May 2021 09:41:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/28] i386/cpu: Expose AVX_VNNI instruction to guest Date: Mon, 24 May 2021 18:41:08 +0200 Message-Id: <20210524164131.383778-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Yang Zhong Expose AVX (VEX-encoded) versions of the Vector Neural Network Instructions to guest. The bit definition: CPUID.(EAX=3D7,ECX=3D1):EAX[bit 4] AVX_VNNI The following instructions are available when this feature is present in the guest. 1. VPDPBUS: Multiply and Add Unsigned and Signed Bytes 2. VPDPBUSDS: Multiply and Add Unsigned and Signed Bytes with Saturation 3. VPDPWSSD: Multiply and Add Signed Word Integers 4. VPDPWSSDS: Multiply and Add Signed Integers with Saturation As for the kvm related code, please reference Linux commit id 1085a6b585d7. The release document ref below link: https://software.intel.com/content/www/us/en/develop/download/\ intel-architecture-instruction-set-extensions-programming-reference.html Signed-off-by: Yang Zhong Message-Id: <20210407015609.22936-1-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 ++-- target/i386/cpu.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c496bfa1c2..9e211ac2ce 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -940,7 +940,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D { .type =3D CPUID_FEATURE_WORD, .feat_names =3D { NULL, NULL, NULL, NULL, - NULL, "avx512-bf16", NULL, NULL, + "avx-vnni", "avx512-bf16", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -3194,7 +3194,7 @@ static X86CPUDefinition builtin_x86_defs[] =3D { MSR_ARCH_CAP_SKIP_L1DFL_VMENTRY | MSR_ARCH_CAP_MDS_NO | MSR_ARCH_CAP_PSCHANGE_MC_NO | MSR_ARCH_CAP_TAA_NO, .features[FEAT_7_1_EAX] =3D - CPUID_7_1_EAX_AVX512_BF16, + CPUID_7_1_EAX_AVX_VNNI | CPUID_7_1_EAX_AVX512_BF16, /* * Missing: XSAVES (not supported by some Linux versions, * including v4.1 to v4.12). diff --git a/target/i386/cpu.h b/target/i386/cpu.h index e6836393f7..da72aa5228 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -817,6 +817,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; /* Speculative Store Bypass Disable */ #define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) =20 +/* AVX VNNI Instruction */ +#define CPUID_7_1_EAX_AVX_VNNI (1U << 4) /* AVX512 BFloat16 Instruction */ #define CPUID_7_1_EAX_AVX512_BF16 (1U << 5) =20 --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876018; cv=none; d=zohomail.com; s=zohoarc; b=OW0Ck1RkkliAYGR3+7BS1qPqDa5gXH0fc7/8FrlMHyXL89NTCuNXT+dL7wv2EgvVhCpHzQhhZShG9lWwRPSU6Lz4vLuf50DvyZm++VUB6cykr2veNlhsBW2McNJMxXZgTc2XuZphXfufSirshFD1uYfVhb5r0EBIWJ0U18nh3vw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876018; h=Content-Transfer-Encoding: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=wULB0dT529terV3VemdiO1RbK/5UYU6YHyBr4JHxFbU=; b=T6maXlvWCacbZnMm2uPp5dqIzP00eXRQu/j942KHiCfEX4tiOtX4qwf+GIgBlgaHSiRXaqot3znQBCXWTfxZPmp6gcPtzIqd5VN3WP4nOrjo+lUgFr7A6yrBuRMJbpO+znmA4sCdnfZsB+FSaXaqFhFMmwed73oGxIMicVNOg84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876018905808.2383434946735; Mon, 24 May 2021 10:06:58 -0700 (PDT) Received: from localhost ([::1]:57114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE2Y-0002MZ-KZ for importer2@patchew.org; Mon, 24 May 2021 13:06:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004o7-9i for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:43918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004LT-Fu for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:56 -0400 Received: by mail-ej1-x633.google.com with SMTP id f18so12624017ejq.10 for ; Mon, 24 May 2021 09:41:37 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wULB0dT529terV3VemdiO1RbK/5UYU6YHyBr4JHxFbU=; b=mIE6nmxjwT50+xy58ba/L1HWXFR2FvOaWppFbmwuciJwMx2+Ob4rJqVjqxNal5UG18 VI1Xf4HrC/L91h5F26yPjrSyeQ9L1LQktDRC8jEoj15f2vTR3njR4g1O8EzAmN/8nwvX i/8qzMm5v2JzCMNtP0JagEI0iSFD07axbTgBvAF7GfIUL2T0jljMSPGPugcahmWfEGet 5mDZ5I45/RU5IisRY301ijqxTbg1VvbuNTK3zcQ/k6LtxkIhnSGRnOli86+KY1V47B1H ZcaYQtJdCOuuBGKfcNtNZ/avVh9WiJSOMAGBrSoPLPKFbayDBb7nIS8LtafJf8K79h2y nspA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wULB0dT529terV3VemdiO1RbK/5UYU6YHyBr4JHxFbU=; b=Ex0Z6V41WCaSaEGcaxN5hR/XlNogkZcCRAGDBTkVZozWU1ybaBGSv8khzbAL3jJaPe mX9PhxKhxlJqlH5sVA2J5RHSfek8COFtEv+oBl45HUpk1MyPHnPrMOmhqo3NkxBwzlnI 3+ae984b+xYi27TpADbL9YbEjVfbP0iFVPlsUIsIPUXLJN3n5Ksoluy3QVcdPHhDzSrB n22LSizBrNmAhfTUGR2LAL7/qMJy4PeXjknBx9YSjLtgY7OXW8IHA0X2o4rhoI+R9dM/ uSxCZfzEhD5FoxUoDqzGfG9yRDUR07rmFanV+BRHvfK2tEsgsDs+m16Y0G0lmBUCqzav yjTA== X-Gm-Message-State: AOAM532jN/+XSwgxgj+d0yR868ASZvkmEWn9jPYYCe2iPefpGaEWPvO+ IivdrG0ogPggUlOoigpWqyzK3t/DEd17xg== X-Google-Smtp-Source: ABdhPJznFr93j3ui+YfjKhAApDwrpl9v6AUG/n1gLUDf9JQRpADJwADMeSZDOV50kNnSoREFyfwoLA== X-Received: by 2002:a17:907:abc:: with SMTP id bz28mr23754293ejc.262.1621874496398; Mon, 24 May 2021 09:41:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/28] object: add more commands to preconfig mode Date: Mon, 24 May 2021 18:41:09 +0200 Message-Id: <20210524164131.383778-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Creating and destroying QOM objects does not require a fully constructed machine. Allow running object-add and object-del before machine initialization has concluded. Signed-off-by: Paolo Bonzini --- hmp-commands.hx | 2 ++ qapi/qom.json | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 435c591a1c..146a13c896 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1297,6 +1297,7 @@ ERST .help =3D "create QOM object", .cmd =3D hmp_object_add, .command_completion =3D object_add_completion, + .flags =3D "p", }, =20 SRST @@ -1311,6 +1312,7 @@ ERST .help =3D "destroy QOM object", .cmd =3D hmp_object_del, .command_completion =3D object_del_completion, + .flags =3D "p", }, =20 SRST diff --git a/qapi/qom.json b/qapi/qom.json index 40d70c434a..4f48035831 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -857,7 +857,8 @@ # <- { "return": {} } # ## -{ 'command': 'object-add', 'data': 'ObjectOptions', 'boxed': true } +{ 'command': 'object-add', 'data': 'ObjectOptions', 'boxed': true, + 'allow-preconfig': true } =20 ## # @object-del: @@ -877,4 +878,5 @@ # <- { "return": {} } # ## -{ 'command': 'object-del', 'data': {'id': 'str'} } +{ 'command': 'object-del', 'data': {'id': 'str'}, + 'allow-preconfig': true } --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876207; cv=none; d=zohomail.com; s=zohoarc; b=J2EDf3XQ9DvBhscGnEiypbyiylm1rcSEgkjOlCvEHs8GKQi6i3/z5SlSb0ho4/meV/YX5kf5FoaKrpws33+AZsbo8lMi26JGGbWQoSdWOganfKAslglUEH2yCqJzO069MYlgjviBGXzPiBXcjxxeikp+G0zF0Vujv6YUXJ66J58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876207; h=Content-Transfer-Encoding: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=n0ESrrlkPNYORxFxIwPYPdD/Q8ItticQuxAzhMcT+48=; b=F4Fmsdc7Z6Vfi3skhUXtYzmEB5mNbB0ow46Q+UNhYngg6Ji6ikx4I3iEQhZ9CXAR9Gmj4xk923ArCC2pgaao0aBwiakh+4sy3Oj826OhnuqJqt9zxp2EhHU5YegQGBbc7GC4PpLKzOFjNMrWIndXJJGkStg52dMMW2RwKTH3pss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876207695252.41560776657593; Mon, 24 May 2021 10:10:07 -0700 (PDT) Received: from localhost ([::1]:37516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE5e-0000cL-IT for importer2@patchew.org; Mon, 24 May 2021 13:10:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeU-00055b-Oe for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:04 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:36446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004Ld-6A for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:02 -0400 Received: by mail-ej1-x632.google.com with SMTP id c20so42855739ejm.3 for ; Mon, 24 May 2021 09:41:38 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n0ESrrlkPNYORxFxIwPYPdD/Q8ItticQuxAzhMcT+48=; b=obCk7aEXRwcEVEvsayjNoORAS85CONOWQVOoUcIL93OxujtYzKbwILbrzjRh9C5emq eLk1UlfsjlmjTS9Vdz+E1OCU987aqw6ELrx9uX5UO0Vx0V56fYcZBJVBgmFrsWlBP74L fT2MfdVd9QoFErQfzIulUlCJRyCymJcHGy0AMPCfhjn9dEYxIOVCPLRC2IDWFmd+8Asp 97TrsIdGpBvUpLIVrBj01QOE6yIeruXpmGqFeOChFR1oL5tzL0JyNM+ksQTHRi6CvX81 eTpC7XwLVi00ppObLTQYZ0R9q9BBpwNb0nJFByC7eGEvzdfqhGECCFolT2i5AaX3CZ9C q0Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=n0ESrrlkPNYORxFxIwPYPdD/Q8ItticQuxAzhMcT+48=; b=oJZuYPafm1o3YxydIQ4rmDaefwxBAyu5E/pQFea0P+niz1x/85ZEtvV0CM5TVoRWG5 Y4mSPYXd952B/jcIxYrxF987mWKDRCs9tk5VjsqRyqo9w/IcuXxcBe+FBV2bqwJkvt/L xq2ch2oXXyyUVR3UKZNbq6tVXnjImgXaPwBbtBJ9cnt5I3hpwJSrARbaiEco4/Gzav+x ZK8sql4SCQbFDjpzROwjVVib1xtn4bksoeSEE97F9bdsi+mPAfIWjtAxCra4KVbZ9AS6 p23h1zfxS1lE71zfMtK/8QLckAjuqpCytW6P87bnMhY8MeasXKATVWxcxMh/xeHAlPfa dk+A== X-Gm-Message-State: AOAM530u0EucUA1dPi+/+jXgUUVKhvh+A+SdbOe9kWsszs936/8h8G4r 5hv7q87WdmbPtUj4MQBc1BS6v/eJPeY9TQ== X-Google-Smtp-Source: ABdhPJxbuYcxLJ0T25XcfaClJpVgfzwRQ0CAAcq5fuCnsvHU/mX9m4HsAUEwclEPc3/bWbO/h0s3/A== X-Received: by 2002:a17:907:98a9:: with SMTP id ju9mr23973845ejc.257.1621874497219; Mon, 24 May 2021 09:41:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/28] qtest: add a QOM object for qtest Date: Mon, 24 May 2021 18:41:10 +0200 Message-Id: <20210524164131.383778-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The qtest server right now can only be created using the -qtest and -qtest-log options. Allow an alternative way to create it using "-object qtest,chardev=3D...,log=3D...". This is part of the long term plan to make more (or all) of QEMU configurable through QMP and preconfig mode. Signed-off-by: Paolo Bonzini --- qapi/qom.json | 17 +++++ softmmu/qtest.c | 185 +++++++++++++++++++++++++++++++++++++++++++++--- softmmu/vl.c | 5 +- 3 files changed, 196 insertions(+), 11 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index 4f48035831..f7ef30f940 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -644,6 +644,21 @@ { 'struct': 'PrManagerHelperProperties', 'data': { 'path': 'str' } } =20 +## +# @QtestProperties: +# +# Properties for qtest objects. +# +# @chardev: the chardev to be used to receive qtest commands on. +# +# @log: the path to a log file +# +# Since: 6.0 +## +{ 'struct': 'QtestProperties', + 'data': { 'chardev': 'str', + '*log': 'str' } } + ## # @RemoteObjectProperties: # @@ -769,6 +784,7 @@ 'memory-backend-ram', 'pef-guest', 'pr-manager-helper', + 'qtest', 'rng-builtin', 'rng-egd', 'rng-random', @@ -825,6 +841,7 @@ 'if': 'defined(CONFIG_LINUX)' }, 'memory-backend-ram': 'MemoryBackendProperties', 'pr-manager-helper': 'PrManagerHelperProperties', + 'qtest': 'QtestProperties', 'rng-builtin': 'RngProperties', 'rng-egd': 'RngEgdProperties', 'rng-random': 'RngRandomProperties', diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 130c366615..72751e1fd8 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -27,6 +27,8 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/cutils.h" +#include "qapi/qmp/qerror.h" +#include "qom/object_interfaces.h" #include CONFIG_DEVICES #ifdef CONFIG_PSERIES #include "hw/ppc/spapr_rtas.h" @@ -34,11 +36,25 @@ =20 #define MAX_IRQ 256 =20 +#define TYPE_QTEST "qtest" + +OBJECT_DECLARE_SIMPLE_TYPE(QTest, QTEST) + +struct QTest { + Object parent; + + bool has_machine_link; + char *chr_name; + Chardev *chr; + CharBackend qtest_chr; + char *log; +}; + bool qtest_allowed; =20 static DeviceState *irq_intercept_dev; static FILE *qtest_log_fp; -static CharBackend qtest_chr; +static QTest *qtest; static GString *inbuf; static int irq_levels[MAX_IRQ]; static qemu_timeval start_time; @@ -320,7 +336,7 @@ static void qtest_irq_handler(void *opaque, int n, int = level) qemu_set_irq(old_irq, level); =20 if (irq_levels[n] !=3D level) { - CharBackend *chr =3D &qtest_chr; + CharBackend *chr =3D &qtest->qtest_chr; irq_levels[n] =3D level; qtest_send_prefix(chr); qtest_sendf(chr, "IRQ %s %d\n", @@ -849,18 +865,39 @@ static void qtest_event(void *opaque, QEMUChrEvent ev= ent) break; } } + void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Er= ror **errp) { + ERRP_GUARD(); Chardev *chr; + Object *qtest; =20 chr =3D qemu_chr_new("qtest", qtest_chrdev, NULL); - if (chr =3D=3D NULL) { error_setg(errp, "Failed to initialize device for qtest: \"%s\"", qtest_chrdev); return; } =20 + qtest =3D object_new(TYPE_QTEST); + object_property_set_str(qtest, "chardev", "qtest", &error_abort); + if (qtest_log) { + object_property_set_str(qtest, "log", qtest_log, &error_abort); + } + object_property_add_child(qdev_get_machine(), "qtest", qtest); + user_creatable_complete(USER_CREATABLE(qtest), errp); + if (*errp) { + object_unparent(qtest); + } + object_unref(OBJECT(chr)); + object_unref(qtest); +} + +static bool qtest_server_start(QTest *q, Error **errp) +{ + Chardev *chr =3D q->chr; + const char *qtest_log =3D q->log; + if (qtest_log) { if (strcmp(qtest_log, "none") !=3D 0) { qtest_log_fp =3D fopen(qtest_log, "w+"); @@ -869,16 +906,20 @@ void qtest_server_init(const char *qtest_chrdev, cons= t char *qtest_log, Error ** qtest_log_fp =3D stderr; } =20 - qemu_chr_fe_init(&qtest_chr, chr, errp); - qemu_chr_fe_set_handlers(&qtest_chr, qtest_can_read, qtest_read, - qtest_event, NULL, &qtest_chr, NULL, true); - qemu_chr_fe_set_echo(&qtest_chr, true); + if (!qemu_chr_fe_init(&q->qtest_chr, chr, errp)) { + return false; + } + qemu_chr_fe_set_handlers(&q->qtest_chr, qtest_can_read, qtest_read, + qtest_event, NULL, &q->qtest_chr, NULL, true); + qemu_chr_fe_set_echo(&q->qtest_chr, true); =20 inbuf =3D g_string_new(""); =20 if (!qtest_server_send) { - qtest_server_set_send_handler(qtest_server_char_be_send, &qtest_ch= r); + qtest_server_set_send_handler(qtest_server_char_be_send, &q->qtest= _chr); } + qtest =3D q; + return true; } =20 void qtest_server_set_send_handler(void (*send)(void*, const char*), @@ -890,7 +931,7 @@ void qtest_server_set_send_handler(void (*send)(void*, = const char*), =20 bool qtest_driver(void) { - return qtest_chr.chr !=3D NULL; + return qtest && qtest->qtest_chr.chr !=3D NULL; } =20 void qtest_server_inproc_recv(void *dummy, const char *buf) @@ -905,3 +946,129 @@ void qtest_server_inproc_recv(void *dummy, const char= *buf) g_string_truncate(gstr, 0); } } + +static void qtest_complete(UserCreatable *uc, Error **errp) +{ + QTest *q =3D QTEST(uc); + if (qtest) { + error_setg(errp, "Only one instance of qtest can be created"); + return; + } + if (!q->chr_name) { + error_setg(errp, "No backend specified"); + return; + } + + if (OBJECT(uc)->parent !=3D qdev_get_machine()) { + q->has_machine_link =3D true; + object_property_add_const_link(qdev_get_machine(), "qtest", OBJECT= (uc)); + } else { + /* -qtest was used. */ + } + + qtest_server_start(q, errp); +} + +static void qtest_unparent(Object *obj) +{ + QTest *q =3D QTEST(obj); + + if (qtest =3D=3D q) { + qemu_chr_fe_disconnect(&q->qtest_chr); + assert(!qtest_opened); + qemu_chr_fe_deinit(&q->qtest_chr, false); + if (qtest_log_fp) { + fclose(qtest_log_fp); + qtest_log_fp =3D NULL; + } + qtest =3D NULL; + } + + if (q->has_machine_link) { + object_property_del(qdev_get_machine(), "qtest"); + q->has_machine_link =3D false; + } +} + +static void qtest_set_log(Object *obj, const char *value, Error **errp) +{ + QTest *q =3D QTEST(obj); + + if (qtest =3D=3D q) { + error_setg(errp, QERR_PERMISSION_DENIED); + } else { + g_free(q->log); + q->log =3D g_strdup(value); + } +} + +static char *qtest_get_log(Object *obj, Error **errp) +{ + QTest *q =3D QTEST(obj); + + return g_strdup(q->log); +} + +static void qtest_set_chardev(Object *obj, const char *value, Error **errp) +{ + QTest *q =3D QTEST(obj); + Chardev *chr; + + if (qtest =3D=3D q) { + error_setg(errp, QERR_PERMISSION_DENIED); + return; + } + + chr =3D qemu_chr_find(value); + if (!chr) { + error_setg(errp, "Cannot find character device '%s'", value); + return; + } + + g_free(q->chr_name); + q->chr_name =3D g_strdup(value); + + if (q->chr) { + object_unref(q->chr); + } + q->chr =3D chr; + object_ref(chr); +} + +static char *qtest_get_chardev(Object *obj, Error **errp) +{ + QTest *q =3D QTEST(obj); + + return g_strdup(q->chr_name); +} + +static void qtest_class_init(ObjectClass *oc, void *data) +{ + UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); + + oc->unparent =3D qtest_unparent; + ucc->complete =3D qtest_complete; + + object_class_property_add_str(oc, "chardev", + qtest_get_chardev, qtest_set_chardev); + object_class_property_add_str(oc, "log", + qtest_get_log, qtest_set_log); +} + +static const TypeInfo qtest_info =3D { + .name =3D TYPE_QTEST, + .parent =3D TYPE_OBJECT, + .class_init =3D qtest_class_init, + .instance_size =3D sizeof(QTest), + .interfaces =3D (InterfaceInfo[]) { + { TYPE_USER_CREATABLE }, + { } + } +}; + +static void register_types(void) +{ + type_register_static(&qtest_info); +} + +type_init(register_types); diff --git a/softmmu/vl.c b/softmmu/vl.c index 93e78469bc..11ac3750d8 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1758,8 +1758,9 @@ static bool object_create_early(const char *type) * add one, state the reason in a comment! */ =20 - /* Reason: rng-egd property "chardev" */ - if (g_str_equal(type, "rng-egd")) { + /* Reason: property "chardev" */ + if (g_str_equal(type, "rng-egd") || + g_str_equal(type, "qtest")) { return false; } =20 --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875436; cv=none; d=zohomail.com; s=zohoarc; b=d/QO+VCIkjGTSWlvJbderXt9BGa31iYa3Nja1zdxyn2HwELlsPzEehZ9ClfrclqVk6SQf2vNZTQrnpO5IRcrQwiwsOc7Z+Fbo7xtqnEdZEgB8k0K0HM4PqNE/f+aTrZ6tYiMwo3GUo1AkZqwv/JCqBh1pOsBFmgiAXYMUjR/BJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875436; h=Content-Transfer-Encoding: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=3MqmAP7pwRW97qJ1+MtqhBMp1/DFWPX7Op2JzM69PlU=; b=g5HPrlAWg1E++Sv5U5KclC/Me2hArOh7OxOnGeoEiM5F1L+H8LrzSv40RXQci0Np5/lVfwzMRwkRUG/JLeHRkeRXGFR14i+qAKHrrkZFFJpTkYJhW2sTMqcQkhokqVlA83vPo6c6Jzdi4SfJT9ddsHs32zQ936/vm/jIgReCF1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875436921163.85882203557935; Mon, 24 May 2021 09:57:16 -0700 (PDT) Received: from localhost ([::1]:60230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDtD-0001fg-Un for importer2@patchew.org; Mon, 24 May 2021 12:57:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeK-0004jP-Oi for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:53 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:38888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeG-0004Lh-QR for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:51 -0400 Received: by mail-ej1-x630.google.com with SMTP id i7so24954819ejc.5 for ; Mon, 24 May 2021 09:41:38 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3MqmAP7pwRW97qJ1+MtqhBMp1/DFWPX7Op2JzM69PlU=; b=ecGHdJKBJUyslijffhvty1GXYgfgVFWcWLTEIXQ3s4CG6zcoezC8D0cp20nbLWCgq2 bfoVfeOLfZ0iK5RwdRbL9bt6A26dTwbmdy4gXiwvYBXLlHaK5wYsvypG8UO8GRn5tbiU TjtS4sHcvr8MW5Yc+g5X3Q6P645kgzRZqZugAkg87XN0xUyRPC4J5WHRN5Lu04PLnh6m JEvLPhX6K8vQZ/RZGZrF/JmSnECbwM1DshBA2h73Ei039SBdSlzPzUu6dBTK5Egq61G8 FUrdjMWwPM77NWv/ZFje/MRrL+2osazkwaY/iPXm4jfq/eyPWMhBWWD2RmW5UjyqFOnD BHXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3MqmAP7pwRW97qJ1+MtqhBMp1/DFWPX7Op2JzM69PlU=; b=XkQIzNkLNx6xkgHHfVBWz3PDEPwa+F0/Xn8AYGFdoWJ+yvMYjpCkIksLWmKmJdiCCC HRpYaBAPpnLfB70P7h+Rwbjmd1/wS7SDovluYxS6Zkfv0VWfKlwoQ4/G7VvxKGY+AGYT V7k6yMhR3cVFU6tFpB+fExWATyDVpa8zMn+0oBUQMc4G0OmXzBV4s5Twt5C9lxtackWz SxSt9IrzvbPgTovPMPrX6k5tlIPMisEHyfDq2QZseVetRhJy+JLroKd/nWLvPkqSvPaL ccXry0cOwbFHSWonejJE8Rk5qbDjIdXkdvfBtf1CuoOY3Y8xurklmPOWAyBPldXYKquK LZeA== X-Gm-Message-State: AOAM530xxJMj/qOrHmkYLPaCjcWNRZDBFdcnuEQQ4p/6qtwyij9IKgTX JCHXsN0uFV4/KcjAQKjo6T6MgKfiNCw0+g== X-Google-Smtp-Source: ABdhPJwLlZZ1/zjsJN6oYZRpU91IChfQ6uMNVbnFG6MXU4g0MwGc7Ht3t0+v+a1CjfGSS3idIuEdvQ== X-Received: by 2002:a17:906:71a:: with SMTP id y26mr21774525ejb.491.1621874497957; Mon, 24 May 2021 09:41:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/28] KVM: do not allow setting properties at runtime Date: Mon, 24 May 2021 18:41:11 +0200 Message-Id: <20210524164131.383778-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Only allow accelerator properties to be set when the accelerator is being created. Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4e0168e88b..54c0860979 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2017,7 +2017,6 @@ static int kvm_init(MachineState *ms) QTAILQ_INIT(&s->kvm_sw_breakpoints); #endif QLIST_INIT(&s->kvm_parked_vcpus); - s->vmfd =3D -1; s->fd =3D qemu_open_old("/dev/kvm", O_RDWR); if (s->fd =3D=3D -1) { fprintf(stderr, "Could not access KVM kernel module: %m\n"); @@ -3112,6 +3111,11 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visi= tor *v, KVMState *s =3D KVM_STATE(obj); int64_t value; =20 + if (s->fd !=3D -1) { + error_setg(errp, "Cannot set properties after the accelerator has = been initialized"); + return; + } + if (!visit_type_int(v, name, &value, errp)) { return; } @@ -3126,6 +3130,11 @@ static void kvm_set_kernel_irqchip(Object *obj, Visi= tor *v, KVMState *s =3D KVM_STATE(obj); OnOffSplit mode; =20 + if (s->fd !=3D -1) { + error_setg(errp, "Cannot set properties after the accelerator has = been initialized"); + return; + } + if (!visit_type_OnOffSplit(v, name, &mode, errp)) { return; } @@ -3172,6 +3181,8 @@ static void kvm_accel_instance_init(Object *obj) { KVMState *s =3D KVM_STATE(obj); =20 + s->fd =3D -1; + s->vmfd =3D -1; s->kvm_shadow_mem =3D -1; s->kernel_irqchip_allowed =3D true; s->kernel_irqchip_split =3D ON_OFF_AUTO_AUTO; --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876866; cv=none; d=zohomail.com; s=zohoarc; b=TTl7XM2YURHaPnGIoo4C/pT09hUl+OrBk06JOfs7xgcM2ElpJuqvzifOTik5ZhUdvVhVXpFqgghoPUen9isGBliWKFO0KNCVTxUkuEg8xY47ljV7g8qx9lDecR8usi3p+i6nFr6U2Jy/nTNygAPTe5hkFbP0VRZY22NezdCbeUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876866; h=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=wOmCbiEylv+BfpPB3BvKqjoJGXomxSB65srB+i+LnhU=; b=bO7uo0Mqb07i7PBHzdHE+uHAaqICJB3Sl/9VL1LYt8E4yEwGvcwoyEyy/M1lJeId4NmYefVkTt6KIi2HQpOhOd8uHf3ePBUd4y+WoMMFNLTjMNkfEx576bzEgeR07S4YQW+VhczYHSwFC5txhhRS+FpyPHkD6mz3haotG0km0Mg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876866571232.13695395813068; Mon, 24 May 2021 10:21:06 -0700 (PDT) Received: from localhost ([::1]:35332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llEGH-0001bZ-Ff for importer2@patchew.org; Mon, 24 May 2021 13:21:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeR-0004s3-9Z for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:59 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:37679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004Lo-LG for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: by mail-ed1-x52b.google.com with SMTP id g7so20568166edm.4 for ; Mon, 24 May 2021 09:41:39 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wOmCbiEylv+BfpPB3BvKqjoJGXomxSB65srB+i+LnhU=; b=oRZBhBUczjvU1ZqY+UmEqWI7ONxaiedbl6hSLd8ng9WdkOZLYWhGo2TttxfOUUHlu/ 3fCVXI4oPR6eh1gVKL014mnkNfYlR8OS1Pj1BITPUL+joCTnLmkB5G9zy2BUsaIUEcz1 BwamyvuUD9rEH1OCLdAv9Y4m9rNUNpGVq1MLyiqfVLb3J6A4rwAWlIZ5IsZsJRwJxVt9 aPM1vd+gz55eCfOWCXIsGi2qCm7nwyn7nkvAEWZOhouGRQZiJySNsnSpE+s3mtlk39UR YvOe6P/W0WjVtGqIkMe+KKfMHxSdWQ+2EIlk9YUwzi5q8Av2mJzpjKz5WziR+eBgdXhl 00Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wOmCbiEylv+BfpPB3BvKqjoJGXomxSB65srB+i+LnhU=; b=jitLUVCsW7BtLS2NFG6PqI1eANoXKvmu3z3BlZIaf2HBIYX6NcjQYSfP2d2PRxQfoh SZ6W+UtPlabaYnGSflhz3IdRdpTIYrVwW+pfb8Sldk59bW/I4X5gQ8pBpfpuIMHJt0iG +6sDxp9fTvbnQvfkeidtyTjMqCXKl6karo+2Cmca7RS9Iv0K9d4YtfgEOZyGWtGIkl16 oh9VII0njYFZ18nfA5Rw7iif1QF8IuB3xjhRzebBuQxu92Ley6v7jHnLTghUCnRz2y3J wRxZ3iV08UVhVmiHOruDHNN2mL1gxLPETWCYxntq81d5mCcnp6yj65hel5J2/1fQ37xy ZXhg== X-Gm-Message-State: AOAM532sBE9TcAfeya1xW+fm/dIX4uuImhp33nOnETD1e46uJe2uvUcR p0Ie55FXCfJ4Jcj5H02MGALfIVwJwfzVUA== X-Google-Smtp-Source: ABdhPJzp4Pr/k3iykJ0txMa/ZfyUS8MoLMex8Ohn8ReECs5E/vOf06m8Xkum/qfsEH1zMNiNfBLaxA== X-Received: by 2002:a05:6402:424c:: with SMTP id g12mr23068130edb.145.1621874498676; Mon, 24 May 2021 09:41:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/28] memory: Introduce log_sync_global() to memory listener Date: Mon, 24 May 2021 18:41:12 +0200 Message-Id: <20210524164131.383778-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr . David Alan Gilbert" , Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu Some of the memory listener may want to do log synchronization without being able to specify a range of memory to sync but always globally. Such a memory listener should provide this new method instead of the log_sync() method. Obviously we can also achieve similar thing when we put the global sync logic into a log_sync() handler. However that's not efficient enough because otherwise memory_global_dirty_log_sync() may do the global sync N times, where N is the number of flat ranges in the address space. Make this new method be exclusive to log_sync(). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 12 ++++++++++++ softmmu/memory.c | 33 +++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index c8b9088924..e38b7e3dce 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -616,6 +616,18 @@ struct MemoryListener { */ void (*log_sync)(MemoryListener *listener, MemoryRegionSection *sectio= n); =20 + /** + * @log_sync_global: + * + * This is the global version of @log_sync when the listener does + * not have a way to synchronize the log with finer granularity. + * When the listener registers with @log_sync_global defined, then + * its @log_sync must be NULL. Vice versa. + * + * @listener: The #MemoryListener. + */ + void (*log_sync_global)(MemoryListener *listener); + /** * @log_clear: * diff --git a/softmmu/memory.c b/softmmu/memory.c index 3bb533c0bc..c19b0be6b1 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -2055,6 +2055,10 @@ void memory_region_set_dirty(MemoryRegion *mr, hwadd= r addr, memory_region_get_dirty_log_mask(m= r)); } =20 +/* + * If memory region `mr' is NULL, do global sync. Otherwise, sync + * dirty bitmap for the specified memory region. + */ static void memory_region_sync_dirty_bitmap(MemoryRegion *mr) { MemoryListener *listener; @@ -2068,18 +2072,24 @@ static void memory_region_sync_dirty_bitmap(MemoryR= egion *mr) * address space once. */ QTAILQ_FOREACH(listener, &memory_listeners, link) { - if (!listener->log_sync) { - continue; - } - as =3D listener->address_space; - view =3D address_space_get_flatview(as); - FOR_EACH_FLAT_RANGE(fr, view) { - if (fr->dirty_log_mask && (!mr || fr->mr =3D=3D mr)) { - MemoryRegionSection mrs =3D section_from_flat_range(fr, vi= ew); - listener->log_sync(listener, &mrs); + if (listener->log_sync) { + as =3D listener->address_space; + view =3D address_space_get_flatview(as); + FOR_EACH_FLAT_RANGE(fr, view) { + if (fr->dirty_log_mask && (!mr || fr->mr =3D=3D mr)) { + MemoryRegionSection mrs =3D section_from_flat_range(fr= , view); + listener->log_sync(listener, &mrs); + } } + flatview_unref(view); + } else if (listener->log_sync_global) { + /* + * No matter whether MR is specified, what we can do here + * is to do a global sync, because we are not capable to + * sync in a finer granularity. + */ + listener->log_sync_global(listener); } - flatview_unref(view); } } =20 @@ -2767,6 +2777,9 @@ void memory_listener_register(MemoryListener *listene= r, AddressSpace *as) { MemoryListener *other =3D NULL; =20 + /* Only one of them can be defined for a listener */ + assert(!(listener->log_sync && listener->log_sync_global)); + listener->address_space =3D as; if (QTAILQ_EMPTY(&memory_listeners) || listener->priority >=3D QTAILQ_LAST(&memory_listeners)->priorit= y) { --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621874942; cv=none; d=zohomail.com; s=zohoarc; b=mmyeFPrWecgMp/66fV9F5GliStGMj+Narh94CM3kUOh9iwSHj99sPCqR2mNiC4TXWEV1Y/MTnthmAzVJvMBNA4VXTntjjZ5NlXWCM31KQfcrB0iz5wlxua0XOhV0xVZ9VdktPBtIHdtWpRoiUHrp02YtzmPsDKmW2QKY3M/Q5uM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621874942; h=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=Dm9fdtL6t7afNY/kOhuKcUr0Mn8HCiKEsUB/elQwJdU=; b=aExBnE7GbQ19Vx4jhMDqRvtE+MkXQW6dOmc0F8Irti895HCYVJ7rrE9iZG79aEPh5Q87+HJw4G6JIg4bBd2bdBjJd3mQnmATaaxzn5wpNDJSWGM5g1fYTfwprjVE7tZws00MAHAwuVbnad50/oe7NPqC03vbO1TCd5QiSxOPnyE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621874942135107.18946502752146; Mon, 24 May 2021 09:49:02 -0700 (PDT) Received: from localhost ([::1]:36442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDlF-0002O2-49 for importer2@patchew.org; Mon, 24 May 2021 12:49:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeK-0004jK-OJ for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:53 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:39663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004M0-DX for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:52 -0400 Received: by mail-ej1-x629.google.com with SMTP id l1so42788889ejb.6 for ; Mon, 24 May 2021 09:41:40 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dm9fdtL6t7afNY/kOhuKcUr0Mn8HCiKEsUB/elQwJdU=; b=roIJFHelJ/OdE5TALajGmsrL0RLAdyfBHpPlWaS6E8OeJhQVVMFc6Vy/acp5mFD9MW s+XFu1XfgJSVskkyqAl9dyvioa9Y7AvEXjmujuEMOm++P47l3UN2Hiq3QvUois9O4jGo 946XdgUU2lTDeUMuCkqZEiJUB2nezuy69U7WIMZqvlynhpZlxFKZe1EG8pqVoZpoDjUE CHrV0n3bgfnH1mGktYjbR+/Oh/XeUkWoJb+vM6bqC9fbyrTyblRPRu8k+UcVc8xHbCPT d2jUuCOqzNjH3uEsrmLGMnWWVRRlNUkZjziWPFBgLxl0xJ/5rVmvwMAmW+wQ8SDqIfmU jMKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Dm9fdtL6t7afNY/kOhuKcUr0Mn8HCiKEsUB/elQwJdU=; b=PByClJR1+okBUzItBTfwSZe2LODfFD4EppNkX9SdTmAy8kPqGeg6z4zCZxJWoV0KUL eLX61IY+rf2qeQTa1eEcDmuQwrVdjjI4Ua9v+5ulmlHpTe/bVHVQ8nASUM0tPbMcu6nk 6W181RyeHIOpdrR0oQfEUgCoRWDipbLmtF7lmfB8q529HTa+OcSZeshnRStLa1YeeLwJ 1MJLu0Vus4dOWsBwgkpQk06uQIPLho7SDELJXbhxN4YnZaDgziU5BY8yskPa9duH76qd q0S1NVNF1Gz0eh9yWEqO8mAtZfMls5QZ8LSBOkeN6G4CuNYO/yBeGKRvgxyWSt29JmDQ hcgA== X-Gm-Message-State: AOAM530CyNhNgw18c9nnqBumWMhA6Vt9kclxeJrR8NHAOs2QTGq68FL+ WWhw2J1GX26AKCKbBSTEh1pg4LoWRaezKA== X-Google-Smtp-Source: ABdhPJxzn6fY6fCGPKNccnuf8miCNN+MBJH4xKbJcTJiSXYva4bK2g/8Lh0jek/zFMi5/nXLjN6GNw== X-Received: by 2002:a17:906:26ce:: with SMTP id u14mr23999302ejc.187.1621874499339; Mon, 24 May 2021 09:41:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/28] KVM: Use a big lock to replace per-kml slots_lock Date: Mon, 24 May 2021 18:41:13 +0200 Message-Id: <20210524164131.383778-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu Per-kml slots_lock will bring some trouble if we want to take all slots_loc= k of all the KMLs, especially when we're in a context that we could have taken s= ome of the KML slots_lock, then we even need to figure out what we've taken and what we need to take. Make this simple by merging all KML slots_lock into a single slots lock. Per-kml slots_lock isn't anything that helpful anyway - so far only x86 has= two address spaces (so, two slots_locks). All the rest archs will be having one address space always, which means there's actually one slots_lock so it wil= l be the same as before. Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-3-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 33 ++++++++++++++++++--------------- include/sysemu/kvm_int.h | 2 -- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 54c0860979..f8980e155b 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -172,8 +172,10 @@ typedef struct KVMResampleFd KVMResampleFd; static QLIST_HEAD(, KVMResampleFd) kvm_resample_fd_list =3D QLIST_HEAD_INITIALIZER(kvm_resample_fd_list); =20 -#define kvm_slots_lock(kml) qemu_mutex_lock(&(kml)->slots_lock) -#define kvm_slots_unlock(kml) qemu_mutex_unlock(&(kml)->slots_lock) +static QemuMutex kml_slots_lock; + +#define kvm_slots_lock() qemu_mutex_lock(&kml_slots_lock) +#define kvm_slots_unlock() qemu_mutex_unlock(&kml_slots_lock) =20 static inline void kvm_resample_fd_remove(int gsi) { @@ -239,9 +241,9 @@ bool kvm_has_free_slot(MachineState *ms) bool result; KVMMemoryListener *kml =3D &s->memory_listener; =20 - kvm_slots_lock(kml); + kvm_slots_lock(); result =3D !!kvm_get_free_slot(kml); - kvm_slots_unlock(kml); + kvm_slots_unlock(); =20 return result; } @@ -307,7 +309,7 @@ int kvm_physical_memory_addr_from_host(KVMState *s, voi= d *ram, KVMMemoryListener *kml =3D &s->memory_listener; int i, ret =3D 0; =20 - kvm_slots_lock(kml); + kvm_slots_lock(); for (i =3D 0; i < s->nr_slots; i++) { KVMSlot *mem =3D &kml->slots[i]; =20 @@ -317,7 +319,7 @@ int kvm_physical_memory_addr_from_host(KVMState *s, voi= d *ram, break; } } - kvm_slots_unlock(kml); + kvm_slots_unlock(); =20 return ret; } @@ -513,7 +515,7 @@ static int kvm_section_update_flags(KVMMemoryListener *= kml, return 0; } =20 - kvm_slots_lock(kml); + kvm_slots_lock(); =20 while (size && !ret) { slot_size =3D MIN(kvm_max_slot_size, size); @@ -529,7 +531,7 @@ static int kvm_section_update_flags(KVMMemoryListener *= kml, } =20 out: - kvm_slots_unlock(kml); + kvm_slots_unlock(); return ret; } =20 @@ -810,7 +812,7 @@ static int kvm_physical_log_clear(KVMMemoryListener *km= l, return ret; } =20 - kvm_slots_lock(kml); + kvm_slots_lock(); =20 for (i =3D 0; i < s->nr_slots; i++) { mem =3D &kml->slots[i]; @@ -836,7 +838,7 @@ static int kvm_physical_log_clear(KVMMemoryListener *km= l, } } =20 - kvm_slots_unlock(kml); + kvm_slots_unlock(); =20 return ret; } @@ -1141,7 +1143,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, ram =3D memory_region_get_ram_ptr(mr) + section->offset_within_region + (start_addr - section->offset_within_address_space); =20 - kvm_slots_lock(kml); + kvm_slots_lock(); =20 if (!add) { do { @@ -1199,7 +1201,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, } while (size); =20 out: - kvm_slots_unlock(kml); + kvm_slots_unlock(); } =20 static void kvm_region_add(MemoryListener *listener, @@ -1226,9 +1228,9 @@ static void kvm_log_sync(MemoryListener *listener, KVMMemoryListener *kml =3D container_of(listener, KVMMemoryListener, l= istener); int r; =20 - kvm_slots_lock(kml); + kvm_slots_lock(); r =3D kvm_physical_sync_dirty_bitmap(kml, section); - kvm_slots_unlock(kml); + kvm_slots_unlock(); if (r < 0) { abort(); } @@ -1328,7 +1330,6 @@ void kvm_memory_listener_register(KVMState *s, KVMMem= oryListener *kml, { int i; =20 - qemu_mutex_init(&kml->slots_lock); kml->slots =3D g_malloc0(s->nr_slots * sizeof(KVMSlot)); kml->as_id =3D as_id; =20 @@ -2001,6 +2002,8 @@ static int kvm_init(MachineState *ms) int type =3D 0; uint64_t dirty_log_manual_caps; =20 + qemu_mutex_init(&kml_slots_lock); + s =3D KVM_STATE(ms->accelerator); =20 /* diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index ccb8869f01..1da30e1884 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -27,8 +27,6 @@ typedef struct KVMSlot =20 typedef struct KVMMemoryListener { MemoryListener listener; - /* Protects the slots and all inside them */ - QemuMutex slots_lock; KVMSlot *slots; int as_id; } KVMMemoryListener; --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875111; cv=none; d=zohomail.com; s=zohoarc; b=YfcRSclc6rhTYiyKWEXDmkURGFX91nTIwHfhuD0Og+DNDp84EPJigNcbbusiEMW8DMHqCTN3gj6UO0s6opXyv0YUeaFcm8HRFWoxI5qeOUpUYn0yZw8fUQpy9pTbd4xYgJEkEmL36Xw3JpfyCFusONiCA1YA7NerQnUamG7RmnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875111; h=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=Cb/EIE1W0YCsIKhSOhonZiq7HmU1guIPixtbSVuS12k=; b=L2UOslzlXpA3NDUZRPx7mep/zUkvu/FAoyLFRL37Nom84ehiE2n0EoFPAmcrPQYhThFA/CdTHw8MXpp6cvnzJ3TtVdxH5JmY51IKTWY5wGOUV5qmnb7vLXEYQNe7gWzykJrNt2DQLLrU941Uw0BI8eS4AY5ceuR/0wTVu1IfQiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875111760122.2705595543631; Mon, 24 May 2021 09:51:51 -0700 (PDT) Received: from localhost ([::1]:45108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDny-0008Gf-L5 for importer2@patchew.org; Mon, 24 May 2021 12:51:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004o3-8O for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:43916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004ME-Gy for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:53 -0400 Received: by mail-ej1-x630.google.com with SMTP id f18so12624343ejq.10 for ; Mon, 24 May 2021 09:41:41 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cb/EIE1W0YCsIKhSOhonZiq7HmU1guIPixtbSVuS12k=; b=QQ/SgtIeFZFKnzpM2bfx+QOW8OveD2eXj4p/JNo17EDyjWE+aFjrXsUz8MVKHRFQ34 DdVkJj/AlgOQp2tGWzU+vLprraNuyghnPAmHXaqL5pCpU1qojxlVudbEiaJW3HJUJRwZ PhFoC0cSwdEuIRFmciHEnaHuFWnmZcphgaQ73lM9cmvmviKcTznl1MW/bhtqkp+0XbW7 1lBkid0dLbS0rtCFDkZ3p8tzg80s2GDMyjngqo2oowJ6WbWNkPKuekqrpKpD6c7RD9HJ ss+klzdW5LTSMOa/UA+i+Q/p+nEZpDcRT9vZaHwZ6uL9uOjOpC89B1jkf58bHB1ppHlO LLtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Cb/EIE1W0YCsIKhSOhonZiq7HmU1guIPixtbSVuS12k=; b=jBqO/YqDEPTn2X4kT1Dpz8wULzPvqLMLWQm55x6CIXxa0gWBbOxK5dKDKLWa9borg7 p2QP6Vzw4ZAJ0wtcPGQh0L5W9FUjM8UBXwzEdYArNdiPq/yrTVbnEq7Il1SCiTweMnRL /i3U7mnBnXd+qm/Ef7s2tSHpJUKnEro4XRbLcMOGRGliP3Ycl//+mAkYDXLPw7v9tt+p SMD1DDi/AiXX92uaOJqHx8QLLdVrZUYLUAriJKogesCEf0cUL5vvZ6N1MLFXqqFsM+h3 EaeTNB9NIVUXdySjRhBBc581Z/Y4kUwDDEBzreXB8gD8mbdHxP8DzX/eWRqAh9ulf6s2 FQiw== X-Gm-Message-State: AOAM5319D4ocffZz4sGe9FKc/5D7nnGikEOYJnXISt3K571WQ+4kEXZL RnVpbPdlwVxD6iVfY7YC5J/s2QoTyEtpIA== X-Google-Smtp-Source: ABdhPJyxPeNI3EvEnColudaANILN8gCNOOS4CUBdAssh099IyQ8LhKHuBPTPiXEuEVpUUIkxOxePJA== X-Received: by 2002:a17:906:d922:: with SMTP id rn2mr24477370ejb.469.1621874500186; Mon, 24 May 2021 09:41:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/28] KVM: Create the KVMSlot dirty bitmap on flag changes Date: Mon, 24 May 2021 18:41:14 +0200 Message-Id: <20210524164131.383778-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr . David Alan Gilbert" , Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu Previously we have two places that will create the per KVMSlot dirty bitmap: 1. When a newly created KVMSlot has dirty logging enabled, 2. When the first log_sync() happens for a memory slot. The 2nd case is lazy-init, while the 1st case is not (which is a fix of what the 2nd case missed). To do explicit initialization of dirty bitmaps, what we're missing is to create the dirty bitmap when the slot changed from not-dirty-track to dirty-track. Do that in kvm_slot_update_flags(). With that, we can safely remove the 2nd lazy-init. This change will be needed for kvm dirty ring because kvm dirty ring does not use the log_sync() interface at all. Also move all the pre-checks into kvm_slot_init_dirty_bitmap(). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-4-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f8980e155b..5bc40fd71b 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -177,6 +177,8 @@ static QemuMutex kml_slots_lock; #define kvm_slots_lock() qemu_mutex_lock(&kml_slots_lock) #define kvm_slots_unlock() qemu_mutex_unlock(&kml_slots_lock) =20 +static void kvm_slot_init_dirty_bitmap(KVMSlot *mem); + static inline void kvm_resample_fd_remove(int gsi) { KVMResampleFd *rfd; @@ -500,6 +502,7 @@ static int kvm_slot_update_flags(KVMMemoryListener *kml= , KVMSlot *mem, return 0; } =20 + kvm_slot_init_dirty_bitmap(mem); return kvm_set_user_memory_region(kml, mem, false); } =20 @@ -584,8 +587,12 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionS= ection *section, #define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1)) =20 /* Allocate the dirty bitmap for a slot */ -static void kvm_memslot_init_dirty_bitmap(KVMSlot *mem) +static void kvm_slot_init_dirty_bitmap(KVMSlot *mem) { + if (!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) || mem->dirty_bmap) { + return; + } + /* * XXX bad kernel interface alert * For dirty bitmap, kernel allocates array of size aligned to @@ -640,11 +647,6 @@ static int kvm_physical_sync_dirty_bitmap(KVMMemoryLis= tener *kml, goto out; } =20 - if (!mem->dirty_bmap) { - /* Allocate on the first log_sync, once and for all */ - kvm_memslot_init_dirty_bitmap(mem); - } - d.dirty_bitmap =3D mem->dirty_bmap; d.slot =3D mem->slot | (kml->as_id << 16); ret =3D kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d); @@ -1181,14 +1183,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, mem->start_addr =3D start_addr; mem->ram =3D ram; mem->flags =3D kvm_mem_flags(mr); - - if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { - /* - * Reallocate the bmap; it means it doesn't disappear in - * middle of a migrate. - */ - kvm_memslot_init_dirty_bitmap(mem); - } + kvm_slot_init_dirty_bitmap(mem); err =3D kvm_set_user_memory_region(kml, mem, true); if (err) { fprintf(stderr, "%s: error registering slot: %s\n", __func__, --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621877783; cv=none; d=zohomail.com; s=zohoarc; b=SISMhyX+rf5pM4oLBu1d9l46syR0UT+zYRgbd3XpuJTtBYOvHiK6nWqq9YPZ3AqxQbs7dkvCGSVYWLErpUEhyKdjs79l/kJaQTW4KcyNA94FO+SNmDLigIp1f9y2bwnZ1ck+QTJnYbsFe6wKEHzucm3eD+YWZo59KeFm2ITbIZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621877783; h=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=yoh7aaW0HkXExKTvgyPRoyUhprnmP0RXGSbOvZabGVI=; b=LxAweUJU+YEPreeXvkdfEhqe9A0Or+cLKXTgzB8wWRVPSDCbFXAXu4eXOeFwvQtTT1r6g1nMrpfItvZQDgstYAa+m8Bqcj9DCVIzBrc+Uj4pE3eUojBM3bCxbPZlJSSXsJ6X/aNcCo/iXtz3rwI7V+tCFCYUu+s87DiHexv/0Us= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621877783959486.5691217675418; Mon, 24 May 2021 10:36:23 -0700 (PDT) Received: from localhost ([::1]:43044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llEV4-00014v-T8 for importer2@patchew.org; Mon, 24 May 2021 13:36:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeU-00055X-OS for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:04 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:36442) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004MS-6R for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:02 -0400 Received: by mail-ej1-x62d.google.com with SMTP id c20so42856068ejm.3 for ; Mon, 24 May 2021 09:41:41 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yoh7aaW0HkXExKTvgyPRoyUhprnmP0RXGSbOvZabGVI=; b=YxCtP9HTWQZ3fma7pN6vIk6ug7EYiPzAL3YuSQrFYYED+tb3cfmZuvaVmNDZApBJrx RhYL+x+QTIiXR3gPPXcmuNP1sb5xeIFhooK0ClgMoRzIRVg0fUb0aaOUtZ5cpK1M/S2V d5GTEi1LpQvF5TNx/0ta8owhKxUrrRpV3qc2AmV6RfaVg+lxuGzzxPPGeyv0H4CnGVcI pN1a0WnuBJALuH5eER+18QoAKMPZLWtJUZqEVeL5bEDatLALvLHbRgLbUna1bJySIZK/ zqryqqEwbxVrmbc/XFX1A+SZh8RZ1awDlde0JUYdyJgut7YyEBeluOC4hsn3oDhcBp6i kOuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yoh7aaW0HkXExKTvgyPRoyUhprnmP0RXGSbOvZabGVI=; b=NGxUkho1QjyBy6BGu1G7mqIhnOITQjrKyr0EMn0xtMJrabsVdDTudDeTmblrodblJm iNYF6lIeccwok5RNeUih6sk4WjGcroZR8HvGJUJ1ptqVOFzHDBoSl1yoVt1aepzQ1+Cq Oh/YkpjUoxSt68COWzXhzhM4DoKdegvuU/OIuKVCocXa86fpvGJEvcWx05NK9Ix+RQfj cx/f4vL7UV51yddKTeJHpVo5TS8jLVEU4xGZOUlLhoxcGxPrtsvCn8V09uYX42Y0A5uI 0z6f2C27N+SCA2rLmyhsQAMIvQX4HlSkM+dS1URoHI9OnuEo0GwDHoARAj+l19K26wyV cauQ== X-Gm-Message-State: AOAM533LGBVNKnB6S0ykqQgWJoLC9tYKN0/oLiCkLrUQs6gjjUzWaA4z jM4mBFoOKR8Csi6ME0iB+obPXAHRMVlBTA== X-Google-Smtp-Source: ABdhPJytkx+Zh8Qg+KJZnYo/v6fWKB5DBpW3ui8pu6KccaaADjEGtcW2Z8IhAEfne3k31uKVYxButw== X-Received: by 2002:a17:906:1f54:: with SMTP id d20mr23739491ejk.94.1621874500882; Mon, 24 May 2021 09:41:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/28] KVM: Provide helper to get kvm dirty log Date: Mon, 24 May 2021 18:41:15 +0200 Message-Id: <20210524164131.383778-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu Provide a helper kvm_slot_get_dirty_log() to make the function kvm_physical_sync_dirty_bitmap() clearer. We can even cache the as_id into KVMSlot when it is created, so that we don't even need to pass it down every time. Since at it, remove return value of kvm_physical_sync_dirty_bitmap() because it should never fail. Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-5-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 52 +++++++++++++++++++++++----------------- include/sysemu/kvm_int.h | 2 ++ 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 5bc40fd71b..caaa2a5c98 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -615,6 +615,30 @@ static void kvm_slot_init_dirty_bitmap(KVMSlot *mem) mem->dirty_bmap =3D g_malloc0(bitmap_size); } =20 +/* + * Sync dirty bitmap from kernel to KVMSlot.dirty_bmap, return true if + * succeeded, false otherwise + */ +static bool kvm_slot_get_dirty_log(KVMState *s, KVMSlot *slot) +{ + struct kvm_dirty_log d =3D {}; + int ret; + + d.dirty_bitmap =3D slot->dirty_bmap; + d.slot =3D slot->slot | (slot->as_id << 16); + ret =3D kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d); + + if (ret =3D=3D -ENOENT) { + /* kernel does not have dirty bitmap in this slot */ + ret =3D 0; + } + if (ret) { + error_report_once("%s: KVM_GET_DIRTY_LOG failed with %d", + __func__, ret); + } + return ret =3D=3D 0; +} + /** * kvm_physical_sync_dirty_bitmap - Sync dirty bitmap from kernel space * @@ -626,15 +650,13 @@ static void kvm_slot_init_dirty_bitmap(KVMSlot *mem) * @kml: the KVM memory listener object * @section: the memory section to sync the dirty bitmap with */ -static int kvm_physical_sync_dirty_bitmap(KVMMemoryListener *kml, - MemoryRegionSection *section) +static void kvm_physical_sync_dirty_bitmap(KVMMemoryListener *kml, + MemoryRegionSection *section) { KVMState *s =3D kvm_state; - struct kvm_dirty_log d =3D {}; KVMSlot *mem; hwaddr start_addr, size; hwaddr slot_size, slot_offset =3D 0; - int ret =3D 0; =20 size =3D kvm_align_section(section, &start_addr); while (size) { @@ -644,19 +666,10 @@ static int kvm_physical_sync_dirty_bitmap(KVMMemoryLi= stener *kml, mem =3D kvm_lookup_matching_slot(kml, start_addr, slot_size); if (!mem) { /* We don't have a slot if we want to trap every access. */ - goto out; + return; } =20 - d.dirty_bitmap =3D mem->dirty_bmap; - d.slot =3D mem->slot | (kml->as_id << 16); - ret =3D kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d); - if (ret =3D=3D -ENOENT) { - /* kernel does not have dirty bitmap in this slot */ - ret =3D 0; - } else if (ret < 0) { - error_report("ioctl KVM_GET_DIRTY_LOG failed: %d", errno); - goto out; - } else { + if (kvm_slot_get_dirty_log(s, mem)) { subsection.offset_within_region +=3D slot_offset; subsection.size =3D int128_make64(slot_size); kvm_get_dirty_pages_log_range(&subsection, d.dirty_bitmap); @@ -666,8 +679,6 @@ static int kvm_physical_sync_dirty_bitmap(KVMMemoryList= ener *kml, start_addr +=3D slot_size; size -=3D slot_size; } -out: - return ret; } =20 /* Alignment requirement for KVM_CLEAR_DIRTY_LOG - 64 pages */ @@ -1179,6 +1190,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, do { slot_size =3D MIN(kvm_max_slot_size, size); mem =3D kvm_alloc_slot(kml); + mem->as_id =3D kml->as_id; mem->memory_size =3D slot_size; mem->start_addr =3D start_addr; mem->ram =3D ram; @@ -1221,14 +1233,10 @@ static void kvm_log_sync(MemoryListener *listener, MemoryRegionSection *section) { KVMMemoryListener *kml =3D container_of(listener, KVMMemoryListener, l= istener); - int r; =20 kvm_slots_lock(); - r =3D kvm_physical_sync_dirty_bitmap(kml, section); + kvm_physical_sync_dirty_bitmap(kml, section); kvm_slots_unlock(); - if (r < 0) { - abort(); - } } =20 static void kvm_log_clear(MemoryListener *listener, diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index 1da30e1884..e13075f738 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -23,6 +23,8 @@ typedef struct KVMSlot int old_flags; /* Dirty bitmap cache for the slot */ unsigned long *dirty_bmap; + /* Cache of the address space ID */ + int as_id; } KVMSlot; =20 typedef struct KVMMemoryListener { --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876374; cv=none; d=zohomail.com; s=zohoarc; b=B6vtVSNWHSutpLVe6Sm5wNZaB1Cfey8aR8PVPh2qZlquTyWfZQuLpBYiiphrw90eoXyjfv8GnPEA2erfqKypyXB7p2cKsxzrPAwVVWbdbRCMb0O9rJpJQukyUF5/6PN2RFXeEauBFum0abGuqUYb/R0wiKAVOgWwWu7aT/dgbgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876374; h=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=0kzAGXdJzBdfA3QG0wpa3vohEalvQkpe/xDroTVz8aI=; b=PAhiaoHjbI2mRGe0rv4Mq5Px7Cgrs95MWt6Sw2ZAlJQt/LifyioB0GHHcGYj0oYhRHAB7LZjmhyBhHd5dg4psSZPF34rw0XmAmjyTD0P8lqEf1UtZ/FgbMi5aaYvv9+RHGsGtxqhey6Nc7u2zmnvvH89Z+GFdffFi5eUoUyD8j0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876374291156.61139637119481; Mon, 24 May 2021 10:12:54 -0700 (PDT) Received: from localhost ([::1]:46080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE8L-0006Tp-0X for importer2@patchew.org; Mon, 24 May 2021 13:12:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004o6-8d for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:45870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004Mx-Fs for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:56 -0400 Received: by mail-ej1-x62f.google.com with SMTP id s22so42584297ejv.12 for ; Mon, 24 May 2021 09:41:42 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0kzAGXdJzBdfA3QG0wpa3vohEalvQkpe/xDroTVz8aI=; b=m4VYHkNWf8V1fOQeRGRoLFRDX+xyleSXvdn332JefXMcL7MsYXdWQ05gqWoNS6Bycm OWFAakcLKKeHifBJPVdLJZyFwM/M/n13ODF13+SJsNCqIhBBG9fux99keaxpxztsIUlg dwlQVQUh9vIovJtWhn/cfCK/ApfIwKMCzEa+lNP9lZt9vWAbW1hzAoMDBXQtWdNndeFl fQWj/8ZFVpKJ+AJFpgmi+YyAIkZ4zY+cOgR8+MS6QwJ3sRdBcqrDX6W+EqnS6Wwzc/ip PvVN8C+6S0FSPg9MxIDM2YLN2fkiN4AltEWY+nNAXHpP5oqgIpSvA1B6WJ/hdJLi3r+g hVGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0kzAGXdJzBdfA3QG0wpa3vohEalvQkpe/xDroTVz8aI=; b=DbHziv4xlAoicoGvVXQNxMghLWJmVqJMwoDDSaxLTnIXQbjCMdlYVRmg682qRL1qjt DVQ+GbxTwUd1AyCh/nikSlT5Em86jAnOihJTvy/EgzoX4BV27kdjo07IXTcFMvAztXJ7 wws017nT5Pbm1h34n0GU6NPXDCE46C+7sMp+O86bTjj02tTwqHJ2FUQTfXpMn6rkkrcF +QtDPsran+bLtIFoyITJqzfNeRgUJfKDqpL+VDZ/vBsXcqia/Uii+o9U42dTa/R+cAMH 5lWGofQbHDoSF18IavpGpWxvv1m2dDZLi4+B5bKivon9DOWEtV0W6CGmrtZp0YMFAMSH Thfw== X-Gm-Message-State: AOAM532hWS+EuCxdSifMZ6q7JxcBy8I7e81XQPAquELNr76JW6ZDTRfL S+XDrsp+gR8Ei1WHtRK+a/+TgZxKz1lx+w== X-Google-Smtp-Source: ABdhPJxeeeFBxCcNMhtc70ciE3hIGrVEIa5LLimpEuoYJue9S2UIgbOqI4aERyoqYfTZM4xGOYjLDg== X-Received: by 2002:a17:906:40d1:: with SMTP id a17mr24109509ejk.43.1621874501589; Mon, 24 May 2021 09:41:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/28] KVM: Provide helper to sync dirty bitmap from slot to ramblock Date: Mon, 24 May 2021 18:41:16 +0200 Message-Id: <20210524164131.383778-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr . David Alan Gilbert" , Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu kvm_physical_sync_dirty_bitmap() calculates the ramblock offset in an awkward way from the MemoryRegionSection that passed in from the caller. The truth is for each KVMSlot the ramblock offset never change for the lifecycle. Cache the ramblock offset for each KVMSlot into the structure when the KVMSlot is created. With that, we can further simplify kvm_physical_sync_dirty_bitmap() with a helper to sync KVMSlot dirty bitmap to the ramblock dirty bitmap of a specific KVMSlot. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-6-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 37 +++++++++++++++++-------------------- include/sysemu/kvm_int.h | 2 ++ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index caaa2a5c98..7031dd4250 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -573,15 +573,12 @@ static void kvm_log_stop(MemoryListener *listener, } =20 /* get kvm's dirty pages bitmap and update qemu's */ -static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section, - unsigned long *bitmap) +static void kvm_slot_sync_dirty_pages(KVMSlot *slot) { - ram_addr_t start =3D section->offset_within_region + - memory_region_get_ram_addr(section->mr); - ram_addr_t pages =3D int128_get64(section->size) / qemu_real_host_page= _size; + ram_addr_t start =3D slot->ram_start_offset; + ram_addr_t pages =3D slot->memory_size / qemu_real_host_page_size; =20 - cpu_physical_memory_set_dirty_lebitmap(bitmap, start, pages); - return 0; + cpu_physical_memory_set_dirty_lebitmap(slot->dirty_bmap, start, pages); } =20 #define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1)) @@ -656,26 +653,19 @@ static void kvm_physical_sync_dirty_bitmap(KVMMemoryL= istener *kml, KVMState *s =3D kvm_state; KVMSlot *mem; hwaddr start_addr, size; - hwaddr slot_size, slot_offset =3D 0; + hwaddr slot_size; =20 size =3D kvm_align_section(section, &start_addr); while (size) { - MemoryRegionSection subsection =3D *section; - slot_size =3D MIN(kvm_max_slot_size, size); mem =3D kvm_lookup_matching_slot(kml, start_addr, slot_size); if (!mem) { /* We don't have a slot if we want to trap every access. */ return; } - if (kvm_slot_get_dirty_log(s, mem)) { - subsection.offset_within_region +=3D slot_offset; - subsection.size =3D int128_make64(slot_size); - kvm_get_dirty_pages_log_range(&subsection, d.dirty_bitmap); + kvm_slot_sync_dirty_pages(mem); } - - slot_offset +=3D slot_size; start_addr +=3D slot_size; size -=3D slot_size; } @@ -1134,7 +1124,8 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, int err; MemoryRegion *mr =3D section->mr; bool writeable =3D !mr->readonly && !mr->rom_device; - hwaddr start_addr, size, slot_size; + hwaddr start_addr, size, slot_size, mr_offset; + ram_addr_t ram_start_offset; void *ram; =20 if (!memory_region_is_ram(mr)) { @@ -1152,9 +1143,13 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, return; } =20 - /* use aligned delta to align the ram address */ - ram =3D memory_region_get_ram_ptr(mr) + section->offset_within_region + - (start_addr - section->offset_within_address_space); + /* The offset of the kvmslot within the memory region */ + mr_offset =3D section->offset_within_region + start_addr - + section->offset_within_address_space; + + /* use aligned delta to align the ram address and offset */ + ram =3D memory_region_get_ram_ptr(mr) + mr_offset; + ram_start_offset =3D memory_region_get_ram_addr(mr) + mr_offset; =20 kvm_slots_lock(); =20 @@ -1193,6 +1188,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, mem->as_id =3D kml->as_id; mem->memory_size =3D slot_size; mem->start_addr =3D start_addr; + mem->ram_start_offset =3D ram_start_offset; mem->ram =3D ram; mem->flags =3D kvm_mem_flags(mr); kvm_slot_init_dirty_bitmap(mem); @@ -1203,6 +1199,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, abort(); } start_addr +=3D slot_size; + ram_start_offset +=3D slot_size; ram +=3D slot_size; size -=3D slot_size; } while (size); diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index e13075f738..ab09a150e1 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -25,6 +25,8 @@ typedef struct KVMSlot unsigned long *dirty_bmap; /* Cache of the address space ID */ int as_id; + /* Cache of the offset in ram address space */ + ram_addr_t ram_start_offset; } KVMSlot; =20 typedef struct KVMMemoryListener { --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875478; cv=none; d=zohomail.com; s=zohoarc; b=P+WrvianJYXSSKO7GD7LWH7+RXvvr9TAFu4zSlJm70V5kyDIw5ehZAqt/Ay35mhgT51IixfIj9Zvm1k+WEBk4WrUjY5hQHcQSJLzAyfkYNJ0NnBv54ULRdZ1RoJQt2PXl0GlcPxPwGz05QtGvtCU2eE2eMsvkRs8E0rRxyO97HU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875478; h=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=9/dX3PC3FCiO5p7uuZf1RyQ9MDHL5qIlrYK5aAJJIeY=; b=SesMuoe+c0y0oKBwtaObouGRAOTmuT5usDxz89z4vbITPCrW6qikoWWT5a+3mgFuADgJv4GaZ+DfHIZ5v2SoabSUoQZoHEz18+HORPIeBNUjRbQ0Mf6aM2Tj8IxYVQSgkXv3Bm2J6oW8CxtNcl1wvsAaf+vmEHn0Nw8XaRCylHY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875478837998.83066642099; Mon, 24 May 2021 09:57:58 -0700 (PDT) Received: from localhost ([::1]:35108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDtt-0003sF-Rs for importer2@patchew.org; Mon, 24 May 2021 12:57:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004oE-At for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:39675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004NI-Hq for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:57 -0400 Received: by mail-ej1-x635.google.com with SMTP id l1so42789094ejb.6 for ; Mon, 24 May 2021 09:41:43 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9/dX3PC3FCiO5p7uuZf1RyQ9MDHL5qIlrYK5aAJJIeY=; b=vZms4vtQnZxGR2ZaJsIxRZubUfjjDUrsYdFFd9rvVWunjQUacu8KNC+6N3cmjelOTt ySJK+pBei1VWMeOzuf5iOYxx/YXVLWCF1AmxF+Vwc2vObP3wf9J7ZzVMQDefoaNuDW5D aKBIVMnYX2AfDjxCbgnTGEDx1RCXyO4wgoyiPsdA3/ScGVCHLknWW1CyrLDsX9GmlcYH 5cym9JDdtifDGjWS2VSG+QKLd4HUgKST0oZiALnwX/MmNrAEYAAiGCE3quvAFY3mIp2y pZTW5vvjfL9rxNISNISe6UQuQzj9CsfJKmZP2DBiA4YTljkqA05FRucnrLEJXO8c86Gl lYGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9/dX3PC3FCiO5p7uuZf1RyQ9MDHL5qIlrYK5aAJJIeY=; b=dtgnIRs7D4gA/N9vfQVtxfHTSmsv0KV/+c6aJg+6na7muWr9mTuSNoBweNkMg7bu65 LzBjJ0kLoGjjd2mCpm340v/HyK10Q+11YouYWWPvODbz+U9OMIE5MeetLI8EPEhRJXp7 7ZBDaVKlXVyw8r+vqxWRw3SaIiyganuvSPyKDRHpcp2BmsTbWPn+NuDspHfkbb4OA9Lj WUquvHO8Qd+buHEb0pyMPA5+oMBIAi+bzg3e1WoIrreivOwKUn2N7LqjGujOFfJPCz3o jMYlYd40dODWVOaCBwlTSeUuYZ5G0GFOaS/diuUoU60CYKncpJ75OxZ3h2p41fXlvoer YJBg== X-Gm-Message-State: AOAM533d8c2/xoSU08K/HL293GNubraZ0ZYdiqvnbXMrrYXEz/+hMTKG /EAyGOpGwQRUddkzbxl6WcRCCJvuWKM3Tg== X-Google-Smtp-Source: ABdhPJyhH6qFhwA4UFg1f1Rw9qnozSNOZPMKNfd/G6zUcBtKxClRm+B5XL+Z27llJv8H4Nw27jibMg== X-Received: by 2002:a17:906:7842:: with SMTP id p2mr23814366ejm.487.1621874502188; Mon, 24 May 2021 09:41:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/28] KVM: Simplify dirty log sync in kvm_set_phys_mem Date: Mon, 24 May 2021 18:41:17 +0200 Message-Id: <20210524164131.383778-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu kvm_physical_sync_dirty_bitmap() on the whole section is inaccurate, because the section can be a superset of the memslot that we're working on. The re= sult is that if the section covers multiple kvm memslots, we could be doing the synchronization for multiple times for each kvmslot in the section. With the two helpers that we just introduced, it's very easy to do it right= now by calling the helpers. Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-7-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 7031dd4250..0ba6d48120 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1161,7 +1161,8 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, goto out; } if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { - kvm_physical_sync_dirty_bitmap(kml, section); + kvm_slot_get_dirty_log(kvm_state, mem); + kvm_slot_sync_dirty_pages(mem); } =20 /* unregister the slot */ --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875804; cv=none; d=zohomail.com; s=zohoarc; b=bymMCpJhKV9udDrDUpxSAX/f6JadUiCLfJ0M2Dz35+QmZD0FQlgK3EfUHxTO7XwYautXmuzSjuQQihkd5doc7OKKehxncxlqvYKgaKW9zFVd8MvGOPb+aDzuP8SC8luYrCk3R8knjrKh2wvToiohTu/n2ga5zGH0a7WNe9egfsM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875804; h=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=XwYPwSfA8Cvd3/TBJlc2cW5Z9lV4MqaeOY7vnJJhpgo=; b=eemPHJWw47jF7sR5okhprgv8iUi3d9jQxFuOWJGZs3/Dw9qYR7WxTvV5Mt/LlRSJpcuRw4CHg9c8WVSmhy09+R45JScCyB8UBpA/cO517uPfEvHn4Q7LKM94/RsNEDUCOpSHtdiwUzSFVWK0bMQPxySdJWcEe/mSY/x/PgZOceU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875804222986.0415206289024; Mon, 24 May 2021 10:03:24 -0700 (PDT) Received: from localhost ([::1]:48846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDz9-0004xh-2m for importer2@patchew.org; Mon, 24 May 2021 13:03:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeR-0004r1-3N for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:59 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]:43911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004Np-Jl for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: by mail-ej1-x62a.google.com with SMTP id f18so12624571ejq.10 for ; Mon, 24 May 2021 09:41:43 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XwYPwSfA8Cvd3/TBJlc2cW5Z9lV4MqaeOY7vnJJhpgo=; b=kx41ThiT0Sp7DPEHEhXUgWUGConJajD3+F3eb2rghcQ7OryOhXAJlHW8zH2ggxdzoc IPGxDbjthdAydZb/IWbnIytCm8AXvWAuUIm1e8Yv03p2oVqSOL/n2f6S8R5jEuGliTeV JPpCETHRWned+Ft1jvzZTfdWuYg8AJ90YDrYjx3sUN9yrd26/mPlll+hyBp2VIbdqIGn 3w/CsUvUtJg06C3h7t9Eyuyy0svQdb9VR6Nrs8HfEcZOud7Wax0H55c2QP2QLxrpSBG8 OdskPtIFpuC6fIbfXlymhYAYXu3vy4N9N5MFAtQt/3aDRxkk1uUv4fsiCv83oCQ6/n+s eR3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XwYPwSfA8Cvd3/TBJlc2cW5Z9lV4MqaeOY7vnJJhpgo=; b=aJwtuDThPycUTAQyPI+nXMIdiCKeLFOx4kxDmfezh/ShEeJAMTzAs3xVsa5yLxd2vA wBBLV3ot5kdidhap1iZYyX6zd8npkCU1tJNqvnJb9ID2TCam9OZoWPRnfE1lBLgcV9XK X/rabZRQMj1o8LqhN8+93wdDJofX0d4NT8AkkrZfq1pQXtzvUtLHH32k7WgGHDp5mdJV BcSls6l/mBSX5ir7mS86xiNuYDDRB9UiRXKpIhM2qIAg+0xQ2nemOztWEpl7KBsY/rLA GoVmv26usApw4LtOqcP0vzmItRDzik3juotkK+O3jOg47i6Mwp4IbxVpAxo9N9V+IKmv iimA== X-Gm-Message-State: AOAM531uFTGwxBRX71+Bm1BTleJZJvGUYZw5wtz7i9ovWKEaupRnPCHl i+e2MvOb74YAU4UQzNlcx/SMEp416jbU7Q== X-Google-Smtp-Source: ABdhPJxEE9vEGaACf5ddOvdcRdrJALDUbJHzt1nTHJXQS17fMjWxOeahwH3I77pwAcU46IHXSYillA== X-Received: by 2002:a17:906:c212:: with SMTP id d18mr4945967ejz.291.1621874502889; Mon, 24 May 2021 09:41:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/28] KVM: Cache kvm slot dirty bitmap size Date: Mon, 24 May 2021 18:41:18 +0200 Message-Id: <20210524164131.383778-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr . David Alan Gilbert" , Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu Cache it too because we'll reference it more frequently in the future. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-8-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 1 + include/sysemu/kvm_int.h | 1 + 2 files changed, 2 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 0ba6d48120..df9fbf59a6 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -610,6 +610,7 @@ static void kvm_slot_init_dirty_bitmap(KVMSlot *mem) hwaddr bitmap_size =3D ALIGN(mem->memory_size / qemu_real_host_page_si= ze, /*HOST_LONG_BITS*/ 64) / 8; mem->dirty_bmap =3D g_malloc0(bitmap_size); + mem->dirty_bmap_size =3D bitmap_size; } =20 /* diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index ab09a150e1..c788452cd9 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -23,6 +23,7 @@ typedef struct KVMSlot int old_flags; /* Dirty bitmap cache for the slot */ unsigned long *dirty_bmap; + unsigned long dirty_bmap_size; /* Cache of the address space ID */ int as_id; /* Cache of the offset in ram address space */ --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876168; cv=none; d=zohomail.com; s=zohoarc; b=IZ+MrdZb7kU4+NnbTWemV2k5K7uUvCvfQnRrUCv+pSizwaisG5hky9/amXPy6tXx96KUT+9OmDoyAIXvZyrmSI0nKdWXSwD1dTHol+Aeu4Nn/TxWpz2i1b+WsfdJv8RRTsaPyHwrkvs2L0fhn1+ZoLamCcMproUYc36qu68KQy8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876168; h=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=+6To3R747Gt8KrZIdybi9XgGpLzBn8XFWqjsTJBScXc=; b=Oh3tEfdthd8FGRQk5XMqe/o1YG8WpACEcGvZzbynkD7d71MGssgtjutkEoAwTiqvjJjI5He5RhA2xlhJ22ENIWchaWG2h3ZpUITY9kos7EAWfa3luexXkDn6Ct6zz+ZVpJEFKuo9A4ZljeOD07EfFvYBnXqSCkCCr/6GofFVb3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876168317868.1625832392574; Mon, 24 May 2021 10:09:28 -0700 (PDT) Received: from localhost ([::1]:35424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE50-0007a4-8K for importer2@patchew.org; Mon, 24 May 2021 13:09:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeT-0004yd-08 for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:01 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:35624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004Nz-3v for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:00 -0400 Received: by mail-ed1-x534.google.com with SMTP id y7so15207838eda.2 for ; Mon, 24 May 2021 09:41:44 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+6To3R747Gt8KrZIdybi9XgGpLzBn8XFWqjsTJBScXc=; b=YBXFKqqlNuV3ZOKRzvT7PDADNDlwnFDaU76/9ZlBFVc17HwYdCikposbI5Jsibqpte asXWgVjRjaC4l7YCj5d5FRaJBF06m8K94SssEdgg3h1sP88xy+DNlyfQ2KVpfHliapF1 6vm0PRHKr3cmn2aebbtmmhlvfkBkV9sEgG9i/8VW/CNqcNwX5yKNGyVfq8YsmAkcGV3Z MwZgM9P6oBlhyHfC5ThhAXOB65q8Helmq/LHsxXQyIeYeEYUBKjztpZG1TN+Kuq63fqR K109XJt2LIQHBSklf4EQCine3Q7SeVdzU3PbQzlCtLz5XwpKmL2RbaF4UiSQPqvRgDyN EktQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+6To3R747Gt8KrZIdybi9XgGpLzBn8XFWqjsTJBScXc=; b=N2Xhee5qui0IipnexcVxSfhfmPr/omvAoaSZQmcgUMyhjpKWeiUJXABrnDuyg29Ijk d8zLOlQ9NRxeJdUSfXDoqmnFI8EareVjeXo8MZtVOxj6btC7T72jiwXQLRRNJdYxz/8H CegqDmWbgseeGuch5mfOAF6YotFGKzPiLVip3hX6nY28Hf2HubJAwPa7wW6c1xoXYhIy 2VoUSPAMW6EzDPKRFcYNIoTlXTize6d2cG8JqVVsew0gQRyTSBaBgPqB4nnje1imSZGK oPDz1IKQx3m8TVwuhgIHsJmI0t77txG8UiE13XU83OdzK6osfGLchaenkkDQdPpVrVbW JwpA== X-Gm-Message-State: AOAM530pMG9cot+uMu10QrCx4t+Dpo7M04lG+fxobNsMhWYe8k/DGoYa L4dY6I4Qe6pPyvF+Kjh7anby+Ig9IL71Mw== X-Google-Smtp-Source: ABdhPJzFkQViG/Onk1fWeMxNnea4Sc3qh83kNVVvB4FrNMI/5bgPVeSgUmgIczDkv7MhoKyAlLNw6A== X-Received: by 2002:aa7:cb92:: with SMTP id r18mr26988829edt.246.1621874503634; Mon, 24 May 2021 09:41:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/28] KVM: Add dirty-ring-size property Date: Mon, 24 May 2021 18:41:19 +0200 Message-Id: <20210524164131.383778-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu Add a parameter for dirty gfn count for dirty rings. If zero, dirty ring is disabled. Otherwise dirty ring will be enabled with the per-vcpu gfn count= as specified. If dirty ring cannot be enabled due to unsupported kernel or illegal parameter, it'll fallback to dirty logging. By default, dirty ring is not enabled (dirty-gfn-count default to 0). Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-9-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 46 +++++++++++++++++++++++++++++++++++++++++++++ qemu-options.hx | 12 ++++++++++++ 2 files changed, 58 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index df9fbf59a6..5afe15ae66 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -126,6 +126,8 @@ struct KVMState KVMMemoryListener *ml; AddressSpace *as; } *as; + uint64_t kvm_dirty_ring_bytes; /* Size of the per-vcpu dirty ring */ + uint32_t kvm_dirty_ring_size; /* Number of dirty GFNs per ring */ }; =20 KVMState *kvm_state; @@ -3182,6 +3184,42 @@ bool kvm_kernel_irqchip_split(void) return kvm_state->kernel_irqchip_split =3D=3D ON_OFF_AUTO_ON; } =20 +static void kvm_get_dirty_ring_size(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + KVMState *s =3D KVM_STATE(obj); + uint32_t value =3D s->kvm_dirty_ring_size; + + visit_type_uint32(v, name, &value, errp); +} + +static void kvm_set_dirty_ring_size(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + KVMState *s =3D KVM_STATE(obj); + Error *error =3D NULL; + uint32_t value; + + if (s->fd !=3D -1) { + error_setg(errp, "Cannot set properties after the accelerator has = been initialized"); + return; + } + + visit_type_uint32(v, name, &value, &error); + if (error) { + error_propagate(errp, error); + return; + } + if (value & (value - 1)) { + error_setg(errp, "dirty-ring-size must be a power of two."); + return; + } + + s->kvm_dirty_ring_size =3D value; +} + static void kvm_accel_instance_init(Object *obj) { KVMState *s =3D KVM_STATE(obj); @@ -3191,6 +3229,8 @@ static void kvm_accel_instance_init(Object *obj) s->kvm_shadow_mem =3D -1; s->kernel_irqchip_allowed =3D true; s->kernel_irqchip_split =3D ON_OFF_AUTO_AUTO; + /* KVM dirty ring is by default off */ + s->kvm_dirty_ring_size =3D 0; } =20 static void kvm_accel_class_init(ObjectClass *oc, void *data) @@ -3212,6 +3252,12 @@ static void kvm_accel_class_init(ObjectClass *oc, vo= id *data) NULL, NULL); object_class_property_set_description(oc, "kvm-shadow-mem", "KVM shadow MMU size"); + + object_class_property_add(oc, "dirty-ring-size", "uint32", + kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, + NULL, NULL); + object_class_property_set_description(oc, "dirty-ring-size", + "Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)"= ); } =20 static const TypeInfo kvm_accel_type =3D { diff --git a/qemu-options.hx b/qemu-options.hx index e22fb94d99..ecdb064409 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -141,6 +141,7 @@ DEF("accel", HAS_ARG, QEMU_OPTION_accel, " kvm-shadow-mem=3Dsize of KVM shadow MMU in bytes\n" " split-wx=3Don|off (enable TCG split w^x mapping)\n" " tb-size=3Dn (TCG translation block cache size)\n" + " dirty-ring-size=3Dn (KVM dirty ring GFN count, defaul= t 0)\n" " thread=3Dsingle|multi (enable multi-threaded TCG)\n",= QEMU_ARCH_ALL) SRST ``-accel name[,prop=3Dvalue[,...]]`` @@ -181,6 +182,17 @@ SRST where both the back-end and front-ends support it and no incompatible TCG features have been enabled (e.g. icount/replay). + + ``dirty-ring-size=3Dn`` + When the KVM accelerator is used, it controls the size of the per-= vCPU + dirty page ring buffer (number of entries for each vCPU). It should + be a value that is power of two, and it should be 1024 or bigger (= but + still less than the maximum value that the kernel supports). 4096 + could be a good initial value if you have no idea which is the bes= t. + Set this value to 0 to disable the feature. By default, this feat= ure + is disabled (dirty-ring-size=3D0). When enabled, KVM will instead + record dirty pages in a bitmap. + ERST =20 DEF("smp", HAS_ARG, QEMU_OPTION_smp, --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875575; cv=none; d=zohomail.com; s=zohoarc; b=EhAqSpxXVaTWrN81ybL4gKU/Cw61ZoEYngXHp13RBTkaHBimNwMPH7taXfW9NxmhXV3V0tA5/RATy8frNpKPHPSxS7/1gnQwlp2JYJ8m+rD9jSGIh/oIlzQtJbSwUK/lwfrxJMLCNGaGlXCg0DmQfQGBZHPXJFdlom/1tnU+6RE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875575; h=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=GBwYk/KWMuO+/yxHf80rqOKUhqHBFBQaoC17YufQN2w=; b=N6XAP8kVAWJxo2t4x4GKnzwz7IOLwANIMM2OvnTCVUNVp5jAKrxJNYVVt48zJNtmjwXpkBcirEJeycLvqGl5u4SArJEQiOmFsmw+Aj+I7wMBvfVD6mn857mMkmjDxQh4gtFHmblp7i5JyR623sn3gTS3bl4ZLfkVtAal3rg+jQk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875575062797.1663505111056; Mon, 24 May 2021 09:59:35 -0700 (PDT) Received: from localhost ([::1]:42500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDvR-0000Sm-Pb for importer2@patchew.org; Mon, 24 May 2021 12:59:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeR-0004rv-8P for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:59 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:35626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004O7-LN for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: by mail-ed1-x536.google.com with SMTP id y7so15207876eda.2 for ; Mon, 24 May 2021 09:41:46 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GBwYk/KWMuO+/yxHf80rqOKUhqHBFBQaoC17YufQN2w=; b=cvg47CIKca5UqC4HEj+1V2AjBKAN007zFW0KlGh9u2nva5RKBUl9iHz1Vbl13g82bz ZOpNfl7Yw0Dl0YIRSOqTAYOAPwEr3MJKfdci89oyC0TfoZmORwfxgBfU2ksHwI1w8n9u 5ZyZfJUr7u2ejkVV+JesiK2DmL+GNglFc+dGX90wh3/FxfAeJue8qfZnObrg5yhFN3il CtRZFx3HwgoXi45kehF7dPjJ6dnseFqSbfTxaLDQDcnVXCegt+gNeevaOY+h7UYFF2RI vuE+UUIokOYsRDoIGnRpb0oD4JLjW3cVGt8W2o0TZMIvEj+0tdM/G0p7I+pFOlg2G414 R45A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=GBwYk/KWMuO+/yxHf80rqOKUhqHBFBQaoC17YufQN2w=; b=tX3m7NWurIs4kVxdyBdujm0nSPJ+CY6r1mnNZqHpnybwVwN0Qs3qIVsz0k/3FmaGlp JZQGsvnSssQZfquPgZGhIiunfP+9Kfkr1TwNRQ+hdjcQAcGrfK+YNuXwZtrmquxzJXVc JqFF6TPxE3CPSljyQGhAqob7epE2+WHMSoIbDrJ78tuGk78QmnwmeeUCapoQ/w7RM0am uEicBfQeKp6fR/4kZrf4UbvJmL+9vgp/wrv6JzG8zKbHaBsqOkxgfBpTrT7/y0AH6u4I vO99ZXHDI+NIt0IbkEv9sHrDozpF1iAfKl/BhlgAB9DU+5mNBY5F3ABMmR2eryTiwiBU cICA== X-Gm-Message-State: AOAM531UC3RElNWVNiSmmP9CJ0x5e7UD/TodEsR7MsKKLdlvtUNHNWvT BHmL2dT3NMFGYamXmK7YTbfqtCIKFfKn9g== X-Google-Smtp-Source: ABdhPJxNTaSg4ZWSRbXceWj/44pdmC85SV1ISWlb2pRZNdzcuYELwHZyslSkCqV+WRt9W5djFfwIfQ== X-Received: by 2002:a05:6402:50b:: with SMTP id m11mr27720416edv.367.1621874504249; Mon, 24 May 2021 09:41:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/28] KVM: Disable manual dirty log when dirty ring enabled Date: Mon, 24 May 2021 18:41:20 +0200 Message-Id: <20210524164131.383778-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is for KVM_CLEAR_DIRTY_LOG, which is only useful for KVM_GET_DIRTY_LOG. Skip enabling it for kvm dirty ring. More importantly, KVM_DIRTY_LOG_INITIALLY_SET will not wr-protect all the p= ages initially, which is against how kvm dirty ring is used - there's no way for= kvm dirty ring to re-protect a page before it's notified as being written first with a GFN entry in the ring! So when KVM_DIRTY_LOG_INITIALLY_SET is enabl= ed with dirty ring, we'll see silent data loss after migration. Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-10-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 5afe15ae66..e1a6c7c89b 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2131,20 +2131,29 @@ static int kvm_init(MachineState *ms) s->coalesced_pio =3D s->coalesced_mmio && kvm_check_extension(s, KVM_CAP_COALESCED_PIO); =20 - dirty_log_manual_caps =3D - kvm_check_extension(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2); - dirty_log_manual_caps &=3D (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | - KVM_DIRTY_LOG_INITIALLY_SET); - s->manual_dirty_log_protect =3D dirty_log_manual_caps; - if (dirty_log_manual_caps) { - ret =3D kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, - dirty_log_manual_caps); - if (ret) { - warn_report("Trying to enable capability %"PRIu64" of " - "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. " - "Falling back to the legacy mode. ", - dirty_log_manual_caps); - s->manual_dirty_log_protect =3D 0; + /* + * KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is not needed when dirty ring is + * enabled. More importantly, KVM_DIRTY_LOG_INITIALLY_SET will assume= no + * page is wr-protected initially, which is against how kvm dirty ring= is + * usage - kvm dirty ring requires all pages are wr-protected at the v= ery + * beginning. Enabling this feature for dirty ring causes data corrup= tion. + */ + if (!s->kvm_dirty_ring_size) { + dirty_log_manual_caps =3D + kvm_check_extension(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2); + dirty_log_manual_caps &=3D (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | + KVM_DIRTY_LOG_INITIALLY_SET); + s->manual_dirty_log_protect =3D dirty_log_manual_caps; + if (dirty_log_manual_caps) { + ret =3D kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2= , 0, + dirty_log_manual_caps); + if (ret) { + warn_report("Trying to enable capability %"PRIu64" of " + "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed.= " + "Falling back to the legacy mode. ", + dirty_log_manual_caps); + s->manual_dirty_log_protect =3D 0; + } } } =20 --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875748; cv=none; d=zohomail.com; s=zohoarc; b=bIx7tpzJ6r/ZCcMJScCR1n2pvXpuXde18DpOycWsmLWGomMyVxBz0+aHtT3jUsCElVbZjEG8X8D8TtWz/150RCam/BfOmll2QavCFm56I1C9dGSzL7jNtVSJiRiDZAQm2cGCQeRDS5ErMJM2EN2ZWe5WWCtBECFNecPanf/H7N8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875748; h=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=an7+odH0ObdHycom4daIIRPyZa0zjFG35WUJ38/yLaw=; b=neu2/h0YH0lnwdgEOv34GiuC49huPvu7UueA4e6sDGUfZk+dHBlcdbQknteY8PvNiVSIsyKXD8d4Su4J5SWU555ZMYrWi+5fapRV8cD5lGGx1KIr6AtXa4yj93OS/aNvj+pRYGyK61x897n6GI2b6qsBBTWrmQcS6is4bEBzGxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875748585985.5174803076552; Mon, 24 May 2021 10:02:28 -0700 (PDT) Received: from localhost ([::1]:46598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDyF-0003I3-Fj for importer2@patchew.org; Mon, 24 May 2021 13:02:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeR-0004tm-Ly for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:59 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:34708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004O8-JZ for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:59 -0400 Received: by mail-ej1-x632.google.com with SMTP id p24so41549844ejb.1 for ; Mon, 24 May 2021 09:41:46 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=an7+odH0ObdHycom4daIIRPyZa0zjFG35WUJ38/yLaw=; b=A2b3SMiXzW1itEMnO6nlm27zCtRrFWJ/jKWw8YdVuQhnsh+ezUjEilMzCMBk6QP2bH MJjCFsmqaDqLftYb3guD1aZW+dRrSrIEieKvLbMD+KOOsY5CC6z+MqWvdcJaL6BUjPhb NY26jVxO5y7MF+xRIZJPvXwSPkVslJkzqXSjO/dItLqssm9YkH4tYMdV1kEBjGwPdhkL whCLHePgdEz4WhjUQaIJRyx2+Yp0T/mrq5jH+6iJe/TS3K4OOHxJXhKsKtyYYeHJ2wVB XBbmwwfRv16Whll3oYsUGb5koLmySFSWcnF1P1YpNk/fIrWEFNRCoSTylImKmhsKKq+y duvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=an7+odH0ObdHycom4daIIRPyZa0zjFG35WUJ38/yLaw=; b=fX1mgMn2bJtL9CTEB8xLmwAOf1U7TskTobdlJV39AbCLJAhuNbuVJhLDlazfDjZuIt vk5Y8EMpW0UEwHe1V0Ctr+8nipGbJ11rkvZ6fcc4TBncpy1lD6Go5nCnARIJhBs4z/T4 mdSlBZC19rYu/kbYGkRN8caos6aBsJmPKK6iHNqUc/P4ByMv4vZFtofpG5n01VZZJKQJ iPKhF/ygZBTqAX3EF/+6Zp+K5VNz98oxiY1vcOqZINBdc3v1bl15J8v6tA3lN9T0Dkma 1Tqlp3zVcreRatHoOnqC9drri1gQWiC/BTcaJ4YfP0vw6j62Hk+PxE8QhwWTYRkAbjIy wbZg== X-Gm-Message-State: AOAM532cjoPHghfdQwyv0zNDaz0dy5zAkb/OXb8rOGGBq1MJZbhQIzKw jXoV1UrNDX0qwsfgdIj+v63Gam9WUHF16g== X-Google-Smtp-Source: ABdhPJyb4Jd+7tokayG7cpIktCF55Bcmow3RjZNGgCjkPSxKu7VkLEaiRGJSaDyX0T5LM+x4Bk14Vg== X-Received: by 2002:a17:906:abcc:: with SMTP id kq12mr24632681ejb.97.1621874504964; Mon, 24 May 2021 09:41:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/28] KVM: Dirty ring support Date: Mon, 24 May 2021 18:41:21 +0200 Message-Id: <20210524164131.383778-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Peter Xu KVM dirty ring is a new interface to pass over dirty bits from kernel to the userspace. Instead of using a bitmap for each memory region, the dirty ring contains an array of dirtied GPAs to fetch (in the form of offset in slots). For each vcpu there will be one dirty ring that binds to it. kvm_dirty_ring_reap() is the major function to collect dirty rings. It can= be called either by a standalone reaper thread that runs in the background, collecting dirty pages for the whole VM. It can also be called directly by= any thread that has BQL taken. Signed-off-by: Peter Xu Message-Id: <20210506160549.130416-11-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 374 ++++++++++++++++++++++++++++++++++++++++- accel/kvm/trace-events | 7 + include/hw/core/cpu.h | 7 + 3 files changed, 385 insertions(+), 3 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e1a6c7c89b..c7ec538850 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -15,6 +15,7 @@ =20 #include "qemu/osdep.h" #include +#include =20 #include =20 @@ -78,6 +79,25 @@ struct KVMParkedVcpu { QLIST_ENTRY(KVMParkedVcpu) node; }; =20 +enum KVMDirtyRingReaperState { + KVM_DIRTY_RING_REAPER_NONE =3D 0, + /* The reaper is sleeping */ + KVM_DIRTY_RING_REAPER_WAIT, + /* The reaper is reaping for dirty pages */ + KVM_DIRTY_RING_REAPER_REAPING, +}; + +/* + * KVM reaper instance, responsible for collecting the KVM dirty bits + * via the dirty ring. + */ +struct KVMDirtyRingReaper { + /* The reaper thread */ + QemuThread reaper_thr; + volatile uint64_t reaper_iteration; /* iteration number of reaper thr = */ + volatile enum KVMDirtyRingReaperState reaper_state; /* reap thr state = */ +}; + struct KVMState { AccelState parent_obj; @@ -128,6 +148,7 @@ struct KVMState } *as; uint64_t kvm_dirty_ring_bytes; /* Size of the per-vcpu dirty ring */ uint32_t kvm_dirty_ring_size; /* Number of dirty GFNs per ring */ + struct KVMDirtyRingReaper reaper; }; =20 KVMState *kvm_state; @@ -389,6 +410,13 @@ static int do_kvm_destroy_vcpu(CPUState *cpu) goto err; } =20 + if (cpu->kvm_dirty_gfns) { + ret =3D munmap(cpu->kvm_dirty_gfns, s->kvm_dirty_ring_size); + if (ret < 0) { + goto err; + } + } + vcpu =3D g_malloc0(sizeof(*vcpu)); vcpu->vcpu_id =3D kvm_arch_vcpu_id(cpu); vcpu->kvm_fd =3D cpu->kvm_fd; @@ -465,6 +493,19 @@ int kvm_init_vcpu(CPUState *cpu, Error **errp) (void *)cpu->kvm_run + s->coalesced_mmio * PAGE_SIZE; } =20 + if (s->kvm_dirty_ring_size) { + /* Use MAP_SHARED to share pages with the kernel */ + cpu->kvm_dirty_gfns =3D mmap(NULL, s->kvm_dirty_ring_size, + PROT_READ | PROT_WRITE, MAP_SHARED, + cpu->kvm_fd, + PAGE_SIZE * KVM_DIRTY_LOG_PAGE_OFFSET); + if (cpu->kvm_dirty_gfns =3D=3D MAP_FAILED) { + ret =3D -errno; + DPRINTF("mmap'ing vcpu dirty gfns failed: %d\n", ret); + goto err; + } + } + ret =3D kvm_arch_init_vcpu(cpu); if (ret < 0) { error_setg_errno(errp, -ret, @@ -583,6 +624,11 @@ static void kvm_slot_sync_dirty_pages(KVMSlot *slot) cpu_physical_memory_set_dirty_lebitmap(slot->dirty_bmap, start, pages); } =20 +static void kvm_slot_reset_dirty_pages(KVMSlot *slot) +{ + memset(slot->dirty_bmap, 0, slot->dirty_bmap_size); +} + #define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1)) =20 /* Allocate the dirty bitmap for a slot */ @@ -639,6 +685,171 @@ static bool kvm_slot_get_dirty_log(KVMState *s, KVMSl= ot *slot) return ret =3D=3D 0; } =20 +/* Should be with all slots_lock held for the address spaces. */ +static void kvm_dirty_ring_mark_page(KVMState *s, uint32_t as_id, + uint32_t slot_id, uint64_t offset) +{ + KVMMemoryListener *kml; + KVMSlot *mem; + + if (as_id >=3D s->nr_as) { + return; + } + + kml =3D s->as[as_id].ml; + mem =3D &kml->slots[slot_id]; + + if (!mem->memory_size || offset >=3D + (mem->memory_size / qemu_real_host_page_size)) { + return; + } + + set_bit(offset, mem->dirty_bmap); +} + +static bool dirty_gfn_is_dirtied(struct kvm_dirty_gfn *gfn) +{ + return gfn->flags =3D=3D KVM_DIRTY_GFN_F_DIRTY; +} + +static void dirty_gfn_set_collected(struct kvm_dirty_gfn *gfn) +{ + gfn->flags =3D KVM_DIRTY_GFN_F_RESET; +} + +/* + * Should be with all slots_lock held for the address spaces. It returns = the + * dirty page we've collected on this dirty ring. + */ +static uint32_t kvm_dirty_ring_reap_one(KVMState *s, CPUState *cpu) +{ + struct kvm_dirty_gfn *dirty_gfns =3D cpu->kvm_dirty_gfns, *cur; + uint32_t ring_size =3D s->kvm_dirty_ring_size; + uint32_t count =3D 0, fetch =3D cpu->kvm_fetch_index; + + assert(dirty_gfns && ring_size); + trace_kvm_dirty_ring_reap_vcpu(cpu->cpu_index); + + while (true) { + cur =3D &dirty_gfns[fetch % ring_size]; + if (!dirty_gfn_is_dirtied(cur)) { + break; + } + kvm_dirty_ring_mark_page(s, cur->slot >> 16, cur->slot & 0xffff, + cur->offset); + dirty_gfn_set_collected(cur); + trace_kvm_dirty_ring_page(cpu->cpu_index, fetch, cur->offset); + fetch++; + count++; + } + cpu->kvm_fetch_index =3D fetch; + + return count; +} + +/* Must be with slots_lock held */ +static uint64_t kvm_dirty_ring_reap_locked(KVMState *s) +{ + int ret; + CPUState *cpu; + uint64_t total =3D 0; + int64_t stamp; + + stamp =3D get_clock(); + + CPU_FOREACH(cpu) { + total +=3D kvm_dirty_ring_reap_one(s, cpu); + } + + if (total) { + ret =3D kvm_vm_ioctl(s, KVM_RESET_DIRTY_RINGS); + assert(ret =3D=3D total); + } + + stamp =3D get_clock() - stamp; + + if (total) { + trace_kvm_dirty_ring_reap(total, stamp / 1000); + } + + return total; +} + +/* + * Currently for simplicity, we must hold BQL before calling this. We can + * consider to drop the BQL if we're clear with all the race conditions. + */ +static uint64_t kvm_dirty_ring_reap(KVMState *s) +{ + uint64_t total; + + /* + * We need to lock all kvm slots for all address spaces here, + * because: + * + * (1) We need to mark dirty for dirty bitmaps in multiple slots + * and for tons of pages, so it's better to take the lock here + * once rather than once per page. And more importantly, + * + * (2) We must _NOT_ publish dirty bits to the other threads + * (e.g., the migration thread) via the kvm memory slot dirty + * bitmaps before correctly re-protect those dirtied pages. + * Otherwise we can have potential risk of data corruption if + * the page data is read in the other thread before we do + * reset below. + */ + kvm_slots_lock(); + total =3D kvm_dirty_ring_reap_locked(s); + kvm_slots_unlock(); + + return total; +} + +static void do_kvm_cpu_synchronize_kick(CPUState *cpu, run_on_cpu_data arg) +{ + /* No need to do anything */ +} + +/* + * Kick all vcpus out in a synchronized way. When returned, we + * guarantee that every vcpu has been kicked and at least returned to + * userspace once. + */ +static void kvm_cpu_synchronize_kick_all(void) +{ + CPUState *cpu; + + CPU_FOREACH(cpu) { + run_on_cpu(cpu, do_kvm_cpu_synchronize_kick, RUN_ON_CPU_NULL); + } +} + +/* + * Flush all the existing dirty pages to the KVM slot buffers. When + * this call returns, we guarantee that all the touched dirty pages + * before calling this function have been put into the per-kvmslot + * dirty bitmap. + * + * This function must be called with BQL held. + */ +static void kvm_dirty_ring_flush(void) +{ + trace_kvm_dirty_ring_flush(0); + /* + * The function needs to be serialized. Since this function + * should always be with BQL held, serialization is guaranteed. + * However, let's be sure of it. + */ + assert(qemu_mutex_iothread_locked()); + /* + * First make sure to flush the hardware buffers by kicking all + * vcpus out in a synchronous way. + */ + kvm_cpu_synchronize_kick_all(); + kvm_dirty_ring_reap(kvm_state); + trace_kvm_dirty_ring_flush(1); +} + /** * kvm_physical_sync_dirty_bitmap - Sync dirty bitmap from kernel space * @@ -1164,7 +1375,24 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, goto out; } if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { - kvm_slot_get_dirty_log(kvm_state, mem); + /* + * NOTE: We should be aware of the fact that here we're on= ly + * doing a best effort to sync dirty bits. No matter whet= her + * we're using dirty log or dirty ring, we ignored two fac= ts: + * + * (1) dirty bits can reside in hardware buffers (PML) + * + * (2) after we collected dirty bits here, pages can be di= rtied + * again before we do the final KVM_SET_USER_MEMORY_REGION= to + * remove the slot. + * + * Not easy. Let's cross the fingers until it's fixed. + */ + if (kvm_state->kvm_dirty_ring_size) { + kvm_dirty_ring_reap_locked(kvm_state); + } else { + kvm_slot_get_dirty_log(kvm_state, mem); + } kvm_slot_sync_dirty_pages(mem); } =20 @@ -1212,6 +1440,51 @@ out: kvm_slots_unlock(); } =20 +static void *kvm_dirty_ring_reaper_thread(void *data) +{ + KVMState *s =3D data; + struct KVMDirtyRingReaper *r =3D &s->reaper; + + rcu_register_thread(); + + trace_kvm_dirty_ring_reaper("init"); + + while (true) { + r->reaper_state =3D KVM_DIRTY_RING_REAPER_WAIT; + trace_kvm_dirty_ring_reaper("wait"); + /* + * TODO: provide a smarter timeout rather than a constant? + */ + sleep(1); + + trace_kvm_dirty_ring_reaper("wakeup"); + r->reaper_state =3D KVM_DIRTY_RING_REAPER_REAPING; + + qemu_mutex_lock_iothread(); + kvm_dirty_ring_reap(s); + qemu_mutex_unlock_iothread(); + + r->reaper_iteration++; + } + + trace_kvm_dirty_ring_reaper("exit"); + + rcu_unregister_thread(); + + return NULL; +} + +static int kvm_dirty_ring_reaper_init(KVMState *s) +{ + struct KVMDirtyRingReaper *r =3D &s->reaper; + + qemu_thread_create(&r->reaper_thr, "kvm-reaper", + kvm_dirty_ring_reaper_thread, + s, QEMU_THREAD_JOINABLE); + + return 0; +} + static void kvm_region_add(MemoryListener *listener, MemoryRegionSection *section) { @@ -1240,6 +1513,36 @@ static void kvm_log_sync(MemoryListener *listener, kvm_slots_unlock(); } =20 +static void kvm_log_sync_global(MemoryListener *l) +{ + KVMMemoryListener *kml =3D container_of(l, KVMMemoryListener, listener= ); + KVMState *s =3D kvm_state; + KVMSlot *mem; + int i; + + /* Flush all kernel dirty addresses into KVMSlot dirty bitmap */ + kvm_dirty_ring_flush(); + + /* + * TODO: make this faster when nr_slots is big while there are + * only a few used slots (small VMs). + */ + kvm_slots_lock(); + for (i =3D 0; i < s->nr_slots; i++) { + mem =3D &kml->slots[i]; + if (mem->memory_size && mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { + kvm_slot_sync_dirty_pages(mem); + /* + * This is not needed by KVM_GET_DIRTY_LOG because the + * ioctl will unconditionally overwrite the whole region. + * However kvm dirty ring has no such side effect. + */ + kvm_slot_reset_dirty_pages(mem); + } + } + kvm_slots_unlock(); +} + static void kvm_log_clear(MemoryListener *listener, MemoryRegionSection *section) { @@ -1345,10 +1648,15 @@ void kvm_memory_listener_register(KVMState *s, KVMM= emoryListener *kml, kml->listener.region_del =3D kvm_region_del; kml->listener.log_start =3D kvm_log_start; kml->listener.log_stop =3D kvm_log_stop; - kml->listener.log_sync =3D kvm_log_sync; - kml->listener.log_clear =3D kvm_log_clear; kml->listener.priority =3D 10; =20 + if (s->kvm_dirty_ring_size) { + kml->listener.log_sync_global =3D kvm_log_sync_global; + } else { + kml->listener.log_sync =3D kvm_log_sync; + kml->listener.log_clear =3D kvm_log_clear; + } + memory_listener_register(&kml->listener, as); =20 for (i =3D 0; i < s->nr_as; ++i) { @@ -2131,12 +2439,53 @@ static int kvm_init(MachineState *ms) s->coalesced_pio =3D s->coalesced_mmio && kvm_check_extension(s, KVM_CAP_COALESCED_PIO); =20 + /* + * Enable KVM dirty ring if supported, otherwise fall back to + * dirty logging mode + */ + if (s->kvm_dirty_ring_size > 0) { + uint64_t ring_bytes; + + ring_bytes =3D s->kvm_dirty_ring_size * sizeof(struct kvm_dirty_gf= n); + + /* Read the max supported pages */ + ret =3D kvm_vm_check_extension(s, KVM_CAP_DIRTY_LOG_RING); + if (ret > 0) { + if (ring_bytes > ret) { + error_report("KVM dirty ring size %" PRIu32 " too big " + "(maximum is %ld). Please use a smaller valu= e.", + s->kvm_dirty_ring_size, + (long)ret / sizeof(struct kvm_dirty_gfn)); + ret =3D -EINVAL; + goto err; + } + + ret =3D kvm_vm_enable_cap(s, KVM_CAP_DIRTY_LOG_RING, 0, ring_b= ytes); + if (ret) { + error_report("Enabling of KVM dirty ring failed: %s. " + "Suggested mininum value is 1024.", strerror(= -ret)); + goto err; + } + + s->kvm_dirty_ring_bytes =3D ring_bytes; + } else { + warn_report("KVM dirty ring not available, using bitmap metho= d"); + s->kvm_dirty_ring_size =3D 0; + } + } + /* * KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is not needed when dirty ring is * enabled. More importantly, KVM_DIRTY_LOG_INITIALLY_SET will assume= no * page is wr-protected initially, which is against how kvm dirty ring= is * usage - kvm dirty ring requires all pages are wr-protected at the v= ery * beginning. Enabling this feature for dirty ring causes data corrup= tion. + * + * TODO: Without KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 and kvm clear dirty= log, + * we may expect a higher stall time when starting the migration. In = the + * future we can enable KVM_CLEAR_DIRTY_LOG to work with dirty ring to= o: + * instead of clearing dirty bit, it can be a way to explicitly wr-pro= tect + * guest pages. */ if (!s->kvm_dirty_ring_size) { dirty_log_manual_caps =3D @@ -2239,6 +2588,14 @@ static int kvm_init(MachineState *ms) ret =3D ram_block_discard_disable(true); assert(!ret); } + + if (s->kvm_dirty_ring_size) { + ret =3D kvm_dirty_ring_reaper_init(s); + if (ret) { + goto err; + } + } + return 0; =20 err: @@ -2551,6 +2908,17 @@ int kvm_cpu_exec(CPUState *cpu) case KVM_EXIT_INTERNAL_ERROR: ret =3D kvm_handle_internal_error(cpu, run); break; + case KVM_EXIT_DIRTY_RING_FULL: + /* + * We shouldn't continue if the dirty ring of this vcpu is + * still full. Got kicked by KVM_RESET_DIRTY_RINGS. + */ + trace_kvm_dirty_ring_full(cpu->cpu_index); + qemu_mutex_lock_iothread(); + kvm_dirty_ring_reap(kvm_state); + qemu_mutex_unlock_iothread(); + ret =3D 0; + break; case KVM_EXIT_SYSTEM_EVENT: switch (run->system_event.type) { case KVM_SYSTEM_EVENT_SHUTDOWN: diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events index e15ae8980d..72a01320a1 100644 --- a/accel/kvm/trace-events +++ b/accel/kvm/trace-events @@ -18,4 +18,11 @@ kvm_set_ioeventfd_pio(int fd, uint16_t addr, uint32_t va= l, bool assign, uint32_t kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t guest_phys_add= r, uint64_t memory_size, uint64_t userspace_addr, int ret) "Slot#%d flags= =3D0x%x gpa=3D0x%"PRIx64 " size=3D0x%"PRIx64 " ua=3D0x%"PRIx64 " ret=3D%d" kvm_clear_dirty_log(uint32_t slot, uint64_t start, uint32_t size) "slot#%"= PRId32" start 0x%"PRIx64" size 0x%"PRIx32 kvm_resample_fd_notify(int gsi) "gsi %d" +kvm_dirty_ring_full(int id) "vcpu %d" +kvm_dirty_ring_reap_vcpu(int id) "vcpu %d" +kvm_dirty_ring_page(int vcpu, uint32_t slot, uint64_t offset) "vcpu %d fet= ch %"PRIu32" offset 0x%"PRIx64 +kvm_dirty_ring_reaper(const char *s) "%s" +kvm_dirty_ring_reap(uint64_t count, int64_t t) "reaped %"PRIu64" pages (to= ok %"PRIi64" us)" +kvm_dirty_ring_reaper_kick(const char *reason) "%s" +kvm_dirty_ring_flush(int finished) "%d" =20 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index d45f78290e..753ca90668 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -329,6 +329,10 @@ struct qemu_work_item; * @ignore_memory_transaction_failures: Cached copy of the MachineState * flag of the same name: allows the board to suppress calling of the * CPU do_transaction_failed hook function. + * @kvm_dirty_gfns: Points to the KVM dirty ring for this CPU when KVM dir= ty + * ring is enabled. + * @kvm_fetch_index: Keeps the index that we last fetched from the per-vCPU + * dirty ring structure. * * State of one CPU core or thread. */ @@ -400,9 +404,12 @@ struct CPUState { */ uintptr_t mem_io_pc; =20 + /* Only used in KVM */ int kvm_fd; struct KVMState *kvm_state; struct kvm_run *kvm_run; + struct kvm_dirty_gfn *kvm_dirty_gfns; + uint32_t kvm_fetch_index; =20 /* Used for events with 'vcpu' and *without* the 'disabled' properties= */ DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS); --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875555; cv=none; d=zohomail.com; s=zohoarc; b=YIykEQxvhkWKMCqnQw7skXfgkweqMs0VErYQMMum85gdf6qDMgesf1x2Inw0Esh6jbXKRAeVrvNTjfIKjsPhb6/izzASVRQV36WjMnBoejY75VkDxByR2VG1PKuLkHuhPr1MfsdKc03+r8tAT0R0QhSW11P6YySngbSvOT9alZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875555; 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=4v/9OYPB+jHGFxocgWm85QsiZNWsRItB2trj79AKSsE=; b=l0/0bKtpP5tutUDjP5P1DyFhG5+ErvPU2g+4gwXozvUOR5Ei++cIPdhRCGdngEapzTP9LBQIkkYUGI80ma5GrbkVKp0s5eisPTM+72xJ7ZVnKFIbc46VKui1NJIy7Q6rj0lKN/3aIpov5A4aft+yb3P28LSNia5p3jIklrteBuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875555495153.43137387424258; Mon, 24 May 2021 09:59:15 -0700 (PDT) Received: from localhost ([::1]:40480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDv8-0007Vk-Cj for importer2@patchew.org; Mon, 24 May 2021 12:59:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeR-0004rA-4z for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:59 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:33457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004OJ-LS for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: by mail-ed1-x52f.google.com with SMTP id b17so32769589ede.0 for ; Mon, 24 May 2021 09:41:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4v/9OYPB+jHGFxocgWm85QsiZNWsRItB2trj79AKSsE=; b=OCb6Xjk5my/3N9io1OrgrC149hXh0LDd3omlHKKJwQDPRGXw8G9w5KMz+OslIXrvY4 WEyPq7cpU6KDiA15Q1w25E4rSW+gzVHE1m/q3fU/qIqBMDPWqXekVD5p4DoNQ915LKy/ NHEclH6GYXOcQQOkLP6yFbOFkqi47svs2DrYSvqO77yZpk9J3gw17fduaaO7u7I0ohiI OjY8/QfTzkqmSkObD3rASpJzEEy2TeOa61EwRsObo1StbPv2eNciT5EHtm7tzI7onBMk DmTw9UlsS1+SsQqsoA/OtdI0DwuZq5a9zSZX0urFdLv8LDmdzOHaWkfH0GPuXeCNCSQM hscw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4v/9OYPB+jHGFxocgWm85QsiZNWsRItB2trj79AKSsE=; b=mvelJRdpFk2LtOULfJNEG1kMHaxB4YsMWUdMsn4ORbMeBIrVzzQw8JvVsGAwkEZpJc Wrm/Yl0a4sUrn+TG7e7bRy/Lo7Qj4rnDcrIuc0Y/5g+TA4doBRF+hj72ozDc5DtMBGTo ddtVPiKJPPXKZA4jdRH0sdStbqTNw4cwAgpbv5gXlqs0D4aliI6e+aW23/oqSj2b/8LK DvVF/h0yJX/VgavW4/KUpcnkpnsr/gD5D3CPmJO0YqahEbEsAh8a9GbDb3hxqVoN/dYV JwlrXP2ovM5GrVTTtETu5eW1p4FcBlfD5jZ/8MnItjH3jNM/QZWxzPpksgtjLHloiZeF MMaw== X-Gm-Message-State: AOAM5327RQMh0BuCm7ka6wlt9f2Qo/LaDtzzWFHAqhrLw/FwBb8eVuxV C3r7b8UWyHq9YI+QvRTWnv5WLp6XFC4nIQ== X-Google-Smtp-Source: ABdhPJz2qb8mHAvg63gvrpDCXdx/MHq3r3yepzuAgYt8z59XBKtDMiYJ3plsm8E8RDscA3GSaacoBQ== X-Received: by 2002:a50:ff13:: with SMTP id a19mr26729636edu.300.1621874505628; Mon, 24 May 2021 09:41:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 19/28] tests/qtest/fuzz: Fix build failure Date: Mon, 24 May 2021 18:41:22 +0200 Message-Id: <20210524164131.383778-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 On Fedora 32, using clang (version 10.0.1-3.fc32) we get: tests/qtest/fuzz/fuzz.c:237:5: error: implicit declaration of function 'q= emu_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration] qemu_init(result.we_wordc, result.we_wordv, NULL); ^ qemu_init() is declared in "sysemu/sysemu.h", include this header to fix. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210513162008.3922223-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- tests/qtest/fuzz/fuzz.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index 04b70e114b..5f77c84983 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -16,6 +16,7 @@ #include =20 #include "qemu/datadir.h" +#include "sysemu/sysemu.h" #include "sysemu/qtest.h" #include "sysemu/runstate.h" #include "qemu/main-loop.h" --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875842; cv=none; d=zohomail.com; s=zohoarc; b=J/Js1aIPdXztv9NBqcS+uLkd8SLZKR680CYdJ+cnwbZCGzgnnbvayxx9FxpMknabvXqPduGgltq4xKHeSP04RJ+kQ3jvJmX1xXs3YGw2zazSvoyUaJRMWPOptieT2exnankOhjYMRT0ZQcXhTrXOhy94Lug1a9TuCcgdalM02UQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875842; h=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=dQR+AbnZ3miqg+tciMmI8Yj2lCzGMfCWCQYc5IFEC9s=; b=llR4vTcsg8o3JE5jA1hJKTV2YTg/xjlUjKtgmu8xQvfJzZGbuppe8sp2mtLRIrvoGGk3Y3YrDdKWwQ+mDiECuwBfBSqeZwElt0kF/79L3NP7GT4OlLoMBSRmVWrAdghIu1wT1alMkLCyw6lTXMOzJDFiPmduOyWG2g1TMbLA5bg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875842864384.25554110536984; Mon, 24 May 2021 10:04:02 -0700 (PDT) Received: from localhost ([::1]:50884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDzl-0006Qa-Nt for importer2@patchew.org; Mon, 24 May 2021 13:04:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeS-0004wU-Bb for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:00 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:33530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004OK-KJ for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:00 -0400 Received: by mail-ej1-x629.google.com with SMTP id z12so41347028ejw.0 for ; Mon, 24 May 2021 09:41:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dQR+AbnZ3miqg+tciMmI8Yj2lCzGMfCWCQYc5IFEC9s=; b=A/FYnowcpPVFp0qag31ki10FqrInMX7PNgqRkOKxgEsIIPWrAoU0gs5yiwjbCajQyD nzG37Ehi6UlwsH3sb0CzFFmGGYuy9q1Uf8q/phHJYeuaXTuMAUOWeCiTjHTyp4VbKjey zqpXkSbjCKtM5pH5TPaFXcIIXlXhFWmTOwaED1sdjk584Rxo3jFIj0b2An6QlwATUhqT e1vfBeDnCEE945sGWwev+BloN1C43K582QHJ+eVop99lFfc9jw+TNivJwstpNyMXvtVJ LHph22Xzteb+ADQBZNNOikSUkHE7t/5BtBP1cjEr1GHMEVNr+4bF8z4rxQp5JiuCrIZb S1rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dQR+AbnZ3miqg+tciMmI8Yj2lCzGMfCWCQYc5IFEC9s=; b=IvnXlhP9NrlLKawO3XUBllSn3Ci5C57XBTpGs35RR5vuWskfKVcvLNM2XNRS8+0X2S q4AcJNnuQQ8cQh7WgcC504uYojX3g/5nsx3XrtVOuqwiXndPIytzjdAg2QTLzRusu/6m bLgI6jOIVrCUEgykVnuZEbE1JqkYvnrIcnu3Kp3Zgszrg4Vd61qqJQfLrFwPXKAq43E7 pUkzi0dd++QHtSn5pA1rG1+FFkz5uPMp5LmSAj8ffshRMXHfcycG8NRinXHeSkCwTGzJ SoRfUQDHED6VKoTjscYG8kn+eq6VHNR7xyiaq/aNeoqWrPXGMk9d0duEibCZL+8u74/z SbOg== X-Gm-Message-State: AOAM531UFmCBCH24rtoYtyy69EcwdJ+10lcc5Od7d9vCvHdYIRHKUEQ9 QcsbnYcySautNrDewyBWR6fabkyAzP32Ag== X-Google-Smtp-Source: ABdhPJy9yMdrtEXAWVD7S2V/JGQsiHYkvQcvR+2u+d0ALpazSWoZaOGGPvYC9488lczTwXHRmDcY/A== X-Received: by 2002:a17:907:20a8:: with SMTP id pw8mr24811237ejb.256.1621874506376; Mon, 24 May 2021 09:41:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/28] meson: Set implicit_include_directories to false Date: Mon, 24 May 2021 18:41:23 +0200 Message-Id: <20210524164131.383778-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Graf , Katsuhiro Ueno Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Katsuhiro Ueno Without this, libvixl cannot be compiled with macOS 11.3 SDK due to include file name conflict (usr/include/c++/v1/version conflicts with VERSION). Signed-off-by: Katsuhiro Ueno Message-Id: Tested-by: Alexander Graf Signed-off-by: Paolo Bonzini --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 632b380738..20d7035e44 100644 --- a/meson.build +++ b/meson.build @@ -2145,6 +2145,7 @@ common_all =3D common_ss.apply(config_all, strict: fa= lse) common_all =3D static_library('common', build_by_default: false, sources: common_all.sources() + genh, + implicit_include_directories: false, dependencies: common_all.dependencies(), name_suffix: 'fa') =20 --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875278; cv=none; d=zohomail.com; s=zohoarc; b=mKCX4EUcKefgpg3XdTK+ptqWoF7lMvwb/eYTTvlUJ1Xu2hsjgT0LWX2N0u0bBBzwe/nOxd+1RDOO1h00oasGF7bDo/mzPGmnS9HhvwPQFSKkH60LrsV3IRJITlNcINU8CLuB7oRcTQKJt19RlP5/xjBGdZjY9Fjh4tMf7Kyk1HE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875278; h=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=7CKD3OtHqojn7OMLGARJQq+Hx6C8OYSiCkvBwkT+gLE=; b=io/+EqWxPuf1RWb/9FqyGXL6leqfOZ7W+19AR4TbT22dJcX9bvJzKSd6sfzhJeImVqYJRPu43a+9tDsvnjLehq1HX4gxGSjnsRRpUcd+BOQPsqGn8aHkattaufPMj2RAJq6WUFxUkAqfEaCHKldjg2VLMdATkBAuziO+6T67dlw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875278077947.9459531207104; Mon, 24 May 2021 09:54:38 -0700 (PDT) Received: from localhost ([::1]:54882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llDqf-0006Mh-1p for importer2@patchew.org; Mon, 24 May 2021 12:54:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004o9-A8 for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:35686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004ON-HG for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:56 -0400 Received: by mail-ej1-x635.google.com with SMTP id k14so39352181eji.2 for ; Mon, 24 May 2021 09:41:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7CKD3OtHqojn7OMLGARJQq+Hx6C8OYSiCkvBwkT+gLE=; b=urzGMW0R3vYlDPn4EEjXycMZ6heCTTmEiiWEMn9CTmLXSBPu+egICMqfcOKZdvGrKr 0/zU5RKTnX0+pVwqRe1f+sVjoJU1SfRn83K09u9DKybJdKONLkQEK9CPRRe6W5gVgAg7 cxIAbOIhfg1QRmoZvGrphliBit3fHUMM9Ct4z2GIKK7Njt0WdFhnQtNgG2CfoZ3/ymLP SJ8LbwFRXgwv847gMLDurBv7HMZn3LTEzo+2vLz0TgW3C5aP56J2bt0U3IwfzuQqMpDS WXTqLeDw8TFR0zxCEN0eLjkvCo0HFBtUgGiXRKjQNFoKw8HlxIlxqyRu4uxKG/xNjD9O ZLfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7CKD3OtHqojn7OMLGARJQq+Hx6C8OYSiCkvBwkT+gLE=; b=Kk4KVfhETH1rI5KwXqcbl5l3PWdQbT3jI0NYdVN0/pDXA7XeF+hIOKtjOy8jmbmrFQ dObVOxLdKUhQ282XEz9DcVVxzrxssQz2aUe3GKHm0wTjcc+R/jtlWLKFOznd6rKpeNsa 06pJcBr9P4HCfHDKN4x55FldCgq5IkeUqnjZ8Xp3098iNINMLN+gZJyRwacTENoG47fq 2Jo7xBFteNhCSvtaXrGy77mIcOGPtDVrjqaCMEU24heimj2ziukHq7gQb5hOxHD7XIdm Z9ny7cd+tUIfYQoF+eWRRK5uyB3HEX7jdtsK8/7hhtIyKP0mcwZRR2t3HYa2P02a36dA HHLw== X-Gm-Message-State: AOAM533wP5ztHmgN2fBz3/gzxASGorNWkp3+Gbxpoj0OJReaQDXmwZf/ 4Rb95K8yfT/Xx+ARSn7flXAMjVkf+Jc28A== X-Google-Smtp-Source: ABdhPJzueAlUKppslrAzHfnJvA1SgicZTPEWsdpRuvZ4HczlUSE5kjJlfOXB5/6XultZ/YFaDM38Ug== X-Received: by 2002:a17:906:55c1:: with SMTP id z1mr24650142ejp.229.1621874507042; Mon, 24 May 2021 09:41:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 21/28] remove qemu-options* from root directory Date: Mon, 24 May 2021 18:41:24 +0200 Message-Id: <20210524164131.383778-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" These headers are also included from softmmu/vl.c, so they should be in include/. Remove qemu-options-wrapper.h, since elsewhere we include "template" headers directly and #define the parameters in the including file; move qemu-options.h to include/. Reviewed-by: Markus Armbruster Signed-off-by: Paolo Bonzini --- qemu-options.h =3D> include/qemu/qemu-options.h | 9 ++++- os-posix.c | 2 +- os-win32.c | 1 - qemu-options-wrapper.h | 40 ------------------- qemu-options.hx | 4 ++ softmmu/vl.c | 24 ++++++++--- 6 files changed, 31 insertions(+), 49 deletions(-) rename qemu-options.h =3D> include/qemu/qemu-options.h (88%) delete mode 100644 qemu-options-wrapper.h diff --git a/qemu-options.h b/include/qemu/qemu-options.h similarity index 88% rename from qemu-options.h rename to include/qemu/qemu-options.h index b4ee63cd60..4a62c83c45 100644 --- a/qemu-options.h +++ b/include/qemu/qemu-options.h @@ -29,8 +29,13 @@ #define QEMU_OPTIONS_H =20 enum { -#define QEMU_OPTIONS_GENERATE_ENUM -#include "qemu-options-wrapper.h" + +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ + opt_enum, +#define DEFHEADING(text) +#define ARCHHEADING(text, arch_mask) + +#include "qemu-options.def" }; =20 #endif diff --git a/os-posix.c b/os-posix.c index a6846f51c1..ae6c9f2a5e 100644 --- a/os-posix.c +++ b/os-posix.c @@ -32,7 +32,7 @@ #include "qemu-common.h" /* Needed early for CONFIG_BSD etc. */ #include "net/slirp.h" -#include "qemu-options.h" +#include "qemu/qemu-options.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "sysemu/runstate.h" diff --git a/os-win32.c b/os-win32.c index fd1137bab1..e31c921983 100644 --- a/os-win32.c +++ b/os-win32.c @@ -27,7 +27,6 @@ #include #include #include "qemu-common.h" -#include "qemu-options.h" #include "sysemu/runstate.h" =20 static BOOL WINAPI qemu_ctrl_handler(DWORD type) diff --git a/qemu-options-wrapper.h b/qemu-options-wrapper.h deleted file mode 100644 index 6f548e3922..0000000000 --- a/qemu-options-wrapper.h +++ /dev/null @@ -1,40 +0,0 @@ - -#if defined(QEMU_OPTIONS_GENERATE_ENUM) - -#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ - opt_enum, -#define DEFHEADING(text) -#define ARCHHEADING(text, arch_mask) - -#elif defined(QEMU_OPTIONS_GENERATE_HELP) - -#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ - if ((arch_mask) & arch_type) \ - fputs(opt_help, stdout); - -#define ARCHHEADING(text, arch_mask) \ - if ((arch_mask) & arch_type) \ - puts(stringify(text)); - -#define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL) - -#elif defined(QEMU_OPTIONS_GENERATE_OPTIONS) - -#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ - { option, opt_arg, opt_enum, arch_mask }, -#define DEFHEADING(text) -#define ARCHHEADING(text, arch_mask) - -#else -#error "qemu-options-wrapper.h included with no option defined" -#endif - -#include "qemu-options.def" - -#undef DEF -#undef DEFHEADING -#undef ARCHHEADING - -#undef QEMU_OPTIONS_GENERATE_ENUM -#undef QEMU_OPTIONS_GENERATE_HELP -#undef QEMU_OPTIONS_GENERATE_OPTIONS diff --git a/qemu-options.hx b/qemu-options.hx index ecdb064409..8116f79818 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -5276,3 +5276,7 @@ ERST =20 =20 HXCOMM This is the last statement. Insert new options before this line! + +#undef DEF +#undef DEFHEADING +#undef ARCHHEADING diff --git a/softmmu/vl.c b/softmmu/vl.c index 11ac3750d8..ac0ff6e160 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -88,7 +88,7 @@ #include "qapi/qobject-input-visitor.h" #include "qemu/option.h" #include "qemu/config-file.h" -#include "qemu-options.h" +#include "qemu/qemu-options.h" #include "qemu/main-loop.h" #ifdef CONFIG_VIRTFS #include "fsdev/qemu-fsdev.h" @@ -854,8 +854,17 @@ static void help(int exitcode) "'disk_image' is a raw hard disk image for IDE hard disk 0\n\n", error_get_progname()); =20 -#define QEMU_OPTIONS_GENERATE_HELP -#include "qemu-options-wrapper.h" +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ + if ((arch_mask) & arch_type) \ + fputs(opt_help, stdout); + +#define ARCHHEADING(text, arch_mask) \ + if ((arch_mask) & arch_type) \ + puts(stringify(text)); + +#define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL) + +#include "qemu-options.def" =20 printf("\nDuring emulation, the following keys are useful:\n" "ctrl-alt-f toggle full screen\n" @@ -880,8 +889,13 @@ typedef struct QEMUOption { =20 static const QEMUOption qemu_options[] =3D { { "h", 0, QEMU_OPTION_h, QEMU_ARCH_ALL }, -#define QEMU_OPTIONS_GENERATE_OPTIONS -#include "qemu-options-wrapper.h" + +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ + { option, opt_arg, opt_enum, arch_mask }, +#define DEFHEADING(text) +#define ARCHHEADING(text, arch_mask) + +#include "qemu-options.def" { NULL }, }; =20 --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876205; cv=none; d=zohomail.com; s=zohoarc; b=HXh1iFiCTAHNc0idGRKSxYjhRmaRy89DnXMEPW9fkhVjT2Qprl9CoBWN5pRWXsIZDx1Qwp1rk3b+TwYrj7WrfVBKtVIIIQm5jbulncQHSZqpQxlJHqjef0el6NMWrPj9s5A64KvcJnwzpYI9Ojv3S8heu3IXUBcaQ+Vy/lro4JQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876205; h=Content-Transfer-Encoding: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=rHESXCpUsGCW+It7hlotQkLFwpit1gHAqFSU/qRoQUY=; b=jIVQAZuvobfUztw8YHU39tDK7nppZCe+BsLMPau2+8xJD7/50Ts46pPxmtX+lGl6WvgSZB7iEG7qBlmuJVE1v2taFiRgXjwk7/NwoLP1v5KPPkBYtLmzP8lu+3NV4O5lfh/WBOu5uFjHK7wFNsrWVe+iVDd39LizzlYAUkHDCtE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876205787378.88490408335747; Mon, 24 May 2021 10:10:05 -0700 (PDT) Received: from localhost ([::1]:37348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE5c-0000Vf-PF for importer2@patchew.org; Mon, 24 May 2021 13:10:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeQ-0004ny-9I for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:58 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:40758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeI-0004OQ-Iv for qemu-devel@nongnu.org; Mon, 24 May 2021 12:41:57 -0400 Received: by mail-ej1-x62c.google.com with SMTP id n2so42775395ejy.7 for ; Mon, 24 May 2021 09:41:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rHESXCpUsGCW+It7hlotQkLFwpit1gHAqFSU/qRoQUY=; b=HD5hQAsOotM3RHIEzHf21zWW7ibbEjo30PDW7W45w8rvo3FJEBM1NZmwS79oK5HOrQ mnfsXohMxuz4KWcDTMHbI1qQ5HYfjT0Cx3+JRgSHsq1GZ26ZN19Y/TqMPn7snx/mwss6 ndfsv1Q6Ygyjso/kNS+scPvWCADFQzFMpXFlckAWcewc9Ch088x1kNhV07hZUiP12DSp aCUOJIN/LdHs655rK7MjnOV/uMEgcEt+niinI+V7Oao0/0BC6yKYSRn+BF2mbnjwdL0s lstXKtI++mLU0cioMIRrKElkC7mervWCZx65hyXE+ZBEGF+XUiEnr49YLf0EzQ2cdTt7 HxPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rHESXCpUsGCW+It7hlotQkLFwpit1gHAqFSU/qRoQUY=; b=Y9P8LzAWSW9ki94C2YKVgp9UbUGHbnd+hHY1Vp5f5aiSgg+nU++/94s9V9AUgA76gv 7Xk1vMBri77P7ADghBRC8hjPwFLB4Nkrs6ViBlzgZIjBqjh2CpDduApopIhCX61U97sP FvoZy7ODEIiLQExKhLipfNxKfC/WLfMVHw4SKverAEC3kPknRbYaxck4dlt3TlWUtKFv wgOe4TZyVmGTqnHmTbYTCEf4Q6k7BO6tKcT4RwFU8UI/3zKmRyCDp40144OJYfRi3ja1 tTTL7PH5nY0NrSARTtORGjfLKNznVxe6CZaBfNTD01e6fz8+yffyXK8vyy1P824xsX5G Vguw== X-Gm-Message-State: AOAM5323lkNbxr0qLHkBbKb6FGPvjyJuEMM5SNFOeRYaN/uaw4o3cywE qUQZXkyq2rkGrigil86+siPB9SqlH/TIOQ== X-Google-Smtp-Source: ABdhPJxRYvUx2chelBCsXYiLIY5RWVTkyIgyDcCTx5cz75s3mdiqwmqtthbQOT1XjYG8TobjD1mt4Q== X-Received: by 2002:a17:907:20b0:: with SMTP id pw16mr24479446ejb.48.1621874507673; Mon, 24 May 2021 09:41:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/28] replication: move include out of root directory Date: Mon, 24 May 2021 18:41:25 +0200 Message-Id: <20210524164131.383778-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The replication.h file is included from migration/colo.c and tests/unit/tes= t-replication.c, so it should be in include/. Signed-off-by: Paolo Bonzini --- block/replication.c | 2 +- replication.h =3D> include/block/replication.h | 4 ++-- migration/colo.c | 2 +- replication.c | 2 +- tests/unit/test-replication.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename replication.h =3D> include/block/replication.h (98%) diff --git a/block/replication.c b/block/replication.c index 97be7ef4de..52163f2d1f 100644 --- a/block/replication.c +++ b/block/replication.c @@ -22,7 +22,7 @@ #include "sysemu/block-backend.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" -#include "replication.h" +#include "block/replication.h" =20 typedef enum { BLOCK_REPLICATION_NONE, /* block replication is not starte= d */ diff --git a/replication.h b/include/block/replication.h similarity index 98% rename from replication.h rename to include/block/replication.h index d49fc22cb9..21931b4f0c 100644 --- a/replication.h +++ b/include/block/replication.h @@ -23,7 +23,7 @@ typedef struct ReplicationOps ReplicationOps; typedef struct ReplicationState ReplicationState; =20 /** - * SECTION:replication.h + * SECTION:block/replication.h * @title:Base Replication System * @short_description: interfaces for handling replication * @@ -32,7 +32,7 @@ typedef struct ReplicationState ReplicationState; * * How to use replication interfaces * - * #include "replication.h" + * #include "block/replication.h" * * typedef struct BDRVReplicationState { * ReplicationState *rs; diff --git a/migration/colo.c b/migration/colo.c index de27662cab..e498fdb125 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -28,7 +28,7 @@ #include "migration/failover.h" #include "migration/ram.h" #ifdef CONFIG_REPLICATION -#include "replication.h" +#include "block/replication.h" #endif #include "net/colo-compare.h" #include "net/colo.h" diff --git a/replication.c b/replication.c index be3a42f9c9..4acd3f8004 100644 --- a/replication.c +++ b/replication.c @@ -14,7 +14,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "replication.h" +#include "block/replication.h" =20 static QLIST_HEAD(, ReplicationState) replication_states; =20 diff --git a/tests/unit/test-replication.c b/tests/unit/test-replication.c index b067240add..afff908d77 100644 --- a/tests/unit/test-replication.c +++ b/tests/unit/test-replication.c @@ -14,7 +14,7 @@ #include "qapi/qmp/qdict.h" #include "qemu/option.h" #include "qemu/main-loop.h" -#include "replication.h" +#include "block/replication.h" #include "block/block_int.h" #include "block/qdict.h" #include "sysemu/block-backend.h" --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621877089; cv=none; d=zohomail.com; s=zohoarc; b=R7QRwFzgHC8QBAEplYGsjg4uu/fN8a1bsD4kF8qxdKrBsJGMFHPXNhu+Llih1ZbE+fAUoqbH+N9s0iScEOF0gzeskcCJbFa6yCLdf9HUp7kC0lEKdv4r1gnqUlwJWUx/8bKkTeym8ZBkTsrP9/CvtIpur0l4zwaOndwQUPsTK1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621877089; h=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=NURTTjYEkN5qlT+hGLhGVfDulriBn9GBwNW8du6ptW0=; b=PsOJV+e3QzYO8gwHPAKUGPb/ZHl6JqwVD6onBug+XaUztd0zcViiza9He1kCgTpyDIbn0xBAtOXnWM3m/dp4ma60+a8vvmxHgbW5F2Qr+cSjEqrz9b9q3/vlVq6Vus0GvKdi3jA3z8LXglx/1k+leZn7tgiZb53bcxNb40SL/50= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621877089704622.0250895074295; Mon, 24 May 2021 10:24:49 -0700 (PDT) Received: from localhost ([::1]:43922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llEJs-0007Zh-KU for importer2@patchew.org; Mon, 24 May 2021 13:24:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeT-00052A-TB; Mon, 24 May 2021 12:42:01 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:39787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004OR-6F; Mon, 24 May 2021 12:42:01 -0400 Received: by mail-ed1-x536.google.com with SMTP id h16so32705511edr.6; Mon, 24 May 2021 09:41:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NURTTjYEkN5qlT+hGLhGVfDulriBn9GBwNW8du6ptW0=; b=XnINKs9IcOc75ykCIk7kgwbCtIGrpyWeMO5tOlPR72u9Kec7WI5eeL21MKuq+VfdUb 6OWAPryoUGptXb7mMBTJiV5tc5t0l9X6x9D0p5+2fcqYFtzqgqlwtOZoPX2ZCL/lcGB/ H8n+eYWItJRqt4QNHcvnmJ6WpkNhumAk1wFh2QpT6u8lZpNJs0QMVnmDfTilUWR0PR9r mkI6uFn11ErjLFwGVvwxV5kOP/rKj33xh037pnJlEjqlsTPoAinEdtx1egTUTxc+MFTZ oAOBFioHCzuTpT/ouqhvDLZa+DzIuKUA1xL1+BI4yekt3fdSXxKrCTbsKTqtSrF3xNtm tAFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NURTTjYEkN5qlT+hGLhGVfDulriBn9GBwNW8du6ptW0=; b=JbWFTFY1vMTwC7pqOpIY9hAvwWHMtJxD3RxssU5V9PvCNG3DEgX8C+CawAgR8Ib/Un 0xwxlQ0WcQUo7arsxB2DYG13fZhQFFLW7owNo91s/eLomHMLYoTmL8Ix/ypcE14Mu0o7 ce9ZZYtFfP3gtYBvYHfaQKsqHOkA8DbBln0Gfu03ZyQ/90DT6xVureA5yd2FG9J6FGH9 8VmFJ6cj/TbZtsrXgRxicMZiZwKvZtbXc76+C4MMnsxacPYD3GBUpSMSHXCW7iRj4+3n OiVzFgfaYWRdh3jkW5bj18TTaXf071w8CWgPoKnnXdlhGxweLGCaDM3M7+HGFlnTwC0v HhVw== X-Gm-Message-State: AOAM5314TWWvKyu/cAvm7vB/M370kRU7ycJVLicnAXpVqmdBvp64/cJ3 bhaxxaXPeFpbVnUupbZhhHj4G0lX2MmdfA== X-Google-Smtp-Source: ABdhPJyWMUndKzt9/+xQ0GekJcWXISBcaU9zi0qS2nVPMZGdBt3nG25FEt3SOVD0zAck24bQ8BqTwg== X-Received: by 2002:a05:6402:1d8e:: with SMTP id dk14mr27059783edb.385.1621874508407; Mon, 24 May 2021 09:41:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/28] vl: allow not specifying size in -m when using -M memory-backend Date: Mon, 24 May 2021 18:41:26 +0200 Message-Id: <20210524164131.383778-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Starting in QEMU 6.0's commit f5c9fcb82d ("vl: separate qemu_create_machine", 2020-12-10), a function have_custom_ram_size() replaced the return value of set_memory_options(). The purpose of the return value was to record the presence of "-m size", and if it was not there, change the default RAM size to the size of the memory backend passed with "-M memory-backend". With that commit, however, have_custom_ram_size() is now queried only after set_memory_options has stored the fixed-up RAM size in QemuOpts for "future use". This was actually the only future use of the fixed-up RAM size, so remove that code and fix the bug. Cc: qemu-stable@nongnu.org Fixes: f5c9fcb82d ("vl: separate qemu_create_machine", 2020-12-10) Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index ac0ff6e160..21e55718a6 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2039,8 +2039,6 @@ static void set_memory_options(MachineClass *mc) exit(EXIT_FAILURE); } =20 - /* store value for the future use */ - qemu_opt_set_number(opts, "size", ram_size, &error_abort); maxram_size =3D ram_size; =20 if (qemu_opt_get(opts, "maxmem")) { --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621875928; cv=none; d=zohomail.com; s=zohoarc; b=HhLdNoA9kTgBUgo/DIoHf8Sen0V30kX3F6UhV/y+OeGMJW/e8x9dvF0fA2+sTtul+10SX7+uI5JoGwIq0cJIVp4UGWlM+gpo7MB0xNxSTnVO5/IsCz0nlonmWzysm75WOdK7Ijc0mQIazcq4ZDpUzO4nLRM23CCvB/z4G8Lr8Z0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621875928; h=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=TzYzur0aoGcQcPzxTRLpL0L9tdlIkO4njHPHcUkBeIQ=; b=bL5Jtwfww25Y7mYfF2hrMXbQQzJP33kxnTt3uJvD/1DqsoAWy4z/4PV8YajuwXmW6N7bPtnYzNYJpYgnsz6slkBfcj2+u2RDJEgXCY8EUasflR4MHD6POq2WCK2sEtowZdxiArCMTSZTv9h5E8fnKdGhzGR7rmXMox3lL/+m8go= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621875928100313.48862679384615; Mon, 24 May 2021 10:05:28 -0700 (PDT) Received: from localhost ([::1]:55114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE18-0000xR-0u for importer2@patchew.org; Mon, 24 May 2021 13:05:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeS-0004yC-Rv; Mon, 24 May 2021 12:42:00 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:39677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004OY-4K; Mon, 24 May 2021 12:42:00 -0400 Received: by mail-ej1-x635.google.com with SMTP id l1so42789619ejb.6; Mon, 24 May 2021 09:41:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TzYzur0aoGcQcPzxTRLpL0L9tdlIkO4njHPHcUkBeIQ=; b=fF9MQQEH/u2jop2j8HBHUka6Vpd6AoxtdU9D+oA4n3aoYUXKjJOW3yHaVfohLWPgL/ nSLxWw02J94gsbL00TD4J53taEO6KwG/fLkc0sN+egDK/TNKopZ5x3RhLtqwqg1mh42o L1gu+gN5WoWFLOtGeGGv1vooapul5drBJa3bfdnAuzrXqzTI+i2+n9x0Xgj6cfw7ZL9Z yUtZz2YgYbBaTW+mYPdxX5B86TnYL9zKgfrzmnw9wBfvEbmy3Y055klhW8MWTAxN+k28 YWjzjDxQa0ESm4adhk9vflr0/m41+3nz+BpCDoXss9JOt9TbNmErbfyMwPX4x79kCDF8 vkWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TzYzur0aoGcQcPzxTRLpL0L9tdlIkO4njHPHcUkBeIQ=; b=hrg6/7V0MOKlFY60bg8w2JZ6b+kufoKMdfoohb9sUdtrNlIzMtbqKzwHF9oYy29rJt hb4VdDDqFCjjwS6w9tnR/B34pzDqosJDvcUrGDbobyQgjFkjxhGZKVW+1gBpi1MN4J0o Jloef75EM2KPefVAm4Xot8Dnm3O2/hYlr8jGwqyxPVidbiGX9d7uXryMIsNaQRwa63F7 DpAp/F9fDRL60Tu4PRDYa8SesjTZgw891jkeec/56OHyg7sN8OnT2McMSLyAN/Pk4fNK xnvfmlSGAF93ZS/WqKe3cAaYjxB8gxNr/VxoYals93nN8o4oq0ZeaDpt3gDGNnvHEYhT yVSA== X-Gm-Message-State: AOAM53246GkMxPlaDk9lhxf9Hnv93QXDrSZmadnb30MgXuDUoYZOfkwf DIJCnp9OOO24bs0meq/rwwEi5msKEMb1Jw== X-Google-Smtp-Source: ABdhPJwZ7h5UKZz//VJPfPgt/Ib4firFw7zs2fc6MOuXxYpeGnBLrPMMb5mb94eWIZL4lVK2sv+b8Q== X-Received: by 2002:a17:906:914d:: with SMTP id y13mr24144351ejw.489.1621874509087; Mon, 24 May 2021 09:41:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 24/28] qemu-config: load modules when instantiating option groups Date: Mon, 24 May 2021 18:41:27 +0200 Message-Id: <20210524164131.383778-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Right now the SPICE module is special cased to be loaded when processing of the -spice command line option. However, the spice option group can also be brought in via -readconfig, in which case the module is not loaded. Add a generic hook to load modules that provide a QemuOpts group, and use it for the "spice" and "iscsi" groups. Fixes: #194 Fixes: https://bugs.launchpad.net/qemu/+bug/1910696 Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- include/qemu/config-file.h | 2 +- softmmu/vl.c | 21 +++++++++++++++++---- stubs/meson.build | 1 + stubs/module-opts.c | 6 ++++++ util/qemu-config.c | 1 + 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 stubs/module-opts.c diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h index 8d3e53ae4d..0500b3668d 100644 --- a/include/qemu/config-file.h +++ b/include/qemu/config-file.h @@ -1,7 +1,7 @@ #ifndef QEMU_CONFIG_FILE_H #define QEMU_CONFIG_FILE_H =20 - +void qemu_load_module_for_opts(const char *group); QemuOptsList *qemu_find_opts(const char *group); QemuOptsList *qemu_find_opts_err(const char *group, Error **errp); QemuOpts *qemu_find_opts_singleton(const char *group); diff --git a/softmmu/vl.c b/softmmu/vl.c index 21e55718a6..6054f6f0b9 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2627,6 +2627,23 @@ void qmp_x_exit_preconfig(Error **errp) } } =20 +#ifdef CONFIG_MODULES +void qemu_load_module_for_opts(const char *group) +{ + static bool spice_tried; + if (g_str_equal(group, "spice") && !spice_tried) { + ui_module_load_one("spice-core"); + spice_tried =3D true; + } + + static bool iscsi_tried; + if (g_str_equal(group, "iscsi") && !iscsi_tried) { + block_module_load_one("iscsi"); + iscsi_tried =3D true; + } +} +#endif + void qemu_init(int argc, char **argv, char **envp) { QemuOpts *opts; @@ -3386,10 +3403,6 @@ void qemu_init(int argc, char **argv, char **envp) break; case QEMU_OPTION_spice: olist =3D qemu_find_opts_err("spice", NULL); - if (!olist) { - ui_module_load_one("spice-core"); - olist =3D qemu_find_opts("spice"); - } if (!olist) { error_report("spice support is disabled"); exit(1); diff --git a/stubs/meson.build b/stubs/meson.build index 3faef16892..f3f979c3fe 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -22,6 +22,7 @@ stub_ss.add(files('isa-bus.c')) stub_ss.add(files('is-daemonized.c')) stub_ss.add(when: 'CONFIG_LINUX_AIO', if_true: files('linux-aio.c')) stub_ss.add(files('migr-blocker.c')) +stub_ss.add(files('module-opts.c')) stub_ss.add(files('monitor.c')) stub_ss.add(files('monitor-core.c')) stub_ss.add(files('pci-bus.c')) diff --git a/stubs/module-opts.c b/stubs/module-opts.c new file mode 100644 index 0000000000..a7d0e4ad6e --- /dev/null +++ b/stubs/module-opts.c @@ -0,0 +1,6 @@ +#include "qemu/osdep.h" +#include "qemu/config-file.h" + +void qemu_load_module_for_opts(const char *group) +{ +} diff --git a/util/qemu-config.c b/util/qemu-config.c index 670bd6ebca..34974c4b47 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -16,6 +16,7 @@ static QemuOptsList *find_list(QemuOptsList **lists, cons= t char *group, { int i; =20 + qemu_load_module_for_opts(group); for (i =3D 0; lists[i] !=3D NULL; i++) { if (strcmp(lists[i]->name, group) =3D=3D 0) break; --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621877266; cv=none; d=zohomail.com; s=zohoarc; b=QnWuRxPEXMoXgVijxMDv6EVcXnTM4tr6UeeoLSSdBY6NOcZCNojt6UwtuWm/kzz4/uzXwy7Fb1fSps24mJ0FY6uExsKH86bOtMW8MNp5Ua7b/0RiQCksO9NtvcpcgXgSPxCXkoY+i7IYqMUo/+OMgD7+JIcpiMdpGPu9PABDSfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621877266; h=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=zJ+4ctxl9rJ2GoSUbpS/PEa40oPl9E9xb9BjzoxwX+g=; b=ejzDbnztUDsKCWsLMb67oYj3Mkg17fmJZhJfiWvQKgis5kGup4+QPDk4q9YBfmYG49xar4anahmEu5Vk46Xm3q9+csYZg2TOefsmHU0d/lKCNwEyNkkYa90NQcRVJqIf50NyKd4be9/e4HHnXSUvfbQqMlSklHTBR8/phxs++2A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16218772662308.364479426455318; Mon, 24 May 2021 10:27:46 -0700 (PDT) Received: from localhost ([::1]:51728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llEMj-0004Ye-4b for importer2@patchew.org; Mon, 24 May 2021 13:27:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeU-00054C-EI for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:02 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:40767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004Om-6M for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:02 -0400 Received: by mail-ej1-x635.google.com with SMTP id n2so42775523ejy.7 for ; Mon, 24 May 2021 09:41:50 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zJ+4ctxl9rJ2GoSUbpS/PEa40oPl9E9xb9BjzoxwX+g=; b=ebyYMXrKX69XMR00nud9wvIup/Hwvgb4wNNDEt5I+5l6g7LCevW7bt0dzRZnFKd6tK CxVs99nyQ/3tVlmf74u/aKGe5GeLTQm/CIn3TDyTTTW40wZ+E668z3FdbI7sXp6yLmg5 oY5dojpNzzZ/x2xsaAC/rndrZngnXc2fOHMykRMUqAk2yJ93GOGOejkLTwmyAxAo7zbY gcgP7Ls+o4+0ANnuiXPDWJ3Ed77YMANtZJMDZaIsvJ4501ROkuBG7393D75uycgsECQ9 K6xDAXGg8cLfauBMA3EPXizrRpyQxqgwznHYwXjkFrOFCqDN5THWNADC2MgcOlgs2EAA 5LYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zJ+4ctxl9rJ2GoSUbpS/PEa40oPl9E9xb9BjzoxwX+g=; b=CY8ngKovf6H5QIcNUjXrbOJwua9JK3DFSg7GT8mxGhmDDLQvFhcJ2k0FQjGZOFP+0k 9BYW0x5BdjNtMrbS2O2nh6brxqqAtrb3Dsw7K/T6YA9TmDZUFZFORJIEw/GX+UIxhyzr nyMZujhyjaDBFPRKOhd59fJotWqpcaf9SRQRU0TxHeynBau//tm1RLXIMaO8BdNuNENo ghKBFbzO4R29UDjpznwQdlrXHw6Ciyg9wZ6S1/8HxNqg+x6ICJiNTi/3Sm05zBeNomWb ME54M/Ha6rIRDLSloc0ThY49uhtNgmW8g1ucBg0/kOmFopeIb2NPDIm395OaXlZayzxe MtRA== X-Gm-Message-State: AOAM532IzSO/+U6U+N0tbXWqmrrD4yYpdT7vNrlr8Usc2xscfpeyz5n7 I+gtwjwj/2+rK1WZylH6j2yajZCNBTPR/w== X-Google-Smtp-Source: ABdhPJzVn6AoFaQw7HZA6wPhN/wT49np5N9kdGSBfweicVHexuvai8RZS4KzmAl0FkiuUJGk9AMikg== X-Received: by 2002:a17:907:7747:: with SMTP id kx7mr24449753ejc.400.1621874509754; Mon, 24 May 2021 09:41:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 25/28] doc: Add notes about -mon option mode=control argument. Date: Mon, 24 May 2021 18:41:28 +0200 Message-Id: <20210524164131.383778-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ali Shirvani , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Ali Shirvani via The mode=3Dcontrol argument configures a QMP monitor. Signed-off-by: Ali Shirvani Reviewed-by: Stefan Hajnoczi Message-Id: <0799f0de89ad2482672b5d61d0de61e6eba782da.1621407918.git.alishi= r@routerhosting.com> Signed-off-by: Paolo Bonzini --- qemu-options.hx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 8116f79818..14258784b3 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3799,8 +3799,11 @@ DEF("mon", HAS_ARG, QEMU_OPTION_mon, \ "-mon [chardev=3D]name[,mode=3Dreadline|control][,pretty[=3Don|off]]\n= ", QEMU_ARCH_ALL) SRST ``-mon [chardev=3D]name[,mode=3Dreadline|control][,pretty[=3Don|off]]`` - Setup monitor on chardev name. ``pretty`` is only valid when - ``mode=3Dcontrol``, turning on JSON pretty printing to ease + Setup monitor on chardev name. ``mode=3Dcontrol`` configures=20 + a QMP monitor (a JSON RPC-style protocol) and it is not the + same as HMP, the human monitor that has a "(qemu)" prompt. + ``pretty`` is only valid when ``mode=3Dcontrol``,=20 + turning on JSON pretty printing to ease human reading and debugging. ERST =20 --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621877392; cv=none; d=zohomail.com; s=zohoarc; b=is0TG9xjBw8XeTk6T0CPRRpyjPF8L6KhHddmHV1PH+uJQ3QL1iCa+CNbI4bt3naan+o5CcPGVXq+Rj1hosQC3YmMMt/GSV9sUrnHC6jDUD7aKh/yhzQD0eV2HfrVIZuSPtct652NAUT8bzBtjkiGKHfBRB+e1qHlBfe10CCkTDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621877392; 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=PRKAqQVQk6atOGbruXu4fzvA7uFctSe6m5tKH4EPE8E=; b=Q3j0LUJEq+U/GdjVl3fAFHxRcmRH4kPvwAtqVKIsZOz36c3Y0DVCFoZdyJG0QB4GF9Ic+1sV4Km5S8DhGYg11RgT/FgvLwTjoapuyPfZIh4ChInyZflVnFk0cNB57QM2BlNS7cYBYxxd+vTCotE1nDovU9TDbkjO9u4FSFc2Wxs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162187739265855.62148788324771; Mon, 24 May 2021 10:29:52 -0700 (PDT) Received: from localhost ([::1]:58396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llEOl-0000gN-E2 for importer2@patchew.org; Mon, 24 May 2021 13:29:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeW-00056y-IH for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:11 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:36584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeJ-0004PZ-Oj for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:03 -0400 Received: by mail-ed1-x530.google.com with SMTP id df21so32753567edb.3 for ; Mon, 24 May 2021 09:41:51 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PRKAqQVQk6atOGbruXu4fzvA7uFctSe6m5tKH4EPE8E=; b=Nj39wwUBKfMBIanByECbgcdw187Y+VRABHLd9fIp9tPBXARJaKUGhROSlUTZOntP2B FGD3g0n0dZKC2I9NUty4WfnAHyGzL+alECUfL7CLJ5/YaHlGK9xfQtDyVjwwd39Xxex6 oJRPZyKUQC1ZNX/jLGQtoiLkXWxxuwu97vg4/MD4qfsnq/6O221eVgUDK38rUGGBgkaT MYyBIvisV4KkoaGEZ/YlSUrRko7jHS4nw7poytr9ecaOqmMisQimjsIz/PCtGvJVAn2x jENP7Q0ovCrzfblcvVXzTouoGsyKrGTYY8ekwiI7yyBM1UKvpiHq8464cMXYVCjkLTbz TSAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=PRKAqQVQk6atOGbruXu4fzvA7uFctSe6m5tKH4EPE8E=; b=sbhW1m53174lljQ2wactINlCEmBWxYsLtH493fWp1TeRytPK2rQQPlKzF91CZi1Z45 6m42ruWyKBge9ByrqHTlH+8Zs8yvKBdzwtrMYc6Pkfn7HeE/zaEn/+JA61SJ62jPpRWB zsWsSnWpl+Qr3NBQNXO81RcJuWtyFyNcOmtIyHXOo6SIj65x2xZT/aPeWFTXGVY6BBq5 iT7AgcN2nOwDUPMfbvtFl66VfRi2czcpMCu8ZTTb9t1rx/J2UDQY40/GfnNLy2Z2KqcX iZVH76CYT+1Pp+1SRsnl5yu/ttp/cU8mOnQ3mYBVrKVfhSqFsUQKH4VBCBn0d1+SKxz6 GhbA== X-Gm-Message-State: AOAM533SeqZXcH487xjN8B9+YNoMm3eWoAR6dg7Vcag2LyPBwxRjTAKw L+ii/a5ZwCzaqdTQ0ykLtwQa+KP9MMHsWw== X-Google-Smtp-Source: ABdhPJwlSB7JR8b/mCXF6zkLIUvx/nYcd+n+cC7Orqvx36SPlrHhPL2fpXP2rEFN9nn6SWtQ1AWf5Q== X-Received: by 2002:a05:6402:951:: with SMTP id h17mr26957486edz.212.1621874510439; Mon, 24 May 2021 09:41:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 26/28] configure: Avoid error messages about missing *-config-*.h files Date: Mon, 24 May 2021 18:41:29 +0200 Message-Id: <20210524164131.383778-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Thomas Huth When compiling with --disable-system there is a harmless yet still annoying error message at the end of the "configure" step: sed: can't read *-config-devices.h: No such file or directory When only building the tools or docs, without any emulator at all, there is even an additional message about missing *-config-target.h files. Fix it by checking whether any of these files are available before using them. Fixes: e0447a834d ("configure: Poison all current target-specific #defines") Reported-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210519113840.298174-1-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/configure b/configure index cca532bb0c..90c0807347 100755 --- a/configure +++ b/configure @@ -6503,10 +6503,14 @@ fi =20 # Create list of config switches that should be poisoned in common code... # but filter out CONFIG_TCG and CONFIG_USER_ONLY which are special. -sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \ - -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \ - *-config-devices.h *-config-target.h | \ - sort -u > config-poison.h +target_configs_h=3D$(ls *-config-devices.h *-config-target.h 2>/dev/null) +if test -n "$target_configs_h" ; then + sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \ + -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \ + $target_configs_h | sort -u > config-poison.h +else + :> config-poison.h +fi =20 # Save the configure command line for later reuse. cat <config.status --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876366; cv=none; d=zohomail.com; s=zohoarc; b=aPdDBrItGQhW9sEGRzK1UnYpOyHcsgI0hLWvtsMhGP0D52EUI1kLQX2oa0B9nctN70oDTS1lc9aYjn17wnZ6rbWllXcvAnkEfuEx+Ir36KZDwMvlMowmpoou2jjD+bYrMtK45KEJkgv6sKL5OheUdTp0ZMcABlfm8/S4SPqmB4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876366; h=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=zDuY3FOPTKsIVSVkuFvz8ny58BlbRg0sWUb7PMImOzk=; b=WxuuxKZ3mI/C7dvn2Q6Ne5645OO9M8lUlKQXd9jCPd11A0q1gS4Ab1V3mBTrjKrGGjjt9LcxngKdthouWUg73mABdEil5TKFFq5p/h0laafLfaISPEXR25/CUrWt+r5DWg8jzsb0QSjjxcli74Vzg9Wz7RYfE97szyJOfYtVMvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876366789742.3780484801504; Mon, 24 May 2021 10:12:46 -0700 (PDT) Received: from localhost ([::1]:45364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE8D-00060F-LM for importer2@patchew.org; Mon, 24 May 2021 13:12:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeW-000571-JW for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:11 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:43912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeK-0004Q8-Ga for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:03 -0400 Received: by mail-ej1-x629.google.com with SMTP id f18so12625143ejq.10 for ; Mon, 24 May 2021 09:41:52 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zDuY3FOPTKsIVSVkuFvz8ny58BlbRg0sWUb7PMImOzk=; b=Z2OreiscSluR+xn/NPAsxr1bmgKboU5qicwZToOSGL01nXblzUBrHVLyoGUCjyxQ0M JJSE8ySq63NK8AZqHDqszqI5CT/va4PfVbiBogRsuuoilxdQ3asmbXS0X6EjyEWcDuna +jaHhzgCSxQys+Nn4NqMz7mJ+m5sSCVdoB63F5HD7GMmjSZgmizTbzdLdWvRxUr5sJV7 jnLu6gXSuwFXVhIiqioS3fkEPM0KE3FugYFxPm4VPT2kjWwTY361CWyvpfHqIH0Ev+DB aLf6M8n9n5x2o3TpvGqkHyz7SnS6Bv/zwQ20/GYGBgTBUysPW7zUd+s+eO1itJeV7lcl T0MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zDuY3FOPTKsIVSVkuFvz8ny58BlbRg0sWUb7PMImOzk=; b=Fk6IBwGlV36tTq762dSEaz1cA7rRMQ4GXiA8zeGwG+58P2UDjXVql6FUnar1ve8Gxe jY0KjHdDuxxafIxBViBd7V1wUq8zSmX+gcXtpexXAjDig1u07UsBp9sIvtgbqabO2/v5 OhANczULbddhDE8z7ms+o2J4jkLf7k/IZN2+VnUuCpsYjxbBG7o99E0Y+jCjW7kPjPJN y3s/EuS1N5e1rI4R8iS2PV6yvmhaqdHAoiKGCS7WLuI+tSUnaVqe4YybBRmPgoVNKKcV 9PKf1MHuZs7CgztUumCg47JE865z9rMx+0WIFlkJd/G1KoM5craHE02aC42AYVbFpQMY Ag1g== X-Gm-Message-State: AOAM530rXbAZH5ABR5fBiROosaFoWrU3Jfav9AJjvDlqi1xguzQqj8oD DJwiw7lwRInWWTjEDTAO1qs2O/D/Pp5Jcg== X-Google-Smtp-Source: ABdhPJySBfbbuM7/tWQEP1Er52iCRde4r1n3pHRqvJ73VecQscymRIyEpqfHMs3HOxfIT4G91lXsaw== X-Received: by 2002:a17:906:11cc:: with SMTP id o12mr23785885eja.547.1621874511189; Mon, 24 May 2021 09:41:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 27/28] hw/scsi: Fix sector translation bug in scsi_unmap_complete_noio Date: Mon, 24 May 2021 18:41:30 +0200 Message-Id: <20210524164131.383778-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kit Westneat Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Kit Westneat check_lba_range expects sectors to be expressed in original qdev blocksize,= but scsi_unmap_complete_noio was translating them to 512 block sizes, which was causing sense errors in the larger LBAs in devices using a 4k block size. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/345 Signed-off-by: Kit Westneat Message-Id: <20210521142829.326217-1-kit.westneat@gmail.com> Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 3580e7ee61..e8a547dbb7 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1582,6 +1582,7 @@ invalid_field: scsi_check_condition(r, SENSE_CODE(INVALID_FIELD)); } =20 +/* sector_num and nb_sectors expected to be in qdev blocksize */ static inline bool check_lba_range(SCSIDiskState *s, uint64_t sector_num, uint32_t nb_sector= s) { @@ -1614,11 +1615,12 @@ static void scsi_unmap_complete_noio(UnmapCBData *d= ata, int ret) assert(r->req.aiocb =3D=3D NULL); =20 if (data->count > 0) { - r->sector =3D ldq_be_p(&data->inbuf[0]) - * (s->qdev.blocksize / BDRV_SECTOR_SIZE); - r->sector_count =3D (ldl_be_p(&data->inbuf[8]) & 0xffffffffULL) - * (s->qdev.blocksize / BDRV_SECTOR_SIZE); - if (!check_lba_range(s, r->sector, r->sector_count)) { + uint64_t sector_num =3D ldq_be_p(&data->inbuf[0]); + uint32_t nb_sectors =3D ldl_be_p(&data->inbuf[8]) & 0xffffffffULL; + r->sector =3D sector_num * (s->qdev.blocksize / BDRV_SECTOR_SIZE); + r->sector_count =3D nb_sectors * (s->qdev.blocksize / BDRV_SECTOR_= SIZE); + + if (!check_lba_range(s, sector_num, nb_sectors)) { block_acct_invalid(blk_get_stats(s->qdev.conf.blk), BLOCK_ACCT_UNMAP); scsi_check_condition(r, SENSE_CODE(LBA_OUT_OF_RANGE)); --=20 2.31.1 From nobody Fri May 3 09:52:45 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621876083; cv=none; d=zohomail.com; s=zohoarc; b=FQzNGilS/tFvsr40H1/F0NnibdNEmAbgmH/+5H+zf7gkMT+V4L+R7PaqZqKit4hL/fv29eCHLiXa9KPX7L7mqsZJGWtZEZkxOoU7TMeTiIb8TsIa7p1BITOOVqWmckxENd8ojUGcUZT0xvWvgKx4bAi7KBDmBmpmFKTBivSPXNI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621876083; h=Content-Transfer-Encoding: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=CUnKL2VXbLNe+f5e2NHSjlxFTJniYAMGMbepsJUE2wI=; b=EJlrvZTDNd6EogxXPpwovbTDaEY1kS7KVZjZiQnyao7P4xtI/x2UKoyA0Kjr61znLL5kFog17UkQotfXjxaW8qQA8hBbFXBZ/f3m2Zda0rv6fIRaFUIudwH0VKr1ehR/gImto/ULSn07qdvBV6ygL7Yclz7oKpouDEyZ6MGkWZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621876083801645.1556456946508; Mon, 24 May 2021 10:08:03 -0700 (PDT) Received: from localhost ([::1]:60354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llE3e-0005EK-Pc for importer2@patchew.org; Mon, 24 May 2021 13:08:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llDeW-00057C-RN for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:11 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:44966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llDeP-0004QI-GH for qemu-devel@nongnu.org; Mon, 24 May 2021 12:42:04 -0400 Received: by mail-ej1-x635.google.com with SMTP id lz27so42791586ejb.11 for ; Mon, 24 May 2021 09:41:52 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g4sm9581922edm.83.2021.05.24.09.41.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CUnKL2VXbLNe+f5e2NHSjlxFTJniYAMGMbepsJUE2wI=; b=ocN06fzb9xAghfKLNL1YL4HhV3rZ3/kkDUUD5rNVMCnqvIgZlZeFF4EcA8jQuTaT98 tK6GrgNgiLmKQfc+yKgIv8JSu4/+K5hErKUStdea5LQlqJVp1G+VRjuxt3woSDwDhhuz QhdrHJNgGu72jhxMY2mWPkqyLNSLEXbi3j2km/jOFh7lwk/9qWRWPdBTnsTV+NvC+vt9 x/EIDyDMnOn2aSNH/K1CUSoH/V4syyUIsDHK4CS5hDYN3mPGNtngtGoXyu9sjUWrorzE QGnPDuXC8bzdXJztzXLihsrNzz16gdcgh6MchrrK3KmH6J8BNLnKei2fRiU0aLbYSiVW BFOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CUnKL2VXbLNe+f5e2NHSjlxFTJniYAMGMbepsJUE2wI=; b=PxPWupmCPnWZW/J51iQk4QRuiiUxCYj/hA/RhNTGqPcJ4L3V0pUEYDThs5KgVNVxZW cNcetF0yKFYSrqsPKALsXHVWB8T+nl08VlNm9h+CNNP+WCR4x3UWFKuwCXv2vMzzF7ev faTGnvYlpPHLeb04lU9NodbXSj/6dAR4YWvMpzRsEtKF+NISXw19t7oV5MulqqdTRYn6 lyojbLoVSVkWGpzXYsoWFqvk3935PNJdHYFB9wWpcUfxqRUKkTXgPtkOLH1NACiYqygI KprvaETxbJqBj2IsCBnRfhVFx/9wQHStTVV2Ld8gbfT1mSecZgCvHsMAgtjoXnngRA/p Yu+Q== X-Gm-Message-State: AOAM530h7BSgmlijDW/tIbKavKUtzkfAv+DVTdeGu5dgiIWvYIyDPZWD f5js6U78arfmE3UWRwv7XGaxj/ljux/P0w== X-Google-Smtp-Source: ABdhPJzii5HErbifEbIp/TFXHyn11LtQyholr4tQzUrmtATXbt4L/0yw6gHHINMXzzc98pTcL3dO5A== X-Received: by 2002:a17:906:bc43:: with SMTP id s3mr24579847ejv.76.1621874511798; Mon, 24 May 2021 09:41:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 28/28] gitlab-ci: use --meson=git for CFI jobs Date: Mon, 24 May 2021 18:41:31 +0200 Message-Id: <20210524164131.383778-29-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524164131.383778-1-pbonzini@redhat.com> References: <20210524164131.383778-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Ensure that the meson submodule is checked out by the check targets, as they will need it to run "meson test". Signed-off-by: Paolo Bonzini --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f718b61fa7..a6290d43bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,9 +27,9 @@ include: - cd build - if test -n "$TARGETS"; then - ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=3Di= nternal} $CONFIGURE_ARGS --target-list=3D"$TARGETS" ; + ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=3Dg= it} $CONFIGURE_ARGS --target-list=3D"$TARGETS" ; else - ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=3Di= nternal} $CONFIGURE_ARGS ; + ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=3Dg= it} $CONFIGURE_ARGS ; fi || { cat config.log meson-logs/meson-log.txt && exit 1; } - if test -n "$LD_JOBS"; then --=20 2.31.1