From patchwork Wed Jun 5 15:57:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivaprasad G Bhat X-Patchwork-Id: 13687070 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 7563F3D548 for ; Wed, 5 Jun 2024 15:58:06 +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=1717603088; cv=none; b=qig91J975lPgkbjxKLdd/BM7UM84FjZLJ8BbEwlNnLcq1H7CVTL59kI2A6RBNx88T4Gg1YhF+rCThsmbLPJnFd7krbEYLRZNvxVGnbCk0lUB0qdHuz0GOB5ciVc+JAcroOyNMu0qMgBsbjYejR9N47CIGeyC+QCatDJREwEHN28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717603088; c=relaxed/simple; bh=2nOC8hp7tIJfyawybwFsG/g4JzixWpM3T1oUBP9Lrcs=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TYzaf5tcGFboQgkZmirMhuhoAtoWHpeUUyC2ddKWOHhWsoNn8RAi97txwHdeTkl9K+oDBNtFGkiQep+BwdDrdBBtKrgmVGFNuQkZSZevNCTCM1iv8vRKAp+PRPlMjK+YT8wnRFcLED0P2yxXlBuhX5QGZpGATjjME4CP/vi7J5Y= 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=ZN2d+Sib; 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="ZN2d+Sib" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 455FofE0032097; Wed, 5 Jun 2024 15:58:02 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=ODVxZWtOLfR1PhbdyFJZvkezWLbzU/DTTtLASzrhuSI=; b=ZN2d+SibnVN7ux4P9DjfYLMbm4zhe7eghOhcSja6h6GrlzuXxzCA4eiV+qw675r1lNZf 6VmQXxk0961MBA5Eo2Gy1NmSgY8JX2zE1f3bCp0MUIsIOlg7spYbOq0w8AWNE9EpdSdL S3NIMcyTfiR407LeVa4WOvkHqFxNhxJq0KYDZ6DOkU4B42y21n/jNJU+vIicxELFGfx/ yIl0bJkw8DjWBfeXNiyYrLjdGfPSAENEaS9lT60yXmFYANyC7D4SP3bYDu8j88ZsdR0j zHz/ceX4ZP2jyD/30YRZbLT0y3fKvjF6RBOcHxW2e+P+uRz+6JSB1mCdBfKhnu2od2Em VA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjth984e3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:01 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 455FrJ7D004662; Wed, 5 Jun 2024 15:58:01 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjth984dx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:01 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 455Dbb9E031114; Wed, 5 Jun 2024 15:58:00 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ygeypn25b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:57:59 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 455Fvsrp22413702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2024 15:57:56 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B75520043; Wed, 5 Jun 2024 15:57:54 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C232A20040; Wed, 5 Jun 2024 15:57:52 +0000 (GMT) Received: from [172.17.0.2] (unknown [9.3.101.175]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Jun 2024 15:57:52 +0000 (GMT) Subject: [PATCH v2 1/4] linux-header: PPC: KVM: Update one-reg ids for DEXCR, HASHKEYR and HASHPKEYR From: Shivaprasad G Bhat To: cohuck@redhat.com, pbonzini@redhat.com, npiggin@gmail.com, kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: mst@redhat.com, danielhb413@gmail.com, qemu-ppc@nongnu.org, sbhat@linux.ibm.com, harshpb@linux.ibm.com, vaibhav@linux.ibm.com Date: Wed, 05 Jun 2024 15:57:52 +0000 Message-ID: <171760305282.1127.16831339459353942369.stgit@ad1b393f0e09> In-Reply-To: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> References: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 77DBWMWTuAu3t2dtKcYoDoMw-zzg20-y X-Proofpoint-ORIG-GUID: hnayKemnZ3yGO56Wj0gH6CP_Hruflitn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 priorityscore=1501 bulkscore=0 phishscore=0 mlxscore=0 adultscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 mlxlogscore=711 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050121 This is a placeholder change for these SPRs until the full linux header update. Signed-off-by: Shivaprasad G Bhat --- linux-headers/asm-powerpc/kvm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h index 1691297a76..eaeda00178 100644 --- a/linux-headers/asm-powerpc/kvm.h +++ b/linux-headers/asm-powerpc/kvm.h @@ -645,6 +645,9 @@ struct kvm_ppc_cpu_char { #define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3) #define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4) #define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5) +#define KVM_REG_PPC_DEXCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc6) +#define KVM_REG_PPC_HASHKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc7) +#define KVM_REG_PPC_HASHPKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc8) /* Transactional Memory checkpointed state: * This is all GPRs, all VSX regs and a subset of SPRs From patchwork Wed Jun 5 15:58:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivaprasad G Bhat X-Patchwork-Id: 13687071 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3FFB210A0D for ; Wed, 5 Jun 2024 15:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717603096; cv=none; b=GWfnw3cRw5DP65e2R62WZXjnKvITixePfHdIg0+byvjAPbJGaowR2bTUD6CYQZMSUqlZQeNP+IsBFgBHjwMZFE4bhNrg199TJ8pAulm5zuSNHWI3kwhHgnw70u3EXgLP7VfZ3IYOzhTJ3GwWMAkSSir+SGQ41RvHmGC0rhzGNdI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717603096; c=relaxed/simple; bh=b1Y2UWFmYOgwy2cqLreUgtFcP1iHoprYjbiysb6NTmM=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Go6ZS7O4aym7OtW+ToO9BtGmfXNvjOOQJVaZGmAnxhVYapdmUbi3PAgFHY211vJVRVtv29xA8zNxP7af7PU+NkSVKhwHtxNgsYeRggoJbFBXz/vUZj66LCiZcOye0EYhJ2jWQJECbao52mHnRBDcS5RHQzsRG64t3ko/ABFbINQ= 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=D2Bb9Ris; arc=none smtp.client-ip=148.163.158.5 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="D2Bb9Ris" Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 455EJl18010620; Wed, 5 Jun 2024 15:58:11 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=ALgeKuVqFIO9D6RFsSznRhTRJ/tzwMvDqDRx65pA2Fs=; b=D2Bb9RisBl6W/mOzdr/VvfNN7aFxmIAuKLkXe5mI5vb1OPr4xYifMIUuUSUqeTu2ncEL 7AR7xOnVRmHE8M1+yc9RHBBqUNge//t5AQaKTVvKIPlo7Zh0jfMTQAA0NzKKIyKXmMr9 LemYEDaqk94PQ5CPw+6nGHY797qxSVAjnKV7cCmvwx6e17FnTbo/NsI6aeNsElKO/X4a xSAtwpnOO2M5Wkf182U1drXNUsDvCIKElfeEB81X1F21/tvzf//6ZNoeywZwSKn+lOYn gN7uLCc+zTvJ62I6uPQTnEfgNH6Fs+v5QHGW3iKsMShd4jtzTobDOt+eoMqBT8LdIisu pA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjsnj09t5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:11 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 455FwBxm003015; Wed, 5 Jun 2024 15:58:11 GMT 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 3yjsnj09sy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:10 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 455FQLTZ008463; Wed, 5 Jun 2024 15:58:10 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ygec0w8ds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:10 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 455Fw4lv57016742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2024 15:58:06 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 749822004B; Wed, 5 Jun 2024 15:58:04 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1E2520040; Wed, 5 Jun 2024 15:58:02 +0000 (GMT) Received: from [172.17.0.2] (unknown [9.3.101.175]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Jun 2024 15:58:02 +0000 (GMT) Subject: [PATCH v2 2/4] target/ppc/cpu_init: Synchronize DEXCR with KVM for migration From: Shivaprasad G Bhat To: cohuck@redhat.com, pbonzini@redhat.com, npiggin@gmail.com, kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: mst@redhat.com, danielhb413@gmail.com, qemu-ppc@nongnu.org, sbhat@linux.ibm.com, harshpb@linux.ibm.com, vaibhav@linux.ibm.com Date: Wed, 05 Jun 2024 15:58:02 +0000 Message-ID: <171760307934.1127.11339021522853395539.stgit@ad1b393f0e09> In-Reply-To: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> References: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: wSsFJF725h6xPuEn73XWw5zFmnfoXTh1 X-Proofpoint-GUID: slsPbLF23A8pgMZYWB3wuUSU2kctDYMK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 phishscore=0 spamscore=0 malwarescore=0 impostorscore=0 mlxlogscore=844 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050121 The patch enables DEXCR migration by hooking with the "KVM one reg" ID KVM_REG_PPC_DEXCR. Signed-off-by: Shivaprasad G Bhat --- target/ppc/cpu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index c11a69fd90..b1422c2eab 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -5818,9 +5818,9 @@ static void register_power10_hash_sprs(CPUPPCState *env) static void register_power10_dexcr_sprs(CPUPPCState *env) { - spr_register(env, SPR_DEXCR, "DEXCR", + spr_register_kvm(env, SPR_DEXCR, "DEXCR", SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, + &spr_read_generic, &spr_write_generic, KVM_REG_PPC_DEXCR, 0); spr_register(env, SPR_UDEXCR, "UDEXCR", From patchwork Wed Jun 5 15:58:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivaprasad G Bhat X-Patchwork-Id: 13687072 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 6BA5410A0D for ; Wed, 5 Jun 2024 15:58:28 +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=1717603109; cv=none; b=h4SFlPbqmOXit2YpsUlQNyoNc6dAyXxjm3wk8Wxb7xyf978RVAx62TpJWAyeCntsUgWQJvOiSSsNBJ/yRJj/jiK8vqXhwEIuvDW4tk8ZWwEphUT/S21ymenAsJRMz06ZHp/BFENo/vXT56Tx3eEthyODZEB/FeK5rfIF5/IwPho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717603109; c=relaxed/simple; bh=KcA0+XP5wfh9Ij5C2Uf1n1BFU7gJXrSZK+n6fELB+Ik=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pPmBpOcgojP7YE4Plp3/xVrkti/iFdRi7G5fmRl8mjFYJ9v17mUlWz+TZjgMBkmmBWTFe0yPOXZrc3Mz6KosZVBwLrMO+Tqdia+lS8SATLuWUZUhmGLJKxmyJ+1AngHrGH58bhpjR4zQTA7WxT1TvxKkVLNkG623bYSPaEJ7Bw8= 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=o2F2m/TC; 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="o2F2m/TC" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 455Fof9f032079; Wed, 5 Jun 2024 15:58:22 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=CVwxRreFDvXecgEAPPFNh+yGctWh3epBSsv5oDyXlfk=; b=o2F2m/TCJzdQKYVpLpMPEUGEf7k/IVk+X8dv6KkWdi5D0xwim1QmlVkRaqGmLdIWm8/B cBi6dcKIqUE2Nwc6Q453RnQ/G6jLkxm9qzakWB7tUKAINTyPYRkBfuPtpz3LAly2xfZz EUYDwhcLg/khougeWAmLcPlmlT8BYTPzAnc8oqk964IzXIXWovF2nSQdSMYXlv2lV+hv T9Mne/q2h2Uz6Wzn1rvGm4CA/i5CA9zGSDpXxnfSeK0dnR13mvjsP71MyFFI5oPieg14 Tks1g1WwsjW9ScutCRxgGMt0vM4pf+MQni8fKsx9OJqZzMVpxTjgYhkiD/bHuDeFOrKN +A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjth984ge-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:22 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 455FwLA8013809; Wed, 5 Jun 2024 15:58:21 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjth984ga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:21 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 455FmKnY031109; Wed, 5 Jun 2024 15:58:20 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ygeypn274-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:20 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 455FwEoU22872458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2024 15:58:16 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5504720043; Wed, 5 Jun 2024 15:58:14 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B512320040; Wed, 5 Jun 2024 15:58:12 +0000 (GMT) Received: from [172.17.0.2] (unknown [9.3.101.175]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Jun 2024 15:58:12 +0000 (GMT) Subject: [PATCH v2 3/4] target/ppc/cpu_init: Synchronize HASHKEYR with KVM for migration From: Shivaprasad G Bhat To: cohuck@redhat.com, pbonzini@redhat.com, npiggin@gmail.com, kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: mst@redhat.com, danielhb413@gmail.com, qemu-ppc@nongnu.org, sbhat@linux.ibm.com, harshpb@linux.ibm.com, vaibhav@linux.ibm.com Date: Wed, 05 Jun 2024 15:58:12 +0000 Message-ID: <171760308953.1127.14625001027546560031.stgit@ad1b393f0e09> In-Reply-To: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> References: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: bNZhf_IiClzwRLEdOk2DN319dLb1Vvku X-Proofpoint-ORIG-GUID: SuQrsRYFtLbn50tKa4dcVz7xHeWF-_R_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 priorityscore=1501 bulkscore=0 phishscore=0 mlxscore=0 adultscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 mlxlogscore=864 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050121 The patch enables HASHKEYR migration by hooking with the "KVM one reg" ID KVM_REG_PPC_HASHKEYR. Signed-off-by: Shivaprasad G Bhat --- target/ppc/cpu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index b1422c2eab..cee0a609eb 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -5805,10 +5805,10 @@ static void register_power10_hash_sprs(CPUPPCState *env) ((uint64_t)g_rand_int(rand) << 32) | (uint64_t)g_rand_int(rand); g_rand_free(rand); #endif - spr_register(env, SPR_HASHKEYR, "HASHKEYR", + spr_register_kvm(env, SPR_HASHKEYR, "HASHKEYR", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, - hashkeyr_initial_value); + KVM_REG_PPC_HASHKEYR, hashkeyr_initial_value); spr_register_hv(env, SPR_HASHPKEYR, "HASHPKEYR", SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, From patchwork Wed Jun 5 15:58:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivaprasad G Bhat X-Patchwork-Id: 13687073 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 C7A7614D2AE for ; Wed, 5 Jun 2024 15:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717603117; cv=none; b=rZET+v4ra1Rh195BSNfqOgnRvqgOXBFGhGniD3xmZI6M2pPsjCHiTU4Ewm+ZGkQFS4xki1DnC7+0V0RoqwTBQSWAgZ2gaFwgDIrO5tlN2gO14u7/Bvv2UzewlmALccbLpb4/edRUWEJq7UJDPw9uNZSpvbppiSb5ZohMpl38xPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717603117; c=relaxed/simple; bh=gXBVoq6Xs7gQ0DJdX1zfdzuLYW3eKW3tWium6g8U0pQ=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bVeVy4KqAt58qet2yqG+ko7TZUSJTC0iZdlBZ2Huak0FlBkp1QEtjN3jK7cSwKoU31N3HjYbMRQ3chpqYb9eHI/I2jyT/ttqgV5NCMU6YloUc89BsQAz5B6ejU4pppEbQyto6hhL6oPijhdPK1eL5Rh5RLL2YplNQrHyRH9EIAQ= 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=bfIlWYIY; arc=none smtp.client-ip=148.163.158.5 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="bfIlWYIY" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 455FVQMU005873; Wed, 5 Jun 2024 15:58:31 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=0b0i85d6kI1uu7ZwoBRm+u/PV/OnUj+nyPs8qzet/D0=; b=bfIlWYIYVmfy20e4CyQWVzSfP7L+b/JBESeYwhdVry2CVeqihbQoWlKjc/myN8WP9V3m sFr0+pwLwWmMXLz9HUn2wIsSQE93BfRNAyMva1/9H81BXx5q/FY2PxClH/iadPD9C7oW 0Y+Aj1Fr3A16FKEUudfQ2AI2RLAVuN+cP3nFSFQeND1ZWVCVVgzO2sXgxub3pRcrIM9y hx8vwQJMFRIt9bia/Ol/u1WVqae7XgIPVvhD64CA/chdf+WwE0L8PTxIqeXb9Tu0d9Fs YOYlC7NIloPWPWv66p+pSW/dDU+Kbiiu40+9xdM+a6eF1g/5n6mksKEBFF2NQjS5mNLz 1w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjsta084k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:31 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 455FwU7P017530; Wed, 5 Jun 2024 15:58:30 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjsta084h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:30 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 455F12lS026652; Wed, 5 Jun 2024 15:58:30 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yggp34jvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 15:58:29 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 455FwOqB51380720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2024 15:58:26 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6658E2004F; Wed, 5 Jun 2024 15:58:24 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2C332004D; Wed, 5 Jun 2024 15:58:22 +0000 (GMT) Received: from [172.17.0.2] (unknown [9.3.101.175]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Jun 2024 15:58:22 +0000 (GMT) Subject: [PATCH v2 4/4] target/ppc/cpu_init: Synchronize HASHPKEYR with KVM for migration From: Shivaprasad G Bhat To: cohuck@redhat.com, pbonzini@redhat.com, npiggin@gmail.com, kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: mst@redhat.com, danielhb413@gmail.com, qemu-ppc@nongnu.org, sbhat@linux.ibm.com, harshpb@linux.ibm.com, vaibhav@linux.ibm.com Date: Wed, 05 Jun 2024 15:58:22 +0000 Message-ID: <171760309939.1127.5764216864720185982.stgit@ad1b393f0e09> In-Reply-To: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> References: <171760304518.1127.12881297254648658843.stgit@ad1b393f0e09> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: U1X47I4HOOXKslKVUKzwQID3BTVmx6AX X-Proofpoint-ORIG-GUID: -f5HJWz56xkbr8ogHkHQKcsFLLtbfLWM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 mlxlogscore=863 priorityscore=1501 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050121 The patch enables HASHPKEYR migration by hooking with the "KVM one reg" ID KVM_REG_PPC_HASHPKEYR. Signed-off-by: Shivaprasad G Bhat --- target/ppc/cpu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index cee0a609eb..e6ebc0cef0 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -5809,11 +5809,11 @@ static void register_power10_hash_sprs(CPUPPCState *env) SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, KVM_REG_PPC_HASHKEYR, hashkeyr_initial_value); - spr_register_hv(env, SPR_HASHPKEYR, "HASHPKEYR", + spr_register_kvm_hv(env, SPR_HASHPKEYR, "HASHPKEYR", SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, - hashpkeyr_initial_value); + KVM_REG_PPC_HASHPKEYR, hashpkeyr_initial_value); } static void register_power10_dexcr_sprs(CPUPPCState *env)