From owner-freebsd-hackers@freebsd.org Tue Jun 12 17:16:54 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7523310093AD for ; Tue, 12 Jun 2018 17:16:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x233.google.com (mail-pl0-x233.google.com [IPv6:2607:f8b0:400e:c01::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED0246F953 for ; Tue, 12 Jun 2018 17:16:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x233.google.com with SMTP id w17-v6so14740350pll.9 for ; Tue, 12 Jun 2018 10:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=P4z8BAnRlOMGDZdl6+/JYDTp5fSgWkcw39Gl7EylADI=; b=arRznr4i2R5ms6KBEcUUqmbRcJZluCQo+mb/adKLkvXCSgqDIkHchLeuwNYb6rqD8T v1Vlqr/jtRSQyR7ACd5mj+6Mjbaxx1L/FwCRCji8Ex11tZrbWipBRXPofQhSbyAe+O48 DB3DLwsQAx2In0jU4HNUyZWnmi32EPg5/yYt56L/1KZndmmTzmTlFXhwSK09e+kD34bf O2zhleFQbzRcvTjyQ3e5brtiqn8YI6+bZ6kTWK51hcrBysqKL/cvO99Kvx0QAoubpkLN md5Qpt6mUg3LxXtG42MhDpLMmBzdQoLvTuZP3eC+NgfKfSqVLBP29fmPvwmUzSYCeWZK O+HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=P4z8BAnRlOMGDZdl6+/JYDTp5fSgWkcw39Gl7EylADI=; b=YWwGpDsJwMllgcAv3wjGfspN7V2CKHFRqB9QYyaB+4ojXomE4nnhiVmEJe1U1PPkIK utXzbx7B0lJG2L4GUM1sXYQRDF1b2cBKljR8WDjqfcpjZB69lzXspeTN7yDtb+HXUy7u P+E4J6oYl0a45Z99koo4qRTKpjkDr8FKXMPOZiHPM//RzSpzKlpDn5O664JvLx6cB4+t 3Tfii+MSu8qovhi5OdEA3TLZHXTLzIEyujGN3uoFHwh5OsZfSSukco+zifBhQdkJo4Wi R6rQhT3M4OnOzCTrQonmqdIgIfTo8ndsr2K9amVD64gue7BBqPJq4gehrud+ouRUiVoZ oa5g== X-Gm-Message-State: APt69E1fTDLt/EoIcvSxBf1LVH78Q27kmf6kFsrrm7pR9umPyzZDCVpJ YEPAkz9UcKm6wh3fAOOGOlA= X-Google-Smtp-Source: ADUXVKIjVHTwbl3J3bPGoZK+b9OFer2prA0hia/5NY/D/40gF613TWbv9BIxmSStKM1yswhm1gYNAg== X-Received: by 2002:a17:902:2809:: with SMTP id e9-v6mr1327436plb.89.1528823813063; Tue, 12 Jun 2018 10:16:53 -0700 (PDT) Received: from raichu (toroon0560w-lp140-02-70-49-169-156.dsl.bell.ca. [70.49.169.156]) by smtp.gmail.com with ESMTPSA id o66-v6sm899612pfi.157.2018.06.12.10.16.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 10:16:52 -0700 (PDT) Sender: Mark Johnston Date: Tue, 12 Jun 2018 13:16:49 -0400 From: Mark Johnston To: Warner Losh Cc: "freebsd-hackers@freebsd.org" Subject: Re: specifying alignment of loader files Message-ID: <20180612171649.GE56138@raichu> References: <20180612170420.GD56138@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 17:16:54 -0000 On Tue, Jun 12, 2018 at 11:11:25AM -0600, Warner Losh wrote: > On Tue, Jun 12, 2018 at 11:04 AM, Mark Johnston wrote: > > > Hi, > > > > I'm writing some code which processes a file loaded by the loader. I > > want the file's contents to be available at a certain alignment in > > memory, and as far as I can see, the loader provides no alignment > > guarantees today. The access will happen early enough during boot that > > making an aligned copy of the data will be awkward, so I'd like the > > loader to provide the desired alignment. > > > > I'm considering adding a new "module_align" variable that would specify > > the alignment for a given file type, and plumb that through to > > command_load(). Does anyone have an alternate suggestion, or an > > objection to my proposal? > > > > I thought the loader already did that for ELF sections... Why not wrap your > file in such a segment? In this case it's a raw binary file (CPU microcode), and I want to be able to load it without any modifications or wrappers.