From nobody Mon May 6 15:12:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1574786939; cv=none; d=zohomail.com; s=zohoarc; b=FCDBdcNIrccpbR2NsL17XDEy8PROgxbAklK8ESQGp7HI1ERpDBReQMMgVUmNuV+X5/8zLjxO1YX8O9i+sOaSq1FITYN/EHpoukhGPRyoByb0726nWFAaK0VzhpGLGNzfYaF0g4xcxX9UtPDvWkNojuDbXcLgWV86UwDof28MPF8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574786939; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8j6JC5FbZ8ois7p+o7n0YBkcwX/sMRSj37FwHU8zryU=; b=nduDTxeYrnO8kliV9pJRDD3AYTUjI+WSRP0K20vxIh4lnROk09UWQGltUrPpDq90t+G0VSt1j8HuWAGVzpqaYOl25R4SppsqRhUYZPdSkgE2fkfEjFXECvTdtvaOfkJXRcJJSLU5t/HSWdr4nKYcwsLeFiEpiUYP5ehapLLtcnw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157478693911340.88650050853403; Tue, 26 Nov 2019 08:48:59 -0800 (PST) Received: from localhost ([::1]:57074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZe1J-000809-2f for importer@patchew.org; Tue, 26 Nov 2019 11:48:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39594) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZdys-0006Fd-Lr for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZdyr-0006WX-56 for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:26 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:63504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZdyq-0006W5-SR for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:25 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAQGITBD091336 for ; Tue, 26 Nov 2019 11:46:24 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wh49uay58-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Nov 2019 11:46:23 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Nov 2019 16:46:21 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 26 Nov 2019 16:46:18 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAQGkIGt18153930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Nov 2019 16:46:18 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01D42A4051; Tue, 26 Nov 2019 16:46:18 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDFB8A404D; Tue, 26 Nov 2019 16:46:17 +0000 (GMT) Received: from bahia.tlslab.ibm.com (unknown [9.101.4.41]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 26 Nov 2019 16:46:17 +0000 (GMT) Subject: [for-5.0 PATCH v2 1/4] linux-headers: Update From: Greg Kurz To: David Gibson Date: Tue, 26 Nov 2019 17:46:17 +0100 In-Reply-To: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> References: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19112616-0028-0000-0000-000003C04AC6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112616-0029-0000-0000-000024834DD7 Message-Id: <157478677756.67101.11558821804418331832.stgit@bahia.tlslab.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-26_04:2019-11-26,2019-11-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 adultscore=0 clxscore=1034 impostorscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911260139 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Update to mainline commit be2eca94d144 ("Merge tag 'for-linus-5.5-1'` of git://github.com/cminyard/linux-ipmi") Signed-off-by: Greg Kurz --- include/standard-headers/linux/ethtool.h | 6 ++++++ include/standard-headers/linux/virtio_ring.h | 2 +- linux-headers/asm-arm/kvm.h | 3 ++- linux-headers/asm-arm64/kvm.h | 5 ++++- linux-headers/asm-mips/unistd_n32.h | 1 + linux-headers/asm-mips/unistd_n64.h | 1 + linux-headers/asm-mips/unistd_o32.h | 1 + linux-headers/asm-powerpc/kvm.h | 3 +++ linux-headers/linux/kvm.h | 11 +++++++++++ linux-headers/linux/psp-sev.h | 3 +++ 10 files changed, 33 insertions(+), 3 deletions(-) diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-he= aders/linux/ethtool.h index 4ff422b635db..6e8a10ee1075 100644 --- a/include/standard-headers/linux/ethtool.h +++ b/include/standard-headers/linux/ethtool.h @@ -1507,6 +1507,11 @@ enum ethtool_link_mode_bit_indices { ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT =3D 66, ETHTOOL_LINK_MODE_100baseT1_Full_BIT =3D 67, ETHTOOL_LINK_MODE_1000baseT1_Full_BIT =3D 68, + ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT =3D 69, + ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT =3D 70, + ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT =3D 71, + ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT =3D 72, + ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT =3D 73, =20 /* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS @@ -1618,6 +1623,7 @@ enum ethtool_link_mode_bit_indices { #define SPEED_56000 56000 #define SPEED_100000 100000 #define SPEED_200000 200000 +#define SPEED_400000 400000 =20 #define SPEED_UNKNOWN -1 =20 diff --git a/include/standard-headers/linux/virtio_ring.h b/include/standar= d-headers/linux/virtio_ring.h index 306cd41147be..f230fed47960 100644 --- a/include/standard-headers/linux/virtio_ring.h +++ b/include/standard-headers/linux/virtio_ring.h @@ -167,7 +167,7 @@ static inline void vring_init(struct vring *vr, unsigne= d int num, void *p, { vr->num =3D num; vr->desc =3D p; - vr->avail =3D p + num*sizeof(struct vring_desc); + vr->avail =3D (struct vring_avail *)((char *)p + num * sizeof(struct vrin= g_desc)); vr->used =3D (void *)(((uintptr_t)&vr->avail->ring[num] + sizeof(__virtio= 16) + align-1) & ~(align - 1)); } diff --git a/linux-headers/asm-arm/kvm.h b/linux-headers/asm-arm/kvm.h index 9d379d337298..0db5644e27af 100644 --- a/linux-headers/asm-arm/kvm.h +++ b/linux-headers/asm-arm/kvm.h @@ -131,8 +131,9 @@ struct kvm_vcpu_events { struct { __u8 serror_pending; __u8 serror_has_esr; + __u8 ext_dabt_pending; /* Align it to 8 bytes */ - __u8 pad[6]; + __u8 pad[5]; __u64 serror_esr; } exception; __u32 reserved[12]; diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index 0ce6e49f3a19..920af01c8b90 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b/linux-headers/asm-arm64/kvm.h @@ -164,8 +164,9 @@ struct kvm_vcpu_events { struct { __u8 serror_pending; __u8 serror_has_esr; + __u8 ext_dabt_pending; /* Align it to 8 bytes */ - __u8 pad[6]; + __u8 pad[5]; __u64 serror_esr; } exception; __u32 reserved[12]; @@ -323,6 +324,8 @@ struct kvm_vcpu_events { #define KVM_ARM_VCPU_TIMER_CTRL 1 #define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0 #define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1 +#define KVM_ARM_VCPU_PVTIME_CTRL 2 +#define KVM_ARM_VCPU_PVTIME_IPA 0 =20 /* KVM_IRQ_LINE irq field index values */ #define KVM_ARM_IRQ_VCPU2_SHIFT 28 diff --git a/linux-headers/asm-mips/unistd_n32.h b/linux-headers/asm-mips/u= nistd_n32.h index 7dffe8e34e63..659d5c9ade47 100644 --- a/linux-headers/asm-mips/unistd_n32.h +++ b/linux-headers/asm-mips/unistd_n32.h @@ -364,6 +364,7 @@ #define __NR_fsmount (__NR_Linux + 432) #define __NR_fspick (__NR_Linux + 433) #define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) =20 =20 #endif /* _ASM_MIPS_UNISTD_N32_H */ diff --git a/linux-headers/asm-mips/unistd_n64.h b/linux-headers/asm-mips/u= nistd_n64.h index f4592d6fc50c..4b6310a05c23 100644 --- a/linux-headers/asm-mips/unistd_n64.h +++ b/linux-headers/asm-mips/unistd_n64.h @@ -340,6 +340,7 @@ #define __NR_fsmount (__NR_Linux + 432) #define __NR_fspick (__NR_Linux + 433) #define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) =20 =20 #endif /* _ASM_MIPS_UNISTD_N64_H */ diff --git a/linux-headers/asm-mips/unistd_o32.h b/linux-headers/asm-mips/u= nistd_o32.h index 04c6728352a5..4ce7b4e288a5 100644 --- a/linux-headers/asm-mips/unistd_o32.h +++ b/linux-headers/asm-mips/unistd_o32.h @@ -410,6 +410,7 @@ #define __NR_fsmount (__NR_Linux + 432) #define __NR_fspick (__NR_Linux + 433) #define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) =20 =20 #endif /* _ASM_MIPS_UNISTD_O32_H */ diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kv= m.h index b0f72dea8b11..264e266a85bf 100644 --- a/linux-headers/asm-powerpc/kvm.h +++ b/linux-headers/asm-powerpc/kvm.h @@ -667,6 +667,8 @@ struct kvm_ppc_cpu_char { =20 /* PPC64 eXternal Interrupt Controller Specification */ #define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */ +#define KVM_DEV_XICS_GRP_CTRL 2 +#define KVM_DEV_XICS_NR_SERVERS 1 =20 /* Layout of 64-bit source attribute values */ #define KVM_XICS_DESTINATION_SHIFT 0 @@ -683,6 +685,7 @@ struct kvm_ppc_cpu_char { #define KVM_DEV_XIVE_GRP_CTRL 1 #define KVM_DEV_XIVE_RESET 1 #define KVM_DEV_XIVE_EQ_SYNC 2 +#define KVM_DEV_XIVE_NR_SERVERS 3 #define KVM_DEV_XIVE_GRP_SOURCE 2 /* 64-bit source identifier */ #define KVM_DEV_XIVE_GRP_SOURCE_CONFIG 3 /* 64-bit source identifier */ #define KVM_DEV_XIVE_GRP_EQ_CONFIG 4 /* 64-bit EQ identifier */ diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 3d9b18f7f871..3b27a1ae85cc 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -235,6 +235,7 @@ struct kvm_hyperv_exit { #define KVM_EXIT_S390_STSI 25 #define KVM_EXIT_IOAPIC_EOI 26 #define KVM_EXIT_HYPERV 27 +#define KVM_EXIT_ARM_NISV 28 =20 /* For KVM_EXIT_INTERNAL_ERROR */ /* Emulate instruction failed. */ @@ -394,6 +395,11 @@ struct kvm_run { } eoi; /* KVM_EXIT_HYPERV */ struct kvm_hyperv_exit hyperv; + /* KVM_EXIT_ARM_NISV */ + struct { + __u64 esr_iss; + __u64 fault_ipa; + } arm_nisv; /* Fix the size of the union. */ char padding[256]; }; @@ -1000,6 +1006,9 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_PMU_EVENT_FILTER 173 #define KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 174 #define KVM_CAP_HYPERV_DIRECT_TLBFLUSH 175 +#define KVM_CAP_PPC_GUEST_DEBUG_SSTEP 176 +#define KVM_CAP_ARM_NISV_TO_USER 177 +#define KVM_CAP_ARM_INJECT_EXT_DABT 178 =20 #ifdef KVM_CAP_IRQ_ROUTING =20 @@ -1227,6 +1236,8 @@ enum kvm_device_type { #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_XIVE, #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE + KVM_DEV_TYPE_ARM_PV_TIME, +#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_MAX, }; =20 diff --git a/linux-headers/linux/psp-sev.h b/linux-headers/linux/psp-sev.h index 34c39690c09d..31f971e89659 100644 --- a/linux-headers/linux/psp-sev.h +++ b/linux-headers/linux/psp-sev.h @@ -58,6 +58,9 @@ typedef enum { SEV_RET_HWSEV_RET_PLATFORM, SEV_RET_HWSEV_RET_UNSAFE, SEV_RET_UNSUPPORTED, + SEV_RET_INVALID_PARAM, + SEV_RET_RESOURCE_LIMIT, + SEV_RET_SECURE_DATA_INVALID, SEV_RET_MAX, } sev_ret_code; =20 From nobody Mon May 6 15:12:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1574786958; cv=none; d=zohomail.com; s=zohoarc; b=Ivd3Jk4L73899CiEkWM+5rx6qtzgWR+jW2brG3hmAEtCpbNT4qttDow2Y1KhExkqdME8sJGSjAILCNHhGRfzeKDtixuFD+mQnY0H0/yiIE2Ki06o1H51zLDmXxUUpZD4F0wCRtZDIuY0VOqes+eJ62WFcLBPEq8uwyT07m/uipg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574786958; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j7ihxQHzOF/QOpQjTCXXM5iFn2ZNyZi1vdAJtSt62IM=; b=WEttl5lPfW+dgDC/eac98XBAhndg08L9+0PrYG9UL1McrwBoDJQ9u731F7Rf6nnISQNiGg/Ya2dmnO2YrHpExOr1DNY0oCEh3b433+jtveW1nUmuHb2uKdv2mlFvdzbzqRTXasJCmVL8fO717w+9SYt25k317tuGu/fY33Ppdfw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574786958357787.3172004259552; Tue, 26 Nov 2019 08:49:18 -0800 (PST) Received: from localhost ([::1]:57082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZe1c-0008Qb-Sx for importer@patchew.org; Tue, 26 Nov 2019 11:49:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39642) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZdyx-0006LB-OT for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZdyw-0006ZN-7K for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:31 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZdyv-0006Yi-SU for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:30 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAQGK7Lw121884 for ; Tue, 26 Nov 2019 11:46:29 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wh0nj3hsk-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Nov 2019 11:46:28 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Nov 2019 16:46:26 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 26 Nov 2019 16:46:24 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAQGkNwt29426020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Nov 2019 16:46:23 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E6AFA405B; Tue, 26 Nov 2019 16:46:23 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3C50CA405C; Tue, 26 Nov 2019 16:46:23 +0000 (GMT) Received: from bahia.tlslab.ibm.com (unknown [9.101.4.41]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 26 Nov 2019 16:46:23 +0000 (GMT) Subject: [for-5.0 PATCH v2 2/4] spapr: Pass the maximum number of vCPUs to the KVM interrupt controller From: Greg Kurz To: David Gibson Date: Tue, 26 Nov 2019 17:46:23 +0100 In-Reply-To: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> References: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19112616-0020-0000-0000-0000038F4BA1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112616-0021-0000-0000-000021E64FCB Message-Id: <157478678301.67101.2717368060417156338.stgit@bahia.tlslab.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-26_04:2019-11-26,2019-11-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 clxscore=1034 malwarescore=0 impostorscore=0 bulkscore=0 suspectscore=2 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911260139 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The XIVE and XICS-on-XIVE KVM devices on POWER9 hosts can greatly reduce their consumption of some scarce HW resources, namely Virtual Presenter identifiers, if they know the maximum number of vCPUs that may run in the VM. Prepare ground for this by passing the value down to xics_kvm_connect() and kvmppc_xive_connect(). This is purely mechanical, no functional change. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/spapr_xive.c | 6 ++++-- hw/intc/spapr_xive_kvm.c | 3 ++- hw/intc/xics_kvm.c | 3 ++- hw/intc/xics_spapr.c | 5 +++-- hw/ppc/spapr_irq.c | 8 +++++--- include/hw/ppc/spapr_irq.h | 10 ++++++++-- include/hw/ppc/spapr_xive.h | 3 ++- include/hw/ppc/xics_spapr.h | 3 ++- 8 files changed, 28 insertions(+), 13 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 729246e906c9..8364f61c786c 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -651,12 +651,14 @@ static void spapr_xive_dt(SpaprInterruptController *i= ntc, uint32_t nr_servers, plat_res_int_priorities, sizeof(plat_res_int_prioriti= es))); } =20 -static int spapr_xive_activate(SpaprInterruptController *intc, Error **err= p) +static int spapr_xive_activate(SpaprInterruptController *intc, + uint32_t nr_servers, Error **errp) { SpaprXive *xive =3D SPAPR_XIVE(intc); =20 if (kvm_enabled()) { - int rc =3D spapr_irq_init_kvm(kvmppc_xive_connect, intc, errp); + int rc =3D spapr_irq_init_kvm(kvmppc_xive_connect, intc, nr_server= s, + errp); if (rc < 0) { return rc; } diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c index 69e73552f1ef..46c7609bd8d0 100644 --- a/hw/intc/spapr_xive_kvm.c +++ b/hw/intc/spapr_xive_kvm.c @@ -728,7 +728,8 @@ static void *kvmppc_xive_mmap(SpaprXive *xive, int pgof= f, size_t len, * All the XIVE memory regions are now backed by mappings from the KVM * XIVE device. */ -int kvmppc_xive_connect(SpaprInterruptController *intc, Error **errp) +int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_server= s, + Error **errp) { SpaprXive *xive =3D SPAPR_XIVE(intc); XiveSource *xsrc =3D &xive->source; diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 954c424b3652..a1f1b7b0d37c 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -342,7 +342,8 @@ void ics_kvm_set_irq(ICSState *ics, int srcno, int val) } } =20 -int xics_kvm_connect(SpaprInterruptController *intc, Error **errp) +int xics_kvm_connect(SpaprInterruptController *intc, uint32_t nr_servers, + Error **errp) { ICSState *ics =3D ICS_SPAPR(intc); int rc; diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c index b3705dab0e8a..8ae4f41459c3 100644 --- a/hw/intc/xics_spapr.c +++ b/hw/intc/xics_spapr.c @@ -422,10 +422,11 @@ static int xics_spapr_post_load(SpaprInterruptControl= ler *intc, int version_id) return 0; } =20 -static int xics_spapr_activate(SpaprInterruptController *intc, Error **err= p) +static int xics_spapr_activate(SpaprInterruptController *intc, + uint32_t nr_servers, Error **errp) { if (kvm_enabled()) { - return spapr_irq_init_kvm(xics_kvm_connect, intc, errp); + return spapr_irq_init_kvm(xics_kvm_connect, intc, nr_servers, errp= ); } return 0; } diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index d4a54afc8662..07e08d6544a0 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -70,15 +70,16 @@ void spapr_irq_msi_free(SpaprMachineState *spapr, int i= rq, uint32_t num) bitmap_clear(spapr->irq_map, irq - SPAPR_IRQ_MSI, num); } =20 -int spapr_irq_init_kvm(int (*fn)(SpaprInterruptController *, Error **), +int spapr_irq_init_kvm(SpaprInterruptControllerInitKvm fn, SpaprInterruptController *intc, + uint32_t nr_servers, Error **errp) { MachineState *machine =3D MACHINE(qdev_get_machine()); Error *local_err =3D NULL; =20 if (kvm_enabled() && machine_kernel_irqchip_allowed(machine)) { - if (fn(intc, &local_err) < 0) { + if (fn(intc, nr_servers, &local_err) < 0) { if (machine_kernel_irqchip_required(machine)) { error_prepend(&local_err, "kernel_irqchip requested but unavailable: "= ); @@ -481,6 +482,7 @@ static void set_active_intc(SpaprMachineState *spapr, SpaprInterruptController *new_intc) { SpaprInterruptControllerClass *sicc; + uint32_t nr_servers =3D spapr_max_server_number(spapr); =20 assert(new_intc); =20 @@ -498,7 +500,7 @@ static void set_active_intc(SpaprMachineState *spapr, =20 sicc =3D SPAPR_INTC_GET_CLASS(new_intc); if (sicc->activate) { - sicc->activate(new_intc, &error_fatal); + sicc->activate(new_intc, nr_servers, &error_fatal); } =20 spapr->active_intc =3D new_intc; diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index ff814d13de37..ca8cb4421374 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -43,7 +43,8 @@ typedef struct SpaprInterruptController SpaprInterruptCon= troller; typedef struct SpaprInterruptControllerClass { InterfaceClass parent; =20 - int (*activate)(SpaprInterruptController *intc, Error **errp); + int (*activate)(SpaprInterruptController *intc, uint32_t nr_servers, + Error **errp); void (*deactivate)(SpaprInterruptController *intc); =20 /* @@ -98,8 +99,13 @@ qemu_irq spapr_qirq(SpaprMachineState *spapr, int irq); int spapr_irq_post_load(SpaprMachineState *spapr, int version_id); void spapr_irq_reset(SpaprMachineState *spapr, Error **errp); int spapr_irq_get_phandle(SpaprMachineState *spapr, void *fdt, Error **err= p); -int spapr_irq_init_kvm(int (*fn)(SpaprInterruptController *, Error **), + +typedef int (*SpaprInterruptControllerInitKvm)(SpaprInterruptController *, + uint32_t, Error **); + +int spapr_irq_init_kvm(SpaprInterruptControllerInitKvm fn, SpaprInterruptController *intc, + uint32_t nr_servers, Error **errp); =20 /* diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index 742b7e834f2a..3a103c224d44 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -66,7 +66,8 @@ int spapr_xive_end_to_target(uint8_t end_blk, uint32_t en= d_idx, /* * KVM XIVE device helpers */ -int kvmppc_xive_connect(SpaprInterruptController *intc, Error **errp); +int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_server= s, + Error **errp); void kvmppc_xive_disconnect(SpaprInterruptController *intc); void kvmppc_xive_reset(SpaprXive *xive, Error **errp); void kvmppc_xive_set_source_config(SpaprXive *xive, uint32_t lisn, XiveEAS= *eas, diff --git a/include/hw/ppc/xics_spapr.h b/include/hw/ppc/xics_spapr.h index 28b87038c89a..1c65c96e3c7a 100644 --- a/include/hw/ppc/xics_spapr.h +++ b/include/hw/ppc/xics_spapr.h @@ -32,7 +32,8 @@ #define TYPE_ICS_SPAPR "ics-spapr" #define ICS_SPAPR(obj) OBJECT_CHECK(ICSState, (obj), TYPE_ICS_SPAPR) =20 -int xics_kvm_connect(SpaprInterruptController *intc, Error **errp); +int xics_kvm_connect(SpaprInterruptController *intc, uint32_t nr_servers, + Error **errp); void xics_kvm_disconnect(SpaprInterruptController *intc); bool xics_kvm_has_broken_disconnect(SpaprMachineState *spapr); =20 From nobody Mon May 6 15:12:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1574786981; cv=none; d=zohomail.com; s=zohoarc; b=ncBg/l+uYwC9wElUHwveWByraHVEsRt8tBlFxmmfoguLPADn3PPYhA9gplLkQ4C9suEs3zfAtLLM/d00dbjcvET11wcn2NzIEUnfhpoRZ1vNLp+Zkfjrq7aTbq50tsAYrcm4Lb12bIZ/mtNpwjDdRbH2yRw/ONKY7TgcPLZdy5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574786981; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mbI2W3Mkl+ZcsPLp9NAphWeLAULEQ0ohVIQWm/g64eI=; b=hg+hGHFaYawJH2+OjC+6CThEttnVCoTAB8tyWQG03iXOEW/xIG55lAdYbvLwmzzi9m71ZK//LqMo+YmoCkMR+DRxbxqqp7YG7rLFJFgQOR/StCV0jBPdR2/DTgT4UE/hb/lYWKLQZRtEwDjcNe7gs6tjHV9Z+3ZJDiY6ltYVrOg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574786981749822.4020197218157; Tue, 26 Nov 2019 08:49:41 -0800 (PST) Received: from localhost ([::1]:57090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZe20-0000GP-EV for importer@patchew.org; Tue, 26 Nov 2019 11:49:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39691) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZdz3-0006R4-Ja for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZdz2-0006cZ-Cy for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:37 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:8702 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZdz2-0006cB-83 for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:36 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAQGJ6lf045547 for ; Tue, 26 Nov 2019 11:46:35 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wh4yr8rvb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Nov 2019 11:46:34 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Nov 2019 16:46:33 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 26 Nov 2019 16:46:29 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAQGkSvx48169174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Nov 2019 16:46:29 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DFAA6AE045; Tue, 26 Nov 2019 16:46:28 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7879AE04D; Tue, 26 Nov 2019 16:46:28 +0000 (GMT) Received: from bahia.tlslab.ibm.com (unknown [9.101.4.41]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 26 Nov 2019 16:46:28 +0000 (GMT) Subject: [for-5.0 PATCH v2 3/4] spapr/xics: Configure number of servers in KVM From: Greg Kurz To: David Gibson Date: Tue, 26 Nov 2019 17:46:28 +0100 In-Reply-To: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> References: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19112616-0008-0000-0000-000003389031 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112616-0009-0000-0000-00004A579545 Message-Id: <157478678846.67101.9660531022460517710.stgit@bahia.tlslab.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-26_04:2019-11-26,2019-11-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 adultscore=0 mlxlogscore=707 impostorscore=0 clxscore=1034 priorityscore=1501 lowpriorityscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911260139 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The XICS-on-XIVE KVM devices now has an attribute to configure the number of interrupt servers. This allows to greatly optimize the usage of the VP space in the XIVE HW, and thus to start a lot more VMs. Only set this attribute if available in order to support older POWER9 KVM and pre-POWER9 XICS KVM devices. The XICS-on-XIVE KVM device now reports the exhaustion of VPs upon the connection of the first VCPU. Check that in order to have a chance to provide a hint to the user. ` Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics_kvm.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index a1f1b7b0d37c..8d6156578fbc 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -165,8 +165,15 @@ void icp_kvm_realize(DeviceState *dev, Error **errp) =20 ret =3D kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0, kernel_xics_fd, v= cpu_id); if (ret < 0) { - error_setg(errp, "Unable to connect CPU%ld to kernel XICS: %s", vc= pu_id, - strerror(errno)); + Error *local_err =3D NULL; + + error_setg(&local_err, "Unable to connect CPU%ld to kernel XICS: %= s", + vcpu_id, strerror(errno)); + if (errno =3D=3D ENOSPC) { + error_append_hint(&local_err, "Try -smp maxcpus=3DN with N < %= u\n", + MACHINE(qdev_get_machine())->smp.max_cpus); + } + error_propagate(errp, local_err); return; } enabled_icp =3D g_malloc(sizeof(*enabled_icp)); @@ -399,6 +406,16 @@ int xics_kvm_connect(SpaprInterruptController *intc, u= int32_t nr_servers, goto fail; } =20 + /* Tell KVM about the # of VCPUs we may have (POWER9 and newer only) */ + if (kvm_device_check_attr(rc, KVM_DEV_XICS_GRP_CTRL, + KVM_DEV_XICS_NR_SERVERS)) { + if (kvm_device_access(rc, KVM_DEV_XICS_GRP_CTRL, + KVM_DEV_XICS_NR_SERVERS, &nr_servers, true, + &local_err)) { + goto fail; + } + } + kernel_xics_fd =3D rc; kvm_kernel_irqchip =3D true; kvm_msi_via_irqfd_allowed =3D true; From nobody Mon May 6 15:12:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1574787147; cv=none; d=zohomail.com; s=zohoarc; b=de+LsJ3fP6yS7LaOPAKxoc/GMuLhejki5kDipVcL9ojhxZt0kfw77T1ez/J+Zk7wOexjexIC10HQHFV/0C3RS/ylBYQ40/aXe1gv3r0/JcmMlIV9peR8S125+eO4PiqU+CgPjQHcJ1F2bv6wvaUCQlHMJTwNqfrW3J83XUZCsrY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574787147; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2Go5UrZ7+1tpx9BSwfMWxjE/Elw4fn4/Xb3PWGCPcIk=; b=VORHcseBL6h3lK7wCboalInDSNZ8T2aj2b+RjkblI2Am9AKJv6m2vuUVejV6/A+dbVg3Vqj1VeTC7G9tbddznouOA4whmIXQq8yFAqbmvSA3K9nD8MO42NrzSeSAxgcisu3WYAqxMIaDi4rMlhyDKGdiqIZ5qTnYxJlHV+99j7o= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574787147503491.88578926772993; Tue, 26 Nov 2019 08:52:27 -0800 (PST) Received: from localhost ([::1]:57126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZe4g-00031U-9U for importer@patchew.org; Tue, 26 Nov 2019 11:52:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39726) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZdz8-0006Z4-W9 for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZdz7-0006gh-KU for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:42 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47040) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZdz7-0006gF-CY for qemu-devel@nongnu.org; Tue, 26 Nov 2019 11:46:41 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAQGIXMS055310 for ; Tue, 26 Nov 2019 11:46:40 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wh2pnf01s-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Nov 2019 11:46:40 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Nov 2019 16:46:38 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 26 Nov 2019 16:46:35 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAQGkY2Z48955554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Nov 2019 16:46:34 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8AFBE4C044; Tue, 26 Nov 2019 16:46:34 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 33E3D4C040; Tue, 26 Nov 2019 16:46:34 +0000 (GMT) Received: from bahia.tlslab.ibm.com (unknown [9.101.4.41]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 26 Nov 2019 16:46:34 +0000 (GMT) Subject: [for-5.0 PATCH v2 4/4] spapr/xive: Configure number of servers in KVM From: Greg Kurz To: David Gibson Date: Tue, 26 Nov 2019 17:46:33 +0100 In-Reply-To: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> References: <157478677206.67101.11965554900825793694.stgit@bahia.tlslab.ibm.com> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19112616-4275-0000-0000-00000386AD8B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112616-4276-0000-0000-0000389A3929 Message-Id: <157478679392.67101.7843580591407950866.stgit@bahia.tlslab.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-26_04:2019-11-26,2019-11-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 mlxlogscore=698 spamscore=0 mlxscore=0 priorityscore=1501 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1034 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911260139 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The XIVE KVM devices now has an attribute to configure the number of interrupt servers. This allows to greatly optimize the usage of the VP space in the XIVE HW, and thus to start a lot more VMs. Only set this attribute if available in order to support older POWER9 KVM. The XIVE KVM device now reports the exhaustion of VPs upon the connection of the first VCPU. Check that in order to have a chance to provide a hint to the user. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/spapr_xive_kvm.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c index 46c7609bd8d0..32b2809210a0 100644 --- a/hw/intc/spapr_xive_kvm.c +++ b/hw/intc/spapr_xive_kvm.c @@ -152,7 +152,8 @@ void kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx, = Error **errp) =20 void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp) { - SpaprXive *xive =3D SPAPR_MACHINE(qdev_get_machine())->xive; + MachineState *ms =3D MACHINE(qdev_get_machine()); + SpaprXive *xive =3D SPAPR_MACHINE(ms)->xive; unsigned long vcpu_id; int ret; =20 @@ -171,8 +172,16 @@ void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **e= rrp) ret =3D kvm_vcpu_enable_cap(tctx->cs, KVM_CAP_PPC_IRQ_XIVE, 0, xive->f= d, vcpu_id, 0); if (ret < 0) { - error_setg(errp, "XIVE: unable to connect CPU%ld to KVM device: %s= ", + Error *local_err =3D NULL; + + error_setg(&local_err, + "XIVE: unable to connect CPU%ld to KVM device: %s", vcpu_id, strerror(errno)); + if (errno =3D=3D ENOSPC) { + error_append_hint(&local_err, "Try -smp maxcpus=3DN with N < %= u\n", + ms->smp.max_cpus); + } + error_propagate(errp, local_err); return; } =20 @@ -758,6 +767,16 @@ int kvmppc_xive_connect(SpaprInterruptController *intc= , uint32_t nr_servers, return -1; } =20 + /* Tell KVM about the # of VCPUs we may have */ + if (kvm_device_check_attr(xive->fd, KVM_DEV_XIVE_GRP_CTRL, + KVM_DEV_XIVE_NR_SERVERS)) { + if (kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_CTRL, + KVM_DEV_XIVE_NR_SERVERS, &nr_servers, true, + &local_err)) { + goto fail; + } + } + /* * 1. Source ESB pages - KVM mapping */