Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp66428ybm; Tue, 26 May 2020 10:53:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM1PzWXV9P7xXH5P6XLGMvAY5zng0IdIxxgfNd2S0mjW9JZdLahmsPMr56tzXMkfY2VuaJ X-Received: by 2002:aa7:d90e:: with SMTP id a14mr20635377edr.284.1590515617518; Tue, 26 May 2020 10:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590515617; cv=none; d=google.com; s=arc-20160816; b=eiy5eFbDId/FCtNMDCL69/k7evVJ91T+ZqiCNQuTf51T/7S5Xd4X/ZG+uAIYGmy38h FvdspSHhqatizULjYgeTveh/iO48tC7vkpW51+Hjh770Upjwbz58ghjbshvsp6qow71r F0EqPtwwv6dnHu7aep/9vszIKxVMnbNaP1HX71Bekk9aQYDhrgRrMkLN3g7Lhw+Hgu49 vmqqJaaG7YpkhNSFkbgB7vWFoPvPt5wDKi+GW/f+ifRX0hl3o2gzr+XhfrEe42aITlv/ uBDSzXvcelD2YdbgEWrKxV/FKN84tModuL9wM7I6n1Z49Lysnjh+S6Qc1iAgHXrR1Hmx xGcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=jleVRFzfu5YTstCi4uf3lfZMJQgI1C2b8BsvtJ+g5gE=; b=l0o8T0WlQLnLtKsdYUKb2GKJdw/SyFlsnWhxze3anXOLvgyofhorvBSMuHDTswjnKq pgcmd5OfFkfceUU782ePz0qBEhOnuuSorRHEFNQtY9w38uYNVKc/puTshT4IASz19eTM fw8BEWZJfrXaNmE6NXac2mdUCPvo482MLtieidmhDI9epgJ/m8QmN8u+iKbpPsaglcoA dMozd32E0bSHDD2Xl86Dw5VAiM+dI4Sat/uio53wFYPfjy/PV/MP1dXbscc5MaYb3RdG nvqo0WSFyNSS35lIT0gdLhfOUw3QI1VcPqle6UQFAlJlTXfEOXrnsDbHHPqkcaPSHdep TfsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t15si356897edy.62.2020.05.26.10.53.14; Tue, 26 May 2020 10:53:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388905AbgEZRvd (ORCPT + 99 others); Tue, 26 May 2020 13:51:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59512 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388767AbgEZRvd (ORCPT ); Tue, 26 May 2020 13:51:33 -0400 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 04QHWAvS079622; Tue, 26 May 2020 13:51:21 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 317003e6h1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 May 2020 13:51:20 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 04QHkM6F026874; Tue, 26 May 2020 17:51:18 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04fra.de.ibm.com with ESMTP id 316uf8ajen-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 May 2020 17:51:18 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04QHpGS4852274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 May 2020 17:51:16 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 599DC11C058; Tue, 26 May 2020 17:51:16 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6E1911C05C; Tue, 26 May 2020 17:51:15 +0000 (GMT) Received: from pomme.local (unknown [9.145.18.233]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 26 May 2020 17:51:15 +0000 (GMT) Subject: Re: [PATCH] KVM: PPC: Book3S HV: read ibm,secure-memory nodes From: Laurent Dufour To: kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, paulus@samba.org Cc: Alexey Kardashevskiy , linux-kernel@vger.kernel.org References: <20200416162715.45846-1-ldufour@linux.ibm.com> Message-ID: <09a71476-1e15-e49b-3536-dabed9d881c0@linux.ibm.com> Date: Tue, 26 May 2020 19:51:15 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200416162715.45846-1-ldufour@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-05-26_02:2020-05-26,2020-05-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 cotscore=-2147483648 bulkscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=999 phishscore=0 impostorscore=0 mlxscore=0 spamscore=0 adultscore=0 clxscore=1011 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005260131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paul, could you please take that patch? Le 16/04/2020 à 18:27, Laurent Dufour a écrit : > The newly introduced ibm,secure-memory nodes supersede the > ibm,uv-firmware's property secure-memory-ranges. > > Firmware will no more expose the secure-memory-ranges property so first > read the new one and if not found rollback to the older one. > > Signed-off-by: Laurent Dufour > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/arch/powerpc/kvm/book3s_hv_uvmem.c b/arch/powerpc/kvm/book3s_hv_uvmem.c > index 53b88cae3e73..ad950f8996e0 100644 > --- a/arch/powerpc/kvm/book3s_hv_uvmem.c > +++ b/arch/powerpc/kvm/book3s_hv_uvmem.c > @@ -735,6 +735,20 @@ static u64 kvmppc_get_secmem_size(void) > const __be32 *prop; > u64 size = 0; > > + /* > + * First try the new ibm,secure-memory nodes which supersede the > + * secure-memory-ranges property. > + * If we found somes, no need to read the deprecated one. > + */ > + for_each_compatible_node(np, NULL, "ibm,secure-memory") { > + prop = of_get_property(np, "reg", &len); > + if (!prop) > + continue; > + size += of_read_number(prop + 2, 2); > + } > + if (size) > + return size; > + > np = of_find_compatible_node(NULL, NULL, "ibm,uv-firmware"); > if (!np) > goto out; >