From nobody Sat May 4 04:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507026867306111.61576266000736; Tue, 3 Oct 2017 03:34:27 -0700 (PDT) Received: from localhost ([::1]:57696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKWm-0004Nz-2y for importer@patchew.org; Tue, 03 Oct 2017 06:34:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKUt-00032e-AQ for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzKUr-0001xb-9k for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:19 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:54513) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzKUr-0001x5-2X for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:17 -0400 Received: by mail-wm0-x244.google.com with SMTP id i124so15831611wmf.3 for ; Tue, 03 Oct 2017 03:32:16 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id x75sm16293812wme.3.2017.10.03.03.32.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 03:32:15 -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; bh=Dxs5JQKpplk5ChihcjkTL+SS9d5EKyAIWIuzG+0Lao8=; b=WfyLcF0HALC0jtZCYZ6Z9zPnqa5kXMtKhjE9fx9xcRoLKv7L27T3IN4r83x2B8AnVm wdt6DM+SKP7Q+IFUD8QBnHeClbEGA6JtjLSEJzqePDdMOifqMx20FZ0ziNnRV0cqUe6P fFb/uE3HhJ2ND+NRdyBL2Plr/ETOj+pTdvSrJ2+7W/B/BHqSHNXsR6psm7/LBY0VMiip L+/7ELFuR/TF+taQOr8LcW/ES65zGyRaG/Dmr1I7Dj4sEMTCXRbGGZbLhFWNwtw011si gvQMpltTasAX8w1YrDo1tIXyguLdwUs4K+K8gmp6sDDZbjbYmHWwVhTvM8eWfR7h2r06 oCVw== 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; bh=Dxs5JQKpplk5ChihcjkTL+SS9d5EKyAIWIuzG+0Lao8=; b=SRu0MyRxCQnt2QMXfOoEn365EOxxHTQLQVnEVIVoyMScB07vOtt8osd70BV93hPnSX Zu+sMYi99ZG6K09nQN/YXRmaglFHR/f5yn1MCOM3fRr9m52VZ8zSu8HgmAsv6Uj7ualy U7McmUaQ5GwkWWQdgRYfS74rOyQw1G5n2xBWuvU/gYiHEytIjCISRoXewAnEv6MYc41g TmgxO7YlxIdGs++/WgfpGcqT1oshBx4KZRuQQqjrQSH4/lUhmeGhsTjwL0godqG00d5g DRLKOhmr8gUkZisecLfYiZUeOdiliGcR1Ewz7JfVk5TOCCUGRvDYW8MHI3+B+IBCLLC5 OI5g== X-Gm-Message-State: AMCzsaW9cC39Fbw9ZHddXhSHUBkjT9t4GLKDnkpMV3jlQ/W789iRWVBg Spl2UamGXvWRrtbdI57TFdIERkEN X-Google-Smtp-Source: AOwi7QDLJJBok0h1/SjWfbVeqaAjuwjtcPqHkNQKVoejH2wv8FVGvItEtun5Vj2dH8vm2sLRZ4zgKw== X-Received: by 10.28.247.9 with SMTP id v9mr6919359wmh.104.1507026735752; Tue, 03 Oct 2017 03:32:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Oct 2017 12:28:36 +0200 Message-Id: <1507026521-19230-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> References: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 1/6] scsi: Ignore executable for in-tree builds X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake The new qemu-pr-helper (commit b855f8d17) should not be checked in, even when doing in-tree builds. Signed-off-by: Eric Blake Message-Id: <20170926151421.14557-1-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 40acfcb..3a7e01d 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ /qemu-version.h /qemu-version.h.tmp /module_block.h +/scsi/qemu-pr-helper /vscclient /vhost-user-scsi /fsdev/virtfs-proxy-helper --=20 1.8.3.1 From nobody Sat May 4 04:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507026867377127.09161902603569; Tue, 3 Oct 2017 03:34:27 -0700 (PDT) Received: from localhost ([::1]:57697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKWn-0004Py-CX for importer@patchew.org; Tue, 03 Oct 2017 06:34:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKUt-00032h-Q9 for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzKUt-0001ya-4U for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:19 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:44337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzKUs-0001y5-UL for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:19 -0400 Received: by mail-wm0-x244.google.com with SMTP id 196so5527520wma.1 for ; Tue, 03 Oct 2017 03:32:18 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id x75sm16293812wme.3.2017.10.03.03.32.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 03:32:16 -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; bh=TnJo51oB4zBG9mVyEBzY7Vm0CnEsfZStHTmOpaEqd18=; b=RMC2+1pvoaqVt9ahwcoWckCL4mLti/IiQDxSRciTQzJOjZBvlsHGHaDDzRfnjPgLtA GOoirlmIngfWmkgLWmQNv9vHFrHH8060jyDEogkWEdwnHVaEDrN1Qv6HOFSayOxnOHr8 Z7RaXwx1GpI0vdYwC9TIl5ktvS1QQwZp7XljJ040/wULeh9jTP2AYmm4mw9YtZB46UYd HRCArlprQ2KEqNb+sGclWKfNSDrI6SfBffMT60uTGTaSI9/VESggoNvF9lQqQr6205A+ zJuc68aLsdo4wdg2YBoULlRfBwKtp6g9T2UQELDCuRsjAFL7TudIDHR4Iv9zb5Lw5oKw FxVQ== 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; bh=TnJo51oB4zBG9mVyEBzY7Vm0CnEsfZStHTmOpaEqd18=; b=s+BdojjGwUlyQDBe7+tgpZRqJQqLEMtPS0/2daMHgWbDiU098OmCKjJPjrtNvCmXWe QEGMTYB3NGPQwNulDGfsk6W2pqTLuhI7JZRQXcVALNzSaiJxD/h0R1OCXa5Evs/5sReB XWgYmsuXbQfBnGNA+RvQTeG6Xtn2jJMurbFdRG2eK44Tkv7Xf6KlWknCrUeIHJjgU8YZ wy8o1VxiaaPrloteelSoX6mtAMYdVw3Hplih5kZ9T3wnHadDehzf7YSm/PoySYtZ9TNn T55zqa/LOgolLr0e57pmgGHUXnYruvUD1dYhfJ3Z+xq7EFC4cRiFT3U39ThgtJkwOgMe CHeg== X-Gm-Message-State: AMCzsaV1uD8NUlp4DX6S05rAm0Noo6FZxtlQtERlXFxGkzweJKYIdWzC DgfzdTxb7jiwK3K8TUBzHPhOxf2R X-Google-Smtp-Source: AOwi7QBmEi5ju378J7KIyChGMFGkyWH7w1mdQIcxpJVHMitVS3jeD9bAeZPwNfJkRfllKmyC87JsHQ== X-Received: by 10.28.236.203 with SMTP id h72mr5969706wmi.147.1507026737626; Tue, 03 Oct 2017 03:32:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Oct 2017 12:28:37 +0200 Message-Id: <1507026521-19230-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> References: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 2/6] iothread: Make iothread_stop() idempotent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost Currently, iothread_stop_all() makes all iothread objects unsafe to be destroyed, because qemu_thread_join() ends up being called twice. To fix this, make iothread_stop() idempotent by checking thread->stopped. Fixes the following crash: qemu-system-x86_64 -object iothread,id=3Diothread0 -monitor stdio -displa= y none QEMU 2.10.50 monitor - type 'help' for more information (qemu) quit qemu: qemu_thread_join: No such process Aborted (core dumped) Reported-by: Christian Borntraeger Signed-off-by: Eduardo Habkost Message-Id: <20170926130028.12471-1-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini --- iothread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iothread.c b/iothread.c index 44c8944..59d0850 100644 --- a/iothread.c +++ b/iothread.c @@ -85,7 +85,7 @@ static int iothread_stop(Object *object, void *opaque) IOThread *iothread; =20 iothread =3D (IOThread *)object_dynamic_cast(object, TYPE_IOTHREAD); - if (!iothread || !iothread->ctx) { + if (!iothread || !iothread->ctx || iothread->stopping) { return 0; } iothread->stopping =3D true; --=20 1.8.3.1 From nobody Sat May 4 04:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507026887770462.34455443884144; Tue, 3 Oct 2017 03:34:47 -0700 (PDT) Received: from localhost ([::1]:57698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKWx-0004eC-EX for importer@patchew.org; Tue, 03 Oct 2017 06:34:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKUw-00034h-G4 for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzKUu-00020F-GY for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:22 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:54514) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzKUu-0001zH-6o for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:20 -0400 Received: by mail-wm0-x243.google.com with SMTP id i124so15831937wmf.3 for ; Tue, 03 Oct 2017 03:32:20 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id x75sm16293812wme.3.2017.10.03.03.32.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 03:32:18 -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; bh=Fl4IUvn9VfvnekEgDfI0Kn7/9qdKijDem+vz1Rpay60=; b=Rzo7VIuhmzKnTpGaGtfQmVoZ6chcoA7d+xLnHpzlRlErp0GhuiCwwOnCJGIZ44RFky yElAXSmCiiZ/tOZcw7jHDp/ir14MYhnWpmC0eWOrCao6Iiu3GOpyWlbybh6g0JPmWzDh 1BrWHTLWWRApAEK6auTq7CZ6vkIq4lTTGAqU4X3f/hicxsbcdMnnFo53gSTXihqSHxW1 j3J7QefgO2OzVH9gnLJS/HL5MoSntxNMTw5DzyBY48pwbtOsG3h02bybJvcverQ7pP7E cAla9sSQRBV9tvmZ97fBzQgJmGuLjcGMLaziJalD6w4UJKLikhmtw8p4LiWNybitS8lp F0Xw== 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; bh=Fl4IUvn9VfvnekEgDfI0Kn7/9qdKijDem+vz1Rpay60=; b=iLM5PzMk5NSdsfZBU07MLB2BDUTDL4/4BTauh18pZX5Gk5DuKauXGO1KthNr1ypvsO Mx1n7dTJb3cqF3gLi1WgkncheHLsDBErcetW4CKB7fshP28hoSiQbAiM2HSUyrmX4sH1 pAoV/C5AbH5U/l9GwPQL9WMZD9/UHFZ41OhO4hNVqxaFPNgCgOHHvpz2wEVFpZIuIgmr EqnWIj6ibBLmxkLZpTUogpdhiKufrUHn3/jLMWqpkxT+HQBlyuJJAmQXSxltYizQtcyT arillsUaID12gbPy4332x1ViPyBtPSl3easg92HI3O7a4gjDH9vWbojNLyFyy3qZLDSS iTwA== X-Gm-Message-State: AHPjjUgEZL8d0j8IPZjcqE2j7oCCLqcwEIVpwHhWWduJrMKIVsoy++Er SI2d/GE9Aai8r5L0ZprsZuVSHRpW X-Google-Smtp-Source: AOwi7QC1oX+B9V5yvzWb03AebcR7MB8y8AYz7GVzNWWMUxf4S6IZWDQIExwfERkc0uSvZrvf9k+C+g== X-Received: by 10.28.13.209 with SMTP id 200mr13977230wmn.19.1507026738724; Tue, 03 Oct 2017 03:32:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Oct 2017 12:28:38 +0200 Message-Id: <1507026521-19230-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> References: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 3/6] linux-headers: sync against v4.14-rc1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Perevalov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Perevalov Signed-off-by: Alexey Perevalov Message-Id: <1506085187-24259-2-git-send-email-a.perevalov@samsung.com> Signed-off-by: Paolo Bonzini --- include/standard-headers/asm-x86/hyperv.h | 19 ++++++++++--- include/standard-headers/linux/pci_regs.h | 42 ++++++++++++++++--------= ---- include/standard-headers/linux/virtio_ring.h | 4 +-- linux-headers/asm-s390/kvm.h | 6 ++++ linux-headers/linux/kvm.h | 3 +- linux-headers/linux/userfaultfd.h | 16 ++++++++++- 6 files changed, 64 insertions(+), 26 deletions(-) diff --git a/include/standard-headers/asm-x86/hyperv.h b/include/standard-h= eaders/asm-x86/hyperv.h index fac7651..5f95d5e 100644 --- a/include/standard-headers/asm-x86/hyperv.h +++ b/include/standard-headers/asm-x86/hyperv.h @@ -149,12 +149,9 @@ */ #define HV_X64_DEPRECATING_AEOI_RECOMMENDED (1 << 9) =20 -/* - * HV_VP_SET available - */ +/* Recommend using the newer ExProcessorMasks interface */ #define HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED (1 << 11) =20 - /* * Crash notification flag. */ @@ -242,7 +239,11 @@ (~((1ull << HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT) - 1)) =20 /* Declare the various hypercall operations. */ +#define HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE 0x0002 +#define HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST 0x0003 #define HVCALL_NOTIFY_LONG_SPIN_WAIT 0x0008 +#define HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX 0x0013 +#define HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX 0x0014 #define HVCALL_POST_MESSAGE 0x005c #define HVCALL_SIGNAL_EVENT 0x005d =20 @@ -259,6 +260,16 @@ #define HV_PROCESSOR_POWER_STATE_C2 2 #define HV_PROCESSOR_POWER_STATE_C3 3 =20 +#define HV_FLUSH_ALL_PROCESSORS BIT(0) +#define HV_FLUSH_ALL_VIRTUAL_ADDRESS_SPACES BIT(1) +#define HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY BIT(2) +#define HV_FLUSH_USE_EXTENDED_RANGE_FORMAT BIT(3) + +enum HV_GENERIC_SET_FORMAT { + HV_GENERIC_SET_SPARCE_4K, + HV_GENERIC_SET_ALL, +}; + /* hypercall status code */ #define HV_STATUS_SUCCESS 0 #define HV_STATUS_INVALID_HYPERCALL_CODE 2 diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-h= eaders/linux/pci_regs.h index c22d3eb..f8d5804 100644 --- a/include/standard-headers/linux/pci_regs.h +++ b/include/standard-headers/linux/pci_regs.h @@ -513,6 +513,7 @@ #define PCI_EXP_DEVSTA_URD 0x0008 /* Unsupported Request Detected */ #define PCI_EXP_DEVSTA_AUXPD 0x0010 /* AUX Power Detected */ #define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */ +#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V1 12 /* v1 endpoints without link = end here */ #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ #define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ #define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */ @@ -556,7 +557,7 @@ #define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ #define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */ #define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */ -#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints end here */ +#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints with link end he= re */ #define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ #define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */ #define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */ @@ -639,7 +640,7 @@ #define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* Enable OBFF Message type B= */ #define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling= */ #define PCI_EXP_DEVSTA2 42 /* Device Status 2 */ -#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ +#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints without link = end here */ #define PCI_EXP_LNKCAP2 44 /* Link Capabilities 2 */ #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */ #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5.0GT/s */ @@ -647,6 +648,7 @@ #define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */ #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ +#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end he= re */ #define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */ #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ #define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */ @@ -733,23 +735,17 @@ #define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ #define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ #define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ -/* Correctable Err Reporting Enable */ -#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 -/* Non-fatal Err Reporting Enable */ -#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 -/* Fatal Err Reporting Enable */ -#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 +#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting E= nable */ +#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 /* Non-Fatal Err Reporting= Enable */ +#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 /* Fatal Err Reporting Enable= */ #define PCI_ERR_ROOT_STATUS 48 -#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ -/* Multi ERR_COR Received */ -#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 -/* ERR_FATAL/NONFATAL Received */ -#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 -/* Multi ERR_FATAL/NONFATAL Received */ -#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 -#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ -#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ -#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ +#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ +#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 /* Multiple ERR_COR */ +#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 /* ERR_FATAL/NONFATAL */ +#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 /* Multiple FATAL/NONFATAL= */ +#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First UNC is Fatal */ +#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ +#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ #define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */ =20 /* Virtual Channel */ @@ -967,6 +963,7 @@ #define PCI_EXP_DPC_CAP_RP_EXT 0x20 /* Root Port Extensions for DPC */ #define PCI_EXP_DPC_CAP_POISONED_TLP 0x40 /* Poisoned TLP Egress Blocking= Supported */ #define PCI_EXP_DPC_CAP_SW_TRIGGER 0x80 /* Software Triggering Supported = */ +#define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0xF00 /* RP PIO log size */ #define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active s= upported */ =20 #define PCI_EXP_DPC_CTL 6 /* DPC control */ @@ -980,6 +977,15 @@ =20 #define PCI_EXP_DPC_SOURCE_ID 10 /* DPC Source Identifier */ =20 +#define PCI_EXP_DPC_RP_PIO_STATUS 0x0C /* RP PIO Status */ +#define PCI_EXP_DPC_RP_PIO_MASK 0x10 /* RP PIO MASK */ +#define PCI_EXP_DPC_RP_PIO_SEVERITY 0x14 /* RP PIO Severity */ +#define PCI_EXP_DPC_RP_PIO_SYSERROR 0x18 /* RP PIO SysError */ +#define PCI_EXP_DPC_RP_PIO_EXCEPTION 0x1C /* RP PIO Exception */ +#define PCI_EXP_DPC_RP_PIO_HEADER_LOG 0x20 /* RP PIO Header Log */ +#define PCI_EXP_DPC_RP_PIO_IMPSPEC_LOG 0x30 /* RP PIO ImpSpec Log */ +#define PCI_EXP_DPC_RP_PIO_TLPPREFIX_LOG 0x34 /* RP PIO TLP Prefix Log */ + /* Precision Time Measurement */ #define PCI_PTM_CAP 0x04 /* PTM Capability */ #define PCI_PTM_CAP_REQ 0x00000001 /* Requester capable */ diff --git a/include/standard-headers/linux/virtio_ring.h b/include/standar= d-headers/linux/virtio_ring.h index 023c6db..f1dc05d 100644 --- a/include/standard-headers/linux/virtio_ring.h +++ b/include/standard-headers/linux/virtio_ring.h @@ -1,7 +1,7 @@ #ifndef _LINUX_VIRTIO_RING_H #define _LINUX_VIRTIO_RING_H -/* An interface for efficient virtio implementation, currently for use by = KVM - * and lguest, but hopefully others soon. Do NOT change this since it will +/* An interface for efficient virtio implementation, currently for use by = KVM, + * but hopefully others soon. Do NOT change this since it will * break existing servers and clients. * * This header is BSD licensed so anyone can use the definitions to implem= ent diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h index 8387d71..7b750ef 100644 --- a/linux-headers/asm-s390/kvm.h +++ b/linux-headers/asm-s390/kvm.h @@ -88,6 +88,12 @@ struct kvm_s390_io_adapter_req { /* kvm attributes for KVM_S390_VM_TOD */ #define KVM_S390_VM_TOD_LOW 0 #define KVM_S390_VM_TOD_HIGH 1 +#define KVM_S390_VM_TOD_EXT 2 + +struct kvm_s390_vm_tod_clock { + __u8 epoch_idx; + __u64 tod; +}; =20 /* kvm attributes for KVM_S390_VM_CPU_MODEL */ /* processor related attributes are r/w */ diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 7971a4f..dd8a918 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -711,7 +711,8 @@ struct kvm_ppc_one_seg_page_size { struct kvm_ppc_smmu_info { __u64 flags; __u32 slb_size; - __u32 pad; + __u16 data_keys; /* # storage keys supported for data */ + __u16 instr_keys; /* # storage keys supported for instructions */ struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; }; =20 diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfa= ultfd.h index 9701772..b43cf0d 100644 --- a/linux-headers/linux/userfaultfd.h +++ b/linux-headers/linux/userfaultfd.h @@ -23,7 +23,9 @@ UFFD_FEATURE_EVENT_REMOVE | \ UFFD_FEATURE_EVENT_UNMAP | \ UFFD_FEATURE_MISSING_HUGETLBFS | \ - UFFD_FEATURE_MISSING_SHMEM) + UFFD_FEATURE_MISSING_SHMEM | \ + UFFD_FEATURE_SIGBUS | \ + UFFD_FEATURE_THREAD_ID) #define UFFD_API_IOCTLS \ ((__u64)1 << _UFFDIO_REGISTER | \ (__u64)1 << _UFFDIO_UNREGISTER | \ @@ -78,6 +80,9 @@ struct uffd_msg { struct { __u64 flags; __u64 address; + union { + __u32 ptid; + } feat; } pagefault; =20 struct { @@ -153,6 +158,13 @@ struct uffdio_api { * UFFD_FEATURE_MISSING_SHMEM works the same as * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem * (i.e. tmpfs and other shmem based APIs). + * + * UFFD_FEATURE_SIGBUS feature means no page-fault + * (UFFD_EVENT_PAGEFAULT) event will be delivered, instead + * a SIGBUS signal will be sent to the faulting process. + * + * UFFD_FEATURE_THREAD_ID pid of the page faulted task_struct will + * be returned, if feature is not requested 0 will be returned. */ #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) #define UFFD_FEATURE_EVENT_FORK (1<<1) @@ -161,6 +173,8 @@ struct uffdio_api { #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) #define UFFD_FEATURE_MISSING_SHMEM (1<<5) #define UFFD_FEATURE_EVENT_UNMAP (1<<6) +#define UFFD_FEATURE_SIGBUS (1<<7) +#define UFFD_FEATURE_THREAD_ID (1<<8) __u64 features; =20 __u64 ioctls; --=20 1.8.3.1 From nobody Sat May 4 04:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507026980265198.63332533802338; Tue, 3 Oct 2017 03:36:20 -0700 (PDT) Received: from localhost ([::1]:57711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKYj-0006Ke-2a for importer@patchew.org; Tue, 03 Oct 2017 06:36:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKUw-00035F-Vo for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzKUv-00020y-O0 for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:23 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:46352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzKUv-00020g-Gq for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:21 -0400 Received: by mail-wm0-x242.google.com with SMTP id m72so15740071wmc.1 for ; Tue, 03 Oct 2017 03:32:21 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id x75sm16293812wme.3.2017.10.03.03.32.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 03:32:19 -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; bh=YYztp9YKTXUAOwnL/hSwk6D6H6XHscVXDEdOB+0TviM=; b=EH6Y5U6F4TnzibRGK1f80xZOJmFVXvyBET8fKmxh2qdGlvGGyxL+x2O5y+37y+PqCm HlZFcB0eUCCSww9lfPodt9033Asw8u/3FXE3A49VCsiPEYDQSGenIPzBx4x6z+WdXBBC qToy+QUUuaeDv+Ap1GJxtfsroCIIlrcrqm46c9IPjsD5LNsLPC5lf8mTnS02KqShJARL joBsLQnQ7TcTMSiNQts4zz5EMJu8XUpwneLdXkApgIdpebGWuiB6WyrWk9OMCdjtBRey YxoSDvkNlYrEKH8PXdLFH54YXm3i/2Y9LzXIc3UGncgn3naoDSZrSKQJXzjNoRng2Izv segw== 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; bh=YYztp9YKTXUAOwnL/hSwk6D6H6XHscVXDEdOB+0TviM=; b=FWuMwFtfpuusPQXgzca/OAHVTysIpIJwafzicAe0ACta1FoSF/YLhYQOg67GYfIHCZ Zir1jdV4z7BScETilZEA0fhTPBkJtAHEIDYneJiEMWoUZiq2DrydrzakvxtIxVpEeCD0 kix2DHT1fEViWxfiA9AoY2bOm5b6fcS5etLbRPsvOlqXOtBWGq3HFo5UQf00hhQI1r2s MBgiWcJFxtvlPeMJkv+TfVJTPLrrRcNGelyxLW4SvQdsaPGQAXrMP7GNpuIFNZ75V7rn 1ynPprPsK8qJTVyMmdfDgMP2ZlvIFgxudy1ZGwLiWqkLZJorXYCKAsDoOCX59+sAVOzC 8dLA== X-Gm-Message-State: AMCzsaVeoTfAy7ncTDNRKQrQeiI3oBi18+nSks4eK+RJLfxmW9UPgN82 UVO4nHjFH2vobtJG3zfIEqBDUsw9 X-Google-Smtp-Source: AOwi7QADNFWfOmhWzvGIzsJ89WvuytiP4uWBkFB9QyoCy9NtrNaJwaVwbEcgP13cBpm3aDslfZgE6w== X-Received: by 10.28.107.150 with SMTP id a22mr3681522wmi.41.1507026740148; Tue, 03 Oct 2017 03:32:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Oct 2017 12:28:39 +0200 Message-Id: <1507026521-19230-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> References: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 4/6] kvm: check KVM_CAP_SYNC_MMU with kvm_vm_check_extension() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz On a server-class ppc host, this capability depends on the KVM type, ie, HV or PR. If both KVM are present in the kernel, we will always get the HV specific value, even if we explicitely requested PR on the command line. This can have an impact if we're using hugepages or a balloon device. Since we've already created the VM at the time any user calls kvm_has_sync_mmu(), switching to kvm_vm_check_extension() is enough to fix any potential issue. It is okay for the other archs that also implement KVM_CAP_SYNC_MMU, ie, mips, s390, x86 and arm, because they don't depend on the VM being created or not. While here, let's cache the state of this extension in a bool variable, since it has several users in the code, as suggested by Thomas Huth. Signed-off-by: Greg Kurz Message-Id: <150600965332.30533.14702405809647835716.stgit@bahia.lan> Reviewed-by: David Gibson Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 8 +++++--- accel/stubs/kvm-stub.c | 4 ++-- include/sysemu/kvm.h | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4f1997d..f54a337 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -87,6 +87,7 @@ struct KVMState #endif int many_ioeventfds; int intx_set_mask; + bool sync_mmu; /* The man page (and posix) say ioctl numbers are signed int, but * they're not. Linux, glibc and *BSD all treat ioctl numbers as * unsigned, and treating them as signed here can break things */ @@ -1664,6 +1665,8 @@ static int kvm_init(MachineState *ms) =20 s->many_ioeventfds =3D kvm_check_many_ioeventfds(); =20 + s->sync_mmu =3D !!kvm_vm_check_extension(kvm_state, KVM_CAP_SYNC_MMU); + return 0; =20 err: @@ -2130,10 +2133,9 @@ int kvm_device_access(int fd, int group, uint64_t at= tr, return err; } =20 -/* Return 1 on success, 0 on failure */ -int kvm_has_sync_mmu(void) +bool kvm_has_sync_mmu(void) { - return kvm_check_extension(kvm_state, KVM_CAP_SYNC_MMU); + return kvm_state->sync_mmu; } =20 int kvm_has_vcpu_events(void) diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index 3965c52..c964af3 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -64,9 +64,9 @@ int kvm_cpu_exec(CPUState *cpu) abort(); } =20 -int kvm_has_sync_mmu(void) +bool kvm_has_sync_mmu(void) { - return 0; + return false; } =20 int kvm_has_many_ioeventfds(void) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 3a458f5..bbf12a1 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -207,7 +207,7 @@ extern KVMState *kvm_state; /* external API */ =20 bool kvm_has_free_slot(MachineState *ms); -int kvm_has_sync_mmu(void); +bool kvm_has_sync_mmu(void); int kvm_has_vcpu_events(void); int kvm_has_robust_singlestep(void); int kvm_has_debugregs(void); --=20 1.8.3.1 From nobody Sat May 4 04:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507026993905365.6497757497633; Tue, 3 Oct 2017 03:36:33 -0700 (PDT) Received: from localhost ([::1]:57712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKYq-0006P4-Ru for importer@patchew.org; Tue, 03 Oct 2017 06:36:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKV1-00039y-Ix for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzKUy-00023r-Vn for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:27 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:54516) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzKUy-000238-OO for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:24 -0400 Received: by mail-wm0-x241.google.com with SMTP id i124so15832368wmf.3 for ; Tue, 03 Oct 2017 03:32:24 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id x75sm16293812wme.3.2017.10.03.03.32.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 03:32:22 -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; bh=DQ6YH1Xm4gdooNEEKWOzRMHfv/KK6qlFyxzrRVyZVIk=; b=Sv/ljFs1v5ETqx0P2dhS3jNX0kV1wi5Cd2tPJZSa/eoYymCSLjXlxUFpSTwYsRDLtD fQw6giZ+szFcgPPsw9er8Uftxc+XbSIqn+qokiZe+UJ83b/efswe2TZ4M/lk3Q3Tlxdz P5m6G67a70i1mg96qREOol5TVX5XI8GbUBOr16XKQNEqyNv5cHsXKSenaWup2QBSAoOj i6xPSyEVkp1s+Z0bY5KT8jQvVBq/V7w1EZdtJqgnPag9k+AdpXPflGT0cONPeEpQE3rK lU7mu4l6lWo2ApGMS+nmahTp40FZERQkDp2UqFKzqPtfdjysHL43c6JI5u8yH3KyRxND wqxw== 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; bh=DQ6YH1Xm4gdooNEEKWOzRMHfv/KK6qlFyxzrRVyZVIk=; b=GbyN2+Gj39UUSLMPa+dPJwpeqTuWBdrFZ3pPKEn6CjwaUKUQ/rNZnnBISUHS0rCnb6 xMKvJhupg9hhJAAE35xnuO/fv8HUC8IJ8QTvWsKmY1pyu/GIOWPQps9TzGzbG8jW4+4l RalYILDkmyB+5lax8PrE89frXFvzLtZ+ZwHEIiSYQHlld8cAVyEYtWWck8nAUUctq3xm //yhk0BA6F9ZXFC4f/ttOT8841/28lG4yDhb2XvsabPdUWVNG6IiNPsOcsQ09UQCW4r8 bKV67tQkJK5Y1LT28vE3+4c27p7LzHwIWr8vQpvSkfC9qynHd0vNcC8P+ZOz4dHUdm2W C+Dw== X-Gm-Message-State: AMCzsaXxD70YkQ2utJ8bxKQzxGlKM4VPjA2zF4rLLjgCBlw7x2ntZXYI U4VEnyM6YDRmtN4mr1zlTyakAxbo X-Google-Smtp-Source: AOwi7QD7X95Ylruz7KpFLMmjuxEbqtlQwgv3ihtDyymsrQcNojG7RSSLZ8//JfoeB8wuw9mdtzdzUQ== X-Received: by 10.28.55.71 with SMTP id e68mr640938wma.139.1507026743348; Tue, 03 Oct 2017 03:32:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Oct 2017 12:28:40 +0200 Message-Id: <1507026521-19230-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> References: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 5/6] kvm: check KVM_CAP_NR_VCPUS with kvm_vm_check_extension() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz On a modern server-class ppc host with the following CPU topology: Architecture: ppc64le Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0,8,16,24 Off-line CPU(s) list: 1-7,9-15,17-23,25-31 Thread(s) per core: 1 If both KVM PR and KVM HV loaded and we pass: -machine pseries,accel=3Dkvm,kvm-type=3DPR -smp 8 We expect QEMU to warn that this exceeds the number of online CPUs: Warning: Number of SMP cpus requested (8) exceeds the recommended cpus supported by KVM (4) Warning: Number of hotpluggable cpus requested (8) exceeds the recommended cpus supported by KVM (4) but nothing is printed... This happens because on ppc the KVM_CAP_NR_VCPUS capability is VM specific ndreally depends on the KVM type, but we currently use it as a global capability. And KVM returns a fallback value based on KVM HV being present. Maybe KVM on POWER shouldn't presume anything as long as it doesn't have a VM, but in all cases, we should call KVM_CREATE_VM first and use KVM_CAP_NR_VCPUS as a VM capability. This patch hence changes kvm_recommended_vcpus() accordingly and moves the sanity checking of smp_cpus after the VM creation. It is okay for the other archs that also implement KVM_CAP_NR_VCPUS, ie, mips, s390, x86 and arm, because they don't depend on the VM being created or not. Signed-off-by: Greg Kurz Reviewed-by: David Gibson Reviewed-by: Thomas Huth Message-Id: <150600966286.30533.10909862523552370889.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f54a337..90c88b5 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1440,7 +1440,7 @@ static void kvm_irqchip_create(MachineState *machine,= KVMState *s) */ static int kvm_recommended_vcpus(KVMState *s) { - int ret =3D kvm_check_extension(s, KVM_CAP_NR_VCPUS); + int ret =3D kvm_vm_check_extension(s, KVM_CAP_NR_VCPUS); return (ret) ? ret : 4; } =20 @@ -1530,26 +1530,6 @@ static int kvm_init(MachineState *ms) s->nr_slots =3D 32; } =20 - /* check the vcpu limits */ - soft_vcpus_limit =3D kvm_recommended_vcpus(s); - hard_vcpus_limit =3D kvm_max_vcpus(s); - - while (nc->name) { - if (nc->num > soft_vcpus_limit) { - warn_report("Number of %s cpus requested (%d) exceeds " - "the recommended cpus supported by KVM (%d)", - nc->name, nc->num, soft_vcpus_limit); - - if (nc->num > hard_vcpus_limit) { - fprintf(stderr, "Number of %s cpus requested (%d) exceeds " - "the maximum cpus supported by KVM (%d)\n", - nc->name, nc->num, hard_vcpus_limit); - exit(1); - } - } - nc++; - } - kvm_type =3D qemu_opt_get(qemu_get_machine_opts(), "kvm-type"); if (mc->kvm_type) { type =3D mc->kvm_type(kvm_type); @@ -1584,6 +1564,27 @@ static int kvm_init(MachineState *ms) } =20 s->vmfd =3D ret; + + /* check the vcpu limits */ + soft_vcpus_limit =3D kvm_recommended_vcpus(s); + hard_vcpus_limit =3D kvm_max_vcpus(s); + + while (nc->name) { + if (nc->num > soft_vcpus_limit) { + warn_report("Number of %s cpus requested (%d) exceeds " + "the recommended cpus supported by KVM (%d)", + nc->name, nc->num, soft_vcpus_limit); + + if (nc->num > hard_vcpus_limit) { + fprintf(stderr, "Number of %s cpus requested (%d) exceeds " + "the maximum cpus supported by KVM (%d)\n", + nc->name, nc->num, hard_vcpus_limit); + exit(1); + } + } + nc++; + } + missing_cap =3D kvm_check_extension_list(s, kvm_required_capabilites); if (!missing_cap) { missing_cap =3D --=20 1.8.3.1 From nobody Sat May 4 04:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15070270686464.6639785349201475; Tue, 3 Oct 2017 03:37:48 -0700 (PDT) Received: from localhost ([::1]:57722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKa9-0007Y5-0B for importer@patchew.org; Tue, 03 Oct 2017 06:37:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzKV2-0003AW-83 for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzKV1-00027X-6b for qemu-devel@nongnu.org; Tue, 03 Oct 2017 06:32:28 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:52599) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzKV1-00026T-08; Tue, 03 Oct 2017 06:32:27 -0400 Received: by mail-wm0-x241.google.com with SMTP id k4so13714148wmc.1; Tue, 03 Oct 2017 03:32:26 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id x75sm16293812wme.3.2017.10.03.03.32.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 03:32:25 -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; bh=9MzqQ2zFVtRVFa82LTurur6VYc1g59WGrarzqxw/zOg=; b=pgv4aD9IGzNAdJKhdHCiVeAk+IIQYPnXfzEf2KlpUFphpLkroyLN7Rq6UuFussGLjr i/j9I80F55dcsIK/M6IMC/CHI5FB6l4NadLMC/d/zj5qR+PU1POyp8sbDqruMR2D8OC/ g29YUtwfXuVGxZf/FEJdpjBQI/vRGtWq7H1lz05Scn4C45U3/vdFdPghrH6hfRMEQE6x xT8mdEXxMunEyoX2kl1Wrd+tcCaKPRpx8zA2dFRWl8c4I7UTp2O0w5prDpUM7zWTTW5y tTg8Vi9gn1GY9wKKPWsoaebGDPibvCV8kwgfJ5mMK2jBdZ2hVMy6otJUW6b1RMBw2F5e ayRQ== 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; bh=9MzqQ2zFVtRVFa82LTurur6VYc1g59WGrarzqxw/zOg=; b=GCdXRV83CNzVPf4AJ+FBrivpZ7Ynjgl88tA6xeRpUva2oAyPl9+5zbwKcu2FxkIT/J SGtwhkzMi6joV4U6aeEnpcY0SUunv5grTxgExrE884OOyT3eYQCUuRQdc05VZi2CSTFh AYN/nzwp38sXGXJa4NBVS4sb3QrMtDv+p6fnbvwEwOE3Momd0XzAT/+RLRGszh7wqSSX ImXEhI/17cYUqG7YBfH1y3ZIYR1nDgWkrrpc0LjgtdZ8DPf0ASmzQKPEdWBVWze0WLwe zRwowEw0pf4bcPrMR1N/po6easO13hXXLNNamefrRXbvfsDe1rHlrE0uR0+gB2oOjGBN niUA== X-Gm-Message-State: AMCzsaWtbQ2fi7pzVaIp9W8/a9jQ/P3PnF+Imfca7jwLQEA6lsrjhLmN JDqiVKkjaVqrRGk42QSGTEP90nLo X-Google-Smtp-Source: AOwi7QBWz7gYPedm5jwPj+yZrTCyfLtDLbWWmjXetS4fTwzmZShkDfDENFCnwOXCtYkLoLLHE4YhFg== X-Received: by 10.28.54.154 with SMTP id y26mr8752485wmh.15.1507026745685; Tue, 03 Oct 2017 03:32:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Oct 2017 12:28:41 +0200 Message-Id: <1507026521-19230-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> References: <1507026521-19230-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 6/6] kvmclock: use the updated system_timer_msr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jim Somerville , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jim Somerville Fixes e2b6c17 (kvmclock: update system_time_msr address forcibly) which makes a call to get the latest value of the address stored in system_timer_msr, but then uses the old address anyway. Signed-off-by: Jim Somerville Message-Id: <59b67db0bd15a46ab47c3aa657c81a4c11f168ea.1506702472.git.Jim.So= merville@windriver.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- hw/i386/kvm/clock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 75ad1ba..1707434 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -62,7 +62,7 @@ static uint64_t kvmclock_current_nsec(KVMClockState *s) { CPUState *cpu =3D first_cpu; CPUX86State *env =3D cpu->env_ptr; - hwaddr kvmclock_struct_pa =3D env->system_time_msr & ~1ULL; + hwaddr kvmclock_struct_pa; uint64_t migration_tsc =3D env->tsc; struct pvclock_vcpu_time_info time; uint64_t delta; @@ -77,6 +77,7 @@ static uint64_t kvmclock_current_nsec(KVMClockState *s) return 0; } =20 + kvmclock_struct_pa =3D env->system_time_msr & ~1ULL; cpu_physical_memory_read(kvmclock_struct_pa, &time, sizeof(time)); =20 assert(time.tsc_timestamp <=3D migration_tsc); --=20 1.8.3.1