From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7D78C47082 for ; Tue, 8 Jun 2021 18:53:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E04E61351 for ; Tue, 8 Jun 2021 18:53:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E04E61351 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C564E6B006C; Tue, 8 Jun 2021 14:53:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C05EC6B006E; Tue, 8 Jun 2021 14:53:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A58626B0070; Tue, 8 Jun 2021 14:53:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 736B26B006C for ; Tue, 8 Jun 2021 14:53:05 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 06F20A8D4 for ; Tue, 8 Jun 2021 18:53:05 +0000 (UTC) X-FDA: 78231453930.20.E6496BC Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf17.hostedemail.com (Postfix) with ESMTP id E35B94202A19 for ; Tue, 8 Jun 2021 18:53:01 +0000 (UTC) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 158IYZ7O170745; Tue, 8 Jun 2021 14:53:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=ja/oWp63gVjtoAxtl10waklaf29/OvvCU3PvYc+GAGg=; b=QjJtO2taJDAEDxKshngV7vNhFnIGyRU8WawoekYYfh2ve1CC9qOav+NRI5CYrJtmRNBe 07JctMIGMFlU95NzSr9GbYW6C600DCG4pxdUOG1CCtNU3FnRNtd8Tmc7d45fEAKR7o6+ jfBJ9jm2gFE5lA7kBg73ptlbDx9lSgdgOe8FZ/N6MQaiauHfMP/Pa6dt0H2GNATe9WPh mTAunY6Du17A6k9EQJmAm7parIQvpSAR3MTk9Ga+/FeiDDwxiAHVaTLen8zBmHdGRAEm UI/7ISFD966X1kz4Hngi8kPQqCUpsxA8XEWLExvbK8ahPm/IqjOJ7FwVbH5gYzcmnr8N 0w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 392ctk2g03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Jun 2021 14:53:00 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 158IYlsN171447; Tue, 8 Jun 2021 14:53:00 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 392ctk2fyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Jun 2021 14:52:59 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 158IqrC3002480; Tue, 8 Jun 2021 18:52:57 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma02fra.de.ibm.com with ESMTP id 392e798003-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Jun 2021 18:52:57 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 158Iq7Rm30933264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Jun 2021 18:52:08 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2BBF1A4040; Tue, 8 Jun 2021 18:52:54 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 80D21A4051; Tue, 8 Jun 2021 18:52:53 +0000 (GMT) Received: from oc7455500831.ibm.com (unknown [9.171.36.114]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 8 Jun 2021 18:52:53 +0000 (GMT) Subject: Re: [PATCH v2 2/2] KVM: s390: fix for hugepage vmalloc To: Claudio Imbrenda , linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, frankja@linux.ibm.com, cohuck@redhat.com, david@redhat.com, linux-mm@kvack.org, Andrew Morton , Nicholas Piggin , Uladzislau Rezki , Catalin Marinas , Thomas Gleixner , Ingo Molnar , David Rientjes References: <20210608180618.477766-1-imbrenda@linux.ibm.com> <20210608180618.477766-3-imbrenda@linux.ibm.com> From: Christian Borntraeger Message-ID: <58ff375c-bad4-e808-fa2f-fd21222ffc74@de.ibm.com> Date: Tue, 8 Jun 2021 20:52:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210608180618.477766-3-imbrenda@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: M21To_wYAthKWxSUEu_dmq6eoR_qiQXV X-Proofpoint-GUID: QjMqZ56-sMhIVPeYrRmVxcRt6QpD54dq X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-06-08_14:2021-06-04,2021-06-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 bulkscore=0 clxscore=1011 impostorscore=0 mlxlogscore=953 lowpriorityscore=0 phishscore=0 priorityscore=1501 mlxscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106080119 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=QjJtO2ta; spf=pass (imf17.hostedemail.com: domain of borntraeger@de.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=borntraeger@de.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Stat-Signature: wydm8toy9rx19j4t7n9tbjq1y6qyjnwc X-Rspamd-Queue-Id: E35B94202A19 X-Rspamd-Server: rspam06 X-HE-Tag: 1623178381-845959 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 08.06.21 20:06, Claudio Imbrenda wrote: > The Create Secure Configuration Ultravisor Call does not support using > large pages for the virtual memory area. This is a hardware limitation. > > This patch replaces the vzalloc call with a longer but equivalent > __vmalloc_node_range call, also setting the VM_NO_HUGE_VMAP flag, to > guarantee that this allocation will not be performed with large pages. > > Signed-off-by: Claudio Imbrenda > Reviewed-by: Janosch Frank > Fixes: 121e6f3258fe393e22c3 ("mm/vmalloc: hugepage vmalloc mappings") > Cc: Andrew Morton > Cc: Nicholas Piggin > Cc: Uladzislau Rezki (Sony) > Cc: Catalin Marinas > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: David Rientjes Would be good to have this in 5.13, as for everything else we want to have hugepages in vmalloc space on s390. In case Andrew picks this up Acked-by: Christian Borntraeger for the KVM/390 part. > --- > arch/s390/kvm/pv.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c > index 813b6e93dc83..6087fe7ae77c 100644 > --- a/arch/s390/kvm/pv.c > +++ b/arch/s390/kvm/pv.c > @@ -140,7 +140,10 @@ static int kvm_s390_pv_alloc_vm(struct kvm *kvm) > /* Allocate variable storage */ > vlen = ALIGN(virt * ((npages * PAGE_SIZE) / HPAGE_SIZE), PAGE_SIZE); > vlen += uv_info.guest_virt_base_stor_len; > - kvm->arch.pv.stor_var = vzalloc(vlen); > + kvm->arch.pv.stor_var = __vmalloc_node_range(vlen, PAGE_SIZE, VMALLOC_START, VMALLOC_END, > + GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL, > + VM_NO_HUGE_VMAP, NUMA_NO_NODE, > + __builtin_return_address(0)); > if (!kvm->arch.pv.stor_var) > goto out_err; > return 0; >