From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 00:09:57 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E1CD10656DF; Mon, 29 Mar 2010 00:09:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 493CE8FC54; Mon, 29 Mar 2010 00:09:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T09uZu087603; Mon, 29 Mar 2010 00:09:56 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T09uvO087600; Mon, 29 Mar 2010 00:09:56 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003290009.o2T09uvO087600@svn.freebsd.org> From: Ed Maste Date: Mon, 29 Mar 2010 00:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205811 - stable/7/sys/dev/aac X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 00:09:57 -0000 Author: emaste Date: Mon Mar 29 00:09:56 2010 New Revision: 205811 URL: http://svn.freebsd.org/changeset/base/205811 Log: MFC r204264: Minor diff reduction with Adaptec's driver: in aac_release_command() set cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default. In every place it was set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow. Modified: stable/7/sys/dev/aac/aac.c stable/7/sys/dev/aac/aac_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/aac/aac.c ============================================================================== --- stable/7/sys/dev/aac/aac.c Mon Mar 29 00:08:58 2010 (r205810) +++ stable/7/sys/dev/aac/aac.c Mon Mar 29 00:09:56 2010 (r205811) @@ -1215,7 +1215,6 @@ aac_bio_command(struct aac_softc *sc, st cm->cm_complete = aac_bio_complete; cm->cm_private = bp; cm->cm_timestamp = time_uptime; - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; /* build the FIB */ fib = cm->cm_fib; @@ -1370,7 +1369,6 @@ aac_wait_command(struct aac_command *cm) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* Put the command on the ready queue and get things going */ - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; aac_enqueue_ready(cm); aac_startio(sc); error = msleep(cm, &sc->aac_io_lock, PRIBIO, "aacwait", 0); @@ -1420,6 +1418,7 @@ aac_release_command(struct aac_command * cm->cm_flags = 0; cm->cm_complete = NULL; cm->cm_private = NULL; + cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; cm->cm_fib->Header.XferState = AAC_FIBSTATE_EMPTY; cm->cm_fib->Header.StructType = AAC_FIBTYPE_TFIB; cm->cm_fib->Header.Flags = 0; Modified: stable/7/sys/dev/aac/aac_cam.c ============================================================================== --- stable/7/sys/dev/aac/aac_cam.c Mon Mar 29 00:08:58 2010 (r205810) +++ stable/7/sys/dev/aac/aac_cam.c Mon Mar 29 00:09:56 2010 (r205811) @@ -453,7 +453,6 @@ aac_cam_action(struct cam_sim *sim, unio cm->cm_complete = aac_cam_complete; cm->cm_private = ccb; cm->cm_timestamp = time_uptime; - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; fib->Header.XferState = AAC_FIBSTATE_HOSTOWNED | From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 00:14:47 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6342810656A7; Mon, 29 Mar 2010 00:14:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78F018FDD1; Mon, 29 Mar 2010 00:13:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T0DGTU088399; Mon, 29 Mar 2010 00:13:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T0DGIp088397; Mon, 29 Mar 2010 00:13:16 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003290013.o2T0DGIp088397@svn.freebsd.org> From: Ed Maste Date: Mon, 29 Mar 2010 00:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205812 - stable/7/sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 00:14:50 -0000 Author: emaste Date: Mon Mar 29 00:13:16 2010 New Revision: 205812 URL: http://svn.freebsd.org/changeset/base/205812 Log: MFC r205411: Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIA ioctl call, as it may sleep. Reviewed by: rwatson Modified: stable/7/sys/net/if_vlan.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_vlan.c ============================================================================== --- stable/7/sys/net/if_vlan.c Mon Mar 29 00:09:56 2010 (r205811) +++ stable/7/sys/net/if_vlan.c Mon Mar 29 00:13:16 2010 (r205812) @@ -1331,9 +1331,9 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd case SIOCGIFMEDIA: VLAN_LOCK(); if (TRUNK(ifv) != NULL) { - error = (*PARENT(ifv)->if_ioctl)(PARENT(ifv), - SIOCGIFMEDIA, data); + p = PARENT(ifv); VLAN_UNLOCK(); + error = (*p->if_ioctl)(p, SIOCGIFMEDIA, data); /* Limit the result to the parent's current config. */ if (error == 0) { struct ifmediareq *ifmr; From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 00:39:10 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF8081065674; Mon, 29 Mar 2010 00:39:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC9198FC19; Mon, 29 Mar 2010 00:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T0d9eC094293; Mon, 29 Mar 2010 00:39:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T0d9jt094287; Mon, 29 Mar 2010 00:39:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003290039.o2T0d9jt094287@svn.freebsd.org> From: Ed Maste Date: Mon, 29 Mar 2010 00:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205816 - stable/7/sys/dev/aac X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 00:39:10 -0000 Author: emaste Date: Mon Mar 29 00:39:09 2010 New Revision: 205816 URL: http://svn.freebsd.org/changeset/base/205816 Log: MFC aac(4) driver changes r204019: Include command type in COMMAND TIMEOUT messages to aid in debugging. r203885: Diff reduction with Adaptec's vendor driver. Driver version 2.1.9 chosen as that Adaptec version roughly corresponds with the current feature set merged to the in-tree driver. r203801: Garbage collect Falcon/PPC support that has not been used in released products, based on discussion with Adaptec. r198617: Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver. Modified: stable/7/sys/dev/aac/aac.c stable/7/sys/dev/aac/aac_cam.c stable/7/sys/dev/aac/aac_pci.c stable/7/sys/dev/aac/aacreg.h stable/7/sys/dev/aac/aacvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/aac/aac.c ============================================================================== --- stable/7/sys/dev/aac/aac.c Mon Mar 29 00:30:44 2010 (r205815) +++ stable/7/sys/dev/aac/aac.c Mon Mar 29 00:39:09 2010 (r205816) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); /* * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters. */ -#define AAC_DRIVER_VERSION 0x02000000 #define AAC_DRIVERNAME "aac" #include "opt_aac.h" @@ -107,28 +106,6 @@ static int aac_dequeue_fib(struct aac_so static int aac_enqueue_response(struct aac_softc *sc, int queue, struct aac_fib *fib); -/* Falcon/PPC interface */ -static int aac_fa_get_fwstatus(struct aac_softc *sc); -static void aac_fa_qnotify(struct aac_softc *sc, int qbit); -static int aac_fa_get_istatus(struct aac_softc *sc); -static void aac_fa_clear_istatus(struct aac_softc *sc, int mask); -static void aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command, - u_int32_t arg0, u_int32_t arg1, - u_int32_t arg2, u_int32_t arg3); -static int aac_fa_get_mailbox(struct aac_softc *sc, int mb); -static void aac_fa_set_interrupts(struct aac_softc *sc, int enable); - -struct aac_interface aac_fa_interface = { - aac_fa_get_fwstatus, - aac_fa_qnotify, - aac_fa_get_istatus, - aac_fa_clear_istatus, - aac_fa_set_mailbox, - aac_fa_get_mailbox, - aac_fa_set_interrupts, - NULL, NULL, NULL -}; - /* StrongARM interface */ static int aac_sa_get_fwstatus(struct aac_softc *sc); static void aac_sa_qnotify(struct aac_softc *sc, int qbit); @@ -2378,8 +2355,9 @@ aac_timeout(struct aac_softc *sc) /* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) { cm->cm_flags |= AAC_CMD_TIMEDOUT; device_printf(sc->aac_dev, - "COMMAND %p TIMEOUT AFTER %d SECONDS\n", - cm, (int)(time_uptime-cm->cm_timestamp)); + "COMMAND %p (TYPE %d) TIMEOUT AFTER %d SECONDS\n", + cm, cm->cm_fib->Header.Command, + (int)(time_uptime-cm->cm_timestamp)); AAC_PRINT_FIB(sc, cm->cm_fib); timedout++; } @@ -2420,17 +2398,6 @@ aac_rx_get_fwstatus(struct aac_softc *sc } static int -aac_fa_get_fwstatus(struct aac_softc *sc) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM0_GETREG4(sc, AAC_FA_FWSTATUS); - return (val); -} - -static int aac_rkt_get_fwstatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2460,15 +2427,6 @@ aac_rx_qnotify(struct aac_softc *sc, int } static void -aac_fa_qnotify(struct aac_softc *sc, int qbit) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL1, qbit); - AAC_FA_HACK(sc); -} - -static void aac_rkt_qnotify(struct aac_softc *sc, int qbit) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2496,17 +2454,6 @@ aac_rx_get_istatus(struct aac_softc *sc) } static int -aac_fa_get_istatus(struct aac_softc *sc) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM0_GETREG2(sc, AAC_FA_DOORBELL0); - return (val); -} - -static int aac_rkt_get_istatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2534,15 +2481,6 @@ aac_rx_clear_istatus(struct aac_softc *s } static void -aac_fa_clear_istatus(struct aac_softc *sc, int mask) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL0_CLEAR, mask); - AAC_FA_HACK(sc); -} - -static void aac_rkt_clear_istatus(struct aac_softc *sc, int mask) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2580,24 +2518,6 @@ aac_rx_set_mailbox(struct aac_softc *sc, } static void -aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command, - u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX, command); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 4, arg0); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 8, arg1); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 12, arg2); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 16, arg3); - AAC_FA_HACK(sc); -} - -static void aac_rkt_set_mailbox(struct aac_softc *sc, u_int32_t command, u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) { @@ -2630,17 +2550,6 @@ aac_rx_get_mailbox(struct aac_softc *sc, } static int -aac_fa_get_mailbox(struct aac_softc *sc, int mb) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM1_GETREG4(sc, AAC_FA_MAILBOX + (mb * 4)); - return (val); -} - -static int aac_rkt_get_mailbox(struct aac_softc *sc, int mb) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2679,20 +2588,6 @@ aac_rx_set_interrupts(struct aac_softc * } static void -aac_fa_set_interrupts(struct aac_softc *sc, int enable) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); - - if (enable) { - AAC_MEM0_SETREG2((sc), AAC_FA_MASK0_CLEAR, AAC_DB_INTERRUPTS); - AAC_FA_HACK(sc); - } else { - AAC_MEM0_SETREG2((sc), AAC_FA_MASK0, ~0); - AAC_FA_HACK(sc); - } -} - -static void aac_rkt_set_interrupts(struct aac_softc *sc, int enable) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); @@ -2875,10 +2770,8 @@ aac_describe_controller(struct aac_softc } device_printf(sc->aac_dev, "%s, aac driver %d.%d.%d-%d\n", adapter_type, - AAC_DRIVER_VERSION >> 24, - (AAC_DRIVER_VERSION >> 16) & 0xFF, - AAC_DRIVER_VERSION & 0xFF, - AAC_DRIVER_BUILD); + AAC_DRIVER_MAJOR_VERSION, AAC_DRIVER_MINOR_VERSION, + AAC_DRIVER_BUGFIX_LEVEL, AAC_DRIVER_BUILD); aac_release_sync_fib(sc); mtx_unlock(&sc->aac_io_lock); @@ -3363,10 +3256,16 @@ aac_rev_check(struct aac_softc *sc, cadd * Doctor up the response struct. */ rev_check_resp.possiblyCompatible = 1; - rev_check_resp.adapterSWRevision.external.ul = - sc->aac_revision.external.ul; + rev_check_resp.adapterSWRevision.external.comp.major = + AAC_DRIVER_MAJOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.minor = + AAC_DRIVER_MINOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.type = + AAC_DRIVER_TYPE; + rev_check_resp.adapterSWRevision.external.comp.dash = + AAC_DRIVER_BUGFIX_LEVEL; rev_check_resp.adapterSWRevision.buildNumber = - sc->aac_revision.buildNumber; + AAC_DRIVER_BUILD; return(copyout((caddr_t)&rev_check_resp, udata, sizeof(struct aac_rev_check_resp))); Modified: stable/7/sys/dev/aac/aac_cam.c ============================================================================== --- stable/7/sys/dev/aac/aac_cam.c Mon Mar 29 00:30:44 2010 (r205815) +++ stable/7/sys/dev/aac/aac_cam.c Mon Mar 29 00:39:09 2010 (r205816) @@ -211,7 +211,7 @@ aac_cam_action(struct cam_sim *sim, unio { struct aac_cam *camsc; struct aac_softc *sc; - struct aac_srb32 *srb; + struct aac_srb *srb; struct aac_fib *fib; struct aac_command *cm; @@ -354,7 +354,7 @@ aac_cam_action(struct cam_sim *sim, unio } fib = cm->cm_fib; - srb = (struct aac_srb32 *)&fib->data[0]; + srb = (struct aac_srb *)&fib->data[0]; cm->cm_datalen = 0; switch (ccb->ccb_h.flags & CAM_DIR_MASK) { @@ -405,10 +405,10 @@ aac_cam_action(struct cam_sim *sim, unio if (ccb->ccb_h.flags & CAM_DATA_PHYS) { /* Send a 32bit command */ fib->Header.Command = ScsiPortCommand; - srb->sg_map32.SgCount = 1; - srb->sg_map32.SgEntry[0].SgAddress = + srb->sg_map.SgCount = 1; + srb->sg_map.SgEntry[0].SgAddress = (uint32_t)(uintptr_t)csio->data_ptr; - srb->sg_map32.SgEntry[0].SgByteCount = + srb->sg_map.SgEntry[0].SgByteCount = csio->dxfer_len; } else { /* @@ -417,15 +417,15 @@ aac_cam_action(struct cam_sim *sim, unio */ cm->cm_data = (void *)csio->data_ptr; cm->cm_datalen = csio->dxfer_len; - cm->cm_sgtable = &srb->sg_map32; + cm->cm_sgtable = &srb->sg_map; } } else { /* XXX Need to handle multiple s/g elements */ panic("aac_cam: multiple s/g elements"); } } else { - srb->sg_map32.SgCount = 0; - srb->sg_map32.SgEntry[0].SgByteCount = 0; + srb->sg_map.SgCount = 0; + srb->sg_map.SgEntry[0].SgByteCount = 0; srb->data_len = 0; } @@ -461,7 +461,7 @@ aac_cam_action(struct cam_sim *sim, unio AAC_FIBSTATE_REXPECTED | AAC_FIBSTATE_NORM; fib->Header.Size = sizeof(struct aac_fib_header) + - sizeof(struct aac_srb32); + sizeof(struct aac_srb); aac_enqueue_ready(cm); aac_startio(cm->cm_sc); Modified: stable/7/sys/dev/aac/aac_pci.c ============================================================================== --- stable/7/sys/dev/aac/aac_pci.c Mon Mar 29 00:30:44 2010 (r205815) +++ stable/7/sys/dev/aac/aac_pci.c Mon Mar 29 00:39:09 2010 (r205816) @@ -435,10 +435,6 @@ aac_pci_attach(device_t dev) fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM"); sc->aac_if = aac_sa_interface; break; - case AAC_HWIF_FALCON: - fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Falcon/PPC"); - sc->aac_if = aac_fa_interface; - break; case AAC_HWIF_RKT: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS"); sc->aac_if = aac_rkt_interface; Modified: stable/7/sys/dev/aac/aacreg.h ============================================================================== --- stable/7/sys/dev/aac/aacreg.h Mon Mar 29 00:30:44 2010 (r205815) +++ stable/7/sys/dev/aac/aacreg.h Mon Mar 29 00:39:09 2010 (r205816) @@ -1363,7 +1363,7 @@ struct aac_close_command { /* * SCSI Passthrough structures */ -struct aac_srb32 { +struct aac_srb { u_int32_t function; u_int32_t bus; u_int32_t target; @@ -1374,7 +1374,7 @@ struct aac_srb32 { u_int32_t retry_limit; u_int32_t cdb_len; u_int8_t cdb[16]; - struct aac_sg_table sg_map32; + struct aac_sg_table sg_map; }; enum { @@ -1453,24 +1453,6 @@ enum { }; /* - * Register set for adapters based on the Falcon bridge and PPC core - */ - -#define AAC_FA_DOORBELL0_CLEAR 0x00 -#define AAC_FA_DOORBELL1_CLEAR 0x02 -#define AAC_FA_DOORBELL0 0x04 -#define AAC_FA_DOORBELL1 0x06 -#define AAC_FA_MASK0_CLEAR 0x08 -#define AAC_FA_MASK1_CLEAR 0x0a -#define AAC_FA_MASK0 0x0c -#define AAC_FA_MASK1 0x0e -#define AAC_FA_MAILBOX 0x10 -#define AAC_FA_FWSTATUS 0x2c /* Mailbox 7 */ -#define AAC_FA_INTSRC 0x900 - -#define AAC_FA_HACK(sc) (void)AAC_MEM0_GETREG4(sc, AAC_FA_INTSRC) - -/* * Register definitions for the Adaptec AAC-364 'Jalapeno I/II' adapters, based * on the SA110 'StrongArm'. */ Modified: stable/7/sys/dev/aac/aacvar.h ============================================================================== --- stable/7/sys/dev/aac/aacvar.h Mon Mar 29 00:30:44 2010 (r205815) +++ stable/7/sys/dev/aac/aacvar.h Mon Mar 29 00:39:09 2010 (r205816) @@ -37,6 +37,16 @@ #include #include +#define AAC_TYPE_DEVO 1 +#define AAC_TYPE_ALPHA 2 +#define AAC_TYPE_BETA 3 +#define AAC_TYPE_RELEASE 4 + +#define AAC_DRIVER_MAJOR_VERSION 2 +#define AAC_DRIVER_MINOR_VERSION 1 +#define AAC_DRIVER_BUGFIX_LEVEL 9 +#define AAC_DRIVER_TYPE AAC_TYPE_RELEASE + #ifndef AAC_DRIVER_BUILD # define AAC_DRIVER_BUILD 1 #endif @@ -319,7 +329,6 @@ struct aac_softc int aac_hwif; #define AAC_HWIF_I960RX 0 #define AAC_HWIF_STRONGARM 1 -#define AAC_HWIF_FALCON 2 #define AAC_HWIF_RKT 3 #define AAC_HWIF_NARK 4 #define AAC_HWIF_UNKNOWN -1 From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 06:56:18 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E1A106566B; Mon, 29 Mar 2010 06:56:18 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08B108FC15; Mon, 29 Mar 2010 06:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T6uHAv077648; Mon, 29 Mar 2010 06:56:17 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T6uH3r077646; Mon, 29 Mar 2010 06:56:17 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003290656.o2T6uH3r077646@svn.freebsd.org> From: Fabien Thomas Date: Mon, 29 Mar 2010 06:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205824 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 06:56:18 -0000 Author: fabient Date: Mon Mar 29 06:56:17 2010 New Revision: 205824 URL: http://svn.freebsd.org/changeset/base/205824 Log: MFC r205694: Handling SIGPIPE will cause deadlock/crash. Return an error immediatly in case of hard shutdown. Modified: stable/7/sys/dev/hwpmc/hwpmc_logging.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_logging.c Mon Mar 29 06:55:38 2010 (r205823) +++ stable/7/sys/dev/hwpmc/hwpmc_logging.c Mon Mar 29 06:56:17 2010 (r205824) @@ -298,7 +298,6 @@ pmclog_loop(void *arg) mtx_unlock(&pmc_kthread_mtx); -sigpipe_retry: /* process the request */ PMCDBG(LOG,WRI,2, "po=%p base=%p ptr=%p", po, lb->plb_base, lb->plb_ptr); @@ -322,9 +321,6 @@ sigpipe_retry: if (error) { /* XXX some errors are recoverable */ - if (error == EPIPE) - goto sigpipe_retry; - /* send a SIGIO to the owner and exit */ PROC_LOCK(p); psignal(p, SIGIO); From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 06:59:08 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D94C41065670; Mon, 29 Mar 2010 06:59:08 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADA308FC0C; Mon, 29 Mar 2010 06:59:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T6x80H078337; Mon, 29 Mar 2010 06:59:08 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T6x84s078335; Mon, 29 Mar 2010 06:59:08 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003290659.o2T6x84s078335@svn.freebsd.org> From: Fabien Thomas Date: Mon, 29 Mar 2010 06:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205826 - stable/7/usr.sbin/pmcstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 06:59:09 -0000 Author: fabient Date: Mon Mar 29 06:59:08 2010 New Revision: 205826 URL: http://svn.freebsd.org/changeset/base/205826 Log: MFC r205693: Do not overflow the term in the case of multi-line display. Modified: stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Directory Properties: stable/7/usr.sbin/pmcstat/ (props changed) Modified: stable/7/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Mon Mar 29 06:57:43 2010 (r205825) +++ stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Mon Mar 29 06:59:08 2010 (r205826) @@ -366,7 +366,7 @@ pmcpl_ct_node_cleartag(void) static int pmcpl_ct_node_dumptop(int pmcin, struct pmcpl_ct_node *ct, - struct pmcpl_ct_sample *rsamples, int x, int *y) + struct pmcpl_ct_sample *rsamples, int x, int *y, int maxy) { int i; @@ -387,7 +387,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct if (ct->pct_narc == 0) { pmcpl_ct_topscreen[x+1][*y] = NULL; if (*y >= PMCPL_CT_MAXLINE || - *y >= pmcstat_displayheight) + *y >= maxy) return 1; *y = *y + 1; for (i=0; i < x; i++) @@ -407,7 +407,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) { if (pmcpl_ct_node_dumptop(pmcin, ct->pct_arc[i].pcta_child, - rsamples, x+1, y)) + rsamples, x+1, y, maxy)) return 1; } } @@ -472,6 +472,9 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s /* Check for line wrap. */ width += ns_len + is_len + vs_len + 1; if (width >= pmcstat_displaywidth) { + maxy--; + if (y >= maxy) + break; PMCSTAT_PRINTW("\n%*s", indentwidth, space); width = indentwidth + ns_len + is_len + vs_len; } @@ -515,7 +518,7 @@ pmcpl_ct_topdisplay(void) for (i = 0; i < pmcpl_ct_root->pct_narc; i++) { if (pmcpl_ct_node_dumptop(pmcin, pmcpl_ct_root->pct_arc[i].pcta_child, - &rsamples, x, &y)) { + &rsamples, x, &y, pmcstat_displayheight - 2)) { break; } } From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 15:29:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 752BA106564A; Mon, 29 Mar 2010 15:29:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 630108FC1C; Mon, 29 Mar 2010 15:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TFT7D2094805; Mon, 29 Mar 2010 15:29:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TFT77W094804; Mon, 29 Mar 2010 15:29:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201003291529.o2TFT77W094804@svn.freebsd.org> From: Warner Losh Date: Mon, 29 Mar 2010 15:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205835 - stable/7/sys/dev/flash X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 15:29:07 -0000 Author: imp Date: Mon Mar 29 15:29:06 2010 New Revision: 205835 URL: http://svn.freebsd.org/changeset/base/205835 Log: MFC: r192058 - Remove nonexistent header file from includes list Modified: stable/7/sys/dev/flash/at45d.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/flash/at45d.c ============================================================================== --- stable/7/sys/dev/flash/at45d.c Mon Mar 29 13:20:52 2010 (r205834) +++ stable/7/sys/dev/flash/at45d.c Mon Mar 29 15:29:06 2010 (r205835) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 22:59:36 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D528106564A; Mon, 29 Mar 2010 22:59:36 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B58D8FC17; Mon, 29 Mar 2010 22:59:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TMxa32096738; Mon, 29 Mar 2010 22:59:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TMxa3S096736; Mon, 29 Mar 2010 22:59:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201003292259.o2TMxa3S096736@svn.freebsd.org> From: Doug Barton Date: Mon, 29 Mar 2010 22:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205867 - stable/7 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 22:59:36 -0000 Author: dougb Date: Mon Mar 29 22:59:35 2010 New Revision: 205867 URL: http://svn.freebsd.org/changeset/base/205867 Log: MFC r205290: MAKE_JUST_WORLDS Modified: stable/7/Makefile (contents, props changed) Modified: stable/7/Makefile ============================================================================== --- stable/7/Makefile Mon Mar 29 22:52:51 2010 (r205866) +++ stable/7/Makefile Mon Mar 29 22:59:35 2010 (r205867) @@ -295,6 +295,7 @@ universe_${target}: "check _.${target}.buildworld for details") @echo ">> ${target} buildworld completed on `LC_ALL=C date`" .endif +.if !defined(MAKE_JUST_WORLDS) .if exists(${.CURDIR}/sys/${target}/conf/NOTES) @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \ ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ @@ -310,6 +311,7 @@ universe_${target}: echo "${target} ${kernel} kernel failed," \ "check _.${target}.${kernel} for details") .endfor +.endif @echo ">> ${target} completed on `LC_ALL=C date`" .endfor universe: universe_epilogue From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 29 23:00:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09152106564A; Mon, 29 Mar 2010 23:00:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E70278FC08; Mon, 29 Mar 2010 23:00:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TN0jMO097070; Mon, 29 Mar 2010 23:00:45 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TN0jdo097059; Mon, 29 Mar 2010 23:00:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201003292300.o2TN0jdo097059@svn.freebsd.org> From: Doug Barton Date: Mon, 29 Mar 2010 23:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205868 - in stable/7: contrib/bind9 contrib/bind9/bin/named contrib/bind9/doc/arm contrib/bind9/doc/draft contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns lib/bind X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 23:00:46 -0000 Author: dougb Date: Mon Mar 29 23:00:45 2010 New Revision: 205868 URL: http://svn.freebsd.org/changeset/base/205868 Log: Update to 9.4-ESV-R1, the latest patchfix release which deals with the problems related to the handling of broken DNSSEC trust chains. This fix is only relevant for those who have DNSSEC validation enabled and configure trust anchors from third parties, either manually, or through a system like DLV. Added: stable/7/contrib/bind9/doc/draft/draft-ietf-6man-text-addr-representation-07.txt - copied unchanged from r205860, vendor/bind9/dist-9.4/doc/draft/draft-ietf-6man-text-addr-representation-07.txt stable/7/contrib/bind9/doc/draft/draft-ietf-behave-dns64-06.txt - copied unchanged from r205860, vendor/bind9/dist-9.4/doc/draft/draft-ietf-behave-dns64-06.txt stable/7/contrib/bind9/doc/draft/draft-ietf-dnsext-axfr-clarify-13.txt - copied unchanged from r205860, vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-axfr-clarify-13.txt stable/7/contrib/bind9/doc/draft/draft-ietf-dnsext-dnssec-gost-06.txt - copied unchanged from r205860, vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-gost-06.txt stable/7/contrib/bind9/doc/draft/draft-ietf-dnsext-rfc3597-bis-02.txt - copied unchanged from r205860, vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-rfc3597-bis-02.txt stable/7/contrib/bind9/doc/draft/draft-ietf-dnsop-dnssec-trust-history-01.txt - copied unchanged from r205860, vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-dnssec-trust-history-01.txt stable/7/contrib/bind9/doc/draft/draft-kerr-ixfr-only-01.txt - copied unchanged from r205860, vendor/bind9/dist-9.4/doc/draft/draft-kerr-ixfr-only-01.txt Deleted: stable/7/contrib/bind9/doc/draft/draft-ietf-6man-text-addr-representation-01.txt stable/7/contrib/bind9/doc/draft/draft-ietf-behave-dns64-01.txt stable/7/contrib/bind9/doc/draft/draft-ietf-dnsext-axfr-clarify-12.txt stable/7/contrib/bind9/doc/draft/draft-ietf-dnsext-dnssec-gost-05.txt stable/7/contrib/bind9/doc/draft/draft-ietf-dnsext-rfc3597-bis-00.txt Modified: stable/7/contrib/bind9/CHANGES stable/7/contrib/bind9/bin/named/server.c stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml stable/7/contrib/bind9/doc/arm/Bv9ARM.ch01.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch02.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch03.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch04.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch05.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch06.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch07.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch08.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch09.html stable/7/contrib/bind9/doc/arm/Bv9ARM.ch10.html stable/7/contrib/bind9/doc/arm/Bv9ARM.html stable/7/contrib/bind9/doc/arm/Bv9ARM.pdf stable/7/contrib/bind9/doc/arm/man.dig.html stable/7/contrib/bind9/doc/arm/man.dnssec-keygen.html stable/7/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/7/contrib/bind9/doc/arm/man.host.html stable/7/contrib/bind9/doc/arm/man.named-checkconf.html stable/7/contrib/bind9/doc/arm/man.named-checkzone.html stable/7/contrib/bind9/doc/arm/man.named.html stable/7/contrib/bind9/doc/arm/man.rndc-confgen.html stable/7/contrib/bind9/doc/arm/man.rndc.conf.html stable/7/contrib/bind9/doc/arm/man.rndc.html stable/7/contrib/bind9/lib/dns/include/dns/rdataset.h stable/7/contrib/bind9/lib/dns/include/dns/resolver.h stable/7/contrib/bind9/lib/dns/include/dns/result.h stable/7/contrib/bind9/lib/dns/include/dns/validator.h stable/7/contrib/bind9/lib/dns/ncache.c stable/7/contrib/bind9/lib/dns/rbtdb.c stable/7/contrib/bind9/lib/dns/rdatalist.c stable/7/contrib/bind9/lib/dns/rdataset.c stable/7/contrib/bind9/lib/dns/rdataslab.c stable/7/contrib/bind9/lib/dns/resolver.c stable/7/contrib/bind9/lib/dns/result.c stable/7/contrib/bind9/lib/dns/sdb.c stable/7/contrib/bind9/lib/dns/sdlz.c stable/7/contrib/bind9/lib/dns/validator.c stable/7/contrib/bind9/lib/dns/view.c stable/7/contrib/bind9/version stable/7/lib/bind/config.h Directory Properties: stable/7/contrib/bind9/ (props changed) stable/7/lib/bind/ (props changed) Modified: stable/7/contrib/bind9/CHANGES ============================================================================== --- stable/7/contrib/bind9/CHANGES Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/CHANGES Mon Mar 29 23:00:45 2010 (r205868) @@ -1,3 +1,7 @@ + --- 9.4-ESV-R1 released --- + +2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619] + --- 9.4-ESV released --- 2831. [security] Do not attempt to validate or cache Modified: stable/7/contrib/bind9/bin/named/server.c ============================================================================== --- stable/7/contrib/bind9/bin/named/server.c Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/bin/named/server.c Mon Mar 29 23:00:45 2010 (r205868) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.419.18.75 2009/07/11 04:30:49 marka Exp $ */ +/* $Id: server.c,v 1.419.18.77 2010/02/26 23:46:32 tbox Exp $ */ /*! \file */ @@ -4563,6 +4563,8 @@ dumpdone(void *arg, isc_result_t result) } if (dctx->cache != NULL) { dns_adb_dump(dctx->view->view->adb, dctx->fp); + dns_resolver_printbadcache(dctx->view->view->resolver, + dctx->fp); dns_db_detach(&dctx->cache); } if (dctx->dumpzones) { Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml ============================================================================== --- stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml Mon Mar 29 23:00:45 2010 (r205868) @@ -2,7 +2,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []> - + BIND 9 Administrator Reference Manual @@ -30,6 +30,7 @@ 2007 2008 2009 + 2010 Internet Systems Consortium, Inc. ("ISC") @@ -7422,6 +7423,13 @@ avoid-v6-udp-ports { 40000; range 50000 1800 (30 minutes). + + Lame-ttl also controls the amount of time DNSSEC + validation failures are cached. There is a minimum + of 30 seconds applied to bad cache entries if the + lame-ttl is set to less than 30 seconds. + + Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM.ch01.html ============================================================================== --- stable/7/contrib/bind9/doc/arm/Bv9ARM.ch01.html Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/doc/arm/Bv9ARM.ch01.html Mon Mar 29 23:00:45 2010 (r205868) @@ -1,5 +1,5 @@ - + @@ -45,17 +45,17 @@ @@ -71,7 +71,7 @@

