Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp890840lqj; Mon, 3 Jun 2024 04:17:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVV80DFWBnIqQPapbsJONkWg+obuh0kGm6ZFSNgFOKiZiSX4PVIfCgH3HfI/f3w+svDjZzVrRBLGLinNhqHLijbl2pEN8u4WbTnD/efzw== X-Google-Smtp-Source: AGHT+IGxlsODaJlmgz2wHKXBOs+V/lnzJBxYuI4JZq3QZ5TWYGdxoeQDD+Oc8OyfhNjdlrvrv5/a X-Received: by 2002:a05:6a20:a110:b0:1af:8a3a:35d7 with SMTP id adf61e73a8af0-1b26f253328mr9140743637.39.1717413459986; Mon, 03 Jun 2024 04:17:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717413459; cv=pass; d=google.com; s=arc-20160816; b=DNh8H+qh+IA/6pu6XjyeUHjDKFNur0p/VEyknuev1tOw2ybww/hpisbrmbb2ApVKMF 9NpMo4JG+CGq4s/dYIMu+2OxzNGZIVmZzxa9aUnxokE0aBF8exDVXIZCck+rWzn48EMo spvCrDV9bL20wOO9G7tLJ5qWSKCTPAZTDazybUD/uulBR8x8WX19CeczUKBXft0npjTg SUVyTuZIDZn4WHNW9N/zFteY2QjWzQc4g9vVfht0ExDAUyQGObV+NGRT0a5SNeMJrc04 fLESyJ5QWce/ieZg0A6kWzJfARMMEu8F0m8mKBDKqrs16R5h6snakQvGBS42ys4cUtKS J0Zg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:cc:to:from:subject:dkim-signature; bh=kH3oDfZ/6Zvu5WhyeQFDN2KW0bunRuNnzBQQcsheSIU=; fh=3wLRez1daRxQ046IropRUujjxbZxHcqKX5Vmx4WeL2Q=; b=TjEsaMSZd28lr9B5S0/eR5dKbwGH4FC7/CdwKpzqq/g9zibvDm9Gz77MuK4vbWipLn kKHMnF4ee0n/bszioCHWbD36AhinoYPpF0ZjyYS5vP5fDJ26SrgttFrhhY5+a2xpuGTQ NCQGyW5HjV3o5Luhh15XeqeOhs0+AwtMytqDDlVj0T7GiH24WEZEYIwnQxUEOSd3gxkk j02w7QT42eNArcmV1lUGk6tqIQjgWfy9/p3XeG9tDD/0TpG9AFOwpGtYIlcX/gzB6JLh KGMgZpwScpu/pS274964GE/TQ7l/n0IUy6VMnhyk/LJMvceizMXGZcWdLdlC7UTITrYz ATHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iPBm5GPq; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-199027-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199027-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242c279dbsi6337957b3a.263.2024.06.03.04.17.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 04:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199027-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iPBm5GPq; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-199027-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199027-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 79F2A282E6B for ; Mon, 3 Jun 2024 11:16:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95FDC85622; Mon, 3 Jun 2024 11:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="iPBm5GPq" 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 158D22031D; Mon, 3 Jun 2024 11:15:16 +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=1717413318; cv=none; b=jfd0KVClQC/sVkZizohKkory5u7qMtNjjPOs5hNijzPb8Mj9Xyil2JiYbUscwsUk0mH4BzzHqJOMZmfZeWCUFDWgY47KQrtpZYknBJwzUJysoTeYX5mURvE9MOJj5Kb/sQ/7SqbxCTnwjcAMZZyBzM0tSHMtXgaA5rj9Iwq4uf0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717413318; c=relaxed/simple; bh=ztv7X3gAR50YuMAnxjtYih/RqVKp8jDpHquHt9Ernak=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=F6D7TbYkP2WLzgaugqfHn7Fy8ojpB8AluCZxVBMTJ8/SsNEPSN1zP3OfLnuJyYb5gpmviI9IxXuquPgdU6oha8yMdm7rVKp0H7jFJ1mRvHc+91ZbhN1gclH90iUwN8EX63NPvoCw6NFfMeqd5PC6JU9Ncfee8/gx+sEHwi7+1nQ= 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=iPBm5GPq; 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 Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 453AlpgY017618; Mon, 3 Jun 2024 11:15:06 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=kH3oDfZ/6Zvu5WhyeQFDN2KW0bunRuNnzBQQcsheSIU=; b=iPBm5GPqOepCyLFtJl/cC4Yk5EtTV+Rmc0M5GNwbUKX9GfCOuWBJmXGbXRmW9i0PFr7m 1AbTjIxT1iK/6AO2c0ybfOTZQ0IbCr6vXbe/RU7gqlhGwaGlBhkajyPd2i0EGosrPelm Tu5U/jP0hueBmuBYeXvdaJA0dGGvq/own9ThtEJX2wzMI1RxVnkhvGSnNTbtDAdx9Kzu 4SvSrJCPi1IMsFoHGuFaBnBX4jZ2Hsvr3oIGixmJM0+1X7W9ZXd7mG3C6PchHrTHTgFa bj0QCK1sZSpcnCaOLwMxPTqkSL4gTYLEG2ut/Um+xc+vCpAE+cauzc66+RT4m7HKfnxh 5g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yhcctr26t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 11:15:05 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 453BF5qg002459; Mon, 3 Jun 2024 11:15:05 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yhcctr26n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 11:15:05 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4538RaEX000795; Mon, 3 Jun 2024 11:15:04 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ygdytqqs2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 11:15:04 +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 453BEx9j34603630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2024 11:15:01 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E62492004D; Mon, 3 Jun 2024 11:14:58 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DF1820043; Mon, 3 Jun 2024 11:14:57 +0000 (GMT) Received: from [172.17.0.2] (unknown [9.3.101.175]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 3 Jun 2024 11:14:56 +0000 (GMT) Subject: [PATCH 5/6] KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHKEYR in sync From: Shivaprasad G Bhat To: kvm@vger.kernel.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: pbonzini@redhat.com, naveen.n.rao@linux.ibm.com, christophe.leroy@csgroup.eu, corbet@lwn.net, mpe@ellerman.id.au, namhyung@kernel.org, npiggin@gmail.com, pbonzini@redhat.com, sbhat@linux.ibm.com, jniethe5@gmail.com, atrajeev@linux.vnet.ibm.com, linux-kernel@vger.kernel.org Date: Mon, 03 Jun 2024 11:14:56 +0000 Message-ID: <171741329242.6631.7779344904083076707.stgit@linux.ibm.com> In-Reply-To: <171741323521.6631.11242552089199677395.stgit@linux.ibm.com> References: <171741323521.6631.11242552089199677395.stgit@linux.ibm.com> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: H_ZzZBDSju26zUOZ3p2esprufX10lzcY X-Proofpoint-GUID: Nq2OE4tmRmRaJxRMsslWzyhQ59SmElri X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-06-03_07,2024-05-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 mlxlogscore=833 clxscore=1015 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406030094 The nestedv2 APIs has the guest state element defined for HASHKEYR for the save-restore with L0. However, its ignored in the code. The patch takes care of this for the HASHKEYR GSID. Signed-off-by: Shivaprasad G Bhat --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kvm/book3s_hv.h | 1 + arch/powerpc/kvm/book3s_hv_nestedv2.c | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 1e2fdcbecffd..a0cd9dbf534f 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h @@ -600,6 +600,7 @@ struct kvm_vcpu_arch { ulong dawr1; ulong dawrx1; ulong dexcr; + ulong hashkeyr; ulong ciabr; ulong cfar; ulong ppr; diff --git a/arch/powerpc/kvm/book3s_hv.h b/arch/powerpc/kvm/book3s_hv.h index 7b0fd282fe95..c073fdfa7dc4 100644 --- a/arch/powerpc/kvm/book3s_hv.h +++ b/arch/powerpc/kvm/book3s_hv.h @@ -117,6 +117,7 @@ KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr1, 64, KVMPPC_GSID_DAWR1) KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx0, 64, KVMPPC_GSID_DAWRX0) KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx1, 64, KVMPPC_GSID_DAWRX1) KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dexcr, 64, KVMPPC_GSID_DEXCR) +KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hashkeyr, 64, KVMPPC_GSID_HASHKEYR) KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ciabr, 64, KVMPPC_GSID_CIABR) KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(wort, 64, KVMPPC_GSID_WORT) KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ppr, 64, KVMPPC_GSID_PPR) diff --git a/arch/powerpc/kvm/book3s_hv_nestedv2.c b/arch/powerpc/kvm/book3s_hv_nestedv2.c index d207a6d936ff..bbff933f2ccc 100644 --- a/arch/powerpc/kvm/book3s_hv_nestedv2.c +++ b/arch/powerpc/kvm/book3s_hv_nestedv2.c @@ -196,6 +196,9 @@ static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb, case KVMPPC_GSID_DEXCR: rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dexcr); break; + case KVMPPC_GSID_HASHKEYR: + rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashkeyr); + break; case KVMPPC_GSID_CIABR: rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ciabr); break; @@ -447,6 +450,9 @@ static int gs_msg_ops_vcpu_refresh_info(struct kvmppc_gs_msg *gsm, case KVMPPC_GSID_DEXCR: vcpu->arch.dexcr = kvmppc_gse_get_u64(gse); break; + case KVMPPC_GSID_HASHKEYR: + vcpu->arch.hashkeyr = kvmppc_gse_get_u64(gse); + break; case KVMPPC_GSID_CIABR: vcpu->arch.ciabr = kvmppc_gse_get_u64(gse); break;