From owner-svn-src-all@freebsd.org Fri May 20 15:59:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45821B44518; Fri, 20 May 2016 15:59:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 1104010F3; Fri, 20 May 2016 15:59:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id t40so58745321ioi.0; Fri, 20 May 2016 08:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=8U/K1UFQFg3LYyvL4nx9loIlcwqbDR95MaMUOIRCqR4=; b=ADa/ry/+PWJpHQqCccOlLJwwRAVq2zxDHfi7iIrBsZu04KUUSXWdQm6rgpwTQsuVj4 h/q+kQOjjsWC63PGDSZqQfr+eaiiU3tXSjSEk8C4XO3CB/7U72oLdXu5AWV2eNZ3yaZz 72cyC2tpCJM/W8r3b1TlxEGJ3GO8n8Q0G4odqx+9aLBuwLu+vz8OQ+NWOuWEtLQ2Cb3x aNzc/+5Qn+ZBRWpJGNEOsch+T8Q3IARevHwZdcTo7IR4TG6P7/A18T1c+kG0imf8daur 3g/6aqZGxVDUqSLNlxDgyG736eVk+6NyQ5A9HOg4Ikgmwajh1rTgOw+hvuXOOLFIXAy9 k/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=8U/K1UFQFg3LYyvL4nx9loIlcwqbDR95MaMUOIRCqR4=; b=HEyy0Pfhk1GRGCeMsE7ui9i12oAxqGUIUjDTHiDGwhYIxGfcCqk0zUPZjNUpF5iaJN cqbcg7IiQAGub8mUqIhhZb2jc0xj8OH87lSFkjHvN7CLmDqKo76cPlrwWwkK5gO4sWYB 2uytotZ1HpeGdqGdbNO56RVDCdoYpyHKgNQsZA+zi4K9iy3cYzKvI4ZvklsrpvLB6P/J gF/klZeMlw6X8+BNXd/g3qOqgq5xXVCiA7k58wM40uOzB+rNEACI+DddfC+7v9GdMKp4 MXWZUropjg0c3e4ZdIHcMkk97FGTjQL68hTa9JfGyYIS77uh/Rh5IYj5dF51+xmUjxHG 150A== X-Gm-Message-State: AOPr4FVCFM2M0/AlmMHt79l2ihAcg3taJybvaq8DTsQSxcICK5ctIPOMMw5zwTDb0lYiiFCzQbV7YTajpmNpcQ== MIME-Version: 1.0 X-Received: by 10.36.81.79 with SMTP id s76mr3373240ita.71.1463759963318; Fri, 20 May 2016 08:59:23 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Fri, 20 May 2016 08:59:23 -0700 (PDT) In-Reply-To: <573F2686.20509@freebsd.org> References: <201605200141.u4K1flpV094958@repo.freebsd.org> <1780135.VYYOsNudFi@ralph.baldwin.cx> <573F2686.20509@freebsd.org> Date: Fri, 20 May 2016 08:59:23 -0700 Message-ID: Subject: Re: svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot From: Adrian Chadd To: Allan Jude Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:59:24 -0000 Right, but if you hand that malloc() pointer to any BIOS int calls, it's highly likely it won't work right. :) -a On 20 May 2016 at 08:00, Allan Jude wrote: > On 2016-05-20 10:48, John Baldwin wrote: >> On Friday, May 20, 2016 01:41:47 AM Allan Jude wrote: >>> Author: allanjude >>> Date: Fri May 20 01:41:47 2016 >>> New Revision: 300257 >>> URL: https://svnweb.freebsd.org/changeset/base/300257 >>> >>> Log: >>> Fixup the geliboot sector rounding code >>> >>> Replace all rounding with the round{up,down}2 macros >>> a missing set of braces caused the previous code to be incorrect >>> >>> replace alloca() with malloc() because alloca() can return an allocation >>> that is actually invalid, causing boot to fail >> >> No, you have to revert the malloc! malloc() can be anywhere. The alloca >> is _on purpose_ to get a bufer below 1MB so that it will work with all >> devices. Some BIOSes can only store data in the first 1MB. >> > > to be clear, the alloca() was something I added, not something that was > there before. And it was breaking, because ZFS was trying to allocate > too large a block of memory, that wouldn't fit below 1MB. > > -- > Allan Jude >