From patchwork Fri Feb 9 09:25:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 871281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zd98L5jrBz9s1h for ; Fri, 9 Feb 2018 20:42:26 +1100 (AEDT) Received: from localhost ([::1]:53051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ek5CK-0007qE-QT for incoming@patchwork.ozlabs.org; Fri, 09 Feb 2018 04:42:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ek4wh-0002NP-FZ for qemu-devel@nongnu.org; Fri, 09 Feb 2018 04:26:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ek4wg-0006MS-FV for qemu-devel@nongnu.org; Fri, 09 Feb 2018 04:26:15 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52200 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ek4wg-0006Lx-B6; Fri, 09 Feb 2018 04:26:14 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9A444085014; Fri, 9 Feb 2018 09:26:13 +0000 (UTC) Received: from localhost (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92B7C1010408; Fri, 9 Feb 2018 09:26:13 +0000 (UTC) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 9 Feb 2018 10:25:17 +0100 Message-Id: <20180209092524.31348-23-cohuck@redhat.com> In-Reply-To: <20180209092524.31348-1-cohuck@redhat.com> References: <20180209092524.31348-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 09 Feb 2018 09:26:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 09 Feb 2018 09:26:13 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 22/29] s390x/cpumodel: allow zpci features in qemu model 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" AEN and AIS can be provided unconditionally, ZPCI should be turned on manually. With -cpu qemu,zpci=on, the guest kernel can now successfully detect virtio-pci devices under tcg. Also fixup the order of the MSA_EXT_{3,4} flags while at it. Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck --- target/s390x/cpu_models.c | 6 ++++++ target/s390x/gen-features.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 212a5f0697..250d931d7e 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -23,6 +23,7 @@ #include "qapi/qmp/qbool.h" #ifndef CONFIG_USER_ONLY #include "sysemu/arch_init.h" +#include "hw/pci/pci.h" #endif #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \ @@ -1271,6 +1272,11 @@ static void register_types(void) /* init all bitmaps from gnerated data initially */ s390_init_feat_bitmap(qemu_max_cpu_feat_init, qemu_max_cpu_feat); +#ifndef CONFIG_USER_ONLY + if (!pci_available) { + clear_bit(S390_FEAT_ZPCI, qemu_max_cpu_feat); + } +#endif for (i = 0; i < ARRAY_SIZE(s390_cpu_defs); i++) { s390_init_feat_bitmap(s390_cpu_defs[i].base_init, s390_cpu_defs[i].base_feat); diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 0570f597ec..89a140c9a7 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -572,8 +572,10 @@ static uint16_t qemu_LATEST[] = { S390_FEAT_STFLE_49, S390_FEAT_LOCAL_TLB_CLEARING, S390_FEAT_INTERLOCKED_ACCESS_2, - S390_FEAT_MSA_EXT_4, + S390_FEAT_ADAPTER_EVENT_NOTIFICATION, + S390_FEAT_ADAPTER_INT_SUPPRESSION, S390_FEAT_MSA_EXT_3, + S390_FEAT_MSA_EXT_4, }; /* add all new definitions before this point */ @@ -582,6 +584,8 @@ static uint16_t qemu_MAX[] = { S390_FEAT_STFLE_53, /* generates a dependency warning, leave it out for now */ S390_FEAT_MSA_EXT_5, + /* only with CONFIG_PCI */ + S390_FEAT_ZPCI, }; /****** END FEATURE DEFS ******/