From patchwork Wed Apr 19 22:23:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Kumar Patra X-Patchwork-Id: 13217572 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 559F4C6FD18 for ; Wed, 19 Apr 2023 22:27:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233350AbjDSW10 (ORCPT ); Wed, 19 Apr 2023 18:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233541AbjDSW1B (ORCPT ); Wed, 19 Apr 2023 18:27:01 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7089C158 for ; Wed, 19 Apr 2023 15:25:35 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1a9253d4551so4804085ad.0 for ; Wed, 19 Apr 2023 15:25:35 -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=Z0i7tJjWh/NHjBLpHlr9FAAX6ZlFJSdbKzrHVYXNZAkwjMTQUTvQD3XCaJo/ZjUjm+ cfoOIcgSmqfFDPhxpibbxiER8tzXmRTaZ4V+DVE7FfbQgw9uj1iaV/uWcYHzoAkEs5yC ZsYp87XtVu7y4E17HC5vahb5+Bj8nvhfsSxCffK61YK/MzNCEcGMJdKKP7O5Bc92ZSDW QG8mXbUp+I0UTTr49EJgJVmTH83TDebC0TzCpqEbZnKdYRbzX3Gjv3O9dWu8AedxPA3n +KUhkNFwBItltzFSJhCxeHguGyjNRuqYfKD6d/inxRUmlgT5Ydg6fQWieoWqaV6crLjP 3LnA== X-Gm-Message-State: AAQBX9etDHpRHcDH0OnOFSP2BhSjUP3jiIrwnuXnrpSYy8KO0dB5k9Ua S1xXExevngbUdsuCyjJVdPZv1A== X-Google-Smtp-Source: AKy350a+wtlv0SH4nHUTs3X+REynERjZtWfA6CRUt3D8Ejpa/aSb6HljJIxaa3PlyPoDKWKx8hTZ+g== 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 Precedence: bulk List-ID: X-Mailing-List: kvm@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) {