Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3192080pxb; Thu, 10 Feb 2022 14:46:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5lsfPoGoBFoA7bpqXekP7kMjv86xFYU9ZK1Ywgoy/5wV0pyVAojWZHTWF4nhAdZ817EoG X-Received: by 2002:a17:902:700b:: with SMTP id y11mr9569791plk.38.1644533187962; Thu, 10 Feb 2022 14:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644533187; cv=none; d=google.com; s=arc-20160816; b=Svznm+yHHmvBWnmcTUeZqINAEFWMZkJZLcZoZGt0q8DWVxPLdGVcGgcP2bIRjFQBgK DqGc/DyMgl3FQgsvZcq+wPctgUFjMltwfFcofK3Av3xzjVHHpu81XqvX4yf1S+nTPHtp WKytoAPa1MQrwNcdgKV3WnJSiouaD5+l84177B2Dv+q/8y1MJVGyD2EA6pX6WNaYRf9B bALwP+zVe5cFCF6desQ3xdrgJ9l/sgd3CDdLJHZsTYmBXt40ZtVEryblcoJM/z4vfL/m ZjySG+0OYsSNPeLQRnKv8MIuCb2eJt8iAEDeQAUbdJkr33t6Yvrdf8JhrENrWWOdSDR5 UQ9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=yzRfUfzRytFxiNpPiXekggdLgYp2UYmh0woVfJnVvMU=; b=HogQSsrx5LLxCuR1lhJYyUsd7LdEp8WVGlfSEqeN21mBdbfx0bjiFoAKsZExXCwMNg ksBlT6QFTnO9ZXgK7+Qr/H7V9jBkE7Pq0QnjeHzBcIE270Vsv9aEHzWIuB2kHXjqIhVe YELvbkPITAz71kLS5pg0fWCbEklQwm0sc5w+sijmS/42Jeo+649FvcBykZQkZ4+ytGJs 6HJtRTiWFmN2mfkgeVs4X3mtiIqxM+O1CiaBOL/e5WwUmqua0IivqfgCxGA/vrVYlaVf rnjwxNa+/vNf4WtiykRbwBVfCAYO7NRBPCtRvcvWPaLoCgcdw5TavuG1rn55nH4Ihyu0 1bqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my11si2337812pjb.138.2022.02.10.14.46.16; Thu, 10 Feb 2022 14:46:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344595AbiBJV2n (ORCPT + 99 others); Thu, 10 Feb 2022 16:28:43 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243233AbiBJV2n (ORCPT ); Thu, 10 Feb 2022 16:28:43 -0500 X-Greylist: delayed 1671 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 10 Feb 2022 13:28:41 PST Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 399B7AF; Thu, 10 Feb 2022 13:28:41 -0800 (PST) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nIGYM-000368-37; Thu, 10 Feb 2022 22:00:34 +0100 Message-ID: <4524b1c9-3a32-8a2d-b7b8-5c4e65df017b@maciej.szmigiero.name> Date: Thu, 10 Feb 2022 22:00:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Content-Language: en-US To: Sean Christopherson , Paolo Bonzini Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Michal Hocko , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Willy Tarreau References: <1acaee7fa7ef7ab91e51f4417572b099caf2f400.1643405658.git.maciej.szmigiero@oracle.com> From: "Maciej S. Szmigiero" Subject: Re: [PATCH] KVM: x86: Fix rmap allocation for very large memslots In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28.01.2022 22:47, Sean Christopherson wrote: > On Fri, Jan 28, 2022, Maciej S. Szmigiero wrote: >> From: "Maciej S. Szmigiero" >> >> Commit 7661809d493b ("mm: don't allow oversized kvmalloc() calls") has >> forbidden using kvmalloc() to make allocations larger than INT_MAX (2 GiB). >> >> Unfortunately, adding a memslot exceeding 1 TiB in size will result in rmap >> code trying to make an allocation exceeding this limit. >> Besides failing this allocation, such operation will also trigger a >> WARN_ON_ONCE() added by the aforementioned commit. >> >> Since we probably still want to use kernel slab for small rmap allocations >> let's only redirect such oversized allocations to vmalloc. >> >> A possible alternative would be to add some kind of a __GFP_LARGE flag to >> skip the INT_MAX check behind kvmalloc(), however this will impact the >> common kernel memory allocation code, not just KVM. > > Paolo has a cleaner fix for this[1][2], but it appears to have stalled out somewhere. > > Paolo??? > > [1] https://lore.kernel.org/all/20211015165519.135670-1-pbonzini@redhat.com > [2] https://lore.kernel.org/all/20211016064302.165220-1-pbonzini@redhat.com So, what we do here? Apparently the cleaner fix at [2] wasn't picked up despite Kees giving it his "Reviewed-by". Thanks, Maciej