From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 8 04:59:25 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BFF1106566B for ; Sun, 8 Jun 2008 04:59:25 +0000 (UTC) (envelope-from tzhuan@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 9F06F8FC12 for ; Sun, 8 Jun 2008 04:59:24 +0000 (UTC) (envelope-from tzhuan@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1320860fgb.35 for ; Sat, 07 Jun 2008 21:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=KYtdYy4Kp7wBnYX3za5vKhQUN9a7OZh9Gi/IYL3czEI=; b=ZtCRW54y4LhOa/IJSaCxCxPva0YGZnohjt9aLJdEaK2XQGbXXSjQPjvfEnLajA91Wn 8k/thPJBNZCsr84Yt7/5JaQBaWn4Fk8fCJH6Zhlta+l7Kvei5Xtq135CjjTF4t1E0tLO 4l5VRzYua6FnvkA9dsjAQYXINHrtN6sg0egUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=OVIL3q2Zj7q5UdTVOrmiK+UPCJIIgCFATSeBGq3oSYXorhvg7ztdSVtRtyOX7w0yVU hU6uxNFXQOwpJk/qaeqliZqOeKgTiDFICRTy1YXyDT3YexVkHxrOHdW2b/NWJ4UFgfN+ Q5itESnveBkX0/m6+SYaCl0Tagxsm/gSBMSsg= Received: by 10.86.63.19 with SMTP id l19mr2504358fga.77.1212899542832; Sat, 07 Jun 2008 21:32:22 -0700 (PDT) Received: by 10.86.92.1 with HTTP; Sat, 7 Jun 2008 21:32:22 -0700 (PDT) Message-ID: <6a7033710806072132i5abe2368h3db3ba269951fac5@mail.gmail.com> Date: Sun, 8 Jun 2008 12:32:22 +0800 From: "Tz-Huan Huang" Sender: tzhuan@gmail.com To: "Alan Cox" In-Reply-To: <484B20E7.2040009@cs.rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <484B20E7.2040009@cs.rice.edu> X-Google-Sender-Auth: 81bb187f1df07ee9 Cc: hackers@freebsd.org Subject: Re: Increasing KVM on amd64 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2008 04:59:25 -0000 On Sun, Jun 8, 2008 at 7:59 AM, Alan Cox wrote: > You can download a patch from > http://www.cs.rice.edu/~alc/amd64_kvm_6GB.patch that increases amd64's > kernel virtual address space to 6GB. This patch also increases the default > for the kmem map to almost 2GB. I believe that kernel loadable modules > still work. However, I suspect that mini-dumps are broken. > > I don't plan on committing this patch in its current form. Some of the > changes are done in a hackish way. I am, however, curious to hear whether > or not it works for you. Thanks for the patch. I applied it on 7-stable but got failed on pmap.c. Patching file amd64/amd64/pmap.c using Plan A... Hunk #1 succeeded at 429 (offset -12 lines). Hunk #2 failed at 442. Hunk #3 succeeded at 1505 (offset -168 lines). Hunk #4 succeeded at 1691 (offset -12 lines). amd64/amd64/pmap.c.rej: *************** *** 442,456 **** /* Map from zero to end of allocations under 2M pages */ /* This replaces some of the KPTphys entries above */ for (i = 0; (i << PDRSHIFT) < *firstaddr; i++) { - ((pd_entry_t *)KPDphys)[i] = i << PDRSHIFT; - ((pd_entry_t *)KPDphys)[i] |= PG_RW | PG_V | PG_PS | PG_G; } /* And connect up the PD to the PDP */ for (i = 0; i < NKPDPE; i++) { - ((pdp_entry_t *)KPDPphys)[i + KPDPI] = KPDphys + (i << PAGE_SHIFT); - ((pdp_entry_t *)KPDPphys)[i + KPDPI] |= PG_RW | PG_V | PG_U; } /* Now set up the direct map space using either 2MB or 1GB pages */ --- 442,456 ---- /* Map from zero to end of allocations under 2M pages */ /* This replaces some of the KPTphys entries above */ for (i = 0; (i << PDRSHIFT) < *firstaddr; i++) { + ((pd_entry_t *)KPDphys)[2048 + i] = i << PDRSHIFT; + ((pd_entry_t *)KPDphys)[2048 + i] |= PG_RW | PG_V | PG_PS | PG_G; } /* And connect up the PD to the PDP */ for (i = 0; i < NKPDPE; i++) { + ((pdp_entry_t *)KPDPphys)[i + KPDPI - 4] = KPDphys + (i << PAGE_SHIFT); + ((pdp_entry_t *)KPDPphys)[i + KPDPI - 4] |= PG_RW | PG_V | PG_U; } /* Now set up the direct map space using either 2MB or 1GB pages */ We have no machine running 8-current with more than 6G memory now... Thanks, Tz-Huan