-Scope of Document

+Scope of Document

The Berkeley Internet Name Domain (BIND) implements a @@ -87,7 +87,7 @@

-Organization of This Document

+Organization of This Document

In this document, Chapter 1 introduces the basic DNS and BIND concepts. Chapter 2 @@ -116,7 +116,7 @@

-Conventions Used in This Document

+Conventions Used in This Document

In this document, we use the following general typographic conventions: @@ -243,7 +243,7 @@

-The Domain Name System (DNS)

+The Domain Name System (DNS)

The purpose of this document is to explain the installation and upkeep of the BIND (Berkeley Internet @@ -253,7 +253,7 @@

-DNS Fundamentals

+DNS Fundamentals

The Domain Name System (DNS) is a hierarchical, distributed database. It stores information for mapping Internet host names to @@ -273,7 +273,7 @@

-Domains and Domain Names

+Domains and Domain Names

The data stored in the DNS is identified by domain names that are organized as a tree according to organizational or administrative boundaries. Each node of the tree, @@ -319,7 +319,7 @@

-Zones

+Zones

To properly operate a name server, it is important to understand the difference between a zone @@ -372,7 +372,7 @@

-Authoritative Name Servers

+Authoritative Name Servers

Each zone is served by at least one authoritative name server, @@ -389,7 +389,7 @@

-The Primary Master

+The Primary Master

The authoritative server where the master copy of the zone data is maintained is called the @@ -409,7 +409,7 @@

-Slave Servers

+Slave Servers

The other authoritative servers, the slave servers (also known as secondary servers) @@ -425,7 +425,7 @@

-Stealth Servers

+Stealth Servers

Usually all of the zone's authoritative servers are listed in NS records in the parent zone. These NS records constitute @@ -460,7 +460,7 @@

-Caching Name Servers

+Caching Name Servers

The resolver libraries provided by most operating systems are stub resolvers, meaning that they are not @@ -487,7 +487,7 @@

-Forwarding

+Forwarding

Even a caching name server does not necessarily perform the complete recursive lookup itself. Instead, it can @@ -514,7 +514,7 @@

-Name Servers in Multiple Roles

+Name Servers in Multiple Roles

The BIND name server can simultaneously act as Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM.ch02.html ============================================================================== --- stable/7/contrib/bind9/doc/arm/Bv9ARM.ch02.html Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/doc/arm/Bv9ARM.ch02.html Mon Mar 29 23:00:45 2010 (r205868) @@ -1,5 +1,5 @@ - + @@ -45,16 +45,16 @@

-Hardware requirements

+Hardware requirements

DNS hardware requirements have traditionally been quite modest. @@ -73,7 +73,7 @@

-CPU Requirements

+CPU Requirements

CPU requirements for BIND 9 range from i486-class machines @@ -84,7 +84,7 @@

-Memory Requirements

+Memory Requirements

The memory of the server has to be large enough to fit the cache and zones loaded off disk. The max-cache-size @@ -107,7 +107,7 @@

-Name Server Intensive Environment Issues

+Name Server Intensive Environment Issues

For name server intensive environments, there are two alternative configurations that may be used. The first is where clients and @@ -124,7 +124,7 @@

-Supported Operating Systems

+Supported Operating Systems

ISC BIND 9 compiles and runs on a large number of Unix-like operating systems, and on some versions of Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM.ch03.html ============================================================================== --- stable/7/contrib/bind9/doc/arm/Bv9ARM.ch03.html Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/doc/arm/Bv9ARM.ch03.html Mon Mar 29 23:00:45 2010 (r205868) @@ -1,5 +1,5 @@ - + @@ -47,14 +47,14 @@

Sample Configurations
-
A Caching-only Name Server
-
An Authoritative-only Name Server
+
A Caching-only Name Server
+
An Authoritative-only Name Server
-
Load Balancing
-
Name Server Operations
+
Load Balancing
+
Name Server Operations
-
Tools for Use With the Name Server Daemon
-
Signals
+
Tools for Use With the Name Server Daemon
+
Signals
@@ -68,7 +68,7 @@ Sample Configurations

-A Caching-only Name Server

+A Caching-only Name Server

The following sample configuration is appropriate for a caching-only name server for use by clients internal to a corporation. All @@ -95,7 +95,7 @@ zone "0.0.127.in-addr.arpa" {

-An Authoritative-only Name Server

+An Authoritative-only Name Server

This sample configuration is for an authoritative-only server that is the master server for "example.com" @@ -137,7 +137,7 @@ zone "eng.example.com" {

-Load Balancing

+Load Balancing

A primitive form of load balancing can be achieved in the DNS by using multiple records @@ -280,10 +280,10 @@ zone "eng.example.com" {

-Name Server Operations

+Name Server Operations

-Tools for Use With the Name Server Daemon

+Tools for Use With the Name Server Daemon

This section describes several indispensable diagnostic, administrative and monitoring tools available to the system @@ -739,7 +739,7 @@ controls {

-Signals

+Signals

Certain UNIX signals cause the name server to take specific actions, as described in the following table. These signals can Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM.ch04.html ============================================================================== --- stable/7/contrib/bind9/doc/arm/Bv9ARM.ch04.html Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/doc/arm/Bv9ARM.ch04.html Mon Mar 29 23:00:45 2010 (r205868) @@ -1,5 +1,5 @@ - + @@ -49,29 +49,29 @@

Dynamic Update
The journal file
Incremental Zone Transfers (IXFR)
-
Split DNS
-
Example split DNS setup
+
Split DNS
+
Example split DNS setup
TSIG
-
Generate Shared Keys for Each Pair of Hosts
-
Copying the Shared Secret to Both Machines
-
Informing the Servers of the Key's Existence
-
Instructing the Server to Use the Key
-
TSIG Key Based Access Control
-
Errors
+
Generate Shared Keys for Each Pair of Hosts
+
Copying the Shared Secret to Both Machines
+
Informing the Servers of the Key's Existence
+
Instructing the Server to Use the Key
+
TSIG Key Based Access Control
+
Errors
-
TKEY
-
SIG(0)
+
TKEY
+
SIG(0)
DNSSEC
-
Generating Keys
-
Signing the Zone
-
Configuring Servers
+
Generating Keys
+
Signing the Zone
+
Configuring Servers
-
IPv6 Support in BIND 9
+
IPv6 Support in BIND 9
-
Address Lookups Using AAAA Records
-
Address to Name Lookups Using Nibble Format
+
Address Lookups Using AAAA Records
+
Address to Name Lookups Using Nibble Format
@@ -205,7 +205,7 @@

-Split DNS

+Split DNS

Setting up different views, or visibility, of the DNS space to internal and external resolvers is usually referred to as a @@ -235,7 +235,7 @@

-Example split DNS setup

+Example split DNS setup

Let's say a company named Example, Inc. (example.com) @@ -481,7 +481,7 @@ nameserver 172.16.72.4

-Generate Shared Keys for Each Pair of Hosts

+Generate Shared Keys for Each Pair of Hosts

A shared secret is generated to be shared between host1 and host2. An arbitrary key name is chosen: "host1-host2.". The key name must @@ -489,7 +489,7 @@ nameserver 172.16.72.4

-Automatic Generation

+Automatic Generation

The following command will generate a 128-bit (16 byte) HMAC-MD5 key as described above. Longer keys are better, but shorter keys @@ -514,7 +514,7 @@ nameserver 172.16.72.4

-Manual Generation

+Manual Generation

The shared secret is simply a random sequence of bits, encoded in base-64. Most ASCII strings are valid base-64 strings (assuming @@ -529,7 +529,7 @@ nameserver 172.16.72.4

-Copying the Shared Secret to Both Machines

+Copying the Shared Secret to Both Machines

This is beyond the scope of DNS. A secure transport mechanism should be used. This could be secure FTP, ssh, telephone, etc. @@ -537,7 +537,7 @@ nameserver 172.16.72.4

-Informing the Servers of the Key's Existence

+Informing the Servers of the Key's Existence

Imagine host1 and host 2 are @@ -566,7 +566,7 @@ key host1-host2. {

-Instructing the Server to Use the Key

+Instructing the Server to Use the Key

Since keys are shared between two hosts only, the server must be told when keys are to be used. The following is added to the named.conf file @@ -598,7 +598,7 @@ server 10.1.2.3 {

-TSIG Key Based Access Control

+TSIG Key Based Access Control

BIND allows IP addresses and ranges to be specified in ACL @@ -626,7 +626,7 @@ allow-update { key host1-host2. ;};

-Errors

+Errors

The processing of TSIG signed messages can result in several errors. If a signed message is sent to a non-TSIG aware @@ -652,7 +652,7 @@ allow-update { key host1-host2. ;};

-TKEY

+TKEY

TKEY is a mechanism for automatically generating a shared secret between two hosts. There are several "modes" of @@ -688,7 +688,7 @@ allow-update { key host1-host2. ;};

-SIG(0)

+SIG(0)

BIND 9 partially supports DNSSEC SIG(0) transaction signatures as specified in RFC 2535 and RFC 2931. @@ -749,7 +749,7 @@ allow-update { key host1-host2. ;};

-Generating Keys

+Generating Keys

The dnssec-keygen program is used to generate keys. @@ -800,7 +800,7 @@ allow-update { key host1-host2. ;};

-Signing the Zone

+Signing the Zone

The dnssec-signzone program is used to @@ -844,7 +844,7 @@ allow-update { key host1-host2. ;};

-Configuring Servers

+Configuring Servers

To enable named to respond appropriately to DNS requests from DNSSEC aware clients, @@ -932,7 +932,7 @@ options {

-IPv6 Support in BIND 9

+IPv6 Support in BIND 9

BIND 9 fully supports all currently defined forms of IPv6 @@ -971,7 +971,7 @@ options {

-Address Lookups Using AAAA Records

+Address Lookups Using AAAA Records

The IPv6 AAAA record is a parallel to the IPv4 A record, and, unlike the deprecated A6 record, specifies the entire @@ -990,7 +990,7 @@ host 3600 IN AAAA

-Address to Name Lookups Using Nibble Format

+Address to Name Lookups Using Nibble Format

When looking up an address in nibble format, the address components are simply reversed, just as in IPv4, and Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM.ch05.html ============================================================================== --- stable/7/contrib/bind9/doc/arm/Bv9ARM.ch05.html Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/doc/arm/Bv9ARM.ch05.html Mon Mar 29 23:00:45 2010 (r205868) @@ -1,5 +1,5 @@ - + @@ -45,13 +45,13 @@

-The Lightweight Resolver Library

+The Lightweight Resolver Library

Traditionally applications have been linked with a stub resolver library that sends recursive DNS queries to a local caching name Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM.ch06.html ============================================================================== --- stable/7/contrib/bind9/doc/arm/Bv9ARM.ch06.html Mon Mar 29 22:59:35 2010 (r205867) +++ stable/7/contrib/bind9/doc/arm/Bv9ARM.ch06.html Mon Mar 29 23:00:45 2010 (r205868) @@ -1,5 +1,5 @@ - + @@ -48,52 +48,52 @@

Configuration File Elements
Address Match Lists
-
Comment Syntax
+
Comment Syntax
Configuration File Grammar
-
acl Statement Grammar
+
acl Statement Grammar
acl Statement Definition and Usage
-
controls Statement Grammar
+
controls Statement Grammar
controls Statement Definition and Usage
-
include Statement Grammar
-
include Statement Definition and +
include Statement Grammar
+
include Statement Definition and Usage
-
key Statement Grammar
-
key Statement Definition and Usage
-
logging Statement Grammar
-
logging Statement Definition and +
key Statement Grammar
+
key Statement Definition and Usage
+
logging Statement Grammar
+
logging Statement Definition and Usage
-
lwres Statement Grammar
-
lwres Statement Definition and Usage
-
masters Statement Grammar
-
masters Statement Definition and +
lwres Statement Grammar
+
lwres Statement Definition and Usage
+
masters Statement Grammar
+
masters Statement Definition and Usage
-
options Statement Grammar
+
options Statement Grammar
options Statement Definition and Usage
server Statement Grammar
server Statement Definition and Usage
-
trusted-keys Statement Grammar
-
trusted-keys Statement Definition +
trusted-keys Statement Grammar
+
trusted-keys Statement Definition and Usage
view Statement Grammar
-
view Statement Definition and Usage
+
view Statement Definition and Usage
zone Statement Grammar
-
zone Statement Definition and Usage
+
zone Statement Definition and Usage
-
Zone File
+
Zone File
Types of Resource Records and When to Use Them
-
Discussion of MX Records
+
Discussion of MX Records
Setting TTLs
-
Inverse Mapping in IPv4
-
Other Zone File Directives
-
BIND Master File Extension: the $GENERATE Directive
+
Inverse Mapping in IPv4
+
Other Zone File Directives
+
BIND Master File Extension: the $GENERATE Directive
Additional File Formats
@@ -455,7 +455,7 @@ Address Match Lists

-Syntax

+Syntax
address_match_list = address_match_list_element ;
   [ address_match_list_element; ... ]
 address_match_list_element = [ ! ] (ip_address [/length] |
@@ -464,7 +464,7 @@
 
 

-Definition and Usage

+Definition and Usage

Address match lists are primarily used to determine access control for various server operations. They are also used in @@ -542,7 +542,7 @@

-Comment Syntax

+Comment Syntax

The BIND 9 comment syntax allows for comments to appear @@ -552,7 +552,7 @@

-Syntax

+Syntax

/* This is a BIND comment as in C */
@@ -567,7 +567,7 @@

-Definition and Usage

+Definition and Usage

Comments may appear anywhere that whitespace may appear in a BIND configuration file. @@ -797,7 +797,7 @@

-acl Statement Grammar

+acl Statement Grammar
acl acl-name {
     address_match_list
 };
@@ -880,7 +880,7 @@
 
 

-controls Statement Grammar

+controls Statement Grammar
controls {
    [ inet ( ip_addr | * ) [ port ip_port ] allow {  address_match_list  }
                 keys { key_list }; ]
@@ -1002,12 +1002,12 @@
 
 

-include Statement Grammar

+include Statement Grammar
include filename;

-include Statement Definition and +include Statement Definition and Usage

The include statement inserts the @@ -1022,7 +1022,7 @@

-key Statement Grammar

+key Statement Grammar
key key_id {
     algorithm string;
     secret string;
@@ -1031,7 +1031,7 @@
 
 

-key Statement Definition and Usage

+key Statement Definition and Usage

The key statement defines a shared secret key for use with TSIG (see the section called “TSIG”) @@ -1078,7 +1078,7 @@

-logging Statement Grammar

+logging Statement Grammar
logging {
    [ channel channel_name {
      ( file path_name
@@ -1102,7 +1102,7 @@
 
 

-logging Statement Definition and +logging Statement Definition and Usage

The logging statement configures a @@ -1136,7 +1136,7 @@

-The channel Phrase

+The channel Phrase

All log output goes to one or more channels; you can make as many of them as you want. @@ -1665,7 +1665,7 @@ category notify { null; };

-The query-errors Category

+The query-errors Category

The query-errors category is specifically intended for debugging purposes: To identify @@ -1893,7 +1893,7 @@ badresp:1,adberr:0,findfail:0,valfail:0]

-lwres Statement Grammar

+lwres Statement Grammar

This is the grammar of the lwres statement in the named.conf file: @@ -1908,7 +1908,7 @@ badresp:1,adberr:0,findfail:0,valfail:0]

-lwres Statement Definition and Usage

+lwres Statement Definition and Usage

The lwres statement configures the name @@ -1959,14 +1959,14 @@ badresp:1,adberr:0,findfail:0,valfail:0]

-masters Statement Grammar

+masters Statement Grammar
 masters name [port ip_port] { ( masters_list | ip_addr [port ip_port] [key key] ) ; [...] };
 

-masters Statement Definition and +masters Statement Definition and Usage

masters lists allow for a common set of masters to be easily used by @@ -1975,7 +1975,7 @@ badresp:1,adberr:0,findfail:0,valfail:0]

-options Statement Grammar

+options Statement Grammar

This is the grammar of the options statement in the named.conf file: @@ -3086,7 +3086,7 @@ options {

-Forwarding

+Forwarding

The forwarding facility can be used to create a large site-wide cache on a few servers, reducing traffic over links to external @@ -3130,7 +3130,7 @@ options {

-Dual-stack Servers

+Dual-stack Servers

Dual-stack servers are used as servers of last resort to work around @@ -3286,7 +3286,7 @@ options {

-Interfaces

+Interfaces

The interfaces and ports that the server will answer queries from may be specified using the listen-on option. listen-on takes @@ -3719,7 +3719,7 @@ avoid-v6-udp-ports {};

-UDP Port Lists

+UDP Port Lists

use-v4-udp-ports, avoid-v4-udp-ports, @@ -3761,7 +3761,7 @@ avoid-v6-udp-ports { 40000; range 50000

-Operating System Resource Limits

+Operating System Resource Limits

The server's usage of many system resources can be limited. Scaled values are allowed when specifying resource limits. For @@ -3922,7 +3922,7 @@ avoid-v6-udp-ports { 40000; range 50000

-Periodic Task Intervals

+Periodic Task Intervals
cleaning-interval

*** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 12:01:35 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1A61106567D; Tue, 30 Mar 2010 12:01:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F9F48FC29; Tue, 30 Mar 2010 12:01:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UC1Zi9072522; Tue, 30 Mar 2010 12:01:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UC1ZbX072520; Tue, 30 Mar 2010 12:01:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201003301201.o2UC1ZbX072520@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Mar 2010 12:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205877 - stable/7/sys/dev/aac X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 12:01:35 -0000 Author: attilio Date: Tue Mar 30 12:01:35 2010 New Revision: 205877 URL: http://svn.freebsd.org/changeset/base/205877 Log: MFC r205160: Checkin a facility for specifying a passthrough FIB from userland. arcconf tool by Adaptec already seems to use for identifying the Serial Number of the devices. Sponsored by: Sandvine Incorporated Modified: stable/7/sys/dev/aac/aac.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/aac/aac.c ============================================================================== --- stable/7/sys/dev/aac/aac.c Tue Mar 30 11:46:43 2010 (r205876) +++ stable/7/sys/dev/aac/aac.c Tue Mar 30 12:01:35 2010 (r205877) @@ -3067,7 +3067,147 @@ out: static int aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg) { - return (EINVAL); + struct aac_command *cm; + struct aac_event *event; + struct aac_fib *fib; + struct aac_srb *srbcmd, *user_srb; + struct aac_sg_entry *sge; + struct aac_sg_entry64 *sge64; + void *srb_sg_address, *ureply; + uint32_t fibsize, srb_sg_bytecount; + int error, transfer_data; + + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + + cm = NULL; + transfer_data = 0; + fibsize = 0; + user_srb = (struct aac_srb *)arg; + + mtx_lock(&sc->aac_io_lock); + if (aac_alloc_command(sc, &cm)) { + event = malloc(sizeof(struct aac_event), M_AACBUF, + M_NOWAIT | M_ZERO); + if (event == NULL) { + error = EBUSY; + mtx_unlock(&sc->aac_io_lock); + goto out; + } + event->ev_type = AAC_EVENT_CMFREE; + event->ev_callback = aac_ioctl_event; + event->ev_arg = &cm; + aac_add_event(sc, event); + msleep(cm, &sc->aac_io_lock, 0, "aacraw", 0); + } + mtx_unlock(&sc->aac_io_lock); + + cm->cm_data = NULL; + fib = cm->cm_fib; + srbcmd = (struct aac_srb *)fib->data; + error = copyin(&user_srb->data_len, &fibsize, sizeof(uint32_t)); + if (error != 0) + goto out; + if (fibsize > (sc->aac_max_fib_size - sizeof(struct aac_fib_header))) { + error = EINVAL; + goto out; + } + error = copyin(user_srb, srbcmd, fibsize); + if (error != 0) + goto out; + srbcmd->function = 0; + srbcmd->retry_limit = 0; + if (srbcmd->sg_map.SgCount > 1) { + error = EINVAL; + goto out; + } + + /* Retrieve correct SG entries. */ + if (fibsize == (sizeof(struct aac_srb) + + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { + sge = srbcmd->sg_map.SgEntry; + sge64 = NULL; + srb_sg_bytecount = sge->SgByteCount; +#ifdef __amd64__ + srb_sg_address = (void *)(uint64_t)sge->SgAddress; +#else + srb_sg_address = (void *)sge->SgAddress; +#endif + } +#ifdef __amd64__ + else if (fibsize == (sizeof(struct aac_srb) + + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { + sge = NULL; + sge64 = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; + srb_sg_bytecount = sge64->SgByteCount; + srb_sg_address = (void *)sge64->SgAddress; + if (sge64->SgAddress > 0xffffffffull && + (sc->flags & AAC_FLAGS_SG_64BIT) == 0) { + error = EINVAL; + goto out; + } + } +#endif + else { + error = EINVAL; + goto out; + } + ureply = (char *)arg + fibsize; + srbcmd->data_len = srb_sg_bytecount; + if (srbcmd->sg_map.SgCount == 1) + transfer_data = 1; + + cm->cm_sgtable = (struct aac_sg_table *)&srbcmd->sg_map; + if (transfer_data) { + cm->cm_datalen = srb_sg_bytecount; + cm->cm_data = malloc(cm->cm_datalen, M_AACBUF, M_NOWAIT); + if (cm->cm_data == NULL) { + error = ENOMEM; + goto out; + } + if (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN) + cm->cm_flags |= AAC_CMD_DATAIN; + if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) { + cm->cm_flags |= AAC_CMD_DATAOUT; + error = copyin(srb_sg_address, cm->cm_data, + cm->cm_datalen); + if (error != 0) + goto out; + } + } + + fib->Header.Size = sizeof(struct aac_fib_header) + + sizeof(struct aac_srb); + fib->Header.XferState = + AAC_FIBSTATE_HOSTOWNED | + AAC_FIBSTATE_INITIALISED | + AAC_FIBSTATE_EMPTY | + AAC_FIBSTATE_FROMHOST | + AAC_FIBSTATE_REXPECTED | + AAC_FIBSTATE_NORM | + AAC_FIBSTATE_ASYNC | + AAC_FIBSTATE_FAST_RESPONSE; + fib->Header.Command = (sc->flags & AAC_FLAGS_SG_64BIT) != 0 ? + ScsiPortCommandU64 : ScsiPortCommand; + + mtx_lock(&sc->aac_io_lock); + aac_wait_command(cm); + mtx_unlock(&sc->aac_io_lock); + + if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN) != 0) { + error = copyout(cm->cm_data, srb_sg_address, cm->cm_datalen); + if (error != 0) + goto out; + } + error = copyout(fib->data, ureply, sizeof(struct aac_srb_response)); +out: + if (cm != NULL) { + if (cm->cm_data != NULL) + free(cm->cm_data, M_AACBUF); + mtx_lock(&sc->aac_io_lock); + aac_release_command(cm); + mtx_unlock(&sc->aac_io_lock); + } + return(error); } /* From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 12:08:00 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842DB106566C; Tue, 30 Mar 2010 12:08:00 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7264D8FC17; Tue, 30 Mar 2010 12:08:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UC80eC074019; Tue, 30 Mar 2010 12:08:00 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UC80hI074017; Tue, 30 Mar 2010 12:08:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201003301208.o2UC80hI074017@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Mar 2010 12:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205879 - stable/7/sys/dev/aac X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 12:08:00 -0000 Author: attilio Date: Tue Mar 30 12:08:00 2010 New Revision: 205879 URL: http://svn.freebsd.org/changeset/base/205879 Log: MFC r205167: Make the code more readable and compiling on 64-bits arch different than amd64. Sponsored by: Sandvine Incorporated Modified: stable/7/sys/dev/aac/aac.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/aac/aac.c ============================================================================== --- stable/7/sys/dev/aac/aac.c Tue Mar 30 12:06:18 2010 (r205878) +++ stable/7/sys/dev/aac/aac.c Tue Mar 30 12:08:00 2010 (r205879) @@ -3127,11 +3127,7 @@ aac_ioctl_send_raw_srb(struct aac_softc sge = srbcmd->sg_map.SgEntry; sge64 = NULL; srb_sg_bytecount = sge->SgByteCount; -#ifdef __amd64__ - srb_sg_address = (void *)(uint64_t)sge->SgAddress; -#else - srb_sg_address = (void *)sge->SgAddress; -#endif + srb_sg_address = (void *)(uintptr_t)sge->SgAddress; } #ifdef __amd64__ else if (fibsize == (sizeof(struct aac_srb) + From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 15:25:16 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 845D31065670; Tue, 30 Mar 2010 15:25:16 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7306B8FC15; Tue, 30 Mar 2010 15:25:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UFPGls017626; Tue, 30 Mar 2010 15:25:16 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UFPGtZ017624; Tue, 30 Mar 2010 15:25:16 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201003301525.o2UFPGtZ017624@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 30 Mar 2010 15:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205882 - stable/7/etc/rc.d X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 15:25:16 -0000 Author: jh Date: Tue Mar 30 15:25:16 2010 New Revision: 205882 URL: http://svn.freebsd.org/changeset/base/205882 Log: MFC r205121: Use an unique directory name instead of hardcoded /tmp/.diskless. A malicious user could create a file named /tmp/.diskless and cause the script to misbehave. PR: conf/141258 Modified: stable/7/etc/rc.d/tmp Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/rc.d/tmp ============================================================================== --- stable/7/etc/rc.d/tmp Tue Mar 30 13:55:15 2010 (r205881) +++ stable/7/etc/rc.d/tmp Tue Mar 30 15:25:16 2010 (r205882) @@ -49,8 +49,8 @@ case "${tmpmfs}" in [Nn][Oo]) ;; *) - if /bin/mkdir -p /tmp/.diskless 2> /dev/null; then - rmdir /tmp/.diskless + if _tmpdir=$(mktemp -d -q /tmp/.diskless.XXXXXX); then + rmdir ${_tmpdir} else if [ -h /tmp ]; then echo "*** /tmp is a symlink to a non-writable area!" From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 18:58:10 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBAD71065674; Tue, 30 Mar 2010 18:58:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A01808FC1A; Tue, 30 Mar 2010 18:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UIwArh064597; Tue, 30 Mar 2010 18:58:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UIwATh064594; Tue, 30 Mar 2010 18:58:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301858.o2UIwATh064594@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 18:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205889 - stable/7/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 18:58:10 -0000 Author: marius Date: Tue Mar 30 18:58:10 2010 New Revision: 205889 URL: http://svn.freebsd.org/changeset/base/205889 Log: MFC: r205393 - Remove a bogus forward declaration. - Fix whitespace. Modified: stable/7/lib/libc/sparc64/fpu/fpu_extern.h stable/7/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sparc64/fpu/fpu_extern.h ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_extern.h Tue Mar 30 18:58:08 2010 (r205888) +++ stable/7/lib/libc/sparc64/fpu/fpu_extern.h Tue Mar 30 18:58:10 2010 (r205889) @@ -41,7 +41,6 @@ #define _SPARC64_FPU_FPU_EXTERN_H_ struct utrapframe; -union instr; struct fpemu; struct fpn; @@ -61,9 +60,9 @@ struct fpn *__fpu_div(struct fpemu *); int __fpu_itof(struct fpn *, u_int); int __fpu_xtof(struct fpn *, u_int64_t); int __fpu_stof(struct fpn *, u_int); -int __fpu_dtof(struct fpn *, u_int, u_int ); -int __fpu_qtof(struct fpn *, u_int, u_int , u_int , u_int ); -void __fpu_explode(struct fpemu *, struct fpn *, int, int ); +int __fpu_dtof(struct fpn *, u_int, u_int); +int __fpu_qtof(struct fpn *, u_int, u_int, u_int, u_int); +void __fpu_explode(struct fpemu *, struct fpn *, int, int); /* fpu_implode.c */ u_int __fpu_ftoi(struct fpemu *, struct fpn *); Modified: stable/7/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 18:58:08 2010 (r205888) +++ stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 18:58:10 2010 (r205889) @@ -198,7 +198,6 @@ __fpu_ftoi(fe, fp) sign = fp->fp_sign; switch (fp->fp_class) { - case FPC_ZERO: return (0); @@ -248,7 +247,6 @@ __fpu_ftox(fe, fp, res) sign = fp->fp_sign; switch (fp->fp_class) { - case FPC_ZERO: res[1] = 0; return (0); @@ -504,7 +502,6 @@ __fpu_implode(fe, fp, type, space) { switch (type) { - case FTYPE_LNG: space[0] = __fpu_ftox(fe, fp, space); break; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:03:27 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE27D106566B; Tue, 30 Mar 2010 19:03:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD4F88FC16; Tue, 30 Mar 2010 19:03:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ3RBo065898; Tue, 30 Mar 2010 19:03:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ3Rpr065896; Tue, 30 Mar 2010 19:03:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301903.o2UJ3Rpr065896@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205891 - stable/7/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:03:28 -0000 Author: marius Date: Tue Mar 30 19:03:27 2010 New Revision: 205891 URL: http://svn.freebsd.org/changeset/base/205891 Log: MFC: r205394 Ensure that __fpu_ftox() both returns the high bits and res[1] contains the low bits also in the default case. PR: 144900 Obtained from: OpenBSD Modified: stable/7/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:03:26 2010 (r205890) +++ stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:03:27 2010 (r205891) @@ -248,8 +248,8 @@ __fpu_ftox(fe, fp, res) sign = fp->fp_sign; switch (fp->fp_class) { case FPC_ZERO: - res[1] = 0; - return (0); + i = 0; + goto done; case FPC_NUM: /* @@ -273,15 +273,17 @@ __fpu_ftox(fe, fp, res) break; if (sign) i = -i; - res[1] = (int)i; - return (i >> 32); + goto done; default: /* Inf, qNaN, sNaN */ break; } /* overflow: replace any inexact exception with invalid */ fe->fe_cx = (fe->fe_cx & ~FSR_NX) | FSR_NV; - return (0x7fffffffffffffffLL + sign); + i = 0x7fffffffffffffffLL + sign; +done: + res[1] = i & 0xffffffff; + return (i >> 32); } /* From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:05:12 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33468106566B; Tue, 30 Mar 2010 19:05:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0826F8FC08; Tue, 30 Mar 2010 19:05:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ5B7H066441; Tue, 30 Mar 2010 19:05:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ5Bjr066437; Tue, 30 Mar 2010 19:05:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301905.o2UJ5Bjr066437@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205894 - stable/7/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:05:12 -0000 Author: marius Date: Tue Mar 30 19:05:11 2010 New Revision: 205894 URL: http://svn.freebsd.org/changeset/base/205894 Log: MFC: r205395 FPU_DEBUG requires . PR: 144900 Submitted by: Peter Jeremy Modified: stable/7/lib/libc/sparc64/fpu/fpu.c stable/7/lib/libc/sparc64/fpu/fpu_explode.c stable/7/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sparc64/fpu/fpu.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu.c Tue Mar 30 19:05:08 2010 (r205893) +++ stable/7/lib/libc/sparc64/fpu/fpu.c Tue Mar 30 19:05:11 2010 (r205894) @@ -69,9 +69,12 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include -#include #include +#ifdef FPU_DEBUG +#include +#endif #include +#include #include "un-namespace.h" #include "libc_private.h" Modified: stable/7/lib/libc/sparc64/fpu/fpu_explode.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:05:08 2010 (r205893) +++ stable/7/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:05:11 2010 (r205894) @@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef FPU_DEBUG +#include +#endif + #include #include #include Modified: stable/7/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:05:08 2010 (r205893) +++ stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:05:11 2010 (r205894) @@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef FPU_DEBUG +#include +#endif + #include #include #include From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:06:34 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 386CF1065672; Tue, 30 Mar 2010 19:06:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 274738FC26; Tue, 30 Mar 2010 19:06:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ6YPm066901; Tue, 30 Mar 2010 19:06:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ6Ymw066899; Tue, 30 Mar 2010 19:06:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301906.o2UJ6Ymw066899@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205897 - stable/7/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:06:34 -0000 Author: marius Date: Tue Mar 30 19:06:33 2010 New Revision: 205897 URL: http://svn.freebsd.org/changeset/base/205897 Log: MFC: r205396 Division should take both arguments' signs into account when the the dividend is infinity or zero and the divisor is not the same. PR: 144900 Submitted by: Peter Jeremy Modified: stable/7/lib/libc/sparc64/fpu/fpu_div.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sparc64/fpu/fpu_div.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_div.c Tue Mar 30 19:06:31 2010 (r205896) +++ stable/7/lib/libc/sparc64/fpu/fpu_div.c Tue Mar 30 19:06:33 2010 (r205897) @@ -167,14 +167,16 @@ __fpu_div(fe) * return it. Otherwise we have the following cases: * * Inf / Inf = NaN, plus NV exception - * Inf / num = Inf [i.e., return x] - * Inf / 0 = Inf [i.e., return x] - * 0 / Inf = 0 [i.e., return x] - * 0 / num = 0 [i.e., return x] + * Inf / num = Inf [i.e., return x #] + * Inf / 0 = Inf [i.e., return x #] + * 0 / Inf = 0 [i.e., return x #] + * 0 / num = 0 [i.e., return x #] * 0 / 0 = NaN, plus NV exception - * num / Inf = 0 + * num / Inf = 0 # * num / num = num (do the divide) - * num / 0 = Inf, plus DZ exception + * num / 0 = Inf #, plus DZ exception + * + * # Sign of result is XOR of operand signs. */ if (ISNAN(x) || ISNAN(y)) { ORDER(x, y); @@ -183,10 +185,10 @@ __fpu_div(fe) if (ISINF(x) || ISZERO(x)) { if (x->fp_class == y->fp_class) return (__fpu_newnan(fe)); + x->fp_sign ^= y->fp_sign; return (x); } - /* all results at this point use XOR of operand signs */ x->fp_sign ^= y->fp_sign; if (ISINF(y)) { x->fp_class = FPC_ZERO; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:08:01 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7FB41065694; Tue, 30 Mar 2010 19:08:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5DC8FC1A; Tue, 30 Mar 2010 19:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ811T067411; Tue, 30 Mar 2010 19:08:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ81j2067409; Tue, 30 Mar 2010 19:08:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301908.o2UJ81j2067409@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205901 - stable/7/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:08:02 -0000 Author: marius Date: Tue Mar 30 19:08:01 2010 New Revision: 205901 URL: http://svn.freebsd.org/changeset/base/205901 Log: MFC: r205397 - While SPARC V9 allows tininess to be detected either before or after rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and UltraSPARC processors defines that in all cases tinyness is detected before rounding, therefore rounding up to the smallest normalised number should set the underflow flag. - If an infinite result is rounded down, the result should have an exponent 1 less than the value for infinity. PR: 144900 Submitted by: Peter Jeremy Modified: stable/7/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:07:41 2010 (r205900) +++ stable/7/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:08:01 2010 (r205901) @@ -329,8 +329,9 @@ __fpu_ftos(fe, fp) * right to introduce leading zeroes. Rounding then acts * differently for normals and subnormals: the largest subnormal * may round to the smallest normal (1.0 x 2^minexp), or may - * remain subnormal. In the latter case, signal an underflow - * if the result was inexact or if underflow traps are enabled. + * remain subnormal. A number that is subnormal before rounding + * will signal an underflow if the result is inexact or if underflow + * traps are enabled. * * Rounding a normal, on the other hand, always produces another * normal (although either way the result might be too big for @@ -345,8 +346,10 @@ __fpu_ftos(fe, fp) if ((exp = fp->fp_exp + SNG_EXP_BIAS) <= 0) { /* subnormal */ /* -NG for g,r; -SNG_FRACBITS-exp for fraction */ (void) __fpu_shr(fp, FP_NMANT - FP_NG - SNG_FRACBITS - exp); - if (fpround(fe, fp) && fp->fp_mant[3] == SNG_EXP(1)) + if (fpround(fe, fp) && fp->fp_mant[3] == SNG_EXP(1)) { + fe->fe_cx |= FSR_UF; return (sign | SNG_EXP(1) | 0); + } if ((fe->fe_cx & FSR_NX) || (fe->fe_fsr & (FSR_UF << FSR_TEM_SHIFT))) fe->fe_cx |= FSR_UF; @@ -407,6 +410,7 @@ zero: res[1] = 0; if ((exp = fp->fp_exp + DBL_EXP_BIAS) <= 0) { (void) __fpu_shr(fp, FP_NMANT - FP_NG - DBL_FRACBITS - exp); if (fpround(fe, fp) && fp->fp_mant[2] == DBL_EXP(1)) { + fe->fe_cx |= FSR_UF; res[1] = 0; return (sign | DBL_EXP(1) | 0); } @@ -426,7 +430,7 @@ zero: res[1] = 0; return (sign | DBL_EXP(DBL_EXP_INFNAN) | 0); } res[1] = ~0; - return (sign | DBL_EXP(DBL_EXP_INFNAN) | DBL_MASK); + return (sign | DBL_EXP(DBL_EXP_INFNAN - 1) | DBL_MASK); } done: res[1] = fp->fp_mant[3]; @@ -468,6 +472,7 @@ zero: res[1] = res[2] = res[3] = 0; if ((exp = fp->fp_exp + EXT_EXP_BIAS) <= 0) { (void) __fpu_shr(fp, FP_NMANT - FP_NG - EXT_FRACBITS - exp); if (fpround(fe, fp) && fp->fp_mant[0] == EXT_EXP(1)) { + fe->fe_cx |= FSR_UF; res[1] = res[2] = res[3] = 0; return (sign | EXT_EXP(1) | 0); } @@ -487,7 +492,7 @@ zero: res[1] = res[2] = res[3] = 0; return (sign | EXT_EXP(EXT_EXP_INFNAN) | 0); } res[1] = res[2] = res[3] = ~0; - return (sign | EXT_EXP(EXT_EXP_INFNAN) | EXT_MASK); + return (sign | EXT_EXP(EXT_EXP_INFNAN - 1) | EXT_MASK); } done: res[1] = fp->fp_mant[1]; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:15:58 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35CF4106566B; Tue, 30 Mar 2010 19:15:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8828FC12; Tue, 30 Mar 2010 19:15:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJFvTJ069449; Tue, 30 Mar 2010 19:15:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJFvrr069447; Tue, 30 Mar 2010 19:15:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301915.o2UJFvrr069447@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205906 - stable/7/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:15:58 -0000 Author: marius Date: Tue Mar 30 19:15:57 2010 New Revision: 205906 URL: http://svn.freebsd.org/changeset/base/205906 Log: MFC: r173859, r205410 Avoid aliasing which leads to incorrect results when compiling with the default strict aliasing rules. PR: 144900 Submitted by: Peter Jeremy Modified: stable/7/lib/libc/sparc64/fpu/fpu_explode.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sparc64/fpu/fpu_explode.c ============================================================================== --- stable/7/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:13:37 2010 (r205905) +++ stable/7/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:15:57 2010 (r205906) @@ -139,9 +139,9 @@ __fpu_xtof(fp, i) * a signed or unsigned entity. */ if (fp->fp_sign && (int64_t)i < 0) - *((int64_t*)fp->fp_mant) = -i; + *((int64_t *)fp->fp_mant) = -i; else - *((int64_t*)fp->fp_mant) = i; + *((int64_t *)fp->fp_mant) = i; fp->fp_mant[2] = 0; fp->fp_mant[3] = 0; __fpu_norm(fp); @@ -262,13 +262,12 @@ __fpu_explode(fe, fp, type, reg) struct fpn *fp; int type, reg; { - u_int32_t s, *sp; - u_int64_t l[2]; + u_int64_t l0, l1; + u_int32_t s; if (type == FTYPE_LNG || type == FTYPE_DBL || type == FTYPE_EXT) { - l[0] = __fpu_getreg64(reg & ~1); - sp = (u_int32_t *)l; - fp->fp_sign = sp[0] >> 31; + l0 = __fpu_getreg64(reg & ~1); + fp->fp_sign = l0 >> 63; } else { s = __fpu_getreg(reg); fp->fp_sign = s >> 31; @@ -276,7 +275,7 @@ __fpu_explode(fe, fp, type, reg) fp->fp_sticky = 0; switch (type) { case FTYPE_LNG: - s = __fpu_xtof(fp, l[0]); + s = __fpu_xtof(fp, l0); break; case FTYPE_INT: @@ -288,12 +287,13 @@ __fpu_explode(fe, fp, type, reg) break; case FTYPE_DBL: - s = __fpu_dtof(fp, sp[0], sp[1]); + s = __fpu_dtof(fp, l0 >> 32, l0 & 0xffffffff); break; case FTYPE_EXT: - l[1] = __fpu_getreg64((reg & ~1) + 2); - s = __fpu_qtof(fp, sp[0], sp[1], sp[2], sp[3]); + l1 = __fpu_getreg64((reg & ~1) + 2); + s = __fpu_qtof(fp, l0 >> 32, l0 & 0xffffffff, l1 >> 32, + l1 & 0xffffffff); break; default: From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:31:59 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AF25106564A; Tue, 30 Mar 2010 19:31:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09A008FC0A; Tue, 30 Mar 2010 19:31:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJVwwm073012; Tue, 30 Mar 2010 19:31:58 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJVwSP073010; Tue, 30 Mar 2010 19:31:58 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201003301931.o2UJVwSP073010@svn.freebsd.org> From: Hiroki Sato Date: Tue, 30 Mar 2010 19:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205908 - stable/7/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:31:59 -0000 Author: hrs Date: Tue Mar 30 19:31:58 2010 New Revision: 205908 URL: http://svn.freebsd.org/changeset/base/205908 Log: Document zfsloader issue on 7.3R. Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Mar 30 19:16:00 2010 (r205907) +++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Mar 30 19:31:58 2010 (r205908) @@ -167,6 +167,14 @@ Late-Breaking News and Corrections + [20100330] It turns out that the + zfsloader in 7.3-RELEASE, a new boot loader + similar to &man.loader.8; but it supports ZFS, does not work + properly. This problem has been fixed in r205539 + (RELENG_7). An Errata Notice for 7.3-RELEASE is + planned. + [20100323] The &os; 7.3-RELEASE Release Notes incorrectly mentioned that the hwpmc(4) driver has been added though this driver has already been added in 7.0-RELEASE. The changes in From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:33:10 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C4FD1065680; Tue, 30 Mar 2010 19:33:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFB618FC16; Tue, 30 Mar 2010 19:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJX9um073350; Tue, 30 Mar 2010 19:33:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJX90Z073348; Tue, 30 Mar 2010 19:33:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301933.o2UJX90Z073348@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205909 - stable/7/sys/sun4v/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:33:10 -0000 Author: marius Date: Tue Mar 30 19:33:09 2010 New Revision: 205909 URL: http://svn.freebsd.org/changeset/base/205909 Log: MFC: r203334 Sync with the other archs and declare the memory location referenced by the address argument of the bus_space_write_multi_*() familiy as const. Modified: stable/7/sys/sun4v/include/bus.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sun4v/include/bus.h ============================================================================== --- stable/7/sys/sun4v/include/bus.h Tue Mar 30 19:31:58 2010 (r205908) +++ stable/7/sys/sun4v/include/bus.h Tue Mar 30 19:33:09 2010 (r205909) @@ -316,7 +316,7 @@ bus_space_write_8(bus_space_tag_t t, bus static __inline void bus_space_write_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint8_t *a, size_t c) + const uint8_t *a, size_t c) { while (c-- > 0) @@ -325,7 +325,7 @@ bus_space_write_multi_1(bus_space_tag_t static __inline void bus_space_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint16_t *a, size_t c) + const uint16_t *a, size_t c) { while (c-- > 0) @@ -334,7 +334,7 @@ bus_space_write_multi_2(bus_space_tag_t static __inline void bus_space_write_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint32_t *a, size_t c) + const uint32_t *a, size_t c) { while (c-- > 0) @@ -343,7 +343,7 @@ bus_space_write_multi_4(bus_space_tag_t static __inline void bus_space_write_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint64_t *a, size_t c) + const uint64_t *a, size_t c) { while (c-- > 0) From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:36:03 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACE541065675; Tue, 30 Mar 2010 19:36:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B3918FC25; Tue, 30 Mar 2010 19:36:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJa3YO074112; Tue, 30 Mar 2010 19:36:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJa3Zj074109; Tue, 30 Mar 2010 19:36:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301936.o2UJa3Zj074109@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205912 - in stable/7/sys/sun4v: include sun4v X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:36:03 -0000 Author: marius Date: Tue Mar 30 19:36:03 2010 New Revision: 205912 URL: http://svn.freebsd.org/changeset/base/205912 Log: MFC: r203335 - Const'ify the bus_stream_asi and bus_type_asi arrays. - Replace hard-coded functions names missed in bus_machdep.c with __func__. - Break some long lines. Modified: stable/7/sys/sun4v/include/bus.h stable/7/sys/sun4v/sun4v/bus_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sun4v/include/bus.h ============================================================================== --- stable/7/sys/sun4v/include/bus.h Tue Mar 30 19:36:00 2010 (r205911) +++ stable/7/sys/sun4v/include/bus.h Tue Mar 30 19:36:03 2010 (r205912) @@ -96,8 +96,8 @@ #define PCI_MEMORY_BUS_SPACE 4 #define LAST_BUS_SPACE 5 -extern int bus_type_asi[]; -extern int bus_stream_asi[]; +extern const int bus_type_asi[]; +extern const int bus_stream_asi[]; #define __BUS_SPACE_HAS_STREAM_METHODS 1 Modified: stable/7/sys/sun4v/sun4v/bus_machdep.c ============================================================================== --- stable/7/sys/sun4v/sun4v/bus_machdep.c Tue Mar 30 19:36:00 2010 (r205911) +++ stable/7/sys/sun4v/sun4v/bus_machdep.c Tue Mar 30 19:36:03 2010 (r205912) @@ -95,7 +95,7 @@ * from: @(#)machdep.c 8.6 (Berkeley) 1/14/94 * from: NetBSD: machdep.c,v 1.111 2001/09/15 07:13:40 eeh Exp * and - * from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.24 2001/08/15 + * from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.24 2001/08/15 */ #include @@ -129,8 +129,8 @@ __FBSDID("$FreeBSD$"); static void nexus_bus_barrier(bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_size_t, int); -/* ASI's for bus access. */ -int bus_type_asi[] = { +/* ASIs for bus access */ +const int bus_type_asi[] = { ASI_REAL_IO, /* nexus */ ASI_REAL_IO, /* SBus */ ASI_REAL_IO_L, /* PCI configuration space */ @@ -139,7 +139,7 @@ int bus_type_asi[] = { 0 }; -int bus_stream_asi[] = { +const int bus_stream_asi[] = { ASI_REAL_IO, /* nexus */ ASI_REAL_IO, /* SBus */ ASI_REAL_IO, /* PCI configuration space */ @@ -249,7 +249,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->dt_segments = NULL; - /* Take into account any restrictions imposed by our parent tag */ + /* Take into account any restrictions imposed by our parent tag. */ if (parent != NULL) { newtag->dt_lowaddr = ulmin(parent->dt_lowaddr, newtag->dt_lowaddr); @@ -551,8 +551,7 @@ nexus_dmamap_load_uio(bus_dma_tag_t dmat if (uio->uio_segflg == UIO_USERSPACE) { td = uio->uio_td; - KASSERT(td != NULL, - ("nexus_dmamap_load_uio: USERSPACE but no proc")); + KASSERT(td != NULL, ("%s: USERSPACE but no proc", __func__)); } nsegs = 0; @@ -652,9 +651,9 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, v *vaddr = malloc(dmat->dt_maxsize, M_DEVBUF, mflags); } else { /* - * XXX: Use contigmalloc until it is merged into this facility - * and handles multi-seg allocations. Nobody is doing multi-seg - * allocations yet though. + * XXX use contigmalloc until it is merged into this + * facility and handles multi-seg allocations. Nobody + * is doing multi-seg allocations yet though. */ *vaddr = contigmalloc(dmat->dt_maxsize, M_DEVBUF, mflags, 0ul, dmat->dt_lowaddr, @@ -795,8 +794,8 @@ sparc64_bus_mem_unmap(void *bh, bus_size } /* - * Fake up a bus tag, for use by console drivers in early boot when the regular - * means to allocate resources are not yet available. + * Fake up a bus tag, for use by console drivers in early boot when the + * regular means to allocate resources are not yet available. * Addr is the physical address of the desired start of the handle. */ bus_space_handle_t From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:37:56 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B52010656B3; Tue, 30 Mar 2010 19:37:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD45A8FC1C; Tue, 30 Mar 2010 19:37:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJbt94074608; Tue, 30 Mar 2010 19:37:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJbtNu074606; Tue, 30 Mar 2010 19:37:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301937.o2UJbtNu074606@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205914 - stable/7/sys/sun4v/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:37:56 -0000 Author: marius Date: Tue Mar 30 19:37:55 2010 New Revision: 205914 URL: http://svn.freebsd.org/changeset/base/205914 Log: MFC: r203341 - Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro; for UPA it should have fulfilled its purpose by now and Fireplane- and JBus-based machines are way to messy in organization to implement something equivalent. - Fix a bunch of style(9) bugs. Modified: stable/7/sys/sun4v/include/bus.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sun4v/include/bus.h ============================================================================== --- stable/7/sys/sun4v/include/bus.h Tue Mar 30 19:37:47 2010 (r205913) +++ stable/7/sys/sun4v/include/bus.h Tue Mar 30 19:37:55 2010 (r205914) @@ -81,7 +81,6 @@ #include #include -#include /* * Nexus and SBus spaces are non-cached and big endian @@ -99,27 +98,24 @@ extern const int bus_type_asi[]; extern const int bus_stream_asi[]; -#define __BUS_SPACE_HAS_STREAM_METHODS 1 +#define __BUS_SPACE_HAS_STREAM_METHODS 1 -#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF -#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFF -#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF -#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXADDR 0xFFFFFFFF +#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF +#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF +#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFF +#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF +#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF +#define BUS_SPACE_MAXADDR 0xFFFFFFFF -#define BUS_SPACE_UNRESTRICTED (~0) +#define BUS_SPACE_UNRESTRICTED (~0) -/* - * Access methods for bus resources and address space. - */ struct bus_space_tag { void *bst_cookie; bus_space_tag_t bst_parent; int bst_type; void (*bst_bus_barrier)(bus_space_tag_t, bus_space_handle_t, - bus_size_t, bus_size_t, int); + bus_size_t, bus_size_t, int); }; /* @@ -135,13 +131,11 @@ static int bus_space_subregion(bus_space */ static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, - bus_space_handle_t *bshp); + bus_size_t size, int flags, bus_space_handle_t *bshp); static __inline int bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, - bus_space_handle_t *bshp) + bus_size_t size __unused, int flags __unused, bus_space_handle_t *bshp) { *bshp = addr; @@ -152,24 +146,26 @@ bus_space_map(bus_space_tag_t t __unused * Unmap a region of device bus space. */ static __inline void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, - bus_size_t size); + bus_size_t size); static __inline void bus_space_unmap(bus_space_tag_t t __unused, bus_space_handle_t bsh __unused, - bus_size_t size __unused) + bus_size_t size __unused) { + } /* This macro finds the first "upstream" implementation of method `f' */ -#define _BS_CALL(t,f) \ +#define _BS_CALL(t,f) \ while (t->f == NULL) \ - t = t->bst_parent; \ + t = t->bst_parent; \ return (*(t)->f) static __inline void bus_space_barrier(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_size_t s, int f) { + _BS_CALL(t, bst_bus_barrier)(t, h, o, s, f); } @@ -177,20 +173,21 @@ static __inline int bus_space_subregion(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_size_t s, bus_space_handle_t *hp) { + *hp = h + o; return (0); } /* flags for bus space map functions */ -#define BUS_SPACE_MAP_CACHEABLE 0x0001 -#define BUS_SPACE_MAP_LINEAR 0x0002 -#define BUS_SPACE_MAP_READONLY 0x0004 -#define BUS_SPACE_MAP_PREFETCHABLE 0x0008 +#define BUS_SPACE_MAP_CACHEABLE 0x0001 +#define BUS_SPACE_MAP_LINEAR 0x0002 +#define BUS_SPACE_MAP_READONLY 0x0004 +#define BUS_SPACE_MAP_PREFETCHABLE 0x0008 /* placeholders for bus functions... */ -#define BUS_SPACE_MAP_BUS1 0x0100 -#define BUS_SPACE_MAP_BUS2 0x0200 -#define BUS_SPACE_MAP_BUS3 0x0400 -#define BUS_SPACE_MAP_BUS4 0x0800 +#define BUS_SPACE_MAP_BUS1 0x0100 +#define BUS_SPACE_MAP_BUS2 0x0200 +#define BUS_SPACE_MAP_BUS3 0x0400 +#define BUS_SPACE_MAP_BUS4 0x0800 /* flags for bus_space_barrier() */ #define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ @@ -198,13 +195,9 @@ bus_space_subregion(bus_space_tag_t t, b #ifdef BUS_SPACE_DEBUG #define KTR_BUS KTR_CT2 -#define BUS_HANDLE_MIN UPA_MEMSTART #define __BUS_DEBUG_ACCESS(h, o, desc, sz) do { \ CTR4(KTR_BUS, "bus space: %s %d: handle %#lx, offset %#lx", \ (desc), (sz), (h), (o)); \ - if ((h) + (o) < BUS_HANDLE_MIN) \ - panic("bus space access at %#lx out of range", \ - (h) + (o)); \ } while (0) #else #define __BUS_DEBUG_ACCESS(h, o, desc, sz) @@ -388,97 +381,109 @@ bus_space_set_multi_8(bus_space_tag_t t, static __inline void bus_space_read_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int8_t *a, bus_size_t c) + uint8_t *a, bus_size_t c) { + for (; c; a++, c--, o++) *a = bus_space_read_1(t, h, o); } static __inline void bus_space_read_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int16_t *a, bus_size_t c) + uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + + for (; c; a++, c--, o += 2) *a = bus_space_read_2(t, h, o); } static __inline void bus_space_read_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int32_t *a, bus_size_t c) + uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + + for (; c; a++, c--, o += 4) *a = bus_space_read_4(t, h, o); } static __inline void bus_space_read_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int64_t *a, bus_size_t c) + uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + + for (; c; a++, c--, o += 8) *a = bus_space_read_8(t, h, o); } static __inline void bus_space_write_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int8_t *a, bus_size_t c) + const uint8_t *a, bus_size_t c) { + for (; c; a++, c--, o++) bus_space_write_1(t, h, o, *a); } static __inline void bus_space_write_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int16_t *a, bus_size_t c) + const uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + + for (; c; a++, c--, o += 2) bus_space_write_2(t, h, o, *a); } static __inline void bus_space_write_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int32_t *a, bus_size_t c) + const uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + + for (; c; a++, c--, o += 4) bus_space_write_4(t, h, o, *a); } static __inline void bus_space_write_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int64_t *a, bus_size_t c) + const uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + + for (; c; a++, c--, o += 8) bus_space_write_8(t, h, o, *a); } static __inline void bus_space_set_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int8_t v, bus_size_t c) + const uint8_t v, bus_size_t c) { + for (; c; c--, o++) bus_space_write_1(t, h, o, v); } static __inline void bus_space_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int16_t v, bus_size_t c) + const uint16_t v, bus_size_t c) { - for (; c; c--, o+=2) + + for (; c; c--, o += 2) bus_space_write_2(t, h, o, v); } static __inline void bus_space_set_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int32_t v, bus_size_t c) + const uint32_t v, bus_size_t c) { - for (; c; c--, o+=4) + + for (; c; c--, o += 4) bus_space_write_4(t, h, o, v); } static __inline void bus_space_set_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int64_t v, bus_size_t c) + const uint64_t v, bus_size_t c) { - for (; c; c--, o+=8) + + for (; c; c--, o += 8) bus_space_write_8(t, h, o, v); } @@ -486,6 +491,7 @@ static __inline void bus_space_copy_region_1(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { + for (; c; c--, o1++, o2++) bus_space_write_1(t, h1, o1, bus_space_read_1(t, h2, o2)); } @@ -494,7 +500,8 @@ static __inline void bus_space_copy_region_2(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=2, o2+=2) + + for (; c; c--, o1 += 2, o2 += 2) bus_space_write_2(t, h1, o1, bus_space_read_2(t, h2, o2)); } @@ -502,7 +509,8 @@ static __inline void bus_space_copy_region_4(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=4, o2+=4) + + for (; c; c--, o1 += 4, o2 += 4) bus_space_write_4(t, h1, o1, bus_space_read_4(t, h2, o2)); } @@ -510,7 +518,8 @@ static __inline void bus_space_copy_region_8(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=8, o2+=8) + + for (; c; c--, o1 += 8, o2 += 8) bus_space_write_8(t, h1, o1, bus_space_read_8(t, h2, o2)); } @@ -692,7 +701,7 @@ bus_space_set_multi_stream_8(bus_space_t static __inline void bus_space_read_region_stream_1(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int8_t *a, bus_size_t c) + bus_size_t o, uint8_t *a, bus_size_t c) { for (; c; a++, c--, o++) @@ -701,34 +710,34 @@ bus_space_read_region_stream_1(bus_space static __inline void bus_space_read_region_stream_2(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int16_t *a, bus_size_t c) + bus_size_t o, uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + for (; c; a++, c--, o += 2) *a = bus_space_read_stream_2(t, h, o); } static __inline void bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int32_t *a, bus_size_t c) + bus_size_t o, uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + for (; c; a++, c--, o += 4) *a = bus_space_read_stream_4(t, h, o); } static __inline void bus_space_read_region_stream_8(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int64_t *a, bus_size_t c) + bus_size_t o, uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + for (; c; a++, c--, o += 8) *a = bus_space_read_stream_8(t, h, o); } static __inline void bus_space_write_region_stream_1(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int8_t *a, bus_size_t c) + bus_size_t o, const uint8_t *a, bus_size_t c) { for (; c; a++, c--, o++) @@ -737,34 +746,34 @@ bus_space_write_region_stream_1(bus_spac static __inline void bus_space_write_region_stream_2(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int16_t *a, bus_size_t c) + bus_size_t o, const uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + for (; c; a++, c--, o += 2) bus_space_write_stream_2(t, h, o, *a); } static __inline void bus_space_write_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int32_t *a, bus_size_t c) + bus_size_t o, const uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + for (; c; a++, c--, o += 4) bus_space_write_stream_4(t, h, o, *a); } static __inline void bus_space_write_region_stream_8(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int64_t *a, bus_size_t c) + bus_size_t o, const uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + for (; c; a++, c--, o += 8) bus_space_write_stream_8(t, h, o, *a); } static __inline void bus_space_set_region_stream_1(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int8_t v, bus_size_t c) + bus_size_t o, const uint8_t v, bus_size_t c) { for (; c; c--, o++) @@ -773,28 +782,28 @@ bus_space_set_region_stream_1(bus_space_ static __inline void bus_space_set_region_stream_2(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int16_t v, bus_size_t c) + bus_size_t o, const uint16_t v, bus_size_t c) { - for (; c; c--, o+=2) + for (; c; c--, o += 2) bus_space_write_stream_2(t, h, o, v); } static __inline void bus_space_set_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int32_t v, bus_size_t c) + bus_size_t o, const uint32_t v, bus_size_t c) { - for (; c; c--, o+=4) + for (; c; c--, o += 4) bus_space_write_stream_4(t, h, o, v); } static __inline void bus_space_set_region_stream_8(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int64_t v, bus_size_t c) + bus_size_t o, const uint64_t v, bus_size_t c) { - for (; c; c--, o+=8) + for (; c; c--, o += 8) bus_space_write_stream_8(t, h, o, v); } @@ -813,7 +822,7 @@ bus_space_copy_region_stream_2(bus_space bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=2, o2+=2) + for (; c; c--, o1 += 2, o2 += 2) bus_space_write_stream_2(t, h1, o1, bus_space_read_stream_2(t, h2, o2)); } @@ -823,7 +832,7 @@ bus_space_copy_region_stream_4(bus_space bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=4, o2+=4) + for (; c; c--, o1 += 4, o2 += 4) bus_space_write_stream_4(t, h1, o1, bus_space_read_stream_4(t, h2, o2)); } @@ -833,7 +842,7 @@ bus_space_copy_region_stream_8(bus_space bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=8, o2+=8) + for (; c; c--, o1 += 8, o2 += 8) bus_space_write_stream_8(t, h1, o1, bus_space_read_8(t, h2, o2)); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:41:43 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 589B71065672; Tue, 30 Mar 2010 19:41:43 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 475BB8FC12; Tue, 30 Mar 2010 19:41:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJfhGo075540; Tue, 30 Mar 2010 19:41:43 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJfhMI075538; Tue, 30 Mar 2010 19:41:43 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201003301941.o2UJfhMI075538@svn.freebsd.org> From: Hiroki Sato Date: Tue, 30 Mar 2010 19:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205916 - stable/7/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:41:43 -0000 Author: hrs Date: Tue Mar 30 19:41:43 2010 New Revision: 205916 URL: http://svn.freebsd.org/changeset/base/205916 Log: Document fdopendir(3) missing prototype issue. Submitted by: delphij Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Mar 30 19:41:38 2010 (r205915) +++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Mar 30 19:41:43 2010 (r205916) @@ -167,6 +167,18 @@ Late-Breaking News and Corrections + [20100330] The libc of &os; 7.3-RELEASE + has the &man.fdopendir.3; function but + <dirent.h> header file does not + contain the function prototype. This could cause programs + compiled on the system to crash on platforms such as + &os;/&arch.amd64;, where sizeof(void *) is + greater than sizeof(int). This problem has + been fixed in r205265 + (RELENG_7). An Errata Notice for 7.3-RELEASE is + planned. + [20100330] It turns out that the zfsloader in 7.3-RELEASE, a new boot loader similar to &man.loader.8; but it supports ZFS, does not work From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 19:52:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E46B1106566B; Tue, 30 Mar 2010 19:52:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D31FA8FC0C; Tue, 30 Mar 2010 19:52:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJqj7D078034; Tue, 30 Mar 2010 19:52:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJqjQ3078031; Tue, 30 Mar 2010 19:52:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301952.o2UJqjQ3078031@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205917 - stable/7/sys/nfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:52:46 -0000 Author: marius Date: Tue Mar 30 19:52:45 2010 New Revision: 205917 URL: http://svn.freebsd.org/changeset/base/205917 Log: MFC: r203731 Some style(9) fixes Modified: stable/7/sys/nfs/nfs_common.c stable/7/sys/nfs/nfs_common.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfs/nfs_common.c ============================================================================== --- stable/7/sys/nfs/nfs_common.c Tue Mar 30 19:41:43 2010 (r205916) +++ stable/7/sys/nfs/nfs_common.c Tue Mar 30 19:52:45 2010 (r205917) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); /* * These functions support the macros and help fiddle mbuf chains for - * the nfs op functions. They do things like create the rpc header and + * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ @@ -76,10 +76,11 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK, NFFIFO, NFNON }; -static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); +static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, + int how); u_quad_t -nfs_curusec(void) +nfs_curusec(void) { struct timeval tv; @@ -177,7 +178,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d while (left == 0) { *mdp = mp = mp->m_next; if (mp == NULL) - return NULL; + return (NULL); left = mp->m_len; *dposp = mtod(mp, caddr_t); } @@ -185,13 +186,13 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d ret = *dposp; *dposp += siz; } else if (mp->m_next == NULL) { - return NULL; + return (NULL); } else if (siz > MHLEN) { panic("nfs S too big"); } else { MGET(mp2, how, MT_DATA); if (mp2 == NULL) - return NULL; + return (NULL); mp2->m_len = siz; mp2->m_next = mp->m_next; mp->m_next = mp2; @@ -207,7 +208,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d /* Loop around copying up the siz2 bytes */ while (siz2 > 0) { if (mp2 == NULL) - return NULL; + return (NULL); xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2; if (xfer > 0) { bcopy(mtod(mp2, caddr_t), ptr, xfer); @@ -230,7 +231,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d *dposp = npos; } } - return ret; + return (ret); } /* @@ -274,19 +275,21 @@ nfsm_build_xx(int s, struct mbuf **mb, c ret = *bpos; (*mb)->m_len += s; *bpos += s; - return ret; + return (ret); } void * nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_TRYWAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_TRYWAIT)); } void * nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT)); } static void * @@ -300,10 +303,10 @@ nfsm_dissect_xx_sub(int s, struct mbuf * if (t1 >= s) { ret = *dpos; *dpos += s; - return ret; + return (ret); } - cp2 = nfsm_disct(md, dpos, s, t1, how); - return cp2; + cp2 = nfsm_disct(md, dpos, s, t1, how); + return (cp2); } int @@ -313,11 +316,11 @@ nfsm_strsiz_xx(int *s, int m, struct mbu tl = nfsm_dissect_xx(NFSX_UNSIGNED, mb, bpos); if (tl == NULL) - return EBADRPC; + return (EBADRPC); *s = fxdr_unsigned(int32_t, *tl); if (*s > m) - return EBADRPC; - return 0; + return (EBADRPC); + return (0); } int @@ -328,10 +331,10 @@ nfsm_adv_xx(int s, struct mbuf **md, cad t1 = mtod(*md, caddr_t) + (*md)->m_len - *dpos; if (t1 >= s) { *dpos += s; - return 0; + return (0); } t1 = nfs_adv(md, dpos, s, t1); if (t1) - return t1; - return 0; + return (t1); + return (0); } Modified: stable/7/sys/nfs/nfs_common.h ============================================================================== --- stable/7/sys/nfs/nfs_common.h Tue Mar 30 19:41:43 2010 (r205916) +++ stable/7/sys/nfs/nfs_common.h Tue Mar 30 19:52:45 2010 (r205917) @@ -33,7 +33,6 @@ * $FreeBSD$ */ - #ifndef _NFS_NFS_COMMON_H_ #define _NFS_NFS_COMMON_H_ @@ -86,7 +85,7 @@ do { \ goto nfsmout; \ } \ } while (0) - + #define nfsm_dissect(c, s) \ ({ \ void *ret; \ From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:02:28 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6660106566C; Tue, 30 Mar 2010 20:02:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3B1A8FC13; Tue, 30 Mar 2010 20:02:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UK2SmQ080400; Tue, 30 Mar 2010 20:02:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UK2Sfr080390; Tue, 30 Mar 2010 20:02:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302002.o2UK2Sfr080390@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205921 - in stable/7/sys: boot/sparc64/loader sparc64/include sun4v/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:02:29 -0000 Author: marius Date: Tue Mar 30 20:02:28 2010 New Revision: 205921 URL: http://svn.freebsd.org/changeset/base/205921 Log: MFC: r203829 - Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware of Sun Fire V1280 doesn't round up the size itself but instead lets claiming of non page-sized amounts of memory fail. - Change parameters and variables related to the TLB slots to unsigned which is more appropriate. - Search the whole OFW device tree instead of only the children of the root nexus device for the BSP as starting with UltraSPARC IV the 'cpu' nodes hang off of from 'cmp' (chip multi-threading processor) or 'core' or combinations thereof. Also in large UltraSPARC III based machines the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which group snooping-coherency domains together instead of directly from the nexus. - Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these are multi-core each CPU has two Fireplane config registers and thus the module/target ID has to be determined differently so the one specific to a certain core is used. Similarly, starting with UltraSPARC IV the individual cores use a different property in the OFW device tree to indicate the CPU/core ID as it no longer is in coincidence with the shared slot/socket ID. While at it additionally distinguish between CPUs with Fireplane and JBus interconnects as these also use slightly different sizes for the JBus/agent/module/target IDs. - Check the return value of init_heap(). This requires moving it after cons_probe() so we can panic when appropriate. This should be fine as the PowerPC OFW loader uses that order for quite some time now. Added: stable/7/sys/sparc64/include/cmt.h - copied unchanged from r203829, head/sys/sparc64/include/cmt.h stable/7/sys/sparc64/include/fireplane.h - copied unchanged from r203829, head/sys/sparc64/include/fireplane.h stable/7/sys/sparc64/include/jbus.h - copied unchanged from r203829, head/sys/sparc64/include/jbus.h stable/7/sys/sun4v/include/cmt.h - copied unchanged from r203829, head/sys/sun4v/include/cmt.h stable/7/sys/sun4v/include/fireplane.h - copied unchanged from r203829, head/sys/sun4v/include/fireplane.h stable/7/sys/sun4v/include/jbus.h - copied unchanged from r203829, head/sys/sun4v/include/jbus.h Modified: stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/sparc64/include/asi.h stable/7/sys/sun4v/include/asi.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Tue Mar 30 20:02:26 2010 (r205920) +++ stable/7/sys/boot/sparc64/loader/main.c Tue Mar 30 20:02:28 2010 (r205921) @@ -46,16 +46,19 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include -#include +#include #include +#include #include #include #include +#include #include #include +#include +#include #include #include #include @@ -68,6 +71,12 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" +#ifndef CTASSERT +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#endif + extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { @@ -76,6 +85,9 @@ enum { LOADSZ = 0x1000000 /* for kernel and modules */ }; +/* At least Sun Fire V1280 require page sized allocations to be claimed. */ +CTASSERT(HEAPSZ % PAGE_SIZE == 0); + static struct mmu_ops { void (*tlb_init)(void); int (*mmu_mapin)(vm_offset_t va, vm_size_t len); @@ -84,11 +96,11 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(int slot); -static void dtlb_enter_sun4u(u_long vpn, u_long data); +static inline u_long dtlb_get_data_sun4u(u_int); +static void dtlb_enter_sun4u(u_long, u_long); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(int slot); -static void itlb_enter_sun4u(u_long vpn, u_long data); +static inline u_long itlb_get_data_sun4u(u_int); +static void itlb_enter_sun4u(u_long, u_long); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); extern vm_offset_t md_load(char *, vm_offset_t *); @@ -104,6 +116,9 @@ static int __elfN(exec)(struct preloaded static int mmu_mapin_sun4u(vm_offset_t, vm_size_t); static int mmu_mapin_sun4v(vm_offset_t, vm_size_t); static vm_offset_t init_heap(void); +static phandle_t find_bsp_sun4u(phandle_t, uint32_t); +const char *cpu_cpuid_prop_sun4u(void); +uint32_t cpu_get_mid_sun4u(void); static void tlb_init_sun4u(void); static void tlb_init_sun4v(void); @@ -120,11 +135,11 @@ static struct mmu_ops mmu_ops_sun4v = { /* sun4u */ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; -int dtlb_slot; -int itlb_slot; +u_int dtlb_slot; +u_int itlb_slot; int cpu_impl; -static int dtlb_slot_max; -static int itlb_slot_max; +static u_int dtlb_slot_max; +static u_int itlb_slot_max; /* sun4v */ static struct tlb_entry *tlb_store; @@ -399,7 +414,7 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(int slot) +dtlb_get_data_sun4u(u_int slot) { /* @@ -411,7 +426,7 @@ dtlb_get_data_sun4u(int slot) } static inline u_long -itlb_get_data_sun4u(int slot) +itlb_get_data_sun4u(u_int slot) { /* @@ -669,33 +684,98 @@ init_heap(void) return (heapva); } +static phandle_t +find_bsp_sun4u(phandle_t node, uint32_t bspid) +{ + char type[sizeof("cpu")]; + phandle_t child; + uint32_t cpuid; + + for (; node > 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) { + child = find_bsp_sun4u(child, bspid); + if (child > 0) + return (child); + } else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop_sun4u(), &cpuid, + sizeof(cpuid)) <= 0) + continue; + if (cpuid == bspid) + return (node); + } + } + return (0); +} + +const char * +cpu_cpuid_prop_sun4u(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return ("upa-portid"); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return ("portid"); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return ("cpuid"); + default: + return (""); + } +} + +uint32_t +cpu_get_mid_sun4u(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return (UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + return (FIREPLANE_CR_GET_AID(ldxa(AA_FIREPLANE_CONFIG, + ASI_FIREPLANE_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return (JBUS_CR_GET_JID(ldxa(0, ASI_JBUS_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (INTR_ID_GET_ID(ldxa(AA_INTR_ID, ASI_INTR_ID))); + default: + return (0); + } +} + static void tlb_init_sun4u(void) { - phandle_t child; - char buf[128]; - u_int bootcpu; - u_int cpu; + phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); - bootcpu = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0) - continue; - if (strcmp(buf, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &cpu, sizeof(cpu)) <= 0) - continue; - if (cpu == bootcpu) - break; - } - if (cpu != bootcpu) + bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); + if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); - if (OF_getprop(child, "#dtlb-entries", &dtlb_slot_max, + if (OF_getprop(bsp, "#dtlb-entries", &dtlb_slot_max, sizeof(dtlb_slot_max)) == -1 || - OF_getprop(child, "#itlb-entries", &itlb_slot_max, + OF_getprop(bsp, "#itlb-entries", &itlb_slot_max, sizeof(itlb_slot_max)) == -1) panic("%s: can't get TLB slot max.", __func__); @@ -750,14 +830,15 @@ main(int (*openfirm)(void *)) archsw.arch_autoload = sparc64_autoload; archsw.arch_maphint = sparc64_maphint; - init_heap(); - setheap((void *)heapva, (void *)(heapva + HEAPSZ)); - /* * Probe for a console. */ cons_probe(); + if (init_heap() == (vm_offset_t)-1) + panic("%s: can't claim heap", __func__); + setheap((void *)heapva, (void *)(heapva + HEAPSZ)); + if ((root = OF_peer(0)) == -1) panic("%s: can't get root phandle", __func__); OF_getprop(root, "compatible", compatible, sizeof(compatible)); Modified: stable/7/sys/sparc64/include/asi.h ============================================================================== --- stable/7/sys/sparc64/include/asi.h Tue Mar 30 20:02:26 2010 (r205920) +++ stable/7/sys/sparc64/include/asi.h Tue Mar 30 20:02:28 2010 (r205921) @@ -33,7 +33,7 @@ #define _MACHINE_ASI_H_ /* - * Standard v9 asis + * Standard v9 ASIs */ #define ASI_N 0x4 #define ASI_NL 0xc @@ -51,7 +51,7 @@ #define ASI_SNFL 0x8b /* - * UltraSPARC extensions. ASIs limited to a certain family are annotated. + * UltraSPARC extensions - ASIs limited to a certain family are annotated. */ #define ASI_PHYS_USE_EC 0x14 #define ASI_PHYS_BYPASS_EC_WITH_EBIT 0x15 @@ -91,9 +91,12 @@ #define ASI_INTR_RECEIVE 0x49 #define ASI_UPA_CONFIG_REG 0x4a /* US-I, II */ -#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III Cu */ -#define AA_FIREPLANE_CONFIG 0x0 /* US-III Cu */ -#define AA_FIREPLANE_ADDRESS 0x8 /* US-III Cu */ +#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG 0x0 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_ADDRESS 0x8 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG_2 0x10 /* US-IV{,+} */ + +#define ASI_JBUS_CONFIG_REG 0x4a /* US-IIIi{,+} */ #define ASI_ESTATE_ERROR_EN_REG 0x4b #define AA_ESTATE_CEEN 0x1 @@ -153,6 +156,11 @@ #define ASI_IIU_INST_TRAP 0x60 /* US-III family */ +#define ASI_INTR_ID 0x63 /* US-IV{,+} */ +#define AA_INTR_ID 0x0 /* US-IV{,+} */ +#define AA_CORE_ID 0x10 /* US-IV{,+} */ +#define AA_CESR_ID 0x40 /* US-IV{,+} */ + #define ASI_ICACHE_INSTR 0x66 #define ASI_ICACHE_TAG 0x67 #define ASI_ICACHE_SNOOP_TAG 0x68 /* US-III family */ @@ -179,7 +187,7 @@ /* * With the advent of the US-III, the numbering has changed, as additional - * registers were inserted in between. We retain the original ordering for + * registers were inserted in between. We retain the original ordering for * now, and append an A to the inserted registers. * Exceptions are AA_SDB_INTR_D6 and AA_SDB_INTR_D7, which were appended * at the end. Copied: stable/7/sys/sparc64/include/cmt.h (from r203829, head/sys/sparc64/include/cmt.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/include/cmt.h Tue Mar 30 20:02:28 2010 (r205921, copy of r203829, head/sys/sparc64/include/cmt.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * 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. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_CMT_H_ +#define _MACHINE_CMT_H_ + +#define INTR_ID_ID_SHIFT (0) +#define INTR_ID_ID_SIZE (10) +#define INTR_ID_ID_MASK \ + (((1 << INTR_ID_ID_SIZE) - 1) << INTR_ID_ID_SHIFT) + +#define INTR_ID_GET_ID(cr) ((cr & INTR_ID_ID_MASK) >> INTR_ID_ID_SHIFT) + +#endif /* _MACHINE_CMT_H_ */ Copied: stable/7/sys/sparc64/include/fireplane.h (from r203829, head/sys/sparc64/include/fireplane.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/include/fireplane.h Tue Mar 30 20:02:28 2010 (r205921, copy of r203829, head/sys/sparc64/include/fireplane.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * 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. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_FIREPLANE_H_ +#define _MACHINE_FIREPLANE_H_ + +#define FIREPLANE_CR_AID_SHIFT (17) +#define FIREPLANE_CR_AID_SIZE (10) +#define FIREPLANE_CR_AID_MASK \ + (((1 << FIREPLANE_CR_AID_SIZE) - 1) << FIREPLANE_CR_AID_SHIFT) + +#define FIREPLANE_CR_GET_AID(cr) \ + ((cr & FIREPLANE_CR_AID_MASK) >> FIREPLANE_CR_AID_SHIFT) + +#endif /* _MACHINE_FIREPLANE_H_ */ Copied: stable/7/sys/sparc64/include/jbus.h (from r203829, head/sys/sparc64/include/jbus.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/include/jbus.h Tue Mar 30 20:02:28 2010 (r205921, copy of r203829, head/sys/sparc64/include/jbus.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * 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. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_JBUS_H_ +#define _MACHINE_JBUS_H_ + +#define JBUS_CR_JID_SHIFT (17) +#define JBUS_CR_JID_SIZE (3) +#define JBUS_CR_JID_MASK \ + (((1 << JBUS_CR_JID_SIZE) - 1) << JBUS_CR_JID_SHIFT) + +#define JBUS_CR_GET_JID(cr) ((cr & JBUS_CR_JID_MASK) >> JBUS_CR_JID_SHIFT) + +#endif /* _MACHINE_JBUS_H_ */ Modified: stable/7/sys/sun4v/include/asi.h ============================================================================== --- stable/7/sys/sun4v/include/asi.h Tue Mar 30 20:02:26 2010 (r205920) +++ stable/7/sys/sun4v/include/asi.h Tue Mar 30 20:02:28 2010 (r205921) @@ -158,6 +158,11 @@ #define AA_DMMU_TAR 0x30 #define ASI_UPA_CONFIG_REG 0x4a /* US-I, II */ +#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG 0x0 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_ADDRESS 0x8 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG_2 0x10 /* US-IV{,+} */ +#define ASI_JBUS_CONFIG_REG 0x4a /* US-IIIi{,+} */ #define ASI_IMMU 0x50 #define ASI_ITLB_DATA_IN_REG 0x54 #define ASI_ITLB_DATA_ACCESS_REG 0x55 @@ -167,5 +172,7 @@ #define ASI_DTLB_DATA_IN_REG 0x5c #define ASI_DTLB_DATA_ACCESS_REG 0x5d #define ASI_DTLB_TAG_READ_REG 0x5e +#define ASI_INTR_ID 0x63 /* US-IV{,+} */ +#define AA_INTR_ID 0x0 /* US-IV{,+} */ #endif /* !_MACHINE_ASI_H_ */ Copied: stable/7/sys/sun4v/include/cmt.h (from r203829, head/sys/sun4v/include/cmt.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sun4v/include/cmt.h Tue Mar 30 20:02:28 2010 (r205921, copy of r203829, head/sys/sun4v/include/cmt.h) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include Copied: stable/7/sys/sun4v/include/fireplane.h (from r203829, head/sys/sun4v/include/fireplane.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sun4v/include/fireplane.h Tue Mar 30 20:02:28 2010 (r205921, copy of r203829, head/sys/sun4v/include/fireplane.h) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include Copied: stable/7/sys/sun4v/include/jbus.h (from r203829, head/sys/sun4v/include/jbus.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sun4v/include/jbus.h Tue Mar 30 20:02:28 2010 (r205921, copy of r203829, head/sys/sun4v/include/jbus.h) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:05:23 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE271065672; Tue, 30 Mar 2010 20:05:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B81C8FC18; Tue, 30 Mar 2010 20:05:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UK5MNP081143; Tue, 30 Mar 2010 20:05:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UK5MgW081141; Tue, 30 Mar 2010 20:05:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302005.o2UK5MgW081141@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205923 - stable/7/sys/boot/sparc64/loader X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:05:23 -0000 Author: marius Date: Tue Mar 30 20:05:22 2010 New Revision: 205923 URL: http://svn.freebsd.org/changeset/base/205923 Log: MFC: r203830, r203831 Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves. Unlike direct access the firmware methods don't automatically use the next free (?) TLB slot, instead the slot to be used has to be specified. We allocate the TLB slots for the kernel top-down as OpenSolaris suggests that the firmware will always allocate the ones for its own use bottom-up. Besides being simpler, according to OpenBSD using the firmware methods is required to allow booting on Sun Fire E10K with multi-systemboard domains. Modified: stable/7/sys/boot/sparc64/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Tue Mar 30 20:05:20 2010 (r205922) +++ stable/7/sys/boot/sparc64/loader/main.c Tue Mar 30 20:05:22 2010 (r205923) @@ -97,10 +97,10 @@ typedef void kernel_entry_t(vm_offset_t void *openfirmware); static inline u_long dtlb_get_data_sun4u(u_int); -static void dtlb_enter_sun4u(u_long, u_long); +static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); static inline u_long itlb_get_data_sun4u(u_int); -static void itlb_enter_sun4u(u_long, u_long); +static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); extern vm_offset_t md_load(char *, vm_offset_t *); @@ -483,55 +483,24 @@ itlb_va_to_pa_sun4u(vm_offset_t va) return (-1); } -static void -dtlb_enter_sun4u(u_long vpn, u_long data) +static int +dtlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) { - u_long reg; - reg = rdpr(pstate); - wrpr(pstate, reg & ~PSTATE_IE, 0); - stxa(AA_DMMU_TAR, ASI_DMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(0, ASI_DTLB_DATA_IN_REG, data); - membar(Sync); - wrpr(pstate, reg, 0); + return (OF_call_method("SUNW,dtlb-load", mmu, 3, 0, index, data, + virt)); } -static void -itlb_enter_sun4u(u_long vpn, u_long data) +static int +itlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) { - u_long reg; - int i; - reg = rdpr(pstate); - wrpr(pstate, reg & ~PSTATE_IE, 0); - - if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp) { - /* - * Search an unused slot != 0 and explicitly enter the data - * and tag there in order to avoid Cheetah+ erratum 34. - */ - for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) - continue; - - stxa(AA_IMMU_TAR, ASI_IMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); - flush(PROMBASE); - break; - } - wrpr(pstate, reg, 0); - if (i == itlb_slot_max) - panic("%s: could not find an unused slot", __func__); - return; - } - - stxa(AA_IMMU_TAR, ASI_IMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(0, ASI_ITLB_DATA_IN_REG, data); - flush(PROMBASE); - wrpr(pstate, reg, 0); + if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp && index == 0 && + (data & TD_L) != 0) + panic("%s: won't enter locked TLB entry at index 0 on USIII+", + __func__); + return (OF_call_method("SUNW,itlb-load", mmu, 3, 0, index, data, + virt)); } static void @@ -581,6 +550,7 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ { vm_offset_t pa, mva; u_long data; + u_int index; if (va + len > curkva) curkva = va + len; @@ -618,12 +588,20 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ TD_CV | TD_P | TD_W; dtlb_store[dtlb_slot].te_pa = pa; dtlb_store[dtlb_slot].te_va = va; + index = dtlb_slot_max - dtlb_slot - 1; + if (dtlb_enter_sun4u(index, data, va) < 0) + panic("%s: can't enter dTLB slot %d data " + "%#lx va %#lx", __func__, index, data, + va); + dtlb_slot++; itlb_store[itlb_slot].te_pa = pa; itlb_store[itlb_slot].te_va = va; - dtlb_slot++; + index = itlb_slot_max - itlb_slot - 1; + if (itlb_enter_sun4u(index, data, va) < 0) + panic("%s: can't enter iTLB slot %d data " + "%#lx va %#lxd", __func__, index, data, + va); itlb_slot++; - dtlb_enter_sun4u(va, data); - itlb_enter_sun4u(va, data); pa = (vm_offset_t)-1; } len -= len > PAGE_SIZE_4M ? PAGE_SIZE_4M : len; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:12:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD00D1065676; Tue, 30 Mar 2010 20:12:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BBC08FC1B; Tue, 30 Mar 2010 20:12:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKCkpE082916; Tue, 30 Mar 2010 20:12:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKCkYQ082913; Tue, 30 Mar 2010 20:12:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302012.o2UKCkYQ082913@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205925 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:12:46 -0000 Author: marius Date: Tue Mar 30 20:12:46 2010 New Revision: 205925 URL: http://svn.freebsd.org/changeset/base/205925 Log: MFC: r203833 - At least the trap table of the Sun Fire V1280 firmware apparently has no cleanwindows handler so just remove trying to trigger it from _start and the AP trampoline code as that leads to a crash there. This should be okay as leaking data from the OFW via the CPU registers on start of the kernel should be no real concern. - Make the comments of _start and the AP trampoline code regarding the initializations they perform match each other and reality. - Make the comments of the AP trampoline code regarding iTLB accesses refer to the right macro. Modified: stable/7/sys/sparc64/sparc64/locore.S stable/7/sys/sparc64/sparc64/mp_locore.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/locore.S Tue Mar 30 20:12:42 2010 (r205924) +++ stable/7/sys/sparc64/sparc64/locore.S Tue Mar 30 20:12:46 2010 (r205925) @@ -46,12 +46,14 @@ ENTRY(btext) ENTRY(_start) /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), no clean - * windows, pil 0, and floating point disabled. + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * floating point disabled. + * Note that some firmware versions don't implement a clean window + * trap handler so we unfortunately can't clear the windows by setting + * %cleanwin to zero here. */ wrpr %g0, PSTATE_NORMAL, %pstate flushw - wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil wr %g0, 0, %fprs Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:12:42 2010 (r205924) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:12:46 2010 (r205925) @@ -44,12 +44,14 @@ __FBSDID("$FreeBSD$"); .text _ALIGN_TEXT /* - * Initialize misc. state to known values: interrupts disabled, - * normal globals, no clean windows, PIL 0, and floating point - * disabled. + * Initialize misc. state to known values: interrupts disabled, normal + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * floating point disabled. + * Note that some firmware versions don't implement a clean window + * trap handler so we unfortunately can't clear the windows by setting + * %cleanwin to zero here. */ 1: wrpr %g0, PSTATE_NORMAL, %pstate - wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil wr %g0, 0, %fprs @@ -68,7 +70,7 @@ __FBSDID("$FreeBSD$"); setx TD_V | TD_L, %l1, %l0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ ldxa [%g0] ASI_ITLB_DATA_ACCESS_REG, %g0 @@ -94,7 +96,7 @@ __FBSDID("$FreeBSD$"); mov (1 << TLB_DAR_SLOT_SHIFT), %l4 setx TD_V, %l1, %l0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ 2: ldxa [%l4] ASI_ITLB_DATA_ACCESS_REG, %g0 @@ -136,7 +138,7 @@ __FBSDID("$FreeBSD$"); mov (1 << TLB_DAR_SLOT_SHIFT), %l0 setx TD_V, %o1, %o0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ 5: ldxa [%l0] ASI_ITLB_DATA_ACCESS_REG, %g0 From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:29:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1331065677; Tue, 30 Mar 2010 20:29:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D78588FC15; Tue, 30 Mar 2010 20:29:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKTjmt086748; Tue, 30 Mar 2010 20:29:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKTjnu086741; Tue, 30 Mar 2010 20:29:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302029.o2UKTjnu086741@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205926 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:29:46 -0000 Author: marius Date: Tue Mar 30 20:29:45 2010 New Revision: 205926 URL: http://svn.freebsd.org/changeset/base/205926 Log: MFC: r203838 - Search the whole OFW device tree instead of only the children of the root nexus device for the CPUs as starting with UltraSPARC IV the 'cpu' nodes hang off of from 'cmp' (chip multi-threading processor) or 'core' or combinations thereof. Also in large UltraSPARC III based machines the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which group snooping-coherency domains together instead of directly from the nexus. It would be great if we could use newbus to deal with the different ways the 'cpu' devices can hang off of pseudo ones but unfortunately both cpu_mp_setmaxid() and sparc64_init() have to work prior to regular device probing. - Add support for UltraSPARC IV and IV+ CPUs. Due to the fact that these are multi-core each CPU has two Fireplane config registers and thus the module/target ID has to be determined differently so the one specific to a certain core is used. Similarly, starting with UltraSPARC IV the individual cores use a different property in the OFW device tree to indicate the CPU/core ID as it no longer is in coincidence with the shared slot/socket ID. This involves changing the MD KTR code to not directly read the UPA module ID either. We use the MID stored in the per-CPU data instead of calling cpu_get_mid() as a replacement in order prevent clobbering any registers as side-effect in the assembler version. This requires CATR() invocations from mp_startup() prior to mapping the per-CPU pages to be removed though. While at it additionally distinguish between CPUs with Fireplane and JBus interconnects as these also use slightly different sizes for the JBus/agent/module/target IDs. - Make sparc64_shutdown_final() static as it's not used outside of machdep.c. Modified: stable/7/sys/sparc64/include/ktr.h stable/7/sys/sparc64/include/md_var.h stable/7/sys/sparc64/include/upa.h stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/ktr.h ============================================================================== --- stable/7/sys/sparc64/include/ktr.h Tue Mar 30 20:12:46 2010 (r205925) +++ stable/7/sys/sparc64/include/ktr.h Tue Mar 30 20:29:45 2010 (r205926) @@ -34,11 +34,9 @@ #include -#include - #ifndef LOCORE -#define KTR_CPU UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)) +#define KTR_CPU PCPU_GET(mid) #else @@ -74,7 +72,7 @@ l2: add r2, 1, r3 ; \ add r1, r2, r1 ; \ rd %tick, r2 ; \ stx r2, [r1 + KTR_TIMESTAMP] ; \ - UPA_GET_MID(r2) ; \ + lduw [PCPU(MID)], r2 ; \ stw r2, [r1 + KTR_CPU] ; \ stw %g0, [r1 + KTR_LINE] ; \ stx %g0, [r1 + KTR_FILE] ; \ @@ -84,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - UPA_GET_MID(r1) ; \ + lduw [PCPU(MID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: stable/7/sys/sparc64/include/md_var.h ============================================================================== --- stable/7/sys/sparc64/include/md_var.h Tue Mar 30 20:12:46 2010 (r205925) +++ stable/7/sys/sparc64/include/md_var.h Tue Mar 30 20:29:45 2010 (r205926) @@ -47,6 +47,8 @@ extern vm_paddr_t kstack0_phys; struct pcpu; struct md_utrap; +char *cpu_cpuid_prop(void); +uint32_t cpu_get_mid(void); void cpu_identify(u_long vers, u_int clock, u_int id); void cpu_setregs(struct pcpu *pc); int is_physical_memory(vm_paddr_t addr); Modified: stable/7/sys/sparc64/include/upa.h ============================================================================== --- stable/7/sys/sparc64/include/upa.h Tue Mar 30 20:12:46 2010 (r205925) +++ stable/7/sys/sparc64/include/upa.h Tue Mar 30 20:29:45 2010 (r205926) @@ -26,25 +26,16 @@ */ #ifndef _MACHINE_UPA_H_ -#define _MACHINE_UPA_H_ +#define _MACHINE_UPA_H_ #define UPA_MEMSTART 0x1c000000000UL #define UPA_MEMEND 0x1ffffffffffUL #define UPA_CR_MID_SHIFT (17) #define UPA_CR_MID_SIZE (5) -#define UPA_CR_MID_MASK \ +#define UPA_CR_MID_MASK \ (((1 << UPA_CR_MID_SIZE) - 1) << UPA_CR_MID_SHIFT) #define UPA_CR_GET_MID(cr) ((cr & UPA_CR_MID_MASK) >> UPA_CR_MID_SHIFT) -#ifdef LOCORE - -#define UPA_GET_MID(r1) \ - ldxa [%g0] ASI_UPA_CONFIG_REG, r1 ; \ - srlx r1, UPA_CR_MID_SHIFT, r1 ; \ - and r1, (1 << UPA_CR_MID_SIZE) - 1, r1 - -#endif - #endif /* _MACHINE_UPA_H_ */ Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Tue Mar 30 20:12:46 2010 (r205925) +++ stable/7/sys/sparc64/sparc64/machdep.c Tue Mar 30 20:29:45 2010 (r205926) @@ -89,10 +89,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include +#include #include #include #include @@ -142,11 +145,12 @@ static int cpu_use_vis = 1; cpu_block_copy_t *cpu_block_copy; cpu_block_zero_t *cpu_block_zero; +static phandle_t find_bsp(phandle_t node, uint32_t bspid); void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); -void sparc64_shutdown_final(void *dummy, int howto); +static void sparc64_shutdown_final(void *dummy, int howto); -static void cpu_startup(void *); +static void cpu_startup(void *arg); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); CTASSERT((1 << INT_SHIFT) == sizeof(int)); @@ -235,18 +239,94 @@ spinlock_exit(void) wrpr(pil, td->td_md.md_saved_pil, 0); } +static phandle_t +find_bsp(phandle_t node, uint32_t bspid) +{ + char type[sizeof("cpu")]; + phandle_t child; + uint32_t cpuid; + + for (; node != 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) { + child = find_bsp(child, bspid); + if (child > 0) + return (child); + } else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + sizeof(cpuid)) <= 0) + continue; + if (cpuid == bspid) + return (node); + } + } + return (0); +} + +char * +cpu_cpuid_prop(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return ("upa-portid"); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return ("portid"); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return ("cpuid"); + default: + return (""); + } +} + +uint32_t +cpu_get_mid(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return (UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + return (FIREPLANE_CR_GET_AID(ldxa(AA_FIREPLANE_CONFIG, + ASI_FIREPLANE_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return (JBUS_CR_GET_JID(ldxa(0, ASI_JBUS_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (INTR_ID_GET_ID(ldxa(AA_INTR_ID, ASI_INTR_ID))); + default: + return (0); + } +} + void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) { - char type[8]; char *env; struct pcpu *pc; vm_offset_t end; vm_offset_t va; caddr_t kmdp; - phandle_t child; phandle_t root; - uint32_t portid; end = 0; kmdp = NULL; @@ -311,7 +391,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_addr = (vm_offset_t)pcpu0; - pc->pc_mid = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); + pc->pc_mid = cpu_get_mid(); pc->pc_tlb_ctx = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; @@ -320,24 +400,11 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Determine the OFW node and frequency of the BSP (and ensure the * BSP is in the device tree in the first place). */ - pc->pc_node = 0; root = OF_peer(0); - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (OF_getprop(child, "device_type", type, sizeof(type)) <= 0) - continue; - if (strcmp(type, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &portid, sizeof(portid)) <= 0) - continue; - if (portid == pc->pc_mid) { - pc->pc_node = child; - break; - } - } + pc->pc_node = find_bsp(root, pc->pc_mid); if (pc->pc_node == 0) OF_exit(); - if (OF_getprop(child, "clock-frequency", &pc->pc_clock, + if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, sizeof(pc->pc_clock)) <= 0) OF_exit(); @@ -830,7 +897,7 @@ cpu_halt(void) cpu_shutdown(&args); } -void +static void sparc64_shutdown_final(void *dummy, int howto) { static struct { Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:12:46 2010 (r205925) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:29:45 2010 (r205926) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "assym.s" @@ -212,14 +211,8 @@ ENTRY(mp_startup) nop wr %l1, 0, %asr24 -3: UPA_GET_MID(%o0) - -#if KTR_COMPILE & KTR_SMP - CATR(KTR_SMP, "mp_start: CPU %d entered kernel" - , %g1, %g2, %g3, 7, 8, 9) - stx %o0, [%g1 + KTR_PARM1] -9: -#endif +3: call cpu_get_mid + nop /* * Inform the boot processor we have inited. @@ -236,13 +229,6 @@ ENTRY(mp_startup) bne %xcc, 4b nop -#if KTR_COMPILE & KTR_SMP - CATR(KTR_SMP, "_mp_start: CPU %d got start signal" - , %g1, %g2, %g3, 7, 8, 9) - stx %o0, [%g1 + KTR_PARM1] -9: -#endif - add %l0, CSA_TTES, %l1 clr %l2 @@ -283,7 +269,7 @@ ENTRY(mp_startup) #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, - "_mp_start: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" + "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) lduw [%l1 + PC_CPUID], %g2 stx %g2, [%g1 + KTR_PARM1] Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Tue Mar 30 20:12:46 2010 (r205925) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Tue Mar 30 20:29:45 2010 (r205926) @@ -119,7 +119,11 @@ static u_int cpuid_to_mid[MAXCPU]; static int isjbus; static volatile u_int shutdown_cpus; +static void ap_count(phandle_t node, u_int mid); +static void ap_start(phandle_t node, u_int mid); static void cpu_mp_unleash(void *v); +static void foreach_ap(phandle_t node, void (*func)(phandle_t node, + u_int mid)); static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg); @@ -166,25 +170,56 @@ mp_init(void) cpu_ipi_selected = spitfire_ipi_selected; } +static void +foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid)) +{ + char type[sizeof("cpu")]; + phandle_t child; + u_int cpuid; + + /* There's no need to traverse the whole OFW tree twice. */ + if (mp_maxid > 0 && mp_ncpus >= mp_maxid + 1) + return; + + for (; node != 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) + foreach_ap(child, func); + else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + sizeof(cpuid)) <= 0) + panic("%s: can't get module ID", __func__); + if (cpuid == PCPU_GET(mid)) + continue; + (*func)(node, cpuid); + } + } +} + /* * Probe for other CPUs. */ void -cpu_mp_setmaxid(void) +cpu_mp_setmaxid() { - char buf[128]; - phandle_t child; - u_int cpus; all_cpus = 1 << curcpu; mp_ncpus = 1; + mp_maxid = 0; + + foreach_ap(OF_child(OF_peer(0)), ap_count); +} + +static void +ap_count(phandle_t node __unused, u_int mid __unused) +{ - cpus = 0; - for (child = OF_child(OF_peer(0)); child != 0; child = OF_peer(child)) - if (OF_getprop(child, "device_type", buf, sizeof(buf)) > 0 && - strcmp(buf, "cpu") == 0) - cpus++; - mp_maxid = cpus - 1; + mp_maxid++; } int @@ -221,15 +256,6 @@ sun4u_startcpu(phandle_t cpu, void *func void cpu_mp_start(void) { - char buf[128]; - volatile struct cpu_start_args *csa; - struct pcpu *pc; - register_t s; - vm_offset_t va; - phandle_t child; - u_int mid; - u_int clock; - u_int cpuid; mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN); @@ -241,63 +267,67 @@ cpu_mp_start(void) cpuid_to_mid[curcpu] = PCPU_GET(mid); - csa = &cpu_start_args; - for (child = OF_child(OF_peer(0)); child != 0 && mp_ncpus <= MAXCPU; - child = OF_peer(child)) { - if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0 || - strcmp(buf, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &mid, sizeof(mid)) <= 0) - panic("%s: can't get module ID", __func__); - if (mid == PCPU_GET(mid)) - continue; - if (OF_getprop(child, "clock-frequency", &clock, - sizeof(clock)) <= 0) - panic("%s: can't get clock", __func__); - if (clock != PCPU_GET(clock)) - hardclock_use_stick = 1; + foreach_ap(OF_child(OF_peer(0)), ap_start); + KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, + ("%s: can only IPI a maximum of %d JBus-CPUs", + __func__, IDR_JALAPENO_MAX_BN_PAIRS)); + PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu)); + smp_active = 1; +} - csa->csa_state = 0; - sun4u_startcpu(child, (void *)mp_tramp, 0); - s = intr_disable(); - while (csa->csa_state != CPU_TICKSYNC) +static void +ap_start(phandle_t node, u_int mid) +{ + volatile struct cpu_start_args *csa; + struct pcpu *pc; + register_t s; + vm_offset_t va; + u_int clock; + u_int cpuid; + + if (mp_ncpus > MAXCPU) + return; + + if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0) + panic("%s: can't get clock", __func__); + if (clock != PCPU_GET(clock)) + hardclock_use_stick = 1; + + csa = &cpu_start_args; + csa->csa_state = 0; + sun4u_startcpu(node, (void *)mp_tramp, 0); + s = intr_disable(); + while (csa->csa_state != CPU_TICKSYNC) + ; + membar(StoreLoad); + csa->csa_tick = rd(tick); + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + while (csa->csa_state != CPU_STICKSYNC) ; membar(StoreLoad); - csa->csa_tick = rd(tick); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { - while (csa->csa_state != CPU_STICKSYNC) - ; - membar(StoreLoad); - csa->csa_stick = rdstick(); - } - while (csa->csa_state != CPU_INIT) - ; - csa->csa_tick = csa->csa_stick = 0; - intr_restore(s); + csa->csa_stick = rdstick(); + } + while (csa->csa_state != CPU_INIT) + ; + csa->csa_tick = csa->csa_stick = 0; + intr_restore(s); - cpuid = mp_ncpus++; - cpuid_to_mid[cpuid] = mid; - cpu_identify(csa->csa_ver, clock, cpuid); - - va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE); - pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; - pcpu_init(pc, cpuid, sizeof(*pc)); - pc->pc_addr = va; - pc->pc_clock = clock; - pc->pc_mid = mid; - pc->pc_node = child; + cpuid = mp_ncpus++; + cpuid_to_mid[cpuid] = mid; + cpu_identify(csa->csa_ver, clock, cpuid); + + va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE); + pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; + pcpu_init(pc, cpuid, sizeof(*pc)); + pc->pc_addr = va; + pc->pc_clock = clock; + pc->pc_mid = mid; + pc->pc_node = node; - cache_init(pc); + cache_init(pc); - all_cpus |= 1 << cpuid; - intr_add_cpu(cpuid); - } - KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, - ("%s: can only IPI a maximum of %d JBus-CPUs", - __func__, IDR_JALAPENO_MAX_BN_PAIRS)); - PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu)); - smp_active = 1; + all_cpus |= 1 << cpuid; + intr_add_cpu(cpuid); } void From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:38:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD9FF106566C; Tue, 30 Mar 2010 20:38:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD658FC1C; Tue, 30 Mar 2010 20:38:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKcKVA088754; Tue, 30 Mar 2010 20:38:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKcK0v088752; Tue, 30 Mar 2010 20:38:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302038.o2UKcK0v088752@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205929 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:38:20 -0000 Author: marius Date: Tue Mar 30 20:38:20 2010 New Revision: 205929 URL: http://svn.freebsd.org/changeset/base/205929 Log: MFC: r203839 Style fixes Modified: stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Tue Mar 30 20:38:18 2010 (r205928) +++ stable/7/sys/sparc64/sparc64/pmap.c Tue Mar 30 20:38:20 2010 (r205929) @@ -241,6 +241,7 @@ PMAP_STATS_VAR(pmap_nnew_thread_oc); */ static int mr_cmp(const void *a, const void *b); static int om_cmp(const void *a, const void *b); + static int mr_cmp(const void *a, const void *b) { @@ -256,6 +257,7 @@ mr_cmp(const void *a, const void *b) else return (0); } + static int om_cmp(const void *a, const void *b) { @@ -1106,10 +1108,9 @@ pmap_release(pmap_t pm) * to a kernel thread, leaving the pmap pointer unchanged. */ mtx_lock_spin(&sched_lock); - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) if (pc->pc_pmap == pm) pc->pc_pmap = NULL; - } mtx_unlock_spin(&sched_lock); obj = pm->pm_tsb_obj; @@ -1145,7 +1146,7 @@ pmap_growkernel(vm_offset_t addr) int pmap_remove_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, - vm_offset_t va) + vm_offset_t va) { vm_page_t m; u_long data; @@ -1193,12 +1194,10 @@ pmap_remove(pmap_t pm, vm_offset_t start tsb_foreach(pm, NULL, start, end, pmap_remove_tte); tlb_context_demap(pm); } else { - for (va = start; va < end; va += PAGE_SIZE) { - if ((tp = tsb_tte_lookup(pm, va)) != NULL) { - if (!pmap_remove_tte(pm, NULL, tp, va)) - break; - } - } + for (va = start; va < end; va += PAGE_SIZE) + if ((tp = tsb_tte_lookup(pm, va)) != NULL && + !pmap_remove_tte(pm, NULL, tp, va)) + break; tlb_range_demap(pm, start, end - 1); } PMAP_UNLOCK(pm); @@ -1240,7 +1239,7 @@ pmap_remove_all(vm_page_t m) int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, - vm_offset_t va) + vm_offset_t va) { u_long data; vm_page_t m; @@ -1282,10 +1281,9 @@ pmap_protect(pmap_t pm, vm_offset_t sva, tsb_foreach(pm, NULL, sva, eva, pmap_protect_tte); tlb_context_demap(pm); } else { - for (va = sva; va < eva; va += PAGE_SIZE) { + for (va = sva; va < eva; va += PAGE_SIZE) if ((tp = tsb_tte_lookup(pm, va)) != NULL) pmap_protect_tte(pm, NULL, tp, va); - } tlb_range_demap(pm, sva, eva - 1); } PMAP_UNLOCK(pm); @@ -1381,21 +1379,18 @@ pmap_enter_locked(pmap_t pm, vm_offset_t */ if ((prot & VM_PROT_WRITE) != 0) { tp->tte_data |= TD_SW; - if (wired) { + if (wired) tp->tte_data |= TD_W; - } vm_page_flag_set(m, PG_WRITEABLE); - } else if ((data & TD_W) != 0) { + } else if ((data & TD_W) != 0) vm_page_dirty(m); - } /* * If we're turning on execute permissions, flush the icache. */ if ((prot & VM_PROT_EXECUTE) != 0) { - if ((data & TD_EXEC) == 0) { + if ((data & TD_EXEC) == 0) icache_page_inval(pa); - } tp->tte_data |= TD_EXEC; } @@ -1490,7 +1485,7 @@ pmap_enter_quick(pmap_t pm, vm_offset_t void pmap_object_init_pt(pmap_t pm, vm_offset_t addr, vm_object_t object, - vm_pindex_t pindex, vm_size_t size) + vm_pindex_t pindex, vm_size_t size) { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); @@ -1524,7 +1519,8 @@ pmap_change_wiring(pmap_t pm, vm_offset_ } static int -pmap_copy_tte(pmap_t src_pmap, pmap_t dst_pmap, struct tte *tp, vm_offset_t va) +pmap_copy_tte(pmap_t src_pmap, pmap_t dst_pmap, struct tte *tp, + vm_offset_t va) { vm_page_t m; u_long data; @@ -1562,10 +1558,9 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm pmap_copy_tte); tlb_context_demap(dst_pmap); } else { - for (va = src_addr; va < src_addr + len; va += PAGE_SIZE) { + for (va = src_addr; va < src_addr + len; va += PAGE_SIZE) if ((tp = tsb_tte_lookup(src_pmap, va)) != NULL) pmap_copy_tte(src_pmap, dst_pmap, tp, va); - } tlb_range_demap(dst_pmap, src_addr, src_addr + len - 1); } vm_page_unlock_queues(); @@ -1798,10 +1793,9 @@ pmap_page_is_mapped(vm_page_t m) if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) return (FALSE); mtx_assert(&vm_page_queue_mtx, MA_OWNED); - TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { + TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) if ((tp->tte_data & TD_PV) != 0) return (TRUE); - } return (FALSE); } @@ -1984,11 +1978,12 @@ pmap_addr_hint(vm_object_t object, vm_of } /* - * Increase the starting virtual address of the given mapping if a - * different alignment might result in more superpage mappings. + * Increase the starting virtual address of the given mapping if a + * different alignment might result in more superpage mappings. */ void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { + } From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:39:49 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F34C81065675; Tue, 30 Mar 2010 20:39:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7FC38FC18; Tue, 30 Mar 2010 20:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKdmOF089177; Tue, 30 Mar 2010 20:39:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKdmLo089175; Tue, 30 Mar 2010 20:39:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302039.o2UKdmLo089175@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205931 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:39:49 -0000 Author: marius Date: Tue Mar 30 20:39:48 2010 New Revision: 205931 URL: http://svn.freebsd.org/changeset/base/205931 Log: MFC: r203843 Resurrect nexusvar.h from r167307. Added: stable/7/sys/sparc64/include/nexusvar.h - copied unchanged from r203843, head/sys/sparc64/include/nexusvar.h Modified: Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Copied: stable/7/sys/sparc64/include/nexusvar.h (from r203843, head/sys/sparc64/include/nexusvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/include/nexusvar.h Tue Mar 30 20:39:48 2010 (r205931, copy of r203843, head/sys/sparc64/include/nexusvar.h) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2001 by Thomas Moestl . + * All rights reserved. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ + +enum nexus_ivars { + NEXUS_IVAR_NODE, + NEXUS_IVAR_NAME, + NEXUS_IVAR_DEVICE_TYPE, + NEXUS_IVAR_MODEL, + NEXUS_IVAR_REG, + NEXUS_IVAR_NREG, + NEXUS_IVAR_INTERRUPTS, + NEXUS_IVAR_NINTERRUPTS, + NEXUS_IVAR_DMATAG, +}; + +#define NEXUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(nexus, var, NEXUS, ivar, type) + +NEXUS_ACCESSOR(node, NODE, phandle_t) +NEXUS_ACCESSOR(name, NAME, char *) +NEXUS_ACCESSOR(device_type, DEVICE_TYPE, char *) +NEXUS_ACCESSOR(model, MODEL, char *) +NEXUS_ACCESSOR(reg, REG, struct upa_regs *) +NEXUS_ACCESSOR(nreg, NREG, int) +NEXUS_ACCESSOR(interrupts, INTERRUPTS, u_int *) +NEXUS_ACCESSOR(ninterrupts, NINTERRUPTS, int) +NEXUS_ACCESSOR(dmatag, DMATAG, bus_dma_tag_t) + +#undef NEXUS_ACCESSOR + +#endif /* _MACHINE_NEXUSVAR_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:44:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA5571065675; Tue, 30 Mar 2010 20:44:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B86678FC1C; Tue, 30 Mar 2010 20:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKi5iD090287; Tue, 30 Mar 2010 20:44:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKi5Ju090284; Tue, 30 Mar 2010 20:44:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302044.o2UKi5Ju090284@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205934 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:44:06 -0000 Author: marius Date: Tue Mar 30 20:44:05 2010 New Revision: 205934 URL: http://svn.freebsd.org/changeset/base/205934 Log: MFC: r203845 - Add the 'cmp' and 'core' pseudo-busses which are used to group CPU cores to the exclusion lists as the CPU nodes aren't handled as regular devices either. Also add the pseudo-devices found in Sun Fire V1280. - Allow nexus_attach() and nexus_alloc_resource() to be used by drivers derived from nexus(4) for subordinate busses. - Don't add the zero-sized memory resources of glue devices to the resource lists. Modified: stable/7/sys/sparc64/include/nexusvar.h stable/7/sys/sparc64/sparc64/nexus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/nexusvar.h ============================================================================== --- stable/7/sys/sparc64/include/nexusvar.h Tue Mar 30 20:44:04 2010 (r205933) +++ stable/7/sys/sparc64/include/nexusvar.h Tue Mar 30 20:44:05 2010 (r205934) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 by Thomas Moestl . + * Copyright (c) 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,48 +11,24 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * 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. * * $FreeBSD$ */ #ifndef _MACHINE_NEXUSVAR_H_ -#define _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ -enum nexus_ivars { - NEXUS_IVAR_NODE, - NEXUS_IVAR_NAME, - NEXUS_IVAR_DEVICE_TYPE, - NEXUS_IVAR_MODEL, - NEXUS_IVAR_REG, - NEXUS_IVAR_NREG, - NEXUS_IVAR_INTERRUPTS, - NEXUS_IVAR_NINTERRUPTS, - NEXUS_IVAR_DMATAG, -}; - -#define NEXUS_ACCESSOR(var, ivar, type) \ - __BUS_ACCESSOR(nexus, var, NEXUS, ivar, type) - -NEXUS_ACCESSOR(node, NODE, phandle_t) -NEXUS_ACCESSOR(name, NAME, char *) -NEXUS_ACCESSOR(device_type, DEVICE_TYPE, char *) -NEXUS_ACCESSOR(model, MODEL, char *) -NEXUS_ACCESSOR(reg, REG, struct upa_regs *) -NEXUS_ACCESSOR(nreg, NREG, int) -NEXUS_ACCESSOR(interrupts, INTERRUPTS, u_int *) -NEXUS_ACCESSOR(ninterrupts, NINTERRUPTS, int) -NEXUS_ACCESSOR(dmatag, DMATAG, bus_dma_tag_t) - -#undef NEXUS_ACCESSOR +DECLARE_CLASS(nexus_driver); #endif /* _MACHINE_NEXUSVAR_H_ */ Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Tue Mar 30 20:44:04 2010 (r205933) +++ stable/7/sys/sparc64/sparc64/nexus.c Tue Mar 30 20:44:05 2010 (r205934) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -153,17 +154,22 @@ static const char *const nexus_excl_name "aliases", "associations", "chosen", + "cmp", "counter-timer", /* No separate device; handled by psycho/sbus */ + "failsafe", "memory", "openprom", "options", "packages", "rsc", + "sgcn", + "todsg", "virtual-memory", NULL }; static const char *const nexus_excl_type[] = { + "core", "cpu", NULL }; @@ -205,20 +211,24 @@ nexus_attach(device_t dev) device_t cdev; phandle_t node; - node = OF_peer(0); - if (node == -1) - panic("%s: OF_peer failed.", __func__); - - sc = device_get_softc(dev); - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, IV_MAX - 1) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0ULL, ~0ULL) != 0) - panic("%s: failed to set up rmans.", __func__); + if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { + node = OF_peer(0); + if (node == -1) + panic("%s: OF_peer failed.", __func__); + + sc = device_get_softc(dev); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, + IV_MAX - 1) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0ULL, ~0ULL) != 0) + panic("%s: failed to set up rmans.", __func__); + } else + node = ofw_bus_get_node(dev); /* * Allow devices to identify. @@ -346,12 +356,16 @@ nexus_alloc_resource(device_t bus, devic struct rman *rm; struct resource *rv; struct resource_list_entry *rle; + device_t nexus; int isdefault, needactivate, passthrough; isdefault = (start == 0UL && end == ~0UL); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); - sc = device_get_softc(bus); + nexus = bus; + while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) + nexus = device_get_parent(nexus); + sc = device_get_softc(nexus); rle = NULL; if (!passthrough) { @@ -497,8 +511,10 @@ nexus_setup_dinfo(device_t dev, phandle_ for (i = 0; i < nreg; i++) { phys = NEXUS_REG_PHYS(®[i]); size = NEXUS_REG_SIZE(®[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, phys, - phys + size - 1, size); + /* Skip the dummy reg property of glue devices like ssm(4). */ + if (size != 0) + resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, + phys, phys + size - 1, size); } free(reg, M_OFWPROP); From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 30 20:46:10 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57E14106566C; Tue, 30 Mar 2010 20:46:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46DFA8FC12; Tue, 30 Mar 2010 20:46:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKkAOO090823; Tue, 30 Mar 2010 20:46:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKkAol090821; Tue, 30 Mar 2010 20:46:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302046.o2UKkAol090821@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205935 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:46:10 -0000 Author: marius Date: Tue Mar 30 20:46:09 2010 New Revision: 205935 URL: http://svn.freebsd.org/changeset/base/205935 Log: MFC: r203846 Predict KASSERTs to be true. Modified: stable/7/sys/sparc64/include/asmacros.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/asmacros.h ============================================================================== --- stable/7/sys/sparc64/include/asmacros.h Tue Mar 30 20:44:05 2010 (r205934) +++ stable/7/sys/sparc64/include/asmacros.h Tue Mar 30 20:46:09 2010 (r205935) @@ -107,7 +107,7 @@ #ifdef INVARIANTS #define KASSERT(r1, msg) \ - brnz r1, 8f ; \ + brnz,pt r1, 8f ; \ nop ; \ PANIC(msg, r1) ; \ 8: From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 00:42:19 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B99A106564A; Wed, 31 Mar 2010 00:42:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE68E8FC17; Wed, 31 Mar 2010 00:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V0gIuS043668; Wed, 31 Mar 2010 00:42:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V0gIfP043666; Wed, 31 Mar 2010 00:42:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003310042.o2V0gIfP043666@svn.freebsd.org> From: Xin LI Date: Wed, 31 Mar 2010 00:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205952 - stable/7/sys/dev/uart X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 00:42:19 -0000 Author: delphij Date: Wed Mar 31 00:42:18 2010 New Revision: 205952 URL: http://svn.freebsd.org/changeset/base/205952 Log: MFC r204533: Add PCI ID for MCS9901. Submitted by: gcooper PR: kern/144397 Modified: stable/7/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_pci.c Wed Mar 31 00:41:32 2010 (r205951) +++ stable/7/sys/dev/uart/uart_bus_pci.c Wed Mar 31 00:42:18 2010 (r205952) @@ -111,6 +111,8 @@ static struct pci_id pci_ns8250_ids[] = { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, +{ 0x9710, 0x9901, 0xa000, 0x1000, + "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 07:12:13 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 040861065672; Wed, 31 Mar 2010 07:12:13 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E62E48FC08; Wed, 31 Mar 2010 07:12:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V7CCSW030789; Wed, 31 Mar 2010 07:12:12 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V7CC0H030787; Wed, 31 Mar 2010 07:12:12 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003310712.o2V7CC0H030787@svn.freebsd.org> From: Fabien Thomas Date: Wed, 31 Mar 2010 07:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205966 - stable/7/usr.sbin/pmcstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 07:12:13 -0000 Author: fabient Date: Wed Mar 31 07:12:12 2010 New Revision: 205966 URL: http://svn.freebsd.org/changeset/base/205966 Log: MFC r205809: Wait for pmc name in the log before displaying data. This will solve an abort in case of low throughput PMCs. Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/7/usr.sbin/pmcstat/ (props changed) Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat_log.c Wed Mar 31 07:10:40 2010 (r205965) +++ stable/7/usr.sbin/pmcstat/pmcstat_log.c Wed Mar 31 07:12:12 2010 (r205966) @@ -1049,7 +1049,6 @@ pmcstat_pmcindex_to_name(int pmcin) if (pr->pr_pmcin == pmcin) return pmcstat_string_unintern(pr->pr_pmcname); - err(EX_SOFTWARE, "ERROR: cannot find pmcid name"); return NULL; } @@ -1789,19 +1788,23 @@ static void pmcstat_refresh_top(void) { char pmcname[40]; + const char *s; /* If in pause mode do not refresh display. */ if (pmcstat_pause) return; + /* Wait until PMC pop in the log. */ + s = pmcstat_pmcindex_to_name(pmcstat_pmcinfilter); + if (s == NULL) + return; + /* Format PMC name. */ if (pmcstat_mergepmc) - snprintf(pmcname, sizeof(pmcname), "[%s]", - pmcstat_pmcindex_to_name(pmcstat_pmcinfilter)); + snprintf(pmcname, sizeof(pmcname), "[%s]", s); else snprintf(pmcname, sizeof(pmcname), "%s.%d", - pmcstat_pmcindex_to_name(pmcstat_pmcinfilter), - pmcstat_pmcinfilter); + s, pmcstat_pmcinfilter); PMCSTAT_PRINTBEGIN(); PMCSTAT_PRINTW("PMC: %s Samples: %u processed, %u invalid\n\n", From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 07:52:49 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07E35106564A; Wed, 31 Mar 2010 07:52:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D02448FC0A; Wed, 31 Mar 2010 07:52:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V7qmAb039943; Wed, 31 Mar 2010 07:52:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V7qmWi039941; Wed, 31 Mar 2010 07:52:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310752.o2V7qmWi039941@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 07:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205969 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 07:52:49 -0000 Author: mav Date: Wed Mar 31 07:52:48 2010 New Revision: 205969 URL: http://svn.freebsd.org/changeset/base/205969 Log: MFC r205074: Mask disk_idx to avoid panic because of extra bits set. PR: kern/102211 Submitted by: yoichi Modified: stable/7/sys/dev/ata/ata-raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-raid.c ============================================================================== --- stable/7/sys/dev/ata/ata-raid.c Wed Mar 31 07:49:59 2010 (r205968) +++ stable/7/sys/dev/ata/ata-raid.c Wed Mar 31 07:52:48 2010 (r205969) @@ -2535,22 +2535,24 @@ ata_raid_intel_read_meta(device_t dev, s /* clear out any old info */ for (disk = 0; disk < raid->total_disks; disk++) { + u_int disk_idx = map->disk_idx[disk] & 0xffff; + raid->disks[disk].dev = NULL; - bcopy(meta->disk[map->disk_idx[disk]].serial, + bcopy(meta->disk[disk_idx].serial, raid->disks[disk].serial, sizeof(raid->disks[disk].serial)); raid->disks[disk].sectors = - meta->disk[map->disk_idx[disk]].sectors; + meta->disk[disk_idx].sectors; raid->disks[disk].flags = 0; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ONLINE) + if (meta->disk[disk_idx].flags & INTEL_F_ONLINE) raid->disks[disk].flags |= AR_DF_ONLINE; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ASSIGNED) + if (meta->disk[disk_idx].flags & INTEL_F_ASSIGNED) raid->disks[disk].flags |= AR_DF_ASSIGNED; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_SPARE) { + if (meta->disk[disk_idx].flags & INTEL_F_SPARE) { raid->disks[disk].flags &= ~(AR_DF_ONLINE | AR_DF_ASSIGNED); raid->disks[disk].flags |= AR_DF_SPARE; } - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_DOWN) + if (meta->disk[disk_idx].flags & INTEL_F_DOWN) raid->disks[disk].flags &= ~AR_DF_ONLINE; } } From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 21:32:53 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08822106566B; Wed, 31 Mar 2010 21:32:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8E728FC08; Wed, 31 Mar 2010 21:32:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VLWqs5028057; Wed, 31 Mar 2010 21:32:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VLWq5B028023; Wed, 31 Mar 2010 21:32:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312132.o2VLWq5B028023@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 21:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206004 - in stable/7/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 21:32:53 -0000 Author: marius Date: Wed Mar 31 21:32:52 2010 New Revision: 206004 URL: http://svn.freebsd.org/changeset/base/206004 Log: MFC: r204152, r204164 Some machines can not only consist of CPUs running at different speeds but also of different types, f.e. Sun Fire V890 can be equipped with a mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization and different workarounds for model specific errata. Therefore move the CPU implementation number from a global variable to the per-CPU data. Functions which are called before the latter is available are passed the implementation number as a parameter now. Modified: stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/sparc64/include/cache.h stable/7/sys/sparc64/include/cpu.h stable/7/sys/sparc64/include/md_var.h stable/7/sys/sparc64/include/pcpu.h stable/7/sys/sparc64/include/pmap.h stable/7/sys/sparc64/include/smp.h stable/7/sys/sparc64/include/tick.h stable/7/sys/sparc64/include/ver.h stable/7/sys/sparc64/sparc64/cache.c stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/identcpu.c stable/7/sys/sparc64/sparc64/iommu.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c stable/7/sys/sparc64/sparc64/nexus.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/spitfire.c stable/7/sys/sparc64/sparc64/tick.c stable/7/sys/sparc64/sparc64/trap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/boot/sparc64/loader/main.c Wed Mar 31 21:32:52 2010 (r206004) @@ -137,7 +137,7 @@ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; u_int dtlb_slot; u_int itlb_slot; -int cpu_impl; +static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; Modified: stable/7/sys/sparc64/include/cache.h ============================================================================== --- stable/7/sys/sparc64/include/cache.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/cache.h Wed Mar 31 21:32:52 2010 (r206004) @@ -91,7 +91,7 @@ struct cacheinfo { struct pcpu; -typedef void cache_enable_t(void); +typedef void cache_enable_t(u_int cpu_impl); typedef void cache_flush_t(void); typedef void dcache_page_inval_t(vm_paddr_t pa); typedef void icache_page_inval_t(vm_paddr_t pa); Modified: stable/7/sys/sparc64/include/cpu.h ============================================================================== --- stable/7/sys/sparc64/include/cpu.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/cpu.h Wed Mar 31 21:32:52 2010 (r206004) @@ -52,7 +52,7 @@ extern char btext[]; extern char etext[]; -void cheetah_init(void); +void cheetah_init(u_int cpu_impl); void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); Modified: stable/7/sys/sparc64/include/md_var.h ============================================================================== --- stable/7/sys/sparc64/include/md_var.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/md_var.h Wed Mar 31 21:32:52 2010 (r206004) @@ -47,8 +47,8 @@ extern vm_paddr_t kstack0_phys; struct pcpu; struct md_utrap; -char *cpu_cpuid_prop(void); -uint32_t cpu_get_mid(void); +char *cpu_cpuid_prop(u_int cpu_impl); +uint32_t cpu_get_mid(u_int cpu_impl); void cpu_identify(u_long vers, u_int clock, u_int id); void cpu_setregs(struct pcpu *pc); int is_physical_memory(vm_paddr_t addr); Modified: stable/7/sys/sparc64/include/pcpu.h ============================================================================== --- stable/7/sys/sparc64/include/pcpu.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/pcpu.h Wed Mar 31 21:32:52 2010 (r206004) @@ -54,6 +54,7 @@ struct pmap; u_long pc_tickref; \ u_long pc_tickadj; \ u_int pc_clock; \ + u_int pc_impl; \ u_int pc_mid; \ u_int pc_node; \ u_int pc_tlb_ctx; \ Modified: stable/7/sys/sparc64/include/pmap.h ============================================================================== --- stable/7/sys/sparc64/include/pmap.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/pmap.h Wed Mar 31 21:32:52 2010 (r206004) @@ -80,7 +80,7 @@ struct pmap { #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_set_memattr(m, ma) (void)0 -void pmap_bootstrap(void); +void pmap_bootstrap(u_int cpu_impl); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kenter(vm_offset_t va, vm_page_t m); void pmap_kremove(vm_offset_t); Modified: stable/7/sys/sparc64/include/smp.h ============================================================================== --- stable/7/sys/sparc64/include/smp.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/smp.h Wed Mar 31 21:32:52 2010 (r206004) @@ -93,7 +93,7 @@ void cpu_mp_shutdown(void); typedef void cpu_ipi_selected_t(u_int, u_long, u_long, u_long); extern cpu_ipi_selected_t *cpu_ipi_selected; -void mp_init(void); +void mp_init(u_int cpu_impl); extern struct mtx ipi_mtx; extern struct ipi_cache_args ipi_cache_args; Modified: stable/7/sys/sparc64/include/tick.h ============================================================================== --- stable/7/sys/sparc64/include/tick.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/tick.h Wed Mar 31 21:32:52 2010 (r206004) @@ -31,8 +31,8 @@ extern u_int hardclock_use_stick; -void tick_clear(void); +void tick_clear(u_int cpu_impl); void tick_start(void); -void tick_stop(void); +void tick_stop(u_int cpu_impl); #endif Modified: stable/7/sys/sparc64/include/ver.h ============================================================================== --- stable/7/sys/sparc64/include/ver.h Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/include/ver.h Wed Mar 31 21:32:52 2010 (r206004) @@ -43,24 +43,28 @@ #ifndef LOCORE -#define VER_MANUF_MASK (((1L<> VER_MANUF_SHIFT) -#define VER_IMPL(ver) \ +#define VER_IMPL(ver) \ (((ver) & VER_IMPL_MASK) >> VER_IMPL_SHIFT) -#define VER_MASK(ver) \ +#define VER_MASK(ver) \ (((ver) & VER_MASK_MASK) >> VER_MASK_SHIFT) -#define VER_MAXTL(ver) \ +#define VER_MAXTL(ver) \ (((ver) & VER_MAXTL_MASK) >> VER_MAXTL_SHIFT) -#define VER_MAXWIN(ver) \ +#define VER_MAXWIN(ver) \ (((ver) & VER_MAXWIN_MASK) >> VER_MAXWIN_SHIFT) -extern int cpu_impl; extern char sparc64_model[]; #endif /* !LOCORE */ Modified: stable/7/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cache.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/cache.c Wed Mar 31 21:32:52 2010 (r206004) @@ -130,7 +130,7 @@ cache_init(struct pcpu *pcpu) if ((set & ~(1UL << (ffs(set) - 1))) != 0) panic("cache_init: E$ set size not a power of 2"); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCIII) { cache_enable = cheetah_cache_enable; cache_flush = cheetah_cache_flush; dcache_page_inval = cheetah_dcache_page_inval; Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/cheetah.c Wed Mar 31 21:32:52 2010 (r206004) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); * CPU-specific initialization */ void -cheetah_init(void) +cheetah_init(u_int cpu_impl) { register_t s; @@ -119,7 +119,7 @@ cheetah_init(void) * Enable level 1 caches. */ void -cheetah_cache_enable(void) +cheetah_cache_enable(u_int cpu_impl) { u_long lsu; Modified: stable/7/sys/sparc64/sparc64/identcpu.c ============================================================================== --- stable/7/sys/sparc64/sparc64/identcpu.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/identcpu.c Wed Mar 31 21:32:52 2010 (r206004) @@ -15,7 +15,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -27,8 +26,6 @@ static char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); -int cpu_impl; - void cpu_identify(u_long vers, u_int freq, u_int id) { Modified: stable/7/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/7/sys/sparc64/sparc64/iommu.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/iommu.c Wed Mar 31 21:32:52 2010 (r206004) @@ -130,6 +130,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -377,7 +378,7 @@ iommu_init(const char *name, struct iomm printf("%s: PROM IOTSB size: %d (%d entries)\n", name, obptsbsize, obptsbentries); if ((is->is_flags & IOMMU_PRESERVE_PROM) != 0 && - !(cpu_impl == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { + !(PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { if (obptsbentries > tsbentries) panic("%s: PROM IOTSB entries exceed kernel", __func__); Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/machdep.c Wed Mar 31 21:32:52 2010 (r206004) @@ -145,7 +145,7 @@ static int cpu_use_vis = 1; cpu_block_copy_t *cpu_block_copy; cpu_block_zero_t *cpu_block_zero; -static phandle_t find_bsp(phandle_t node, uint32_t bspid); +static phandle_t find_bsp(phandle_t node, uint32_t bspid, u_int cpu_impl); void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); static void sparc64_shutdown_final(void *dummy, int howto); @@ -240,7 +240,7 @@ spinlock_exit(void) } static phandle_t -find_bsp(phandle_t node, uint32_t bspid) +find_bsp(phandle_t node, uint32_t bspid, u_int cpu_impl) { char type[sizeof("cpu")]; phandle_t child; @@ -249,7 +249,7 @@ find_bsp(phandle_t node, uint32_t bspid) for (; node != 0; node = OF_peer(node)) { child = OF_child(node); if (child > 0) { - child = find_bsp(child, bspid); + child = find_bsp(child, bspid, cpu_impl); if (child > 0) return (child); } else { @@ -258,7 +258,7 @@ find_bsp(phandle_t node, uint32_t bspid) continue; if (strcmp(type, "cpu") != 0) continue; - if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + if (OF_getprop(node, cpu_cpuid_prop(cpu_impl), &cpuid, sizeof(cpuid)) <= 0) continue; if (cpuid == bspid) @@ -269,7 +269,7 @@ find_bsp(phandle_t node, uint32_t bspid) } char * -cpu_cpuid_prop(void) +cpu_cpuid_prop(u_int cpu_impl) { switch (cpu_impl) { @@ -293,7 +293,7 @@ cpu_cpuid_prop(void) } uint32_t -cpu_get_mid(void) +cpu_get_mid(u_int cpu_impl) { switch (cpu_impl) { @@ -327,6 +327,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l vm_offset_t va; caddr_t kmdp; phandle_t root; + u_int cpu_impl; end = 0; kmdp = NULL; @@ -341,12 +342,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Do CPU-specific Initialization. */ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) - cheetah_init(); + cheetah_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). */ - tick_clear(); + tick_clear(cpu_impl); /* * UltraSparc II[e,i] based systems come up with the tick interrupt @@ -356,7 +357,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * enabled, causing an interrupt storm on startup since they are not * handled. */ - tick_stop(); + tick_stop(cpu_impl); /* * Initialize Open Firmware (needed for console). @@ -391,7 +392,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_addr = (vm_offset_t)pcpu0; - pc->pc_mid = cpu_get_mid(); + pc->pc_impl = cpu_impl; + pc->pc_mid = cpu_get_mid(cpu_impl); pc->pc_tlb_ctx = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; @@ -401,7 +403,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * BSP is in the device tree in the first place). */ root = OF_peer(0); - pc->pc_node = find_bsp(root, pc->pc_mid); + pc->pc_node = find_bsp(root, pc->pc_mid, cpu_impl); if (pc->pc_node == 0) OF_exit(); if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, @@ -467,7 +469,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l panic("sparc64_init: cannot determine number of iTLB slots"); cache_init(pc); - cache_enable(); + cache_enable(cpu_impl); uma_set_align(pc->pc_cache.dc_linesize - 1); cpu_block_copy = bcopy; @@ -493,13 +495,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l } #ifdef SMP - mp_init(); + mp_init(cpu_impl); #endif /* * Initialize virtual memory and calculate physmem. */ - pmap_bootstrap(); + pmap_bootstrap(cpu_impl); /* * Initialize tunables. Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Wed Mar 31 21:32:52 2010 (r206004) @@ -202,17 +202,17 @@ ENTRY(mp_startup) cmp %l1, CPU_IMPL_ULTRASPARCIII bl %icc, 3f nop - mov CPU_STICKSYNC, %l1 + mov CPU_STICKSYNC, %l2 membar #StoreLoad - stw %l1, [%l0 + CSA_STATE] + stw %l2, [%l0 + CSA_STATE] -2: ldx [%l0 + CSA_STICK], %l1 - brz %l1, 2b +2: ldx [%l0 + CSA_STICK], %l2 + brz %l2, 2b nop - wr %l1, 0, %asr24 + wr %l2, 0, %asr24 3: call cpu_get_mid - nop + mov %l1, %o0 /* * Inform the boot processor we have inited. Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Wed Mar 31 21:32:52 2010 (r206004) @@ -119,11 +119,11 @@ static u_int cpuid_to_mid[MAXCPU]; static int isjbus; static volatile u_int shutdown_cpus; -static void ap_count(phandle_t node, u_int mid); -static void ap_start(phandle_t node, u_int mid); +static void ap_count(phandle_t node, u_int mid, u_int cpu_impl); +static void ap_start(phandle_t node, u_int mid, u_int cpu_impl); static void cpu_mp_unleash(void *v); static void foreach_ap(phandle_t node, void (*func)(phandle_t node, - u_int mid)); + u_int mid, u_int cpu_impl)); static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg); @@ -137,7 +137,7 @@ CTASSERT(MAXCPU <= sizeof(u_int) * NBBY) CTASSERT(MAXCPU <= sizeof(int) * NBBY); void -mp_init(void) +mp_init(u_int cpu_impl) { struct tte *tp; int i; @@ -171,11 +171,13 @@ mp_init(void) } static void -foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid)) +foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid, + u_int cpu_impl)) { char type[sizeof("cpu")]; phandle_t child; u_int cpuid; + uint32_t cpu_impl; /* There's no need to traverse the whole OFW tree twice. */ if (mp_maxid > 0 && mp_ncpus >= mp_maxid + 1) @@ -191,12 +193,17 @@ foreach_ap(phandle_t node, void (*func)( continue; if (strcmp(type, "cpu") != 0) continue; - if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, - sizeof(cpuid)) <= 0) - panic("%s: can't get module ID", __func__); + if (OF_getprop(node, "implementation#", &cpu_impl, + sizeof(cpu_impl)) <= 0) + panic("%s: couldn't determine CPU " + "implementation", __func__); + if (OF_getprop(node, cpu_cpuid_prop(cpu_impl), &cpuid, + sizeof(cpuid)) <= 0) + panic("%s: couldn't determine CPU module ID", + __func__); if (cpuid == PCPU_GET(mid)) continue; - (*func)(node, cpuid); + (*func)(node, cpuid, cpu_impl); } } } @@ -216,7 +223,7 @@ cpu_mp_setmaxid() } static void -ap_count(phandle_t node __unused, u_int mid __unused) +ap_count(phandle_t node __unused, u_int mid __unused, u_int cpu_impl __unused) { mp_maxid++; @@ -276,20 +283,20 @@ cpu_mp_start(void) } static void -ap_start(phandle_t node, u_int mid) +ap_start(phandle_t node, u_int mid, u_int cpu_impl) { volatile struct cpu_start_args *csa; struct pcpu *pc; register_t s; vm_offset_t va; - u_int clock; u_int cpuid; + uint32_t clock; if (mp_ncpus > MAXCPU) return; if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0) - panic("%s: can't get clock", __func__); + panic("%s: couldn't determine CPU frequency", __func__); if (clock != PCPU_GET(clock)) hardclock_use_stick = 1; @@ -321,6 +328,7 @@ ap_start(phandle_t node, u_int mid) pcpu_init(pc, cpuid, sizeof(*pc)); pc->pc_addr = va; pc->pc_clock = clock; + pc->pc_impl = cpu_impl; pc->pc_mid = mid; pc->pc_node = node; @@ -393,9 +401,9 @@ cpu_mp_bootstrap(struct pcpu *pc) volatile struct cpu_start_args *csa; csa = &cpu_start_args; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) - cheetah_init(); - cache_enable(); + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + cheetah_init(pc->pc_impl); + cache_enable(pc->pc_impl); pmap_map_tsb(); /* * Flush all non-locked TLB entries possibly left over by the Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/nexus.c Wed Mar 31 21:32:52 2010 (r206004) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -521,7 +522,7 @@ nexus_setup_dinfo(device_t dev, phandle_ nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { - if (OF_getprop(node, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + if (OF_getprop(node, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? "upa-portid" : "portid", &ign, sizeof(ign)) <= 0) { device_printf(dev, "<%s>: could not determine portid\n", ndi->ndi_obdinfo.obd_name); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:32:52 2010 (r206004) @@ -278,7 +278,7 @@ om_cmp(const void *a, const void *b) * Bootstrap the system enough to run with virtual memory. */ void -pmap_bootstrap(void) +pmap_bootstrap(u_int cpu_impl) { struct pmap *pm; struct tte *tp; @@ -1538,7 +1538,7 @@ pmap_copy_tte(pmap_t src_pmap, pmap_t ds void pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, - vm_size_t len, vm_offset_t src_addr) + vm_size_t len, vm_offset_t src_addr) { struct tte *tp; vm_offset_t va; Modified: stable/7/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/7/sys/sparc64/sparc64/spitfire.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/spitfire.c Wed Mar 31 21:32:52 2010 (r206004) @@ -56,7 +56,7 @@ PMAP_STATS_VAR(spitfire_icache_npage_inv * Enable the level 1 caches. */ void -spitfire_cache_enable(void) +spitfire_cache_enable(u_int cpu_impl __unused) { u_long lsu; Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/tick.c Wed Mar 31 21:32:52 2010 (r206004) @@ -120,7 +120,7 @@ cpu_initclocks(void) */ } else { clock = PCPU_GET(clock); - intr_setup(PIL_TICK, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + intr_setup(PIL_TICK, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? tick_hardclock_bbwar : tick_hardclock, -1, NULL, NULL); set_cputicker(tick_cputicks, clock, 0); } @@ -322,7 +322,7 @@ tick_start(void) } void -tick_clear(void) +tick_clear(u_int cpu_impl) { if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) @@ -331,7 +331,7 @@ tick_clear(void) } void -tick_stop(void) +tick_stop(u_int cpu_impl) { if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) Modified: stable/7/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/trap.c Wed Mar 31 21:12:27 2010 (r206003) +++ stable/7/sys/sparc64/sparc64/trap.c Wed Mar 31 21:32:52 2010 (r206004) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -380,7 +381,7 @@ trap(struct trapframe *tf) if (tf->tf_tpc > (u_long)fas_nofault_begin && tf->tf_tpc < (u_long)fas_nofault_end) { cache_flush(); - cache_enable(); + cache_enable(PCPU_GET(impl)); tf->tf_tpc = (u_long)fas_fault; tf->tf_tnpc = tf->tf_tpc + 4; error = 0; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 21:41:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCD4A106564A; Wed, 31 Mar 2010 21:41:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA6A18FC17; Wed, 31 Mar 2010 21:41:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VLf3Vn030009; Wed, 31 Mar 2010 21:41:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VLf3WR030007; Wed, 31 Mar 2010 21:41:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312141.o2VLf3WR030007@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 21:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206008 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 21:41:04 -0000 Author: marius Date: Wed Mar 31 21:41:03 2010 New Revision: 206008 URL: http://svn.freebsd.org/changeset/base/206008 Log: MFC: r204153 Starting with UltraSPARC IV CPUs the CPU caches are described with different OFW properties. Modified: stable/7/sys/sparc64/sparc64/cache.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cache.c Wed Mar 31 21:41:00 2010 (r206007) +++ stable/7/sys/sparc64/sparc64/cache.c Wed Mar 31 21:41:03 2010 (r206008) @@ -43,6 +43,7 @@ */ /*- * Copyright (c) 2001 by Thomas Moestl . + * Copyright (c) 2008, 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -89,32 +90,49 @@ icache_page_inval_t *icache_page_inval; #define OF_GET(h, n, v) OF_getprop((h), (n), &(v), sizeof(v)) +static u_int cache_new_prop(u_int cpu_impl); + +static u_int +cache_new_prop(u_int cpu_impl) +{ + + switch (cpu_impl) { + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (1); + default: + return (0); + } +} + /* - * Fill in the cache parameters using the cpu node. + * Fill in the cache parameters using the CPU node. */ void cache_init(struct pcpu *pcpu) { u_long set; + u_int use_new_prop; - if (OF_GET(pcpu->pc_node, "icache-size", - pcpu->pc_cache.ic_size) == -1 || - OF_GET(pcpu->pc_node, "icache-line-size", - pcpu->pc_cache.ic_linesize) == -1 || - OF_GET(pcpu->pc_node, "icache-associativity", - pcpu->pc_cache.ic_assoc) == -1 || - OF_GET(pcpu->pc_node, "dcache-size", - pcpu->pc_cache.dc_size) == -1 || - OF_GET(pcpu->pc_node, "dcache-line-size", - pcpu->pc_cache.dc_linesize) == -1 || - OF_GET(pcpu->pc_node, "dcache-associativity", - pcpu->pc_cache.dc_assoc) == -1 || - OF_GET(pcpu->pc_node, "ecache-size", - pcpu->pc_cache.ec_size) == -1 || - OF_GET(pcpu->pc_node, "ecache-line-size", - pcpu->pc_cache.ec_linesize) == -1 || - OF_GET(pcpu->pc_node, "ecache-associativity", - pcpu->pc_cache.ec_assoc) == -1) + use_new_prop = cache_new_prop(pcpu->pc_impl); + if (OF_GET(pcpu->pc_node, !use_new_prop ? "icache-size" : + "l1-icache-size", pcpu->pc_cache.ic_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "icache-line-size" : + "l1-icache-line-size", pcpu->pc_cache.ic_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "icache-associativity" : + "l1-icache-associativity", pcpu->pc_cache.ic_assoc) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-size" : + "l1-dcache-size", pcpu->pc_cache.dc_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-line-size" : + "l1-dcache-line-size", pcpu->pc_cache.dc_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-associativity" : + "l1-dcache-associativity", pcpu->pc_cache.dc_assoc) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-size" : + "l2-cache-size", pcpu->pc_cache.ec_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-line-size" : + "l2-cache-line-size", pcpu->pc_cache.ec_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-associativity" : + "l2-cache-associativity", pcpu->pc_cache.ec_assoc) == -1) panic("cache_init: could not retrieve cache parameters"); set = pcpu->pc_cache.ic_size / pcpu->pc_cache.ic_assoc; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 21:57:49 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6711065672; Wed, 31 Mar 2010 21:57:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB5968FC1D; Wed, 31 Mar 2010 21:57:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VLvnW3034231; Wed, 31 Mar 2010 21:57:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VLvnha034225; Wed, 31 Mar 2010 21:57:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312157.o2VLvnha034225@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 21:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206010 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 21:57:49 -0000 Author: marius Date: Wed Mar 31 21:57:49 2010 New Revision: 206010 URL: http://svn.freebsd.org/changeset/base/206010 Log: MFC: r205258 - Add TTE and context register bits for the additional page sizes supported by UltraSparc-IV and -IV+ as well as SPARC64 V, VI, VII and VIIIfx CPUs. - Replace TLB_PCXR_PGSZ_MASK and TLB_SCXR_PGSZ_MASK with TLB_CXR_PGSZ_MASK which just is the complement of TLB_CXR_CTX_MASK instead of trying to assemble it from the page size bits which vary across CPUs. - Add macros for the remainder of the SFSR bits, which are useful for at least debugging purposes. Modified: stable/7/sys/sparc64/include/tlb.h stable/7/sys/sparc64/include/tte.h stable/7/sys/sparc64/sparc64/genassym.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/swtch.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/tlb.h ============================================================================== --- stable/7/sys/sparc64/include/tlb.h Wed Mar 31 21:57:48 2010 (r206009) +++ stable/7/sys/sparc64/include/tlb.h Wed Mar 31 21:57:49 2010 (r206010) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2008, 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,11 +36,11 @@ #define TLB_DIRECT_ADDRESS_MASK ((1UL << TLB_DIRECT_ADDRESS_BITS) - 1) #define TLB_DIRECT_PAGE_MASK ((1UL << TLB_DIRECT_PAGE_BITS) - 1) -#define TLB_PHYS_TO_DIRECT(pa) \ +#define TLB_PHYS_TO_DIRECT(pa) \ ((pa) | VM_MIN_DIRECT_ADDRESS) -#define TLB_DIRECT_TO_PHYS(va) \ +#define TLB_DIRECT_TO_PHYS(va) \ ((va) & TLB_DIRECT_ADDRESS_MASK) -#define TLB_DIRECT_TO_TTE_MASK \ +#define TLB_DIRECT_TO_TTE_MASK \ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) @@ -56,18 +57,21 @@ (((1UL << TLB_CXR_CTX_BITS) - 1) << TLB_CXR_CTX_SHIFT) #define TLB_CXR_CTX_SHIFT (0) #define TLB_CXR_PGSZ_BITS (3) -#define TLB_PCXR_PGSZ_MASK \ - ((((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_N_PGSZ0_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_N_PGSZ1_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_P_PGSZ0_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_P_PGSZ1_SHIFT)) +#define TLB_CXR_PGSZ_MASK (~TLB_CXR_CTX_MASK) +#define TLB_PCXR_N_IPGSZ0_SHIFT (53) /* SPARC64 VI, VII, VIIIfx */ +#define TLB_PCXR_N_IPGSZ1_SHIFT (50) /* SPARC64 VI, VII, VIIIfx */ #define TLB_PCXR_N_PGSZ0_SHIFT (61) #define TLB_PCXR_N_PGSZ1_SHIFT (58) +#define TLB_PCXR_N_PGSZ_I_SHIFT (55) /* US-IV+ */ +#define TLB_PCXR_P_IPGSZ0_SHIFT (24) /* SPARC64 VI, VII, VIIIfx */ +#define TLB_PCXR_P_IPGSZ1_SHIFT (27) /* SPARC64 VI, VII, VIIIfx */ #define TLB_PCXR_P_PGSZ0_SHIFT (16) #define TLB_PCXR_P_PGSZ1_SHIFT (19) -#define TLB_SCXR_PGSZ_MASK \ - ((((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_SCXR_S_PGSZ0_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_SCXR_S_PGSZ1_SHIFT)) +/* + * Note that the US-IV+ documentation appears to have TLB_PCXR_P_PGSZ_I_SHIFT + * and TLB_PCXR_P_PGSZ0_SHIFT erroneously inverted. + */ +#define TLB_PCXR_P_PGSZ_I_SHIFT (22) /* US-IV+ */ #define TLB_SCXR_S_PGSZ1_SHIFT (19) #define TLB_SCXR_S_PGSZ0_SHIFT (16) @@ -87,7 +91,7 @@ #define TLB_DEMAP_TYPE_SHIFT (6) #define TLB_DEMAP_TYPE_PAGE (0) #define TLB_DEMAP_TYPE_CONTEXT (1) -#define TLB_DEMAP_TYPE_ALL (2) /* USIII and beyond only */ +#define TLB_DEMAP_TYPE_ALL (2) /* US-III and beyond only */ #define TLB_DEMAP_VA(va) ((va) & ~PAGE_MASK) #define TLB_DEMAP_ID(id) ((id) << TLB_DEMAP_ID_SHIFT) @@ -118,9 +122,17 @@ #define MMU_SFSR_FT_SIZE (6) #define MMU_SFSR_CT_SIZE (2) -#define MMU_SFSR_GET_ASI(sfsr) \ +#define MMU_SFSR_GET_ASI(sfsr) \ (((sfsr) >> MMU_SFSR_ASI_SHIFT) & ((1UL << MMU_SFSR_ASI_SIZE) - 1)) +#define MMU_SFSR_GET_FT(sfsr) \ + (((sfsr) >> MMU_SFSR_FT_SHIFT) & ((1UL << MMU_SFSR_FT_SIZE) - 1)) +#define MMU_SFSR_GET_CT(sfsr) \ + (((sfsr) >> MMU_SFSR_CT_SHIFT) & ((1UL << MMU_SFSR_CT_SIZE) - 1)) + +#define MMU_SFSR_E (1UL << MMU_SFSR_E_SHIFT) +#define MMU_SFSR_PR (1UL << MMU_SFSR_PR_SHIFT) #define MMU_SFSR_W (1UL << MMU_SFSR_W_SHIFT) +#define MMU_SFSR_OW (1UL << MMU_SFSR_OW_SHIFT) #define MMU_SFSR_FV (1UL << MMU_SFSR_FV_SHIFT) typedef void tlb_flush_nonlocked_t(void); Modified: stable/7/sys/sparc64/include/tte.h ============================================================================== --- stable/7/sys/sparc64/include/tte.h Wed Mar 31 21:57:48 2010 (r206009) +++ stable/7/sys/sparc64/include/tte.h Wed Mar 31 21:57:49 2010 (r206010) @@ -36,25 +36,42 @@ #define TD_SIZE_SHIFT (61) #define TD_SOFT2_SHIFT (50) +#define TD_RSVD2_SHIFT (49) +#define TD_SIZE2_SHIFT (48) #define TD_DIAG_SF_SHIFT (41) #define TD_RSVD_CH_SHIFT (43) +#define TD_RSVD_OC_SHIFT (47) +#define TD_RSVD_PT_SHIFT TD_RSVD_CH_SHIFT +#define TD_RSVD_VE_SHIFT (41) #define TD_PA_SHIFT (13) #define TD_SOFT_SHIFT (7) #define TD_SIZE_BITS (2) #define TD_SOFT2_BITS (9) -#define TD_DIAG_SF_BITS (9) -#define TD_RSVD_CH_BITS (7) -#define TD_PA_CH_BITS (30) -#define TD_PA_SF_BITS (28) +#define TD_RSVD2_BITS (1) /* US-IV+, SPARC64 VI, VII, VIIIfx */ +#define TD_SIZE2_BITS (1) /* US-IV+, SPARC64 VI, VII, VIIIfx */ +#define TD_DIAG_SF_BITS (9) /* US-I, II{,e,i} */ +#define TD_RSVD_CH_BITS (7) /* US-III{,i,+}, US-IV, SPARC64 V */ +#define TD_RSVD_OC_BITS (1) /* SPARC64 VI, VII */ +#define TD_RSVD_PT_BITS (5) /* US-IV+, SPARC64 VI, VII */ +#define TD_RSVD_VE_BITS (7) /* SPARC64 VIIIfx */ +#define TD_PA_CH_BITS (30) /* US-III{,i,+}, US-IV{,+}, SPARC64 V */ +#define TD_PA_OC_BITS (34) /* SPARC64 VI, VII */ +#define TD_PA_SF_BITS (28) /* US-I, II{,e,i}, SPARC64 VIIIfx */ #define TD_PA_BITS TD_PA_CH_BITS #define TD_SOFT_BITS (6) #define TD_SIZE_MASK ((1UL << TD_SIZE_BITS) - 1) #define TD_SOFT2_MASK ((1UL << TD_SOFT2_BITS) - 1) +#define TD_RSVD2_MASK ((1UL << TD_RSVD2_BITS) - 1) +#define TD_SIZE2_MASK ((1UL << TD_SIZE2_BITS) - 1) #define TD_DIAG_SF_MASK ((1UL << TD_DIAG_SF_BITS) - 1) #define TD_RSVD_CH_MASK ((1UL << TD_RSVD_CH_BITS) - 1) +#define TD_RSVD_OC_MASK ((1UL << TD_RSVD_OC_BITS) - 1) +#define TD_RSVD_PT_MASK ((1UL << TD_RSVD_PT_BITS) - 1) +#define TD_RSVD_VE_MASK ((1UL << TD_RSVD_VE_BITS) - 1) #define TD_PA_CH_MASK ((1UL << TD_PA_CH_BITS) - 1) +#define TD_PA_OC_MASK ((1UL << TD_PA_OC_BITS) - 1) #define TD_PA_SF_MASK ((1UL << TD_PA_SF_BITS) - 1) #define TD_PA_MASK ((1UL << TD_PA_BITS) - 1) #define TD_SOFT_MASK ((1UL << TD_SOFT_BITS) - 1) @@ -63,6 +80,9 @@ #define TS_64K (1UL) #define TS_512K (2UL) #define TS_4M (3UL) +#define TS_32M (4UL) /* US-IV+, SPARC64 VI, VII only */ +#define TS_256M (5UL) /* US-IV+, SPARC64 VI, VII only */ +#define TS_2G (6UL) /* SPARC64 VIIIfx only */ #define TS_MIN TS_8K #define TS_MAX TS_4M @@ -72,6 +92,15 @@ #define TD_64K (TS_64K << TD_SIZE_SHIFT) #define TD_512K (TS_512K << TD_SIZE_SHIFT) #define TD_4M (TS_4M << TD_SIZE_SHIFT) +#define TD_32M \ + (((TS_32M & TD_SIZE_MASK) << TD_SIZE_SHIFT) | \ + (TD_SIZE2_MASK << TD_SIZE2_SHIFT)) +#define TD_256M \ + (((TS_256M & TD_SIZE_MASK) << TD_SIZE_SHIFT) | \ + (TD_SIZE2_MASK << TD_SIZE2_SHIFT)) +#define TD_2G \ + (((TS_2G & TD_SIZE_MASK) << TD_SIZE_SHIFT) | \ + (TD_SIZE2_MASK << TD_SIZE2_SHIFT)) #define TD_NFO (1UL << 60) #define TD_IE (1UL << 59) #define TD_PA(pa) ((pa) & (TD_PA_MASK << TD_PA_SHIFT)) @@ -94,29 +123,28 @@ #define TV_VPN(va, sz) ((((va) >> TTE_PAGE_SHIFT(sz)) << TV_SIZE_BITS) | sz) #define TTE_SIZE_SPREAD (3) -#define TTE_PAGE_SHIFT(sz) \ +#define TTE_PAGE_SHIFT(sz) \ (PAGE_SHIFT + ((sz) * TTE_SIZE_SPREAD)) -#define TTE_GET_SIZE(tp) \ +#define TTE_GET_SIZE(tp) \ (((tp)->tte_data >> TD_SIZE_SHIFT) & TD_SIZE_MASK) -#define TTE_GET_PAGE_SHIFT(tp) \ +#define TTE_GET_PAGE_SHIFT(tp) \ TTE_PAGE_SHIFT(TTE_GET_SIZE(tp)) -#define TTE_GET_PAGE_SIZE(tp) \ +#define TTE_GET_PAGE_SIZE(tp) \ (1 << TTE_GET_PAGE_SHIFT(tp)) -#define TTE_GET_PAGE_MASK(tp) \ +#define TTE_GET_PAGE_MASK(tp) \ (TTE_GET_PAGE_SIZE(tp) - 1) -#define TTE_GET_PA(tp) \ +#define TTE_GET_PA(tp) \ ((tp)->tte_data & (TD_PA_MASK << TD_PA_SHIFT)) -#define TTE_GET_VPN(tp) \ +#define TTE_GET_VPN(tp) \ ((tp)->tte_vpn >> TV_SIZE_BITS) -#define TTE_GET_VA(tp) \ +#define TTE_GET_VA(tp) \ (TTE_GET_VPN(tp) << TTE_GET_PAGE_SHIFT(tp)) -#define TTE_GET_PMAP(tp) \ - (((tp)->tte_data & TD_P) != 0 ? \ - (kernel_pmap) : \ - (PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)(tp)))->md.pmap)) -#define TTE_ZERO(tp) \ +#define TTE_GET_PMAP(tp) \ + (((tp)->tte_data & TD_P) != 0 ? (kernel_pmap) : \ + (PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)(tp)))->md.pmap)) +#define TTE_ZERO(tp) \ memset(tp, 0, sizeof(*tp)) struct pmap; @@ -130,6 +158,7 @@ struct tte { static __inline int tte_match(struct tte *tp, vm_offset_t va) { + return (((tp->tte_data & TD_V) != 0) && (tp->tte_vpn == TV_VPN(va, TTE_GET_SIZE(tp)))); } Modified: stable/7/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/7/sys/sparc64/sparc64/genassym.c Wed Mar 31 21:57:48 2010 (r206009) +++ stable/7/sys/sparc64/sparc64/genassym.c Wed Mar 31 21:57:49 2010 (r206010) @@ -139,7 +139,7 @@ ASSYM(TD_W, TD_W); ASSYM(TS_MIN, TS_MIN); ASSYM(TS_MAX, TS_MAX); ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT); -ASSYM(TLB_PCXR_PGSZ_MASK, TLB_PCXR_PGSZ_MASK); +ASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); #endif Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:57:48 2010 (r206009) +++ stable/7/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:57:49 2010 (r206010) @@ -566,7 +566,7 @@ pmap_map_tsb(void) * FP block operations in the kernel). */ stxa(AA_DMMU_SCXR, ASI_DMMU, (ldxa(AA_DMMU_SCXR, ASI_DMMU) & - TLB_SCXR_PGSZ_MASK) | TLB_CTX_KERNEL); + TLB_CXR_PGSZ_MASK) | TLB_CTX_KERNEL); flush(KERNBASE); intr_restore(s); @@ -1964,7 +1964,7 @@ pmap_activate(struct thread *td) stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & - TLB_PCXR_PGSZ_MASK) | context); + TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); mtx_unlock_spin(&sched_lock); Modified: stable/7/sys/sparc64/sparc64/swtch.S ============================================================================== --- stable/7/sys/sparc64/sparc64/swtch.S Wed Mar 31 21:57:48 2010 (r206009) +++ stable/7/sys/sparc64/sparc64/swtch.S Wed Mar 31 21:57:49 2010 (r206010) @@ -237,7 +237,7 @@ ENTRY(cpu_switch) stxa %i4, [%i5] ASI_DMMU mov AA_IMMU_TSB, %i5 stxa %i4, [%i5] ASI_IMMU - setx TLB_PCXR_PGSZ_MASK, %i5, %i4 + setx TLB_CXR_PGSZ_MASK, %i5, %i4 mov AA_DMMU_PCXR, %i5 ldxa [%i5] ASI_DMMU, %l1 and %l1, %i4, %l1 From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 22:00:22 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE351106566C; Wed, 31 Mar 2010 22:00:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC5DC8FC0A; Wed, 31 Mar 2010 22:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VM0M9F034925; Wed, 31 Mar 2010 22:00:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VM0M4B034923; Wed, 31 Mar 2010 22:00:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312200.o2VM0M4B034923@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 22:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206012 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 22:00:23 -0000 Author: marius Date: Wed Mar 31 22:00:22 2010 New Revision: 206012 URL: http://svn.freebsd.org/changeset/base/206012 Log: MFC: r205263 Add macros for the VER.impl of SPARC64 II to VIIIfx. Modified: stable/7/sys/sparc64/include/ver.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/ver.h ============================================================================== --- stable/7/sys/sparc64/include/ver.h Wed Mar 31 22:00:22 2010 (r206011) +++ stable/7/sys/sparc64/include/ver.h Wed Mar 31 22:00:22 2010 (r206012) @@ -69,8 +69,15 @@ extern char sparc64_model[]; #endif /* !LOCORE */ -/* Known implementations. */ +/* Known implementations */ #define CPU_IMPL_SPARC64 0x01 +#define CPU_IMPL_SPARC64II 0x02 +#define CPU_IMPL_SPARC64III 0x03 +#define CPU_IMPL_SPARC64IV 0x04 +#define CPU_IMPL_SPARC64V 0x05 +#define CPU_IMPL_SPARC64VI 0x06 +#define CPU_IMPL_SPARC64VII 0x07 +#define CPU_IMPL_SPARC64VIIIfx 0x08 #define CPU_IMPL_ULTRASPARCI 0x10 #define CPU_IMPL_ULTRASPARCII 0x11 #define CPU_IMPL_ULTRASPARCIIi 0x12 From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 31 22:05:54 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 287BE106566B; Wed, 31 Mar 2010 22:05:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 162628FC16; Wed, 31 Mar 2010 22:05:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VM5r42036247; Wed, 31 Mar 2010 22:05:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VM5rML036245; Wed, 31 Mar 2010 22:05:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312205.o2VM5rML036245@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 22:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206014 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 22:05:54 -0000 Author: marius Date: Wed Mar 31 22:05:53 2010 New Revision: 206014 URL: http://svn.freebsd.org/changeset/base/206014 Log: MFC: r205399 Improve the KVA space sizing of r186682 (r190080); on machines with large dTLBs we can actually use all of the available lockable entries of the tiny dTLB for the kernel TSB. With this change the KVA space sizing happens to be more in line with the MI one so up to at least 24GB machines KVA doesn't need to be limited manually. This is just another stopgap though, the real solution is to take advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs providing it so we don't need to lock the kernel TSB pages into the dTLB in the first place. Modified: stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Wed Mar 31 22:05:49 2010 (r206013) +++ stable/7/sys/sparc64/sparc64/pmap.c Wed Mar 31 22:05:53 2010 (r206014) @@ -236,6 +236,8 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc); PMAP_STATS_VAR(pmap_nnew_thread); PMAP_STATS_VAR(pmap_nnew_thread_oc); +static inline u_long dtlb_get_data(u_int slot); + /* * Quick sort callout for comparing memory regions */ @@ -274,6 +276,18 @@ om_cmp(const void *a, const void *b) return (0); } +static inline u_long +dtlb_get_data(u_int slot) +{ + + /* + * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * around errata of USIII and beyond. + */ + (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); + return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); +} + /* * Bootstrap the system enough to run with virtual memory. */ @@ -287,11 +301,13 @@ pmap_bootstrap(u_int cpu_impl) vm_paddr_t pa; vm_size_t physsz; vm_size_t virtsz; + u_long data; phandle_t pmem; phandle_t vmem; - int sz; + u_int dtlb_slots_avail; int i; int j; + int sz; /* * Find out what physical memory is available from the PROM and @@ -336,22 +352,30 @@ pmap_bootstrap(u_int cpu_impl) /* * Calculate the size of kernel virtual memory, and the size and mask * for the kernel TSB based on the phsyical memory size but limited - * by letting the kernel TSB take up no more than half of the dTLB - * slots available for locked entries. - */ + * by the amount of dTLB slots available for locked entries (given + * that for spitfire-class CPUs all of the dt64 slots can hold locked + * entries but there is no large dTLB for unlocked ones, we don't use + * more than half of it for locked entries). + */ + dtlb_slots_avail = 0; + for (i = 0; i < dtlb_slots; i++) { + data = dtlb_get_data(i); + if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) + dtlb_slots_avail++; + } +#ifdef SMP + dtlb_slots_avail -= PCPU_PAGES; +#endif + if (cpu_impl >= CPU_IMPL_ULTRASPARCI && + cpu_impl < CPU_IMPL_ULTRASPARCIII) + dtlb_slots_avail /= 2; virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); virtsz = MIN(virtsz, - (dtlb_slots / 2 * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); + (dtlb_slots_avail * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); vm_max_kernel_address = VM_MIN_KERNEL_ADDRESS + virtsz; tsb_kernel_size = virtsz >> (PAGE_SHIFT - TTE_SHIFT); tsb_kernel_mask = (tsb_kernel_size >> TTE_SHIFT) - 1; - if (kernel_tlb_slots + PCPU_PAGES + tsb_kernel_size / PAGE_SIZE_4M + - 1 /* PROM page */ + 1 /* spare */ > dtlb_slots) - panic("pmap_bootstrap: insufficient dTLB entries"); - if (kernel_tlb_slots + 1 /* PROM page */ + 1 /* spare */ > itlb_slots) - panic("pmap_bootstrap: insufficient iTLB entries"); - /* * Allocate the kernel TSB and lock it in the TLB. */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 1 00:38:39 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DC3E1065672; Thu, 1 Apr 2010 00:38:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC018FC1A; Thu, 1 Apr 2010 00:38:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o310cd8l070710; Thu, 1 Apr 2010 00:38:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o310ccjN070708; Thu, 1 Apr 2010 00:38:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004010038.o310ccjN070708@svn.freebsd.org> From: Xin LI Date: Thu, 1 Apr 2010 00:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206025 - in stable: 6/libexec/ftpd 7/libexec/ftpd 8/libexec/ftpd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 00:38:39 -0000 Author: delphij Date: Thu Apr 1 00:38:38 2010 New Revision: 206025 URL: http://svn.freebsd.org/changeset/base/206025 Log: MFC r205656: Check that gl_pathc is bigger than zero before derefencing gl_pathv. When gl_pathc == 0, the content of gl_pathv is undefined. PR: bin/144761 Submitted by: David BERARD Obtained from: OpenBSD Modified: stable/7/libexec/ftpd/popen.c Directory Properties: stable/7/libexec/ftpd/ (props changed) Changes in other areas also in this revision: Modified: stable/6/libexec/ftpd/popen.c stable/8/libexec/ftpd/popen.c Directory Properties: stable/6/libexec/ftpd/ (props changed) stable/8/libexec/ftpd/ (props changed) Modified: stable/7/libexec/ftpd/popen.c ============================================================================== --- stable/7/libexec/ftpd/popen.c Thu Apr 1 00:36:40 2010 (r206024) +++ stable/7/libexec/ftpd/popen.c Thu Apr 1 00:38:38 2010 (r206025) @@ -110,10 +110,11 @@ ftpd_popen(char *program, char *type) flags |= GLOB_LIMIT; if (glob(argv[argc], flags, NULL, &gl)) gargv[gargc++] = strdup(argv[argc]); - else + else if (gl.gl_pathc > 0) { for (pop = gl.gl_pathv; *pop && gargc < (MAXGLOBARGS-1); pop++) gargv[gargc++] = strdup(*pop); + } globfree(&gl); } gargv[gargc] = NULL; From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 1 15:17:53 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54D52106564A; Thu, 1 Apr 2010 15:17:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4141B8FC17; Thu, 1 Apr 2010 15:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o31FHrtf068095; Thu, 1 Apr 2010 15:17:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o31FHrIj068089; Thu, 1 Apr 2010 15:17:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004011517.o31FHrIj068089@svn.freebsd.org> From: Marius Strobl Date: Thu, 1 Apr 2010 15:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206045 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 15:17:53 -0000 Author: marius Date: Thu Apr 1 15:17:52 2010 New Revision: 206045 URL: http://svn.freebsd.org/changeset/base/206045 Log: MFC: r205409 - The firmware of Sun Fire V1280 has a misfeature of setting %wstate to 7 which corresponds to WSTATE_KMIX in OpenSolaris whenever calling into it which totally screws us even when restoring %wstate afterwards as spill/fill traps can happen while in OFW. The rather hackish OpenBSD approach of just setting the equivalent of WSTATE_KERNEL to 7 also is no option as we treat %wstate as a bit field. So in order to deal with this problem actually implement spill/fill handlers for %wstate 7 which just act as the WSTATE_KERNEL ones except of theoretically also handling 32-bit, turn off interrupts completely so we don't even take IPIs while in OFW which should ensure we only take spill/fill traps at most and restore %wstate after calling into OFW once we have taken over the trap table. While at it, actually set WSTATE_{,PROM}_KMIX before calling into OFW just like OpenSolaris does, which should at least help testing this change on non-V1280. - Remove comments referring to the %wstate usage in BSD/OS. - Remove the no longer used RSF_ALIGN_RETRY macro. - Correct some trap table addresses in comments. - Ensure %wstate is set to WSTATE_KERNEL when taking over the trap table. - Ensure PSTATE_AM is off when entering or exiting to OFW as well as that interrupts are also completely off when exiting to OFW as the firmware trap table shouldn't be used to handle our interrupts. Modified: stable/7/sys/sparc64/include/wstate.h stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/locore.S stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/support.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/wstate.h ============================================================================== --- stable/7/sys/sparc64/include/wstate.h Thu Apr 1 15:17:50 2010 (r206044) +++ stable/7/sys/sparc64/include/wstate.h Thu Apr 1 15:17:52 2010 (r206045) @@ -33,7 +33,7 @@ #define _MACHINE_WSTATE_H_ /* - * Window state register bits. + * Window state register bits * * There really are no bits per se, just the two fields WSTATE.NORMAL * and WSTATE.OTHER. The rest is up to software. @@ -42,37 +42,8 @@ * (whichever is currently in effect) and WSTATE_OTHER to represent * user mode saves (only). * - * We use the low bit to suggest 32-bit mode, with the next bit set - * once we succeed in saving in some mode. That is, if the WSTATE_ASSUME - * bit is set, the spill or fill handler we use will be one that makes - * an assumption about the proper window-save mode. If the spill or - * fill fails with an alignment fault, the spill or fill op should - * take the `assume' bit away retry the instruction that caused the - * spill or fill. This will use the new %wstate, which will test for - * which mode to use. The alignment fault code helps us out here by - * resuming the spill vector at offset +70, where we are allowed to - * execute two instructions (i.e., write to %wstate and RETRY). - * - * If the ASSUME bit is not set when the alignment fault occurs, the - * given stack pointer is hopelessly wrong (and the spill, if it is a - * spill, should be done as a sort of "panic spill") -- so those two - * instructions will be a branch sequence. - * * Note that locore.s assumes this same bit layout (since the translation * from "bits" to "{spill,fill}_N_{normal,other}" is done in hardware). - * - * The value 0 is preferred for unknown to make it easy to start in - * unknown state and continue in whichever state unknown succeeds in -- - * a successful "other" save, for instance, can just set %wstate to - * ASSUMExx << USERSHIFT and thus leave the kernel state "unknown". - * - * We also need values for managing the somewhat tricky transition from - * user to kernel and back, so we use the one remaining free bit to mean - * "although this looks like kernel mode, the window(s) involved are - * user windows and should be saved ASI_AIUP". Everything else is - * otherwise the same, but we need not bother with assumptions in this - * mode (we expect it to apply to at most one window spill or fill), - * i.e., WSTATE_TRANSITION can ignore WSTATE_ASSUME if it likes. */ #define WSTATE_NORMAL_MASK 1 /* wstate normal minus transition */ @@ -88,4 +59,8 @@ #define WSTATE_NESTED /* if set, spill must not fault */ \ (WSTATE_TRANSITION << WSTATE_OTHER_SHIFT) +/* Values used by the PROM and (Open)Solaris */ +#define WSTATE_PROM_KMIX 7 +#define WSTATE_PROM_MASK 7 + #endif /* !_MACHINE_WSTATE_H_ */ Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Thu Apr 1 15:17:50 2010 (r206044) +++ stable/7/sys/sparc64/sparc64/exception.S Thu Apr 1 15:17:52 2010 (r206045) @@ -316,15 +316,6 @@ END(tl1_kstack_fault) #define RSF_FILL_INC tl0_ret_fill_end - tl0_ret_fill /* - * Retry a spill or fill with a different wstate due to an alignment fault. - * We may just be using the wrong stack offset. - */ -#define RSF_ALIGN_RETRY(ws) \ - wrpr %g0, (ws), %wstate ; \ - retry ; \ - .align 16 - -/* * Generate a T_SPILL or T_FILL trap if the window operation fails. */ #define RSF_TRAP(type) \ @@ -1716,6 +1707,19 @@ END(tl1_dmmu_prot_trap) RSF_SPILL_TOPCB .endm + .macro tl1_spill_7_n + btst 1, %sp + bnz,a,pn %xcc, tl1_spill_0_n + nop + srl %sp, 0, %sp + SPILL(stw, %sp, 4, EMPTY) + saved + retry + .align 32 + RSF_FATAL(T_SPILL) + RSF_FATAL(T_SPILL) + .endm + .macro tl1_spill_0_o wr %g0, ASI_AIUP, %asi SPILL(stxa, %sp + SPOFF, 8, %asi) @@ -1770,6 +1774,19 @@ END(tl1_dmmu_prot_trap) RSF_FILL_MAGIC .endm + .macro tl1_fill_7_n + btst 1, %sp + bnz,a,pt %xcc, tl1_fill_0_n + nop + srl %sp, 0, %sp + FILL(lduw, %sp, 4, EMPTY) + restored + retry + .align 32 + RSF_FATAL(T_FILL) + RSF_FATAL(T_FILL) + .endm + /* * This is used to spill windows that are still occupied with user * data on kernel entry to the pcb. @@ -2016,8 +2033,10 @@ tl1_spill_0_n: tl1_spill_2_n: tl1_spill_2_n ! 0x288 tl1_spill_3_n: - tl1_spill_3_n ! 0x29c - tl1_spill_bad 4 ! 0x290-0x29f + tl1_spill_3_n ! 0x28c + tl1_spill_bad 3 ! 0x290-0x29b +tl1_spill_7_n: + tl1_spill_7_n ! 0x29c tl1_spill_0_o: tl1_spill_0_o ! 0x2a0 tl1_spill_1_o: @@ -2029,10 +2048,13 @@ tl1_fill_0_n: tl1_fill_0_n ! 0x2c0 tl1_fill_bad 1 ! 0x2c4 tl1_fill_2_n: - tl1_fill_2_n ! 0x2d0 + tl1_fill_2_n ! 0x2c8 tl1_fill_3_n: - tl1_fill_3_n ! 0x2d4 - tl1_fill_bad 12 ! 0x2d8-0x2ff + tl1_fill_3_n ! 0x2cc + tl1_fill_bad 3 ! 0x2d0-0x2db +tl1_fill_7_n: + tl1_fill_7_n ! 0x2dc + tl1_fill_bad 8 ! 0x2e0-0x2ff tl1_reserved 1 ! 0x300 tl1_breakpoint: tl1_gen T_BREAKPOINT ! 0x301 @@ -2649,7 +2671,7 @@ END(tl0_ret) * Kernel trap entry point * * void tl1_trap(u_int type, u_long o1, u_long o2, u_long tar, u_long sfar, - * u_int sfsr) + * u_int sfsr) * * This is easy because the stack is already setup and the windows don't need * to be split. We build a trapframe and call trap(), the same as above, but Modified: stable/7/sys/sparc64/sparc64/locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/locore.S Thu Apr 1 15:17:50 2010 (r206044) +++ stable/7/sys/sparc64/sparc64/locore.S Thu Apr 1 15:17:52 2010 (r206045) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -139,8 +140,12 @@ ENTRY(cpu_setregs) * Force trap level 1 and take over the trap table. */ SET(tl0_base, %o2, %o1) + SET(tba_taken_over, %o3, %o2) + mov 1, %o3 + wrpr %g0, WSTATE_KERNEL, %wstate wrpr %g0, 1, %tl wrpr %o1, 0, %tba + stw %o3, [%o2] /* * Re-enable interrupts. Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Thu Apr 1 15:17:50 2010 (r206044) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Apr 1 15:17:52 2010 (r206045) @@ -137,6 +137,7 @@ struct kva_md_info kmi; u_long ofw_vec; u_long ofw_tba; +u_int tba_taken_over; char sparc64_model[32]; @@ -458,7 +459,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Determine the TLB slot maxima, which are expected to be * equal across all CPUs. - * NB: for Cheetah-class CPUs, these properties only refer + * NB: for cheetah-class CPUs, these properties only refer * to the t16s. */ if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots, Modified: stable/7/sys/sparc64/sparc64/support.S ============================================================================== --- stable/7/sys/sparc64/sparc64/support.S Thu Apr 1 15:17:50 2010 (r206044) +++ stable/7/sys/sparc64/sparc64/support.S Thu Apr 1 15:17:52 2010 (r206045) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -751,11 +752,20 @@ ENTRY(openfirmware) save %sp, -CCFSZ, %sp SET(ofw_vec, %l7, %l6) ldx [%l6], %l6 - rdpr %pil, %l7 - wrpr %g0, PIL_TICK, %pil - call %l6 + rdpr %pstate, %l7 + andn %l7, PSTATE_AM | PSTATE_IE, %l5 + wrpr %l5, 0, %pstate + SET(tba_taken_over, %l5, %l4) + brz,pn %l4, 1f + rdpr %wstate, %l5 + andn %l5, WSTATE_PROM_MASK, %l3 + wrpr %l3, WSTATE_PROM_KMIX, %wstate +1: call %l6 mov %i0, %o0 - wrpr %l7, 0, %pil + brz,pn %l4, 1f + nop + wrpr %g0, %l5, %wstate +1: wrpr %l7, 0, %pstate ret restore %o0, %g0, %o0 END(openfirmware) @@ -766,9 +776,14 @@ END(openfirmware) ENTRY(openfirmware_exit) save %sp, -CCFSZ, %sp flushw - wrpr %g0, PIL_TICK, %pil SET(ofw_tba, %l7, %l5) ldx [%l5], %l5 + rdpr %pstate, %l7 + andn %l7, PSTATE_AM | PSTATE_IE, %l7 + wrpr %l7, 0, %pstate + rdpr %wstate, %l7 + andn %l7, WSTATE_PROM_MASK, %l7 + wrpr %l7, WSTATE_PROM_KMIX, %wstate wrpr %l5, 0, %tba ! restore the OFW trap table SET(ofw_vec, %l7, %l6) ldx [%l6], %l6 From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 2 08:57:39 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA6C5106564A; Fri, 2 Apr 2010 08:57:39 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8DA48FC3A; Fri, 2 Apr 2010 08:57:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o328vdXr006818; Fri, 2 Apr 2010 08:57:39 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o328vdbS006816; Fri, 2 Apr 2010 08:57:39 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201004020857.o328vdbS006816@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 2 Apr 2010 08:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206085 - stable/7/usr.sbin/cdcontrol X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 08:57:39 -0000 Author: jh Date: Fri Apr 2 08:57:39 2010 New Revision: 206085 URL: http://svn.freebsd.org/changeset/base/206085 Log: MFC r197833: When run() returns an error, print the error message also in non-interactive mode. Previously error messages were printed only in interactive mode. PR: bin/124517 Modified: stable/7/usr.sbin/cdcontrol/cdcontrol.c Directory Properties: stable/7/usr.sbin/cdcontrol/ (props changed) Modified: stable/7/usr.sbin/cdcontrol/cdcontrol.c ============================================================================== --- stable/7/usr.sbin/cdcontrol/cdcontrol.c Fri Apr 2 08:55:10 2010 (r206084) +++ stable/7/usr.sbin/cdcontrol/cdcontrol.c Fri Apr 2 08:57:39 2010 (r206085) @@ -241,7 +241,7 @@ int main (int argc, char **argv) if (argc > 0) { char buf[80], *p; - int len; + int len, rc; for (p=buf; argc-->0; ++argv) { len = strlen (*argv); @@ -257,7 +257,11 @@ int main (int argc, char **argv) } *p = 0; arg = parse (buf, &cmd); - return (run (cmd, arg)); + rc = run (cmd, arg); + if (rc < 0 && verbose) + warn(NULL); + + return (rc); } if (verbose == 1) From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 2 15:36:56 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FB351065693; Fri, 2 Apr 2010 15:36:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E46F8FC12; Fri, 2 Apr 2010 15:36:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32FauQZ098759; Fri, 2 Apr 2010 15:36:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32Fauuk098757; Fri, 2 Apr 2010 15:36:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004021536.o32Fauuk098757@svn.freebsd.org> From: Andriy Gapon Date: Fri, 2 Apr 2010 15:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206100 - stable/7/usr.bin/calendar/calendars X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 15:36:56 -0000 Author: avg Date: Fri Apr 2 15:36:56 2010 New Revision: 206100 URL: http://svn.freebsd.org/changeset/base/206100 Log: MFC r205854: calendar.freebsd: add my entry Modified: stable/7/usr.bin/calendar/calendars/calendar.freebsd Directory Properties: stable/7/usr.bin/calendar/ (props changed) stable/7/usr.bin/calendar/calendars/ (props changed) Modified: stable/7/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- stable/7/usr.bin/calendar/calendars/calendar.freebsd Fri Apr 2 15:33:24 2010 (r206099) +++ stable/7/usr.bin/calendar/calendars/calendar.freebsd Fri Apr 2 15:36:56 2010 (r206100) @@ -182,6 +182,7 @@ 07/22 Lukas Ertl born in Weissenbach/Enns, Steiermark, Austria, 1976 07/23 Sergey A. Osokin born in Krasnogorsky, Stepnogorsk, Akmolinskaya region, Kazakhstan, 1972 07/24 Alexander Nedotsukov born in Ulyanovsk, Russian Federation, 1974 +07/27 Andriy Gapon born in Kyrykivka, Sumy region, Ukraine, 1976 07/28 Jim Mock born in Bethlehem, Pennsylvania, United States, 1974 07/28 Tom Hukins born in Manchester, United Kingdom, 1976 07/29 Dirk Meyer born in Kassel, Hessen, Germany, 1965 From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 2 15:39:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BC0F106566B; Fri, 2 Apr 2010 15:39:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 709318FC15; Fri, 2 Apr 2010 15:39:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32Fdbqv099395; Fri, 2 Apr 2010 15:39:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32Fdbve099394; Fri, 2 Apr 2010 15:39:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004021539.o32Fdbve099394@svn.freebsd.org> From: Andriy Gapon Date: Fri, 2 Apr 2010 15:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206101 - in stable/7/usr.bin/calendar: . calendars X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 15:39:37 -0000 Author: avg Date: Fri Apr 2 15:39:37 2010 New Revision: 206101 URL: http://svn.freebsd.org/changeset/base/206101 Log: fix mergeinfo for r193462 in stable/7 move mergeinfo up from calendar/calendars to calendar Modified: Directory Properties: stable/7/usr.bin/calendar/ (props changed) stable/7/usr.bin/calendar/calendars/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Sat Apr 3 07:19:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20712106564A; Sat, 3 Apr 2010 07:19:32 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0648FC0A; Sat, 3 Apr 2010 07:19:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o337JVoP015163; Sat, 3 Apr 2010 07:19:31 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o337JVPl015161; Sat, 3 Apr 2010 07:19:31 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201004030719.o337JVPl015161@svn.freebsd.org> From: Fabien Thomas Date: Sat, 3 Apr 2010 07:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206122 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 07:19:32 -0000 Author: fabient Date: Sat Apr 3 07:19:31 2010 New Revision: 206122 URL: http://svn.freebsd.org/changeset/base/206122 Log: MFC r205998: If there is multiple PMCs for the same interrupt ignore new post. This will indirectly fix a bug where the thread will be pinned forever if the assert is not compiled. Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Sat Apr 3 07:12:35 2010 (r206121) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Sat Apr 3 07:19:31 2010 (r206122) @@ -3976,9 +3976,11 @@ pmc_post_callchain_callback(void) td = curthread; - KASSERT((td->td_pflags & TDP_CALLCHAIN) == 0, - ("[pmc,%d] thread %p already marked for callchain capture", - __LINE__, (void *) td)); + /* + * If there is multiple PMCs for the same interrupt ignore new post + */ + if (td->td_pflags & TDP_CALLCHAIN) + return; /* * Mark this thread as needing callchain capture. From owner-svn-src-stable-7@FreeBSD.ORG Sat Apr 3 10:07:11 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 063911065675; Sat, 3 Apr 2010 10:07:11 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 981228FC0C; Sat, 3 Apr 2010 10:07:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o33A7Axw052175; Sat, 3 Apr 2010 10:07:10 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o33A7AG4052173; Sat, 3 Apr 2010 10:07:10 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201004031007.o33A7AG4052173@svn.freebsd.org> From: Hiroki Sato Date: Sat, 3 Apr 2010 10:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206131 - stable/7/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 10:07:11 -0000 Author: hrs Date: Sat Apr 3 10:07:10 2010 New Revision: 206131 URL: http://svn.freebsd.org/changeset/base/206131 Log: - Typo (s/-p flag/-d flag/) in a ps(1) entry. [*] - Use &man.*; wherever possible. Spotted by: pluknet gmail.com [*] PR: docs/145059 [*] Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Sat Apr 3 08:53:53 2010 (r206130) +++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Sat Apr 3 10:07:10 2010 (r206131) @@ -167,6 +167,18 @@ Late-Breaking News and Corrections + [20100402] The &os; 7.3-RELEASE Release Notes incorrectly + mentioned that a flag has been added to the + &man.ps.1; utility. It should have been a + flag. The correct entry is: + +

+ The &man.ps.1; command now supports a new flag + . This displays descendant info with the + output similar to Linux's (or + ). +
+ [20100330] The libc of &os; 7.3-RELEASE has the &man.fdopendir.3; function but <dirent.h> header file does not @@ -188,9 +200,9 @@ planned. [20100323] The &os; 7.3-RELEASE Release Notes incorrectly - mentioned that the hwpmc(4) driver has been added though this + mentioned that the &man.hwpmc.4; driver has been added though this driver has already been added in 7.0-RELEASE. The changes in - 7.3-RELEASE are that pmcannotate(8) utility and support for + 7.3-RELEASE are that &man.pmcannotate.8; utility and support for Intel Core 2 and Core i7 have been added. From owner-svn-src-stable-7@FreeBSD.ORG Sat Apr 3 15:52:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDE3F106564A; Sat, 3 Apr 2010 15:52:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCDC48FC1A; Sat, 3 Apr 2010 15:52:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o33FqWPK031217; Sat, 3 Apr 2010 15:52:32 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o33FqW7F031215; Sat, 3 Apr 2010 15:52:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004031552.o33FqW7F031215@svn.freebsd.org> From: Alan Cox Date: Sat, 3 Apr 2010 15:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206139 - stable/7/sys/i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 15:52:32 -0000 Author: alc Date: Sat Apr 3 15:52:32 2010 New Revision: 206139 URL: http://svn.freebsd.org/changeset/base/206139 Log: MFC r205652 A ptrace(2) by one process may trigger a page size promotion in the address space of another process. Modify pmap_promote_pde() to handle this. Modified: stable/7/sys/i386/i386/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Sat Apr 3 15:43:28 2010 (r206138) +++ stable/7/sys/i386/i386/pmap.c Sat Apr 3 15:52:32 2010 (r206139) @@ -2990,7 +2990,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t * either invalid, unused, or does not map the first 4KB physical page * within a 2- or 4MB page. */ - firstpte = vtopte(trunc_4mpage(va)); + firstpte = pmap_pte_quick(pmap, trunc_4mpage(va)); setpde: newpde = *firstpte; if ((newpde & ((PG_FRAME & PDRMASK) | PG_A | PG_V)) != (PG_A | PG_V)) {