Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4850931iob; Mon, 9 May 2022 03:10:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/aL2A9+TFsrhpdOL69C0PepZK+DIiuA9hNktKnDsKzGVxH1aI1HaAqqJYhJ4vyh4xC7f8 X-Received: by 2002:a63:f441:0:b0:3c2:7845:976 with SMTP id p1-20020a63f441000000b003c278450976mr13041710pgk.194.1652091030756; Mon, 09 May 2022 03:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652091030; cv=none; d=google.com; s=arc-20160816; b=kL8wcdUlH++n9E1Q9lOPCnv0ye93qVwSJDDAQe7Cl4Dea9MrL8/Yzx7XgiVeu5sw7a LkGQljRoEp8TuYk+S1s8lRdkRv5aYTRfcE7OWgQmhJcedWvLWK1TDeOuNVtW5bgeE0Jr DBpDlKaUQhgyzFIyzmf1iyRcJW0uyF29MgbmNy51+28HWgXLY4k+5iLSh271fcnYrav/ Gn/0Kn1b3ztWd+UQMvGzKjv6wLoAx/xTliaIPFfujWeAV0Y7XJbaeGJvNeIdgZrd3aPo ySNsn1AJ2pm10uwYitpzJTyqSeJhAxkVm08+pf4e3SDiRTOyvJA6ZniJszED37pOfM3D aLUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PLUNZth0Gzu0RXkdCxlC7YsvIKkko3pZWci/8TjWfsg=; b=aqcvaZQ5hkS88z7s2tc+VdLVWke6NVv77XBF3uYKftP0rPHLrCFlwHMXlxI40d3vez +Wj/9vPChk69V4IFI5qwVZEoFWM08V7/wHcIYh6pkh22hASxr2UkwN/NyqLzvPXVyYqI 3pP/UNwdXIIDYL4CdYfPpsvKi/x1NPyLCeko59zDUyfpXQUNK4YqesvvSVHytO0oVSuX hLdK5DoBjtOveIYdKYqbgMElSAfeSx88ER2rmsce+bltQ5+nebnDaOUQQQkpmhN5OuWX b6E5lAYAPPUf4J0W/FM+bkfkWjPOwHzoisb02dDwfgE6d0vobwprj0ry3yTcZkgPRPfU HE+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=1fEjcPA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k10-20020a170902ba8a00b00159071eb8f6si10880749pls.502.2022.05.09.03.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:10:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=1fEjcPA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 33732238852; Mon, 9 May 2022 02:49:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233184AbiEIFoH (ORCPT + 99 others); Mon, 9 May 2022 01:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231927AbiEIFhp (ORCPT ); Mon, 9 May 2022 01:37:45 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1B921550EF for ; Sun, 8 May 2022 22:33:47 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id t6so17815055wra.4 for ; Sun, 08 May 2022 22:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PLUNZth0Gzu0RXkdCxlC7YsvIKkko3pZWci/8TjWfsg=; b=1fEjcPA9ZwqimNLicimZh7D54btJlReV6ttUi5sPPHZnlucnlayki28FnMUzJ/QL9Y M3c5KF+PPpNktxtj878OD+pC4SkuQy2P6dLZQYUe2Cujk0Gb7K/0i0a8L3+IV/hrdY4w clL8WGuArZLzgWuOlj6y5KUXWtm0lP97uo8OZdfkDmwLMoLvksx9f6ufrBVKNZkXmh5d nyuQNHzTw/00jpMFdO8AU/V3rp4KrVfb5sHGTxhTXdr+wSJhwyUxsMYI6zF73msEMXuS oNnwgVMaQmo1HLNVjh1tA9fH8g64Xjq73hzz8gXkMiEDk3tyUN8wHgrRYsJh1psS5+Rt GXfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PLUNZth0Gzu0RXkdCxlC7YsvIKkko3pZWci/8TjWfsg=; b=rDScGcW3BC95VMIyaEZMGhUBSeW+0dAS6hRjuRF0NCGRHoBszMWz4L/wq4IoEu0hXQ 31p6cXTlcLQwA21t41bJzU/nnzZG/weMfeJTV2q3zrK5lCICCu5bQJkV+BPCuv4u7Aro 0QQTXsC9amyQSM8jldrOhChttNtB5O3ITSfNi4EfDmgKgAVe//BrFyA/UNhESLoGHhJt PPXFXW0x86Qh7k/UhZ1ynFjX93vJFT3+HXOeMhq5kUZU9NZsCPAAto8PFywMNBRKNk93 28tzteRrn+AlqxYS1WGvfz6glW6k93uZfqQ3FgxUgi9tg34pOHnDbLTGapKO8DOP/U2f ulqQ== X-Gm-Message-State: AOAM533XYtG3HZNAL0aJuPlidyfnVW7eh9xzY9iV6PPynP6ySornEmgr 9VrRZ0+9hLhqgCGpjdt2SB+6YPcYnFPG11IlujU9KQ== X-Received: by 2002:a05:6000:12d1:b0:20a:d901:3828 with SMTP id l17-20020a05600012d100b0020ad9013828mr11892146wrx.313.1652074425312; Sun, 08 May 2022 22:33:45 -0700 (PDT) MIME-Version: 1.0 References: <20220420112450.155624-1-apatel@ventanamicro.com> <20220420112450.155624-6-apatel@ventanamicro.com> In-Reply-To: From: Anup Patel Date: Mon, 9 May 2022 11:03:34 +0530 Message-ID: Subject: Re: [PATCH v2 5/7] RISC-V: KVM: Reduce KVM_MAX_VCPUS value To: Atish Patra Cc: Anup Patel , Paolo Bonzini , Palmer Dabbelt , Paul Walmsley , Alistair Francis , KVM General , "open list:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)" , linux-riscv , "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, May 4, 2022 at 7:45 AM Atish Patra wrote: > > On Wed, Apr 20, 2022 at 4:25 AM Anup Patel wrote: > > > > Currently, the KVM_MAX_VCPUS value is 16384 for RV64 and 128 > > for RV32. > > > > The KVM_MAX_VCPUS value is too high for RV64 and too low for > > RV32 compared to other architectures (e.g. x86 sets it to 1024 > > and ARM64 sets it to 512). The too high value of KVM_MAX_VCPUS > > on RV64 also leads to VCPU mask on stack consuming 2KB. > > > > We set KVM_MAX_VCPUS to 1024 for both RV64 and RV32 to be > > aligned other architectures. > > > > Signed-off-by: Anup Patel > > --- > > arch/riscv/include/asm/kvm_host.h | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h > > index 806f74dc0bfc..61d8b40e3d82 100644 > > --- a/arch/riscv/include/asm/kvm_host.h > > +++ b/arch/riscv/include/asm/kvm_host.h > > @@ -16,8 +16,7 @@ > > #include > > #include > > > > -#define KVM_MAX_VCPUS \ > > - ((HGATP_VMID_MASK >> HGATP_VMID_SHIFT) + 1) > > +#define KVM_MAX_VCPUS 1024 > > > > #define KVM_HALT_POLL_NS_DEFAULT 500000 > > > > -- > > 2.25.1 > > > > Reviewed-by: Atish Patra Queued this patch for 5.19 Thanks, Anup > > -- > Regards, > Atish