Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2014 16:40:49 +0000 (UTC)
From:      Juergen Lock <nox@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r353030 - in head/emulators/qemu-devel: . files
Message-ID:  <201405051640.s45GennW085723@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nox
Date: Mon May  5 16:40:49 2014
New Revision: 353030
URL: http://svnweb.freebsd.org/changeset/ports/353030
QAT: https://qat.redports.org/buildarchive/r353030/

Log:
  - bsd-user: Handle FreeBSD sysctl hw.pagesizes (by returning only
    getpagesize() for now); this fixes rtld on head after r264346 that
    now uses the sysctl.
  - Bump PORTREVISION.

Added:
  head/emulators/qemu-devel/files/extra-patch-sysctl-hw-pagesizes   (contents, props changed)
Modified:
  head/emulators/qemu-devel/Makefile

Modified: head/emulators/qemu-devel/Makefile
==============================================================================
--- head/emulators/qemu-devel/Makefile	Mon May  5 16:24:00 2014	(r353029)
+++ head/emulators/qemu-devel/Makefile	Mon May  5 16:40:49 2014	(r353030)
@@ -3,7 +3,7 @@
 
 PORTNAME=	qemu
 PORTVERSION=	2.0.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	emulators
 MASTER_SITES=	http://wiki.qemu.org/download/:release \
 		LOCAL/nox:snapshot
@@ -63,6 +63,7 @@ EXTRA_PATCHES+=	${FILESDIR}/extra-patch-
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-sysctl-hw-availpages
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-sysctl-0oldlen
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bsd-user-mmap.c
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-sysctl-hw-pagesizes
 .endif
 
 CONFIGURE_ARGS+=	--extra-ldflags=-L${LOCALBASE}/lib

Added: head/emulators/qemu-devel/files/extra-patch-sysctl-hw-pagesizes
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/extra-patch-sysctl-hw-pagesizes	Mon May  5 16:40:49 2014	(r353030)
@@ -0,0 +1,53 @@
+From nox Mon Sep 17 00:00:00 2001
+From: Juergen Lock <nox@jelal.kn-bremen.de>
+Date: 05 May 2014 00:54:00 +0200
+Subject: Handle bsd-user FreeBSD hw.pagesizes sysctl
+
+hw.pagesizes is defined as OID_AUTO so the mib can change; find out
+it's value at the first hw.* sysctl syscall.
+Handle it by returning only getpagesize() for now.
+
+Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
+
+--- a/bsd-user/freebsd/os-sys.c
++++ b/bsd-user/freebsd/os-sys.c
+@@ -227,6 +227,7 @@ abi_long do_freebsd_sysctl(CPUArchState 
+         default:
+             {
+                 static int oid_hw_availpages;
++                static int oid_hw_pagesizes;
+ 
+                 if (!oid_hw_availpages) {
+                     int real_oid[CTL_MAXNAME+2];
+@@ -235,6 +236,13 @@ abi_long do_freebsd_sysctl(CPUArchState 
+                     if (sysctlnametomib("hw.availpages", real_oid, &len) >= 0)
+                         oid_hw_availpages = real_oid[1];
+                 }
++                if (!oid_hw_pagesizes) {
++                    int real_oid[CTL_MAXNAME+2];
++                    size_t len = sizeof(real_oid) / sizeof(int);
++
++                    if (sysctlnametomib("hw.pagesizes", real_oid, &len) >= 0)
++                        oid_hw_pagesizes = real_oid[1];
++                }
+ 
+                 if (oid_hw_availpages && snamep[1] == oid_hw_availpages) {
+                     long lvalue;
+@@ -252,6 +260,17 @@ abi_long do_freebsd_sysctl(CPUArchState 
+                     }
+                     goto out;
+                 }
++
++                if (oid_hw_pagesizes && snamep[1] == oid_hw_pagesizes) {
++                    // XXX some targets do superpages now too... */
++                    if (oldlen) {
++                        (*(abi_ulong *)holdp) = tswapal((abi_ulong)getpagesize());
++                        ((abi_ulong *)holdp)[1] = 0;
++                    }
++                    holdlen = sizeof(abi_ulong) * 2;
++                    ret = 0;
++                    goto out;
++                }
+                 break;
+             }
+         }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405051640.s45GennW085723>