From owner-p4-projects@FreeBSD.ORG Tue Dec 5 05:43:26 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4A8AE16A55D; Tue, 5 Dec 2006 05:43:26 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F08F916A515 for ; Tue, 5 Dec 2006 05:43:25 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FA1243C9D for ; Tue, 5 Dec 2006 05:42:48 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kB55hPXp068997 for ; Tue, 5 Dec 2006 05:43:25 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kB55hPm3068989 for perforce@freebsd.org; Tue, 5 Dec 2006 05:43:25 GMT (envelope-from jb@freebsd.org) Date: Tue, 5 Dec 2006 05:43:25 GMT Message-Id: <200612050543.kB55hPm3068989@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 111115 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2006 05:43:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=111115 Change 111115 by jb@jb_freebsd8 on 2006/12/05 05:43:09 IFC Affected files ... .. //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/boot/chapter.sgml#4 integrate .. //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/config/chapter.sgml#9 integrate .. //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/desktop/chapter.sgml#6 integrate .. //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/install/chapter.sgml#12 integrate .. //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/mirrors/chapter.sgml#8 integrate .. //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/x11/chapter.sgml#11 integrate .. //depot/projects/dtrace/doc/zh_CN.GB2312/books/porters-handbook/book.sgml#14 integrate .. //depot/projects/dtrace/src/sys/boot/sparc64/loader/hcall.S#4 delete .. //depot/projects/dtrace/src/sys/powerpc/include/pmap.h#4 integrate .. //depot/projects/dtrace/src/sys/powerpc/powerpc/mmu_if.m#6 integrate .. //depot/projects/dtrace/src/sys/powerpc/powerpc/mmu_oea.c#9 integrate .. //depot/projects/dtrace/src/sys/powerpc/powerpc/pmap_dispatch.c#7 integrate .. //depot/projects/dtrace/src/sys/powerpc/powerpc/uio_machdep.c#4 integrate .. //depot/projects/dtrace/src/sys/sun4v/sun4v/hcall.S#9 integrate .. //depot/projects/dtrace/www/share/sgml/news.xml#13 integrate .. //depot/projects/dtrace/www/share/sgml/press.xml#10 integrate Differences ... ==== //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/boot/chapter.sgml#4 (text+ko) ==== @@ -3,7 +3,7 @@ The FreeBSD Chinese (Simplified) Project Original Revision: 1.65 - $FreeBSD: doc/zh_CN.GB2312/books/handbook/boot/chapter.sgml,v 1.4 2006/06/03 15:34:22 delphij Exp $ + $FreeBSD: doc/zh_CN.GB2312/books/handbook/boot/chapter.sgml,v 1.5 2006/12/05 02:36:13 delphij Exp $ --> FreeBSD 引导过程 @@ -614,12 +614,12 @@ 这个变量是在 loader 里面设置的。 - 自动重启队列 + 自动重启过程 - 自动重启队列保证了可用的文件系统是稳定的。 - 如果不是,且 &man.fsck.8; 不能修复这些错误, - &man.init.8; 会进入单用户模式 - 以便系统管理员直接解决问题。 + 自动重启过程会确认系统中可用的文件系统处于健康的状态。 + 如果不是, 而且使用 &man.fsck.8; 也无法修复这些问题, + &man.init.8; 会进入 单用户模式 + 以便系统管理员直接修正这些问题。 @@ -628,12 +628,12 @@ 控制台 此模式可以通过 - 自动重启队列或者通过带有 + 自动重启过程 或者通过带有 选项的用户引导或通过在 loader 里设置 boot_single 变量等多种方式来达到。 - 也可以在多用户模式下调动无 reboot()选项和 - halt () 选项的 &man.shutdown.8; + 也可以在多用户模式下调动无重启 () 选项和停机 + () 选项的 &man.shutdown.8; 命令来进入单用户模式。 如果系统 控制台 在文件 @@ -683,19 +683,19 @@ - shutdown 队列 + 关机 (shutdown) 过程 shutdown - 由命令 &man.shutdown.8; 的控制, + 由命令 &man.shutdown.8; 的发起的关机过程中, &man.init.8; 会试着运行 /etc/rc.shutdown 脚本, - 给所有进程发送 TERM 信号,然后给不按时停止的进程发送 - KILL信号。 + 给所有进程发送 TERM 信号, 最后给不按时停止的进程发送 + KILL 信号。 - 在支持电源管理的体系上关闭 FreeBSD 系统的电源,只要简单的使用命令 - shutdown -p now 立即关闭电源。使用命令 - shutdown -r now 重启 FreeBSD。要执行 &man.shutdown.8; + 在支持电源管理的平台上关闭 FreeBSD 系统的电源, 只要简单地使用命令 + shutdown -p now 即可。 此外, 可以用命令 + shutdown -r now 来重启 FreeBSD。 要执行 &man.shutdown.8; 您必须是 root 用户或 operator 组的成员。 也可以使用 &man.halt.8; 和 &man.reboot.8; 命令来关闭系统, 请参看它们的联机手册以获得更多的信息。 ==== //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/config/chapter.sgml#9 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD Chinese Documentation Project - Original Revision: 1.223 - $FreeBSD: doc/zh_CN.GB2312/books/handbook/config/chapter.sgml,v 1.11 2006/10/27 06:37:47 delphij Exp $ + Original Revision: 1.225 + $FreeBSD: doc/zh_CN.GB2312/books/handbook/config/chapter.sgml,v 1.12 2006/12/05 02:36:13 delphij Exp $ --> @@ -1499,18 +1499,21 @@ sysctl.conf sysctl - sysctl.conf 看起来很像 - rc.conf。它用 variable=value - 的形式来设定值。指定的值在系统进入多用户模式之后被设定。 - 并不是所有的变量都可以在这个模式下设定。 + sysctl.conf 和 + rc.conf 这两个文件的风格很接近。 其中的配置均为 + 变量=值 + 这样的形式。 在这个文件中配置的值, 均会在系统进入多用户模式之后进行实际的修改操作。 + 需要注意的是, 并不是所有的变量都能够在多用户模式下修改。 + + 如果希望关闭对收到致命的信号退出的进程进行记录, + 并阻止普通用户看到其他用户的进程, 可以在 sysctl.conf + 中进行下列配置: - 一个简单的例子举明了在 sysctl.conf - 中关闭了重要的退出信号的日志并且让 Linux 程序知道他们其实运行在 - &os; 下面: + # 不记录由于致命信号导致的进程退出 (例如信号 11,访问越界) +kern.logsigexit=0 - kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11) -compat.linux.osname=&os; -compat.linux.osrelease=4.3-STABLE +# 阻止用户看到以其他用户 UID 身份执行的进程。 +security.bsd.see_other_uids=0 @@ -1873,10 +1876,10 @@ 在大型生产服务器上, 可能会轻易地用掉数千个文件描述符, 具体用量取决于服务的类型和并行启动的服务数量。 - 在早期版本的 &os; 中, kern.maxfile 的默认值, + 在早期版本的 &os; 中, kern.maxfiles 的默认值, 是根据您内核配置文件中的 选项计算的。 kern.maxfiles 这个数值, - 会与 成比例增减。 + 会随 成比例地增减。 当编译定制的内核时, 按照您系统的用途来修改这个值是个好主意。 这个数字同时还决定内核的许多预设的限制值。 有时, 尽管并不会真的有 256 个用户同时连接一台生产服务器, ==== //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/desktop/chapter.sgml#6 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD Chinese Project - Original Revision: 1.66 - $FreeBSD: doc/zh_CN.GB2312/books/handbook/desktop/chapter.sgml,v 1.7 2006/09/15 05:41:06 delphij Exp $ + Original Revision: 1.67 + $FreeBSD: doc/zh_CN.GB2312/books/handbook/desktop/chapter.sgml,v 1.8 2006/12/05 02:36:13 delphij Exp $ --> @@ -557,7 +557,7 @@ 安装 OpenOffice.org 方法如下: - &prompt.root; pkg_add -r openoffice + &prompt.root; pkg_add -r openoffice.org 如果您正在使用 &os; 的 -RELEASE 版本, 一般来说这样做是没问题的。 @@ -581,7 +581,7 @@ package,您仍旧可以选择编译 port。然而, 您必须记住它的要求以及大量的磁盘空间和相当长的时间编译。 - &prompt.root; cd /usr/ports/editors/openoffice.org-2.0 + &prompt.root; cd /usr/ports/editors/openoffice.org-2 &prompt.root; make install clean ==== //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/install/chapter.sgml#12 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD Simplified Chinese Project - Original Revision: 1.337 - $FreeBSD: doc/zh_CN.GB2312/books/handbook/install/chapter.sgml,v 1.14 2006/11/17 14:51:01 delphij Exp $ + Original Revision: 1.338 + $FreeBSD: doc/zh_CN.GB2312/books/handbook/install/chapter.sgml,v 1.15 2006/12/05 02:36:13 delphij Exp $ --> @@ -2016,7 +2016,7 @@ 本范例中的IP地址属于一个C类地址 (192.168.0.0 - - 192.168.255.255)。默认的子网掩码为 + 192.168.0.255)。默认的子网掩码为 (255.255.255.0)。 ==== //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/mirrors/chapter.sgml#8 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD Chinese Documentation Project - Original Revision: 1.420 - $FreeBSD: doc/zh_CN.GB2312/books/handbook/mirrors/chapter.sgml,v 1.10 2006/08/26 13:45:54 delphij Exp $ + Original Revision: 1.421 + $FreeBSD: doc/zh_CN.GB2312/books/handbook/mirrors/chapter.sgml,v 1.11 2006/12/05 02:36:13 delphij Exp $ --> @@ -2624,6 +2624,14 @@ + RELENG_6_2_0_RELEASE + + + FreeBSD 6.2 + + + + RELENG_6_1_0_RELEASE ==== //depot/projects/dtrace/doc/zh_CN.GB2312/books/handbook/x11/chapter.sgml#11 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD Simplified Chinese Project - Original Revision: 1.177 - $FreeBSD: doc/zh_CN.GB2312/books/handbook/x11/chapter.sgml,v 1.16 2006/11/17 14:59:43 delphij Exp $ + Original Revision: 1.178 + $FreeBSD: doc/zh_CN.GB2312/books/handbook/x11/chapter.sgml,v 1.17 2006/12/05 02:36:13 delphij Exp $ --> @@ -663,7 +663,7 @@ x11-fonts/ttmkfdir 中找到。 &prompt.root; cd /usr/X11R6/lib/X11/fonts/TrueType -&prompt.root; ttmkfdir > fonts.dir +&prompt.root; ttmkfdir -o fonts.dir 现在把 &truetype; 字体目录添加到字体路径中。 这和上面 Type1 字体的步骤是一样的, ==== //depot/projects/dtrace/doc/zh_CN.GB2312/books/porters-handbook/book.sgml#14 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD Simplified Chinese Project - Original Revision: 1.769 - $FreeBSD: doc/zh_CN.GB2312/books/porters-handbook/book.sgml,v 1.19 2006/11/17 15:01:43 delphij Exp $ + Original Revision: 1.772 + $FreeBSD: doc/zh_CN.GB2312/books/porters-handbook/book.sgml,v 1.20 2006/12/05 02:36:13 delphij Exp $ --> + + 自动激活的特性 + + 在使用 GNU configure 脚本时, 一定要小心有些特性会由其自动检测而激活。 + 您应通过明确地指定相应的 + --without-xxx--disable-xxx + 参数到 CONFIGURE_ARGS 来禁用不希望的特性。 + + + 处理选项时的错误做法 + .if defined(WITH_FOO) +LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo +CONFIGURE_ARGS+= --enable-foo +.endif + + + 在前面的例子中, 假设系统中已经安装了 libfoo 库。 用户可能并不希望应用程序使用 libfoo, + 因此他在 make config 对话框中关掉了这个选项。 + 但是, 应用程序的 configure 脚本检测到了系统中存在这个库, + 并将其加入到了最终可执行文件支持的功能中。 现在, 如果用户决定从系统中卸载 libfoo 时, + ports 系统就无法保护这个应用程序免遭破坏了 (因为没有记录 libfoo 的依赖关系)。 + + + 处理选项时的正确做法 + .if defined(WITH_FOO) +LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo +CONFIGURE_ARGS+= --enable-foo +.else +CONFIGURE_ARGS+= --disable-foo +.endif + + + 在第二个例子中, libfoo 库被明确禁用。 即使系统中已经安装了这个库, + configure 脚本也不会启用相应的功能了。 + + @@ -6436,6 +6472,44 @@ 而无需 WX_PREMK 的参与。 + + + 额外的 <command>configure</command> 参数 + + 某些 GNU configure 脚本在只设置了 + WX_CONFIG 环境变量时, 无法自动找到 + wxWidgets, 而需要使用额外的参数来加以指定。 + 您可以使用 WX_CONF_ARGS 变量来给出这些参数。 + + + 可用于 <makevar>WX_CONF_ARGS</makevar> 的值 + + + + + 可用值 + + 结果 + + + + + + absolute + + --with-wx-config=${WX_CONFIG} + + + + relative + + --with-wx=${X11BASE} + --with-wx-config=${WX_CONFIG:T} + + + +
+
@@ -9962,6 +10036,10 @@ 加入了 libelf 之后的 7.0-CURRENT。 700025 + + 对音效相关的 sysctl 进行大幅调整之后的 7.0-CURRENT。 + 700026 + ==== //depot/projects/dtrace/src/sys/powerpc/include/pmap.h#4 (text+ko) ==== @@ -29,7 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: pmap.h,v 1.17 2000/03/30 16:18:24 jdolecek Exp $ - * $FreeBSD: src/sys/powerpc/include/pmap.h,v 1.19 2005/12/06 21:09:01 jhb Exp $ + * $FreeBSD: src/sys/powerpc/include/pmap.h,v 1.20 2006/12/05 04:01:52 grehan Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -95,7 +95,7 @@ void pmap_deactivate(struct thread *); vm_offset_t pmap_kextract(vm_offset_t); int pmap_dev_direct_mapped(vm_offset_t, vm_size_t); - +boolean_t pmap_page_executable(vm_page_t); boolean_t pmap_mmu_install(char *name, int prio); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) ==== //depot/projects/dtrace/src/sys/powerpc/powerpc/mmu_if.m#6 (text+ko) ==== @@ -23,7 +23,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/sys/powerpc/powerpc/mmu_if.m,v 1.6 2006/08/01 19:06:05 alc Exp $ +# $FreeBSD: src/sys/powerpc/powerpc/mmu_if.m,v 1.7 2006/12/05 04:01:52 grehan Exp $ # #include @@ -752,3 +752,17 @@ vm_offset_t _pa; vm_size_t _size; }; + + +/** + * @brief Evaluate if a physical page has an executable mapping + * + * @param _pg physical page + * + * @retval bool TRUE if a physical mapping exists for the given page. + */ +METHOD boolean_t page_executable { + mmu_t _mmu; + vm_page_t _pg; +}; + ==== //depot/projects/dtrace/src/sys/powerpc/powerpc/mmu_oea.c#9 (text+ko) ==== @@ -91,7 +91,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/mmu_oea.c,v 1.113 2006/11/30 08:13:06 grehan Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/mmu_oea.c,v 1.114 2006/12/05 04:01:52 grehan Exp $"); /* * Manages physical address maps. @@ -342,6 +342,7 @@ vm_offset_t moea_kextract(mmu_t, vm_offset_t); void moea_kenter(mmu_t, vm_offset_t, vm_offset_t); boolean_t moea_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +boolean_t moea_page_executable(mmu_t, vm_page_t); static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_change_wiring, moea_change_wiring), @@ -380,6 +381,7 @@ MMUMETHOD(mmu_kextract, moea_kextract), MMUMETHOD(mmu_kenter, moea_kenter), MMUMETHOD(mmu_dev_direct_mapped,moea_dev_direct_mapped), + MMUMETHOD(mmu_page_executable, moea_page_executable), { 0, 0 } }; @@ -2453,6 +2455,12 @@ return (EFAULT); } +boolean_t +moea_page_executable(mmu_t mmu, vm_page_t pg) +{ + return ((moea_attr_fetch(pg) & PTE_EXEC) == PTE_EXEC); +} + /* * Map a set of physical memory pages into the kernel virtual * address space. Return a pointer to where it is mapped. This ==== //depot/projects/dtrace/src/sys/powerpc/powerpc/pmap_dispatch.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/pmap_dispatch.c,v 1.8 2006/11/11 20:57:52 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/pmap_dispatch.c,v 1.9 2006/12/05 04:01:52 grehan Exp $"); /* * Dispatch MI pmap calls to the appropriate MMU implementation @@ -345,6 +345,11 @@ return (MMU_DEV_DIRECT_MAPPED(mmu_obj, pa, size)); } +boolean_t +pmap_page_executable(vm_page_t pg) +{ + return (MMU_PAGE_EXECUTABLE(mmu_obj, pg)); +} /* * MMU install routines. Highest priority wins, equal priority also ==== //depot/projects/dtrace/src/sys/powerpc/powerpc/uio_machdep.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/uio_machdep.c,v 1.5 2005/01/07 02:29:20 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/uio_machdep.c,v 1.6 2006/12/05 04:01:52 grehan Exp $"); #include #include @@ -49,6 +49,7 @@ #include #include +#include #include /* @@ -92,10 +93,13 @@ uio_yield(); if (uio->uio_rw == UIO_READ) error = copyout(cp, iov->iov_base, cnt); - else + else error = copyin(iov->iov_base, cp, cnt); if (error) goto out; + if (uio->uio_rw == UIO_WRITE && + pmap_page_executable(ma[offset >> PAGE_SHIFT])) + __syncicache(cp, cnt); break; case UIO_SYSSPACE: if (uio->uio_rw == UIO_READ) ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/hcall.S#9 (text+ko) ==== @@ -1,1433 +1,1850 @@ -/* - * CDDL HEADER START +/*- + * Copyright (c) 2006 Kip Macy + * All rights reserved. * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END + * $FreeBSD: src/sys/sun4v/sun4v/hcall.S,v 1.17 2006/11/26 04:37:49 kmacy Exp $ */ -/* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ -#pragma ident "@(#)hcall.s 1.10 05/09/28 SMI" - -/* - * Hypervisor calls - */ -#define _ASM - +#include + #include -__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/hcall.S,v 1.3 2006/11/08 22:16:05 kmacy Exp $") - #include #include -#include +#include #include #include "assym.s" +/* + * Section 9 API Versioning + * + */ -#if defined(lint) -#error lint -#endif -#if defined(__lint) -#error __lint -#endif -#if defined(lint) || defined(__lint) +/* + * request and check for a version of the hypervisor apis + * which may be compatible + * + * arg0 api_group (%o0) + * arg1 major_number (%o1) + * arg2 req_minor_number (%o2) + * + * ret0 status (%o0) + * ret1 act_minor_number (%o1) + * + */ +ENTRY(api_set_version) + mov API_SET_VERSION, %o5 + ta CORE_TRAP + retl + stx %o1, [%o3] +END(api_set_version) -/*ARGSUSED*/ -int64_t -hv_cnputchar(uint8_t ch) -{ return (0); } +/* + * retrieve the major and minor number of the most recently + * successfully negotiated API + * + * arg0 api_group (%o0) + * + * ret0 status (%o0) + * ret1 major_number (%o1) + * ret2 major_number (%o2) + * + */ +ENTRY(api_get_version) + mov %o2, %o4 + mov %o1, %o3 + mov API_GET_VERSION, %o5 + ta CORE_TRAP + retl + stx %o1, [%o4] + +END(api_get_version) + +/* + * Section 10 Domain Services + * + */ -/*ARGSUSED*/ -int64_t -hv_cngetchar(uint8_t *ch) -{ return (0); } +/* + * stop all CPUs in the virtual machine domain and place them + * in the stopped state + * + * arg0 exit_code (%o0) + * + */ +ENTRY(hv_mach_exit) + mov MACH_EXIT, %o5 + ta FAST_TRAP + retl + nop +END(hv_mach_exit) + +/* + * copy the most current machine description into buffer + * upon success or EINVAL the service returns the actual + * size of the machine description + * + * arg0 buffer (%o0) + * arg1 length (%o1) + * + * ret0 status (%o0) + * ret1 length (%o1) + * + */ +ENTRY(hv_mach_desc) + mov %o1, %o2 + ldx [%o1], %o1 + mov MACH_DESC, %o5 + ta FAST_TRAP + retl + stx %o1, [%o2] +END(hv_mach_desc) -/*ARGSUSED*/ -uint64_t -hv_tod_get(uint64_t *seconds) -{ return (0); } +/* + * execute a software initiated reset of a virtual machine domain + * + */ +ENTRY(hv_mach_sir) + mov MACH_SIR, %o5 + ta FAST_TRAP + retl + nop +END(hv_mach_sir) + +/* + * report the guests soft state to the hypervisor + * + * arg0 soft_state (%o0) + * arg1 soft_state_desc_ptr (%o1) + * + * ret0 status (%o0) + * + */ +ENTRY(hv_mach_set_soft_state) + mov MACH_SET_SOFT_STATE, %o5 + ta FAST_TRAP + retl + nop +END(hv_mach_set_soft_state) + +/* + * retrieve the current value of the guest's software state + * + * arg0 soft_desc_ptr (%o0) + * + * ret0 status (%o0) + * arg1 soft_state (%o1) + * + */ +ENTRY(hv_mach_get_soft_state) + mov %o1, %o2 + mov MACH_SET_SOFT_STATE, %o5 + ta FAST_TRAP + retl + stx %o1, [%o2] +END(hv_mach_get_soft_state) + +/* + * set a watchdog timer, 0 disables, upon success + * time_remaining contains the time previously remaining + * + * arg0 timeout (%o0) + * + * ret0 status (%o0) + * ret1 time_remaining (%o1) + * + */ +ENTRY(hv_mach_watchdog) + mov %o1, %o2 + mov MACH_WATCHDOG, %o5 + ta FAST_TRAP + brnz,pn %o0, 1f + nop + stx %o1, [%o2] +1: retl + nop +END(hv_mach_watchdog) + +/* + * Section 11 CPU Services + * + */ -/*ARGSUSED*/ -uint64_t -hv_tod_set(uint64_t seconds) -{ return (0);} +/* + * start CPU with id cpuid with pc in %pc and real trap base address + * of rtba + * + * arg0 cpuid (%o0) + * arg1 pc (%o1) + * arg2 rtba (%o2) + * arg3 target_arg0 (%o3) + * + * ret0 status (%o0) + * + */ +ENTRY(hv_cpu_start) + mov CPU_START, %o5 + ta FAST_TRAP + retl + nop +END(hv_cpu_start) -/*ARGSUSED*/ -uint64_t -hv_mmu_map_perm_addr(void *vaddr, int ctx, uint64_t tte, int flags) -{ return (0); } +/* + * stop CPU with id cpuid + * + * arg0 cpuid (%o0) + * + * ret0 status (%o0) + * + */ +ENTRY(hv_cpu_stop) + mov CPU_STOP, %o5 + ta FAST_TRAP + retl + nop +END(hv_cpu_stop) -/*ARGSUSED*/ -uint64_t -hv_mmu_unmap_perm_addr(void *vaddr, int ctx, int flags) -{ return (0); } +/* + * set the real trap base address of the local cpu to rtba + * upon success the previous_rtba contains the address of the + * old rtba + * + * arg0 rtba (%o0) + * + * ret0 status (%o0) + * ret1 previous_rtba(%o1) + * + */ +ENTRY(hv_cpu_set_rtba) + mov %o1, %o2 + mov CPU_SET_RTBA, %o5 + ta FAST_TRAP + retl + stx %o1, [%o2] + +END(hv_cpu_set_rtba) -/*ARGSUSED*/ -uint64_t -hv_set_ctx0(uint64_t ntsb_descriptor, uint64_t desc_ra) -{ return (0); } +/* + * return the current real trap base address + * + * ret0 status (%o0) + * ret1 rtba (%o1) + * + */ +ENTRY(hv_cpu_get_rtba) + mov CPU_GET_RTBA, %o5 + ta FAST_TRAP + retl + nop +END(hv_cpu_get_rtba) + +/* + * suspend execution on current cpu + * + * ret0 status (%o0) + * + */ +ENTRY(hv_cpu_yield) + mov CPU_YIELD, %o5 + ta FAST_TRAP + retl + nop +END(hv_cpu_yield) -/*ARGSUSED*/ -uint64_t -hv_set_ctxnon0(uint64_t ntsb_descriptor, uint64_t desc_ra) -{ return (0); } +/* + * configure queue of size nentries to be placed at base raddr + * + * arg0 queue (%o0) + * arg1 base raddr (%o1) + * arg2 nentries (%o2) + * + * ret0 status (%o0) + * + */ +ENTRY(hv_cpu_qconf) + mov CPU_QCONF, %o5 + ta FAST_TRAP + retl + nop +END(hv_cpu_qconf) + +/* + * return configuration of queue queue + * + * arg0 queue (%o0) + * + * ret0 status (%o0) + * ret1 base raddr (%o1) + * ret2 nentries (%o2) + * + */ +ENTRY(hv_cpu_qinfo) +END(hv_cpu_qinfo) + +/* + * send cpu mondo interrupt to cpulist + * + * arg0 ncpus (%o0) + * arg1 cpu list ra (%o1) + * arg2 mondo data ra(%o2) + * + * ret0 status (%o0) + * + */ +ENTRY(hv_cpu_mondo_send) + ldx [PCPU(MONDO_DATA_RA)], %o2 + mov CPU_MONDO_SEND, %o5 + ta FAST_TRAP + retl + membar #Sync +END(hv_cpu_mondo_send) -#ifdef SET_MMU_STATS -/*ARGSUSED*/ -uint64_t -hv_mmu_set_stat_area(uint64_t rstatarea, uint64_t size) -{ return (0); } -#endif /* SET_MMU_STATS */ +/* + * return the hypervisor id for the current cpu + * + * ret0 status (%o0) + * ret1 cpuid (%o1) + * + */ +ENTRY(hv_cpu_myid) + mov %o0, %o2 + mov CPU_MYID, %o5 + ta FAST_TRAP + stx %o1, [%o2] + retl + nop +END(hv_cpu_myid) -/*ARGSUSED*/ -uint64_t -hv_cpu_qconf(int queue, uint64_t paddr, int size) -{ return (0); } +/* + * retrieve the current state of cpu cpuid + * + * arg0 cpuid (%o0) + * + * ret0 status (%o0) + * ret1 state (%o1) + * + */ +ENTRY(hv_cpu_state) + mov %o1, %o2 + mov CPU_STATE, %o5 + ta FAST_TRAP + stx %o1, [%o2] + retl + nop +END(hv_cpu_state) + +/* + * Section 12 MMU Services + * + */ + +/* + * set the tsb(s) for the current cpu for context 0 + * + * arg0 ntsb (%o0) + * arg1 tsbdptr (%o1) + * + * ret0 status (%o0) + * + */ +ENTRY(hv_mmu_tsb_ctx0) + mov MMU_TSB_CTX0, %o5 + ta FAST_TRAP + retl + nop +END(hv_mmu_tsb_ctx0) -/*ARGSUSED*/ -uint64_t -hvio_config_get(devhandle_t dev_hdl, pci_device_t bdf, - pci_config_offset_t off, pci_config_size_t size, pci_cfg_data_t *data_p) -{ return (0); } +/* + * set the tsb(s) for the current cpu for non-zero contexts + * + * arg0 ntsb (%o0) + * arg1 tsbptr (%o1) + * + * ret0 status (%o0) + * >>> TRUNCATED FOR MAIL (1000 lines) <<<