Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp939035rwr; Wed, 19 Apr 2023 15:51:50 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2HZQDuo4MGQedqVWRm2Cv4AHp8eqh7QM/LJunIgQKXauA0um8Z+I5EhL7XD4mfyRXADmJ X-Received: by 2002:a17:902:e551:b0:19c:a9b8:4349 with SMTP id n17-20020a170902e55100b0019ca9b84349mr8690754plf.32.1681944710085; Wed, 19 Apr 2023 15:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681944710; cv=none; d=google.com; s=arc-20160816; b=gfOT6qkMgPtTZOIt75h7gYqwQtjICRBPgwW/XDc9NM1aFuTPw8Cx5ZQOge/5tKwn27 WsvIW4IgspTyQzlPbdpQy6+l+chdFM/0BAi8fv1cDwsYSiG+N5G7/KnAruPg/WgZ1uCn shvs62siMJKcLYI/7TmhhEuKZrxun1TlwyjWhKrBIezR/PYE0Vet7gQevlJxucMUHcMA DknoFTsLxrbteAXsp4cU7NzF03wrg5QJipp0lREIQXZk4INDWZ7lR0f+cEY55H3+4DAr BrmW74HnXFj6lnbDKxSae6eJu+7rSGlMNs4k4TvDcfOigXxA4ndly39PzcF3PP5/Iw5L qaxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2k6fZhtBjuovD0xJN9/3Mss7sJpSj6M+Lhg1puIM9yQ=; b=rG2Iipud1S/j4/x0Bl6YCk9oRHYknzODeWm4kJqp4vDSTwSowDoflrmINEQy2U/Ax8 UGADFX1xfvVcO/cP+w5r9DDBtHSicxEdFsYkmCh7JXjbCvskHuIn1rDZsz8dKnitDJAR PN1B4urxWFGcfuuCdl19HYEMYTERRnpcBW65L0FTx+AtSWAfQkEbo3TOSeqoiPi+mLh1 w4duehqkEYqiEGe1FFTMs4KbqFEaeK8y+Hd55Zsl3r/ashyPgOqZSOro8CmXrGsK2Qyt 0gwDuPmWddRnNHmVaaNh6iQnCczDxcR5H6Ljr0KQXgh6n7GL5aexuy9rgt/oSxVO62lz RHYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=frHFpOgJ; 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 r4-20020a655084000000b0051344de1eb8si16906336pgp.276.2023.04.19.15.50.47; Wed, 19 Apr 2023 15:51:50 -0700 (PDT) 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; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=frHFpOgJ; 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 S232904AbjDSWbT (ORCPT + 99 others); Wed, 19 Apr 2023 18:31:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbjDSWbS (ORCPT ); Wed, 19 Apr 2023 18:31:18 -0400 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 296F37EC8 for ; Wed, 19 Apr 2023 15:30:45 -0700 (PDT) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1a69f686345so4562785ad.2 for ; Wed, 19 Apr 2023 15:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1681943053; x=1684535053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2k6fZhtBjuovD0xJN9/3Mss7sJpSj6M+Lhg1puIM9yQ=; b=frHFpOgJMj3IyT+0l6lF4ggQqLWSqJ+R5Lwl83JFjnZ1FgOj+RCeflj5OiteP2veXj hs8UabqlFhDeAfeVOqN8nsOlJjF/2yPcJvsYdreBOn4W0VsT07xnNPxxC9wRqCbEDrEI ZWpU6jo5/ivGxGl/5WlSrPuw4s+yWAlTdUEKKQGRxh6JkIhcKHr1ykdZxEako+r8BVLI Iia+UAGrprs58WkfVvjD7u2w/7WcLDjo2lLLRaRlMw3OivWlNDMPp50fyu9RdhML7Hv4 wHYTWA+nkcv0sFjdO1RQEsLbEgouvwKngVct5OCtGdc8SgVKzfHhIkTKi03d/OSMpN46 dypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681943053; x=1684535053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2k6fZhtBjuovD0xJN9/3Mss7sJpSj6M+Lhg1puIM9yQ=; b=DtQq78e0t0UknBuuihtvDY2BaUAJkudksjIdfAzL51ZnZDOxUGKSeDkG3xMRlu+YRb 6tTQecTKjJrsXcJNOmxScq2vLPCSqWKB+NUm3x+w4dWcypSiuBGeffg29h9H2VbvWl58 2kuB8Oq2A9jOplZs26+F/LKfrSYSHjaDFko5l1vKWe7w+KmePS1CfOe72Uuioy3Xv3gN TOpjYp16+s4pFHhpfE706TQonNjGJWaN0CurZpDnTChghqdzaAHuHx9vHU6/Gi05HuAZ Qt3pM5s50nX+BcUfeztmaT5fBYpTWG1b7MVviMip5diBByFkC97MaP0poCHbUFszIrRW iElQ== X-Gm-Message-State: AAQBX9cbxvxc2knS2BWPmC653i4bkQddhXpfvgoIx1fLM4PZKdH7l75W tKIGeNApkwkNsPoIW5R7RpRHLqf1oURJSxHDYEg= X-Received: by 2002:a17:903:8c6:b0:1a0:42d4:e38a with SMTP id lk6-20020a17090308c600b001a042d4e38amr7048884plb.11.1681943053760; Wed, 19 Apr 2023 15:24:13 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id e4-20020a170902744400b001a681fb3e77sm11867810plt.44.2023.04.19.15.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 15:24:13 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Alexandre Ghiti , Andrew Jones , Andrew Morton , Anup Patel , Atish Patra , Suzuki K Poulose , Will Deacon , Marc Zyngier , Sean Christopherson , linux-coco@lists.linux.dev, Dylan Reid , abrestic@rivosinc.com, Samuel Ortiz , Jiri Slaby , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , Paolo Bonzini , Rajnesh Kanwal , Uladzislau Rezki Subject: [RFC kvmtool 06/10] riscv: Change initrd alignment to a page size Date: Wed, 19 Apr 2023 15:23:46 -0700 Message-Id: <20230419222350.3604274-7-atishp@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419222350.3604274-1-atishp@rivosinc.com> References: <20230419222350.3604274-1-atishp@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Currently, the initrd image is aligned to 8. This is problematic for CoVE where the image is expected to be aligned at page granularity level. Thus, align it to 4k. This can be done only if user requested a TVM. However, initrd usually much bigger (in MBs at least). Thus, aligning to a page for everything should not matter much. Signed-off-by: Atish Patra --- riscv/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/kvm.c b/riscv/kvm.c index d59e8bc..5f9b0d5 100644 --- a/riscv/kvm.c +++ b/riscv/kvm.c @@ -113,7 +113,7 @@ void kvm__arch_init(struct kvm *kvm) } #define FDT_ALIGN SZ_4M -#define INITRD_ALIGN 8 +#define INITRD_ALIGN SZ_4K bool kvm__arch_load_kernel_image(struct kvm *kvm, int fd_kernel, int fd_initrd, const char *kernel_cmdline) { -- 2.25.1