[{"id":1768947,"web_url":"http://patchwork.ozlabs.org/comment/1768947/","msgid":"<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>","list_archive_url":null,"date":"2017-09-15T05:15:41","subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 14.09.2017 21:25, Greg Kurz wrote:\n> The following capabilities are VM specific:\n> - KVM_CAP_PPC_SMT_POSSIBLE\n> - KVM_CAP_PPC_HTAB_FD\n\nBTW, looks like kvmppc_has_cap_htab_fd() is dead code ... should we\neither remove it or check it somewhere?\n\n> - KVM_CAP_PPC_ALLOC_HTAB\n> \n> If both KVM HV and KVM PR are present, checking them always return\n> the HV value, even if we explicitely requested to use PR.\n> \n> This has no visible effect for KVM_CAP_PPC_ALLOC_HTAB, because we also\n> try the KVM_PPC_ALLOCATE_HTAB ioctl which is only suppored by HV. As\n> a consequence, the spapr code doesn't even check KVM_CAP_PPC_HTAB_FD.\n>\n> However, this will cause kvmppc_hint_smt_possible(), introduced by\n> commit fa98fbfcdfcb9, to report several VSMT modes (eg, Available\n> VSMT modes: 8 4 2 1) whereas PR only support mode 1.\n> \n> This patch fixes all three anyway to use kvm_vm_check_extension(). It\n> is okay since the VM is already created at the time kvm_arch_init() or\n> kvmppc_reset_htab() is called.\n> \n> Signed-off-by: Greg Kurz <groug@kaod.org>\n> ---\n>  target/ppc/kvm.c |    6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c\n> index 1deaf106d2b9..208c70e81426 100644\n> --- a/target/ppc/kvm.c\n> +++ b/target/ppc/kvm.c\n> @@ -131,7 +131,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n>      cap_interrupt_level = kvm_check_extension(s, KVM_CAP_PPC_IRQ_LEVEL);\n>      cap_segstate = kvm_check_extension(s, KVM_CAP_PPC_SEGSTATE);\n>      cap_booke_sregs = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_SREGS);\n> -    cap_ppc_smt_possible = kvm_check_extension(s, KVM_CAP_PPC_SMT_POSSIBLE);\n> +    cap_ppc_smt_possible = kvm_vm_check_extension(s, KVM_CAP_PPC_SMT_POSSIBLE);\n>      cap_ppc_rma = kvm_check_extension(s, KVM_CAP_PPC_RMA);\n>      cap_spapr_tce = kvm_check_extension(s, KVM_CAP_SPAPR_TCE);\n>      cap_spapr_tce_64 = kvm_check_extension(s, KVM_CAP_SPAPR_TCE_64);\n> @@ -143,7 +143,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n>      cap_ppc_watchdog = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_WATCHDOG);\n>      /* Note: we don't set cap_papr here, because this capability is\n>       * only activated after this by kvmppc_set_papr() */\n> -    cap_htab_fd = kvm_check_extension(s, KVM_CAP_PPC_HTAB_FD);\n> +    cap_htab_fd = kvm_vm_check_extension(s, KVM_CAP_PPC_HTAB_FD);\n>      cap_fixup_hcalls = kvm_check_extension(s, KVM_CAP_PPC_FIXUP_HCALL);\n>      cap_ppc_smt = kvm_vm_check_extension(s, KVM_CAP_PPC_SMT);\n>      cap_htm = kvm_vm_check_extension(s, KVM_CAP_PPC_HTM);\n> @@ -2353,7 +2353,7 @@ int kvmppc_reset_htab(int shift_hint)\n>          /* Full emulation, tell caller to allocate htab itself */\n>          return 0;\n>      }\n> -    if (kvm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n> +    if (kvm_vm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n>          int ret;\n>          ret = kvm_vm_ioctl(kvm_state, KVM_PPC_ALLOCATE_HTAB, &shift);\n>          if (ret == -ENOTTY) {\n\nLooking at the comment in the code after the \"if (ret == -ENOTTY)\" line,\nit sounds like there is a bug in the kernel and the\nKVM_CAP_PPC_ALLOC_HTAB should depend on the hv_enabled variable, too?\nAnyway, that's another topic, your patch is fine!\n\nReviewed-by: Thomas Huth <thuth@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtkP237Vwz9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 15:24:54 +1000 (AEST)","from localhost ([::1]:51334 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsj7U-0006xq-Gn\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 01:24:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43669)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dsiyj-0006Hg-Bj\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 01:15:50 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dsiyf-0005nN-Sl\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 01:15:49 -0400","from mx1.redhat.com ([209.132.183.28]:41726)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>)\n\tid 1dsiyf-0005n0-KZ; Fri, 15 Sep 2017 01:15:45 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 5F83BC04B310;\n\tFri, 15 Sep 2017 05:15:44 +0000 (UTC)","from [10.36.116.76] (ovpn-116-76.ams2.redhat.com [10.36.116.76])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id DA5D56D2BE;\n\tFri, 15 Sep 2017 05:15:42 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 5F83BC04B310","To":"Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org","References":"<150541711102.1616.2690784964841960181.stgit@bahia.lan>\n\t<150541714343.1616.11893912014879112098.stgit@bahia.lan>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>","Date":"Fri, 15 Sep 2017 07:15:41 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<150541714343.1616.11893912014879112098.stgit@bahia.lan>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 15 Sep 2017 05:15:44 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, qemu-ppc@nongnu.org,\n\tSam Bobroff <sam.bobroff@au1.ibm.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769022,"web_url":"http://patchwork.ozlabs.org/comment/1769022/","msgid":"<20170915063540.GF5250@umbus.fritz.box>","list_archive_url":null,"date":"2017-09-15T06:35:40","subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Fri, Sep 15, 2017 at 07:15:41AM +0200, Thomas Huth wrote:\n> On 14.09.2017 21:25, Greg Kurz wrote:\n> > The following capabilities are VM specific:\n> > - KVM_CAP_PPC_SMT_POSSIBLE\n> > - KVM_CAP_PPC_HTAB_FD\n> \n> BTW, looks like kvmppc_has_cap_htab_fd() is dead code ... should we\n> either remove it or check it somewhere?\n\nIt's checked in kvmppc_get_htab_fd().","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au header.b=\"P27WBRGB\"; \n\tdkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtpBh41clz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 18:16:12 +1000 (AEST)","from localhost ([::1]:51871 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dslnG-0001U1-Fh\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 04:16:10 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:59002)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dslmY-0001SE-3E\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:15:27 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dslmU-0004RY-Lx\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:15:26 -0400","from ozlabs.org ([103.22.144.67]:37997)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgibson@ozlabs.org>)\n\tid 1dslmU-0004PP-68; Fri, 15 Sep 2017 04:15:22 -0400","by ozlabs.org (Postfix, from userid 1007)\n\tid 3xtp9d6fsXz9t2h; Fri, 15 Sep 2017 18:15:17 +1000 (AEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1505463317;\n\tbh=vCFhGNb/Xs2QnFnuCtJeOUE9Uwyp8lLu8261f79jtto=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=P27WBRGBs48cQwc9KAYf5wYoKKaeXO6dBOB0mdvNnL+UXWNBl/UTzADZTxGNDMz5i\n\tX6UxgPmLAmH1zCTatHlcmuzjzV4e27sCNFYHPI/AJSMoq99MoHPLCdAXnDWwVflZ83\n\tcbTLL5nS9v6s+FyTpdbUoaWOh9r2c3V3FQhgSR9w=","Date":"Fri, 15 Sep 2017 16:35:40 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"Thomas Huth <thuth@redhat.com>","Message-ID":"<20170915063540.GF5250@umbus.fritz.box>","References":"<150541711102.1616.2690784964841960181.stgit@bahia.lan>\n\t<150541714343.1616.11893912014879112098.stgit@bahia.lan>\n\t<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"O98KdSgI27dgYlM5\"","Content-Disposition":"inline","In-Reply-To":"<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"103.22.144.67","Subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, qemu-ppc@nongnu.org,\n\tGreg Kurz <groug@kaod.org>,\n\tSam Bobroff <sam.bobroff@au1.ibm.com>, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769023,"web_url":"http://patchwork.ozlabs.org/comment/1769023/","msgid":"<20170915063439.GE5250@umbus.fritz.box>","list_archive_url":null,"date":"2017-09-15T06:34:39","subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Thu, Sep 14, 2017 at 09:25:43PM +0200, Greg Kurz wrote:\n> The following capabilities are VM specific:\n> - KVM_CAP_PPC_SMT_POSSIBLE\n> - KVM_CAP_PPC_HTAB_FD\n> - KVM_CAP_PPC_ALLOC_HTAB\n> \n> If both KVM HV and KVM PR are present, checking them always return\n> the HV value, even if we explicitely requested to use PR.\n> \n> This has no visible effect for KVM_CAP_PPC_ALLOC_HTAB, because we also\n> try the KVM_PPC_ALLOCATE_HTAB ioctl which is only suppored by HV. As\n> a consequence, the spapr code doesn't even check KVM_CAP_PPC_HTAB_FD.\n> \n> However, this will cause kvmppc_hint_smt_possible(), introduced by\n> commit fa98fbfcdfcb9, to report several VSMT modes (eg, Available\n> VSMT modes: 8 4 2 1) whereas PR only support mode 1.\n> \n> This patch fixes all three anyway to use kvm_vm_check_extension(). It\n> is okay since the VM is already created at the time kvm_arch_init() or\n> kvmppc_reset_htab() is called.\n> \n> Signed-off-by: Greg Kurz <groug@kaod.org>\n\nApplied to ppc-for-2.11.\n\n> ---\n>  target/ppc/kvm.c |    6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c\n> index 1deaf106d2b9..208c70e81426 100644\n> --- a/target/ppc/kvm.c\n> +++ b/target/ppc/kvm.c\n> @@ -131,7 +131,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n>      cap_interrupt_level = kvm_check_extension(s, KVM_CAP_PPC_IRQ_LEVEL);\n>      cap_segstate = kvm_check_extension(s, KVM_CAP_PPC_SEGSTATE);\n>      cap_booke_sregs = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_SREGS);\n> -    cap_ppc_smt_possible = kvm_check_extension(s, KVM_CAP_PPC_SMT_POSSIBLE);\n> +    cap_ppc_smt_possible = kvm_vm_check_extension(s, KVM_CAP_PPC_SMT_POSSIBLE);\n>      cap_ppc_rma = kvm_check_extension(s, KVM_CAP_PPC_RMA);\n>      cap_spapr_tce = kvm_check_extension(s, KVM_CAP_SPAPR_TCE);\n>      cap_spapr_tce_64 = kvm_check_extension(s, KVM_CAP_SPAPR_TCE_64);\n> @@ -143,7 +143,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n>      cap_ppc_watchdog = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_WATCHDOG);\n>      /* Note: we don't set cap_papr here, because this capability is\n>       * only activated after this by kvmppc_set_papr() */\n> -    cap_htab_fd = kvm_check_extension(s, KVM_CAP_PPC_HTAB_FD);\n> +    cap_htab_fd = kvm_vm_check_extension(s, KVM_CAP_PPC_HTAB_FD);\n>      cap_fixup_hcalls = kvm_check_extension(s, KVM_CAP_PPC_FIXUP_HCALL);\n>      cap_ppc_smt = kvm_vm_check_extension(s, KVM_CAP_PPC_SMT);\n>      cap_htm = kvm_vm_check_extension(s, KVM_CAP_PPC_HTM);\n> @@ -2353,7 +2353,7 @@ int kvmppc_reset_htab(int shift_hint)\n>          /* Full emulation, tell caller to allocate htab itself */\n>          return 0;\n>      }\n> -    if (kvm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n> +    if (kvm_vm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n>          int ret;\n>          ret = kvm_vm_ioctl(kvm_state, KVM_PPC_ALLOCATE_HTAB, &shift);\n>          if (ret == -ENOTTY) {\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au header.b=\"ThNgte4l\"; \n\tdkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtpC85ygBz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 18:16:36 +1000 (AEST)","from localhost ([::1]:51873 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dslne-0001km-MU\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 04:16:34 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:59000)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dslmY-0001SC-2h\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:15:27 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dslmU-0004Rf-MT\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:15:26 -0400","from ozlabs.org ([103.22.144.67]:53051)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgibson@ozlabs.org>)\n\tid 1dslmU-0004PO-5u; Fri, 15 Sep 2017 04:15:22 -0400","by ozlabs.org (Postfix, from userid 1007)\n\tid 3xtp9d4pqPz9sPr; Fri, 15 Sep 2017 18:15:17 +1000 (AEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1505463317;\n\tbh=C5TM3jZa0RML4qMQwqWhw3FNaxoSMK9OqzdjxafCe+Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ThNgte4lVihJ7DlKwPcyfB1B/EhN7pdvvc9p2JFK7T+v6lh34iMI7Be3dfeSpCGD1\n\thCnh6oMFfghKYeuhwgl2xz7mU1cPg5rGKhPae0A95tD3M+e8yaEitYS9Ipp4mPcEKJ\n\tLh7ozTaGtEZlTuh6/jvaBDkN4uTwHWTktxahq5/4=","Date":"Fri, 15 Sep 2017 16:34:39 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"Greg Kurz <groug@kaod.org>","Message-ID":"<20170915063439.GE5250@umbus.fritz.box>","References":"<150541711102.1616.2690784964841960181.stgit@bahia.lan>\n\t<150541714343.1616.11893912014879112098.stgit@bahia.lan>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"qFgkTsE6LiHkLPZw\"","Content-Disposition":"inline","In-Reply-To":"<150541714343.1616.11893912014879112098.stgit@bahia.lan>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"103.22.144.67","Subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>,\n\tqemu-ppc@nongnu.org, qemu-devel@nongnu.org,\n\tSam Bobroff <sam.bobroff@au1.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769028,"web_url":"http://patchwork.ozlabs.org/comment/1769028/","msgid":"<fff9daba-393f-a226-4b9d-467e7a6f47a0@redhat.com>","list_archive_url":null,"date":"2017-09-15T08:18:49","subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 15.09.2017 08:35, David Gibson wrote:\n> On Fri, Sep 15, 2017 at 07:15:41AM +0200, Thomas Huth wrote:\n>> On 14.09.2017 21:25, Greg Kurz wrote:\n>>> The following capabilities are VM specific:\n>>> - KVM_CAP_PPC_SMT_POSSIBLE\n>>> - KVM_CAP_PPC_HTAB_FD\n>>\n>> BTW, looks like kvmppc_has_cap_htab_fd() is dead code ... should we\n>> either remove it or check it somewhere?\n> \n> It's checked in kvmppc_get_htab_fd().\n\nThat function checks the \"cap_htab_fd\" variable, but is not using the\nkvmppc_has_cap_htab_fd() function which I was referring to.\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtpGf2Hdbz9sPr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 18:19:38 +1000 (AEST)","from localhost ([::1]:51885 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dslqa-0005Cz-Dk\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 04:19:36 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:32843)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dslq7-0005Am-6E\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:19:08 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dslpx-0006GB-OE\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:19:02 -0400","from mx1.redhat.com ([209.132.183.28]:55846)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>)\n\tid 1dslpx-0006Dp-Hi; Fri, 15 Sep 2017 04:18:57 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 99E89C057FA6;\n\tFri, 15 Sep 2017 08:18:56 +0000 (UTC)","from [10.36.116.76] (ovpn-116-76.ams2.redhat.com [10.36.116.76])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 2809269A6D;\n\tFri, 15 Sep 2017 08:18:54 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 99E89C057FA6","To":"David Gibson <david@gibson.dropbear.id.au>","References":"<150541711102.1616.2690784964841960181.stgit@bahia.lan>\n\t<150541714343.1616.11893912014879112098.stgit@bahia.lan>\n\t<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>\n\t<20170915063540.GF5250@umbus.fritz.box>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<fff9daba-393f-a226-4b9d-467e7a6f47a0@redhat.com>","Date":"Fri, 15 Sep 2017 10:18:49 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170915063540.GF5250@umbus.fritz.box>","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"UPpDfpwETGsD99h2IoNgO9C16rSIGWedD\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tFri, 15 Sep 2017 08:18:56 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, qemu-ppc@nongnu.org,\n\tGreg Kurz <groug@kaod.org>,\n\tSam Bobroff <sam.bobroff@au1.ibm.com>, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769045,"web_url":"http://patchwork.ozlabs.org/comment/1769045/","msgid":"<20170915083932.GM5250@umbus.fritz.box>","list_archive_url":null,"date":"2017-09-15T08:39:32","subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Fri, Sep 15, 2017 at 10:18:49AM +0200, Thomas Huth wrote:\n> On 15.09.2017 08:35, David Gibson wrote:\n> > On Fri, Sep 15, 2017 at 07:15:41AM +0200, Thomas Huth wrote:\n> >> On 14.09.2017 21:25, Greg Kurz wrote:\n> >>> The following capabilities are VM specific:\n> >>> - KVM_CAP_PPC_SMT_POSSIBLE\n> >>> - KVM_CAP_PPC_HTAB_FD\n> >>\n> >> BTW, looks like kvmppc_has_cap_htab_fd() is dead code ... should we\n> >> either remove it or check it somewhere?\n> > \n> > It's checked in kvmppc_get_htab_fd().\n> \n> That function checks the \"cap_htab_fd\" variable, but is not using the\n> kvmppc_has_cap_htab_fd() function which I was referring to.\n\nOh, sorry, good point.\n\nWe should remove it.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au header.b=\"GrRX24Gr\"; \n\tdkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtpkZ0397z9sPr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 18:40:22 +1000 (AEST)","from localhost ([::1]:51944 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsmAe-0006Q2-4l\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 04:40:20 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37849)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dsmAG-0006Pe-EW\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:39:57 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dsmAF-0001vc-9l\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:39:56 -0400","from ozlabs.org ([2401:3900:2:1::2]:38707)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgibson@ozlabs.org>)\n\tid 1dsmAE-0001vE-U5; Fri, 15 Sep 2017 04:39:55 -0400","by ozlabs.org (Postfix, from userid 1007)\n\tid 3xtpjx6r0pz9sRm; Fri, 15 Sep 2017 18:39:49 +1000 (AEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1505464789;\n\tbh=RBiThG0E8s2jk07Incrf/z2i8OoG5Ys6SYRbQCC+Zck=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=GrRX24GrLntE8QEzSB/X1EzsUXXb5IwmVxMeIE3Zj78AOV4OGW9wL9ifIHHtRrgZb\n\tR2NIOFiMwq0ywq+D/VSmTDw+tQw+uh8Gb16fBt/y6Zy01NOg29jILvA0V1uoBhf1uc\n\ticwO6kFwKZ1f3hWsscBDusoEwtF6pGX3f4fIPGhI=","Date":"Fri, 15 Sep 2017 18:39:32 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"Thomas Huth <thuth@redhat.com>","Message-ID":"<20170915083932.GM5250@umbus.fritz.box>","References":"<150541711102.1616.2690784964841960181.stgit@bahia.lan>\n\t<150541714343.1616.11893912014879112098.stgit@bahia.lan>\n\t<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>\n\t<20170915063540.GF5250@umbus.fritz.box>\n\t<fff9daba-393f-a226-4b9d-467e7a6f47a0@redhat.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"Aaj1jBvBEV7KRjLi\"","Content-Disposition":"inline","In-Reply-To":"<fff9daba-393f-a226-4b9d-467e7a6f47a0@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2401:3900:2:1::2","Subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, qemu-ppc@nongnu.org,\n\tGreg Kurz <groug@kaod.org>,\n\tSam Bobroff <sam.bobroff@au1.ibm.com>, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769051,"web_url":"http://patchwork.ozlabs.org/comment/1769051/","msgid":"<340b1c62-1dba-3823-cdc6-3b9f3cb1cbb7@redhat.com>","list_archive_url":null,"date":"2017-09-15T08:52:08","subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 15.09.2017 10:43, Greg Kurz wrote:\n> On Fri, 15 Sep 2017 07:15:41 +0200\n> Thomas Huth <thuth@redhat.com> wrote:\n> \n>> On 14.09.2017 21:25, Greg Kurz wrote:\n>>> The following capabilities are VM specific:\n>>> - KVM_CAP_PPC_SMT_POSSIBLE\n>>> - KVM_CAP_PPC_HTAB_FD  \n>>\n>> BTW, looks like kvmppc_has_cap_htab_fd() is dead code ... should we\n>> either remove it or check it somewhere?\n>>\n> \n> Heh you're right :)\n> \n> The only user for cap_htab_fd is kvmppc_get_htab_fd(), in order to provide a\n> sensible error message that KVM doesn't allow saving HPTEs (ie, migration isn't\n> supported with some older KVM HV). It doesn't need kvmppc_has_cap_htab_fd() for\n> that since all the code sits in target/ppc/kvm.c.\n> \n> I can't think of any other use, so I guess we can drop it.\n\nOK. If you've got some spare minutes, could you maybe send a patch?\n\n[...]\n>>> @@ -2353,7 +2353,7 @@ int kvmppc_reset_htab(int shift_hint)\n>>>          /* Full emulation, tell caller to allocate htab itself */\n>>>          return 0;\n>>>      }\n>>> -    if (kvm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n>>> +    if (kvm_vm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n>>>          int ret;\n>>>          ret = kvm_vm_ioctl(kvm_state, KVM_PPC_ALLOCATE_HTAB, &shift);\n>>>          if (ret == -ENOTTY) {  \n>>\n>> Looking at the comment in the code after the \"if (ret == -ENOTTY)\" line,\n>> it sounds like there is a bug in the kernel and the\n>> KVM_CAP_PPC_ALLOC_HTAB should depend on the hv_enabled variable, too?\n> \n> It already does :)\n> \n> commit a8acaece5d88db234d0b82b8692dea15d602f622\n\nOh, right, seems like I was looking at an older kernel branch :-/ So\nnever mind, we're fine here.\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtq1L1Hf6z9sPr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 18:53:10 +1000 (AEST)","from localhost ([::1]:52006 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsmN2-0003Nt-6N\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 04:53:08 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42687)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dsmMG-0003LV-BY\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:52:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dsmMD-0004cf-9R\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:52:20 -0400","from mx1.redhat.com ([209.132.183.28]:41440)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>)\n\tid 1dsmMD-0004cH-0W; Fri, 15 Sep 2017 04:52:17 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id AB9E880F79;\n\tFri, 15 Sep 2017 08:52:15 +0000 (UTC)","from [10.36.116.76] (ovpn-116-76.ams2.redhat.com [10.36.116.76])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 538E266829;\n\tFri, 15 Sep 2017 08:52:14 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com AB9E880F79","To":"Greg Kurz <groug@kaod.org>","References":"<150541711102.1616.2690784964841960181.stgit@bahia.lan>\n\t<150541714343.1616.11893912014879112098.stgit@bahia.lan>\n\t<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>\n\t<20170915104320.3d88e231@bahia.lan>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<340b1c62-1dba-3823-cdc6-3b9f3cb1cbb7@redhat.com>","Date":"Fri, 15 Sep 2017 10:52:08 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170915104320.3d88e231@bahia.lan>","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"efAhknn29v8A2I7fX8cFhWx7iQviuGkuX\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tFri, 15 Sep 2017 08:52:15 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, qemu-ppc@nongnu.org,\n\tqemu-devel@nongnu.org, Sam Bobroff <sam.bobroff@au1.ibm.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769052,"web_url":"http://patchwork.ozlabs.org/comment/1769052/","msgid":"<20170915104320.3d88e231@bahia.lan>","list_archive_url":null,"date":"2017-09-15T08:43:20","subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","submitter":{"id":69178,"url":"http://patchwork.ozlabs.org/api/people/69178/","name":"Greg Kurz","email":"groug@kaod.org"},"content":"On Fri, 15 Sep 2017 07:15:41 +0200\nThomas Huth <thuth@redhat.com> wrote:\n\n> On 14.09.2017 21:25, Greg Kurz wrote:\n> > The following capabilities are VM specific:\n> > - KVM_CAP_PPC_SMT_POSSIBLE\n> > - KVM_CAP_PPC_HTAB_FD  \n> \n> BTW, looks like kvmppc_has_cap_htab_fd() is dead code ... should we\n> either remove it or check it somewhere?\n> \n\nHeh you're right :)\n\nThe only user for cap_htab_fd is kvmppc_get_htab_fd(), in order to provide a\nsensible error message that KVM doesn't allow saving HPTEs (ie, migration isn't\nsupported with some older KVM HV). It doesn't need kvmppc_has_cap_htab_fd() for\nthat since all the code sits in target/ppc/kvm.c.\n\nI can't think of any other use, so I guess we can drop it.\n\n> > - KVM_CAP_PPC_ALLOC_HTAB\n> > \n> > If both KVM HV and KVM PR are present, checking them always return\n> > the HV value, even if we explicitely requested to use PR.\n> > \n> > This has no visible effect for KVM_CAP_PPC_ALLOC_HTAB, because we also\n> > try the KVM_PPC_ALLOCATE_HTAB ioctl which is only suppored by HV. As\n> > a consequence, the spapr code doesn't even check KVM_CAP_PPC_HTAB_FD.\n> >\n> > However, this will cause kvmppc_hint_smt_possible(), introduced by\n> > commit fa98fbfcdfcb9, to report several VSMT modes (eg, Available\n> > VSMT modes: 8 4 2 1) whereas PR only support mode 1.\n> > \n> > This patch fixes all three anyway to use kvm_vm_check_extension(). It\n> > is okay since the VM is already created at the time kvm_arch_init() or\n> > kvmppc_reset_htab() is called.\n> > \n> > Signed-off-by: Greg Kurz <groug@kaod.org>\n> > ---\n> >  target/ppc/kvm.c |    6 +++---\n> >  1 file changed, 3 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c\n> > index 1deaf106d2b9..208c70e81426 100644\n> > --- a/target/ppc/kvm.c\n> > +++ b/target/ppc/kvm.c\n> > @@ -131,7 +131,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n> >      cap_interrupt_level = kvm_check_extension(s, KVM_CAP_PPC_IRQ_LEVEL);\n> >      cap_segstate = kvm_check_extension(s, KVM_CAP_PPC_SEGSTATE);\n> >      cap_booke_sregs = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_SREGS);\n> > -    cap_ppc_smt_possible = kvm_check_extension(s, KVM_CAP_PPC_SMT_POSSIBLE);\n> > +    cap_ppc_smt_possible = kvm_vm_check_extension(s, KVM_CAP_PPC_SMT_POSSIBLE);\n> >      cap_ppc_rma = kvm_check_extension(s, KVM_CAP_PPC_RMA);\n> >      cap_spapr_tce = kvm_check_extension(s, KVM_CAP_SPAPR_TCE);\n> >      cap_spapr_tce_64 = kvm_check_extension(s, KVM_CAP_SPAPR_TCE_64);\n> > @@ -143,7 +143,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n> >      cap_ppc_watchdog = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_WATCHDOG);\n> >      /* Note: we don't set cap_papr here, because this capability is\n> >       * only activated after this by kvmppc_set_papr() */\n> > -    cap_htab_fd = kvm_check_extension(s, KVM_CAP_PPC_HTAB_FD);\n> > +    cap_htab_fd = kvm_vm_check_extension(s, KVM_CAP_PPC_HTAB_FD);\n> >      cap_fixup_hcalls = kvm_check_extension(s, KVM_CAP_PPC_FIXUP_HCALL);\n> >      cap_ppc_smt = kvm_vm_check_extension(s, KVM_CAP_PPC_SMT);\n> >      cap_htm = kvm_vm_check_extension(s, KVM_CAP_PPC_HTM);\n> > @@ -2353,7 +2353,7 @@ int kvmppc_reset_htab(int shift_hint)\n> >          /* Full emulation, tell caller to allocate htab itself */\n> >          return 0;\n> >      }\n> > -    if (kvm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n> > +    if (kvm_vm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {\n> >          int ret;\n> >          ret = kvm_vm_ioctl(kvm_state, KVM_PPC_ALLOCATE_HTAB, &shift);\n> >          if (ret == -ENOTTY) {  \n> \n> Looking at the comment in the code after the \"if (ret == -ENOTTY)\" line,\n> it sounds like there is a bug in the kernel and the\n> KVM_CAP_PPC_ALLOC_HTAB should depend on the hv_enabled variable, too?\n\nIt already does :)\n\ncommit a8acaece5d88db234d0b82b8692dea15d602f622\nAuthor: David Gibson <david@gibson.dropbear.id.au>\nDate:   Wed Nov 23 16:14:07 2016 +1100\n\n    KVM: PPC: Correctly report KVM_CAP_PPC_ALLOC_HTAB\n    \n    At present KVM on powerpc always reports KVM_CAP_PPC_ALLOC_HTAB as enabled.\n    However, the ioctl() it advertises (KVM_PPC_ALLOCATE_HTAB) only actually\n    works on KVM HV.  On KVM PR it will fail with ENOTTY.\n    \n    QEMU already has a workaround for this, so it's not breaking things in\n    practice, but it would be better to advertise this correctly.\n    \n    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>\n    Signed-off-by: Paul Mackerras <paulus@ozlabs.org>\n\n> Anyway, that's another topic, your patch is fine!\n> \n> Reviewed-by: Thomas Huth <thuth@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtq1V3TqVz9sPr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 18:53:18 +1000 (AEST)","from localhost ([::1]:52007 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsmNA-0003U9-It\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 04:53:16 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39377)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dsmDq-0002Fo-Lw\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:43:39 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dsmDn-0003uB-JD\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:43:38 -0400","from 4.mo2.mail-out.ovh.net ([87.98.172.75]:41712)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <groug@kaod.org>) id 1dsmDn-0003sm-8C\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 04:43:35 -0400","from player770.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo2.mail-out.ovh.net (Postfix) with ESMTP id 778F7AC332\n\tfor <qemu-devel@nongnu.org>; Fri, 15 Sep 2017 10:43:31 +0200 (CEST)","from bahia.lan (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139])\n\t(Authenticated sender: groug@kaod.org)\n\tby player770.ha.ovh.net (Postfix) with ESMTPSA id A64F73C00EF;\n\tFri, 15 Sep 2017 10:43:21 +0200 (CEST)"],"Date":"Fri, 15 Sep 2017 10:43:20 +0200","From":"Greg Kurz <groug@kaod.org>","To":"Thomas Huth <thuth@redhat.com>","Message-ID":"<20170915104320.3d88e231@bahia.lan>","In-Reply-To":"<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>","References":"<150541711102.1616.2690784964841960181.stgit@bahia.lan>\n\t<150541714343.1616.11893912014879112098.stgit@bahia.lan>\n\t<19f09a67-5b16-6bdf-5c72-c2df84537ea7@redhat.com>","X-Mailer":"Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu)","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tboundary=\"Sig_/qSnuVehBQ5RfY=wC4JaCFui\";\n\tprotocol=\"application/pgp-signature\"","X-Ovh-Tracer-Id":"10570511277259921714","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrgeekgddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"87.98.172.75","Subject":"Re: [Qemu-devel] [PATCH 3/3] ppc/kvm: check some capabilities with\n\tkvm_vm_check_extension()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, qemu-ppc@nongnu.org,\n\tqemu-devel@nongnu.org, Sam Bobroff <sam.bobroff@au1.ibm.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]