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=-17.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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=unavailable 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 D9BAAC2B9F4 for ; Mon, 14 Jun 2021 13:44:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDD466102A for ; Mon, 14 Jun 2021 13:44:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234123AbhFNNq5 (ORCPT ); Mon, 14 Jun 2021 09:46:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25621 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233390AbhFNNqy (ORCPT ); Mon, 14 Jun 2021 09:46:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623678291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lrIwXDeHLLQ2dpMrbw5IZ7PKfiFZNvx91zdI2k8RLy8=; b=dBTQ9/gdvaDjxFh0vuWpOqrXIcWhgM9wuk4OmfH56earF1k3Y+d7qritaFOAcap95xBtwP Wg+p4sTrmixzNfuI+e0TjA98rzIcI6wZr5MWLrU549hpO9tv95CY4Bj2KBifPAl9qxgMj+ ejPG39nSEkq69u/2OthWMGu7L299+10= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-260-ZWpRFG7VPdSVa9wYHDOWKQ-1; Mon, 14 Jun 2021 09:44:50 -0400 X-MC-Unique: ZWpRFG7VPdSVa9wYHDOWKQ-1 Received: by mail-wr1-f71.google.com with SMTP id z13-20020adfec8d0000b0290114cc6b21c4so7040807wrn.22 for ; Mon, 14 Jun 2021 06:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=lrIwXDeHLLQ2dpMrbw5IZ7PKfiFZNvx91zdI2k8RLy8=; b=rZoEYmNVnD5b92oxz/QCHWOb6VDAKGvWWXxifnQmiBv2kejLlABDkTY9wbi26XxvMp wB1HvvTRiC9yj/UZWs58SxxnB56uhmT8bomQArYG3ubtAlozOtF6ymBHIJfnH/ggfH26 pWYyMYrUkqZivdFcPfPEPIquguY2fuvGXTLx9I1y/2imkW5l/eFcaFRNwiz3AASPXW+6 gP5FuWE8tH6pcK2AOy3kYfla47Pdruq3EXUTSkrfIGZUers5G89QwiTMclggp2MuKj6z G/LdlRwBjUhf7UdLEp0+pwkwhi82vzyAX2uacOgZpjxZKgKSGcHYaEtcn9iPcIM+e/Ue A0gQ== X-Gm-Message-State: AOAM531MF2FHO00260CxSMD+8TJcz+pV5bXqtsczjF+Rz7D5adKgwQvF EoS8podW/fUZrSpOAhm10Cyf6BsqEpYH/QPeUnfsju/fuY92Yq4gbw6WM9p8TpnitNrizlN2f4N OmWAwO+TQZ0ue+83UWMpudlOC X-Received: by 2002:a1c:f206:: with SMTP id s6mr16351324wmc.102.1623678285248; Mon, 14 Jun 2021 06:44:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFXrW+YbfMtfgwKXb7OxONoQUWezJP1D2Ith4tIayhYHEhRZ9UZdTJKdX2jlwWnzIBZZCPAA== X-Received: by 2002:a1c:f206:: with SMTP id s6mr16351304wmc.102.1623678285091; Mon, 14 Jun 2021 06:44:45 -0700 (PDT) Received: from [192.168.3.132] (p5b0c66ca.dip0.t-ipconnect.de. [91.12.102.202]) by smtp.gmail.com with ESMTPSA id o7sm17627580wro.76.2021.06.14.06.44.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Jun 2021 06:44:44 -0700 (PDT) Subject: Re: [PATCH v4 2/2] KVM: s390: prepare 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, borntraeger@de.ibm.com, cohuck@redhat.com, linux-mm@kvack.org, Nicholas Piggin , Andrew Morton , Uladzislau Rezki , Catalin Marinas , Thomas Gleixner , Ingo Molnar , David Rientjes , Christoph Hellwig References: <20210614132357.10202-1-imbrenda@linux.ibm.com> <20210614132357.10202-3-imbrenda@linux.ibm.com> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Mon, 14 Jun 2021 15:44:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210614132357.10202-3-imbrenda@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.06.21 15:23, 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 an almost equivalent call to > the newly introduced vmalloc_no_huge function, which guarantees that > only small pages will be used for the backing. > > The new call will not clear the allocated memory, but that has never > been an actual requirement. > > Signed-off-by: Claudio Imbrenda > Reviewed-by: Janosch Frank > Acked-by: Christian Borntraeger > Acked-by: Nicholas Piggin > Cc: Andrew Morton > Cc: Nicholas Piggin > Cc: Uladzislau Rezki (Sony) > Cc: Catalin Marinas > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: David Rientjes > Cc: Christoph Hellwig > --- > arch/s390/kvm/pv.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c > index 813b6e93dc83..c8841f476e91 100644 > --- a/arch/s390/kvm/pv.c > +++ b/arch/s390/kvm/pv.c > @@ -140,7 +140,12 @@ 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); > + /* > + * The Create Secure Configuration Ultravisor Call does not support > + * using large pages for the virtual memory area. > + * This is a hardware limitation. > + */ > + kvm->arch.pv.stor_var = vmalloc_no_huge(vlen); > if (!kvm->arch.pv.stor_var) > goto out_err; > return 0; > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb