Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5781956yba; Mon, 13 May 2019 17:42:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuu2sjzyQqyRCSTHwaTbKUaJdjXZOk9i6htZEse43RE6h6HTbvjdXy2FXsr1A11GSBW+/l X-Received: by 2002:a63:cc4e:: with SMTP id q14mr34008543pgi.84.1557794539177; Mon, 13 May 2019 17:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557794539; cv=none; d=google.com; s=arc-20160816; b=VrXRIRUaiyANdbgc59XdjkvGtODuX1oujphh+w5gz3kgnVZSgPZ02iQM2F5wV7DaxJ VAQOLO2u0la/1h+wr2ncbM/LTw+k6DV5s9c019qH5YXM5iu2rhvsQe32qjhJ32gZIYSa xlwqsFB87iXR9FA/+aw9VjD5CEQg1mElC4YVRE6+IPFuqvfzePrGQwMJbIlMD4O6G9d2 rzxKQzbkCmRqlDw0J8EEKKxZjZAtO6LNaboG6D+ZRkqbasSJ4PKeKmmV2S4Kzs30DAgP 36JvZGpL/hDB/U7k2N33t1/Sxxka7TGe9QXHy68vRzTLidcpmPPVGlyMecehUQC6GIto 7zgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=kMZ5w85F7GQqBXnYMmtQZ+xbVTO8OslBtbOYC6aSOnc=; b=BVTtnmabnr/5epGXxA0/0qX15IJczbnTs4iUpBculA2+4ejqE35zzJW5GZYSBaAomR r/yGDdspLDvAbc1JdsHPYZ3L34Avx4LUHRvlgGnmHVi1e2uM3oaz6yBU6wokX65CB9be ZW6rfuP3Mr+Uihsbr8Ks0i9CAMfGV4sm4WBsn3AhcMaYOqpEUxP3mGtMxNhbDB+h0jjF LwW1314ngifDSW9AU6F6/1lyAs8qw7BGL62g0zlBTqxJ5iuFMYKtJ4Cs76O/e20lBdaD E/inKPsuHj4AvwY5JiK9fU+Dj6hWKg6ivm9PVbk/tuOMXMmWLX8aKxmRUSMuJl8u0ugK VuNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=dIDbl08z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4si18837887plb.305.2019.05.13.17.42.02; Mon, 13 May 2019 17:42:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=dIDbl08z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbfENAj4 (ORCPT + 99 others); Mon, 13 May 2019 20:39:56 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:39045 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbfENAj4 (ORCPT ); Mon, 13 May 2019 20:39:56 -0400 Received: by mail-it1-f195.google.com with SMTP id 9so2043143itf.4 for ; Mon, 13 May 2019 17:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=kMZ5w85F7GQqBXnYMmtQZ+xbVTO8OslBtbOYC6aSOnc=; b=dIDbl08zuYEXjpcqx5vKPssywdXTZxvDMCnbtlVVbXHC97okSbaxXNZpoFGB/UovIx XoNy7bRb7HHziO9YZaDJxH0NKnSIMjQ+anjVkDM2z+PgnN/HRC9xUdqv81IzsDJKWChr K756P8PpDsujRhQqr77vMsEUI1ZULdqJ7QDQnH+geiBWrD64ANnYy9jNOVPAdTi5+ngh fadPDEslLEAUiySuMIlfbc8wfrZSVhxEbiE9zKtdsj/ohJZn7u4TFbLScXkiEvyHUqO8 fDcOd0W2a2UwGMTHMw43d7np5QJOHencef/vU/jqX6rHMgAauiHTMBZaGwlof4Y+TRyX Jizw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=kMZ5w85F7GQqBXnYMmtQZ+xbVTO8OslBtbOYC6aSOnc=; b=pqtom9Q9HWCx9fnouly/mE8DnpdaNPzqc+c5Yi1ns7gUzrwiHYDWYeSaL+07kOJlhR 9lVtGk9MMZN93pgd5Sg0W/Kr5+QtZXUvB1qdllmuL69RbtvjEa7K1uPDOsdWWr4ctVjR nO2gWWRNGwGxJXi2xJ0F5TkfRFtCyCUfTw1s9t544JTrc17ou3m3uecI9MyTw6gIHrrw 8jw/QskafpSe18dk22qe6kr460VGLGmn/nx2n25Z3TaTCPfEPTgNps0hp7rmPbnEB+Bu suXvYKAnvqalc7LFbnvS3urZcwZ2BWXtjFJiK35RcGS4bb7stkg25DDA8zldkruLv2GY a/xw== X-Gm-Message-State: APjAAAXB6LO815LlCZtbFce/pHrMsAsU4eM71YofhuTYpPk8PGs77H6p RkfThvN+D58Nx+VXHl3lFyuvpg== X-Received: by 2002:a24:2758:: with SMTP id g85mr1604621ita.30.1557794395577; Mon, 13 May 2019 17:39:55 -0700 (PDT) Received: from localhost (c-73-95-159-87.hsd1.co.comcast.net. [73.95.159.87]) by smtp.gmail.com with ESMTPSA id c11sm494780itj.31.2019.05.13.17.39.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 17:39:55 -0700 (PDT) Date: Mon, 13 May 2019 17:39:54 -0700 (PDT) From: Paul Walmsley X-X-Sender: paulw@viisi.sifive.com To: Atish Patra cc: Paul Walmsley , "linux-kernel@vger.kernel.org" , "mark.rutland@arm.com" , Albert Ou , Anup Patel , Palmer Dabbelt , Zong Li , "merker@debian.org" , "linux-riscv@lists.infradead.org" Subject: Re: [v2 PATCH] RISC-V: Add a PE/COFF compliant Image header. In-Reply-To: Message-ID: References: <20190501195607.32553-1-atish.patra@wdc.com> User-Agent: Alpine 2.21.9999 (DEB 301 2018-08-15) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 May 2019, Atish Patra wrote: > On 5/13/19 5:09 PM, Paul Walmsley wrote: > > > What are the semantics of those reserved fields? > > +struct riscv_image_header { > + u32 code0; > + u32 code1; > + u64 text_offset; > + u64 image_size; > + u64 res1; > + u64 res2; > + u64 res3; > + u64 magic; > + u32 res4; ---> We can use this for versioning when required > + u32 res5; ---> This is reserved for PE/COFF header > +}; I saw that in your patch. The problem is that this doesn't describe what other software might expect in those fields. Can anything at all be placed in those reserved fields? > > > Do we need to add it now or add it later when we actually need a version > > > number. My preference is to add it later based on requirement. > > > > If it isn't added now, how would bootloaders know whether it was there or > > not? > > > > > Here is the corresponding U-Boot Patch > https://patchwork.ozlabs.org/patch/1096087/ > > Currently, boot loader doesn't care about versioning. Since we are updating a > reserved field, offsets will not change. If a boot loader want to use the > versioning, it should be patched along with the kernel patch. > > Any other boot loader that doesn't care about the version, it can continue to > do so without any change. > > My idea is to enable the minimum required fields in this patch and keep > everything else as reserved so that it can be amended in future as required. If those fields really are reserved for implementors to do whatever they want with them, then that might be a reasonable approach. That seems unlikely, however, since specification authors usually reserve the right to use reserved fields for their own purposes in later versions. - Paul