From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C0DB42A87; Wed, 4 Jun 2025 13:53:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749045216; cv=none; b=tkExubze3aT58s8LnMaDpKmSl7/Xep4o8eRiN8cQdTn7HeFWjzLOnBtHS/pFUFaVBuPd3ooRa2fG8YXXU/xv/qF7JoBzrfx7NKUaIwOURBSShEORztJxP+x7kGtUFT6ghDFduZiooXjfZ9ZmGyn1U+hHpnL2u2oNh0t3bAWg+fU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749045216; c=relaxed/simple; bh=gEaec+r6HaRvOWsI9UxPmbcF79etZ2qgODjTDrDOwyI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cT89hcU1kNR5rIZHMHrcde+L6qFBgTh7kwSLNYQAoh7V6E3MSzz64zcFS2z/mmTdBKSNDsbzelT2g4O72Gmk5ke6qLXrM3qmpGToZzbW5Kob5Bd3FPZ1i40zbggsAWGbC1s8i5GDk/yKpEIR+yPb0GbmQpHMR2oSXnV60ngU/JI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Uje3IDdS; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Uje3IDdS" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 554Cr7Ys027917; Wed, 4 Jun 2025 13:53:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=mTxob+ 3AN6+5NNCmHiHdX7KGjxH7xfoNmONml4Cdnx0=; b=Uje3IDdSEkqrUrvRBdZcCt nBT7CYFlz6nwIvCvEmjtNZkTuc/cRw3vxpTqErq1jV4om+g4MhCtNfxHrWswwyF5 12bRc+xV1VVnXHNvZs9Ed5BShuDXaJjFZ9I2qG5TDrLpuRvqZKaJ44HkQbvTr1DV mCTWgJ3MpcXFYnNdjbhpNU4YjZfYp8IMkFjBtzZRPQJEkEj6xLPNrgpG7pB3rATz aPx3QX+vZJi/vvxi0/5ia5t7rAL/GibOdihYA1Ikj3MMNaD7JoeOAyMAWTJ/Uifb qFcNpPr9goZ1W/YqlqvjCkkhG2PLky7rTFJtn5zx8jQzbZAfpQG4phGB2t06Kd/w == Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 471geyb1gt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Jun 2025 13:53:29 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 554Bx5aw031700; Wed, 4 Jun 2025 13:53:28 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 470cg003u3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Jun 2025 13:53:28 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 554DrOR151511664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jun 2025 13:53:24 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68AE620043; Wed, 4 Jun 2025 13:53:24 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D96A420040; Wed, 4 Jun 2025 13:53:23 +0000 (GMT) Received: from [9.111.35.118] (unknown [9.111.35.118]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 4 Jun 2025 13:53:23 +0000 (GMT) Message-ID: <618a014d-5deb-4d66-b2d9-cea930f8f050@linux.ibm.com> Date: Wed, 4 Jun 2025 15:53:23 +0200 Precedence: bulk X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] KVM: s390: Use ESCA instead of BSCA at VM init To: Christoph Schlameuss , kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, Christian Borntraeger , Claudio Imbrenda , David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Thomas Huth References: <20250603-rm-bsca-v5-1-f691288ada5c@linux.ibm.com> Content-Language: en-US From: Janosch Frank Autocrypt: addr=frankja@linux.ibm.com; keydata= xsFNBFubpD4BEADX0uhkRhkj2AVn7kI4IuPY3A8xKat0ihuPDXbynUC77mNox7yvK3X5QBO6 qLqYr+qrG3buymJJRD9xkp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sMAAoJEONU5rjiOLn4DDEP/RuyckW65SZcPG4cMfNgWxZF8rVjeVl/9PBfy01K 8R0hajU40bWtXSMiby7j0/dMjz99jN6L+AJHJvrLz4qYRzn2Ys843W+RfXj62Zde4YNBE5SL jJweRCbMWKaJLj6499fctxTyeb9+AMLQS4yRSwHuAZLmAb5AyCW1gBcTWZb8ON5BmWnRqeGm IgC1EvCnHy++aBnHTn0m+zV89BhTLTUal35tcjUFwluBY39R2ux/HNlBO1GY3Z+WYXhBvq7q katThLjaQSmnOrMhzqYmdShP1leFTVbzXUUIYv/GbynO/YrL2gaQpaP1bEUEi8lUAfXJbEWG dnHFkciryi092E8/9j89DJg4mmZqOau7TtUxjRMlBcIliXkzSLUk+QvD4LK1kWievJse4mte FBdkWHfP4BH/+8DxapRcG1UAheSnSRQ5LiO50annOB7oXF+vgKIaie2TBfZxQNGAs3RQ+bga DchCqFm5adiSP5+OT4NjkKUeGpBe/aRyQSle/RropTgCi85pje/juYEn2P9UAgkfBJrOHvQ9 Z+2Sva8FRd61NJLkCJ4LFumRn9wQlX2icFbi8UDV3do0hXJRRYTWCxrHscMhkrFWLhYiPF4i phX7UNdOWBQ90qpHyAxHmDazdo27gEjfvsgYMdveKknEOTEb5phwxWgg7BcIDoJf9UMC In-Reply-To: <20250603-rm-bsca-v5-1-f691288ada5c@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=ea09f6EH c=1 sm=1 tr=0 ts=68404fda cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=aytlwjwg4dCizeVP_UwA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: MVw8LoSiXmCwLMQF8LVry3anz_Ll0GlP X-Proofpoint-ORIG-GUID: MVw8LoSiXmCwLMQF8LVry3anz_Ll0GlP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjA0MDEwMyBTYWx0ZWRfX+6oTeaE2wR4S sXnShZdCtl42YiJbkVvsaTY09fbg+rV0VxsxuK4Ixnuu++KqYTFPdwQ4Up4JO6AgO34+ekzmQUq lCx4bvj9i7ScvquIk815zDpp5saJhDBmY6Z/7K+MH+8Bw5TU5rJUyvRrGVqmAt+5qCYq3Mczk+O H2M34dMdjDwxFaEZugkdu2e4B7iPaaE7LhBmOl60GrhppMPPWWxV25q+sMeBW0COey6fD5t6Liu K6kU9oHrKGoInnB4tRUViH4lhG0BVPC/502djw3tZoTzbygs///w6FJG1gZcShC/yJNn9mxZ/IH lDUMMSaF/ugjASPmYxshO+LLT9nP7wKK+xH+ERQT1V7WBDZ08lyF91+2tayIO1uR5EL0v4ETFPE k0jvwByJvzvFOzx+v5+oVSjiAUgiNda4g0ROYgycrJWXs6//P5Un2WOrSXFBWe9XqJs5wHok X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-04_03,2025-06-03_02,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=717 bulkscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 phishscore=0 mlxscore=0 adultscore=0 clxscore=1015 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506040103 On 6/3/25 6:35 PM, Christoph Schlameuss wrote: > All modern IBM Z and Linux One machines do offer support for the > Extended System Control Area (ESCA). The ESCA is available since the > z114/z196 released in 2010. > KVM needs to allocate and manage the SCA for guest VMs. Prior to this > change the SCA was setup as Basic SCA only supporting a maximum of 64 > vCPUs when initializing the VM. With addition of the 65th vCPU the SCA > was needed to be converted to a ESCA. > > Instead of allocating a BSCA and upgrading it for PV or when adding the > 65th cpu we can always allocate the ESCA directly upon VM creation > simplifying the code in multiple places as well as completely removing > the need to convert an existing SCA. > > In cases where the ESCA is not supported (z10 and earlier) the use of > the SCA entries and with that SIGP interpretation are disabled for VMs. > This increases the number of exits from the VM in multiprocessor > scenarios and thus decreases performance. > The same is true for VSIE where SIGP is currently disabled and thus no > SCA entries are used. > > The only downside of the change is that we will always allocate 4 pages > for a 248 cpu ESCA instead of a single page for the BSCA per VM. > In return we can delete a bunch of checks and special handling depending > on the SCA type as well as the whole BSCA to ESCA conversion. > > With that behavior change we are no longer referencing a bsca_block in > kvm->arch.sca. This will always be esca_block instead. > By specifying the type of the sca as esca_block we can simplify access > to the sca and get rid of some helpers while making the code clearer. > > KVM_MAX_VCPUS is also moved to kvm_host_types to allow using this in > future type definitions. > Thanks for taking care of this, it makes the code a lot nicer to read. Reviewed-by: Janosch Frank