Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3552243pxv; Mon, 26 Jul 2021 06:43:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkHCXLL2JYkMy3+aAsQ03wYWHWhSi7bAgc1y5/Sx9cCvTgllGh1ChfhbW201F06D7ka4et X-Received: by 2002:a92:c7d0:: with SMTP id g16mr12773579ilk.278.1627307029663; Mon, 26 Jul 2021 06:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627307029; cv=none; d=google.com; s=arc-20160816; b=0P8ZmcyDhGFVgdSPAX1Yj3+aPWmWsjWfwv45RoXjMcCCil2Kb13Yv98tep12OSdoHF qL5T5EHKHpD4E+pGih0/cY5tzb9VhCtA3jKTlC9kjIaz6XUHnwKaW6+45Nymq1zhbp5t u2gobe8c/+9LTsALKvP3tzM7HLVE5KcU8AJHECDePgProLGhZ/Xm/UGvxBV+M+OSUiHJ zmN4KMqFIA/vBHlkgoyBKoVfpD8T/pLpPzA+TJhnCj+6Wu2G6hg2rDt5Je3UohLsQgTW vS+VEr9fMNZr9DdIyEl41HArZyQ69GfXj2+eOss4orHunnVXzzZuSA8s9fXlnYGPJgE9 VMdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=iwb+gJ5kZupdhuNB/HcDQBwyIfUYDI68vwzalsg6VHw=; b=mtJtZuwTPIhlW7/JXBcNm9N0xfPNbKB4E+k/JT1qNulbKzoeAKx9FH4B4daaNgF2Lk zithaONQuGx2EOUAiznecAZQTNzt/ZqmQtQ3d4xrn3zIxocy3t6U5/hAlxgmkR9bJd/Q E08Mq5yYb+TPSEDS7q8GAflNI58IJdo13Yr3iOFv5/AhGCcMD3ZY6wE2CNHTrEtl8FXt jA4FXdC/aUn2fa1Zb6O7dOQrsBnHT9gGPxFVfe4oJx3+6fGfdUr4v0WAfVLoj9oJa/Fx mRskWHCO+6i2etFfYwNENu9u88/3EJCeUfDV5C5jjPJS2QZrPV6bMG716UsQ5u1y6FhZ gp3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U4X4iDQO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay7si7819566jab.36.2021.07.26.06.43.37; Mon, 26 Jul 2021 06:43:49 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U4X4iDQO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233937AbhGZNCG (ORCPT + 99 others); Mon, 26 Jul 2021 09:02:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41702 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234170AbhGZNAp (ORCPT ); Mon, 26 Jul 2021 09:00:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627306873; 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=iwb+gJ5kZupdhuNB/HcDQBwyIfUYDI68vwzalsg6VHw=; b=U4X4iDQOSh2zIFRsXKCqbVwmVGSiZxCzDTGoSrqkEa4Y0PysciG6fWM8tdjuxhmzPL0W4/ 3b6TsFbgwaW2UcE/RI54Y3A88HodkoSjXNklDt3UD2dFPtfU7aOc0sPr2iQOMqmIub6nvH j2v/Q6d31mtZP0/IpkGA8xENz5CZCxI= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-kPSopGQ_MGGgsQN8GAE5MA-1; Mon, 26 Jul 2021 09:41:12 -0400 X-MC-Unique: kPSopGQ_MGGgsQN8GAE5MA-1 Received: by mail-ej1-f71.google.com with SMTP id i4-20020a1709064ec4b0290504bafdd58dso2105625ejv.4 for ; Mon, 26 Jul 2021 06:41:12 -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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iwb+gJ5kZupdhuNB/HcDQBwyIfUYDI68vwzalsg6VHw=; b=q9FNgyl8shA0Rkg/dN7A8bBn/5F97Yy21pizCNOlNmMdzgl7QsO+Rej5JU2LAe7UQk Ujn7gZJ+15PeiIZlzWg9dk3xN9CXR1aR1AMebI9tXoA5ADT1CBa54FRMWalcrI3EKxt8 GJX9AeqldiMYDdHnZkBvu8tG5Fud3K+L3JfDqUkAz5v9Q4iALGVPUYGnFAIIAgxRw3Gu JKLqleY5b6KPEveQOgWAEheieJ7tkCB236yit0oDy/O4hTVQcRv8nRQG12miSlZqS02B nJyN+ita6GmBTQMnC/X+lbg9ZLrb4H3rDNrDM90jUMHOS8u1bPmJaWUdf2AR7h5rKaHa tcKA== X-Gm-Message-State: AOAM530iPCy27Ls/AG4G9+KTOSJPSTscFAjMD40Locdnw8LkF9JrEfZL goS+YadS59PBHojvi3cTYOW16nSDAVwpmJh2ArPhEOnLNaeev/tdd2wBY4weCpMEMcmiQNsQOJv f+NoSCVs3P9Dulj+rh1KNchzU X-Received: by 2002:a17:907:62a7:: with SMTP id nd39mr17088037ejc.502.1627306871205; Mon, 26 Jul 2021 06:41:11 -0700 (PDT) X-Received: by 2002:a17:907:62a7:: with SMTP id nd39mr17088011ejc.502.1627306871006; Mon, 26 Jul 2021 06:41:11 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c15sm12639677edu.78.2021.07.26.06.41.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jul 2021 06:41:10 -0700 (PDT) Subject: Re: [PATCH 0/6] x86/kvm: add boot parameters for max vcpu configs To: Juergen Gross , linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Jonathan Corbet , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , kvmarm@lists.cs.columbia.edu References: <20210701154105.23215-1-jgross@suse.com> From: Paolo Bonzini Message-ID: Date: Mon, 26 Jul 2021 15:41:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210701154105.23215-1-jgross@suse.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 01/07/21 17:40, Juergen Gross wrote: > In order to be able to have a single kernel for supporting even huge > numbers of vcpus per guest some arrays should be sized dynamically. > > The easiest way to do that is to add boot parameters for the maximum > number of vcpus and the highest supported vcpu-id overwriting the > normal default. > > This patch series is doing that for x86. The same scheme can be easily > adapted to other architectures, but I don't want to do that in the > first iteration. > > In the long term I'd suggest to have a per-guest setting of the two > parameters allowing to spare some memory for smaller guests. OTOH this > would require new ioctl()s and respective qemu modifications, so I let > those away for now. > > I've tested the series not to break normal guest operation and the new > parameters to be effective on x86. For Arm64 I did a compile test only. > > Juergen Gross (6): > x86/kvm: fix vcpu-id indexed array sizes > x86/kvm: remove non-x86 stuff from arch/x86/kvm/ioapic.h > x86/kvm: add boot parameter for maximum vcpu-id > x86/kvm: introduce per cpu vcpu masks > kvm: allocate vcpu pointer array separately > x86/kvm: add boot parameter for setting max number of vcpus per guest > > .../admin-guide/kernel-parameters.txt | 18 +++++++ > arch/arm64/kvm/arm.c | 28 +++++++++-- > arch/x86/include/asm/kvm_host.h | 22 ++++++--- > arch/x86/kvm/hyperv.c | 25 +++++++--- > arch/x86/kvm/ioapic.c | 14 +++++- > arch/x86/kvm/ioapic.h | 8 +-- > arch/x86/kvm/irq_comm.c | 9 +++- > arch/x86/kvm/x86.c | 49 ++++++++++++++++++- > include/linux/kvm_host.h | 17 ++++++- > 9 files changed, 160 insertions(+), 30 deletions(-) > Queued patches 1-2, thanks (1 for stable too). Paolo