svn commit: r278438 - head/sys/dev/drm2/radeon

2015-02-08 Thread Dimitry Andric
Author: dim
Date: Mon Feb  9 07:56:50 2015
New Revision: 278438
URL: https://svnweb.freebsd.org/changeset/base/278438

Log:
  After r278004 was committed, Bruce Evans noted that the casts were
  actually completely unnecessary, here:
  
  https://lists.freebsd.org/pipermail/svn-src-all/2015-February/098478.html
  
  Remove the casts, and just assign &xxx_io_mc_regs[0][0] directly.
  
  Reviewed by:  dumbbell
  MFC after:3 days
  Differential Revision: https://reviews.freebsd.org/D1748

Modified:
  head/sys/dev/drm2/radeon/ni.c
  head/sys/dev/drm2/radeon/si.c

Modified: head/sys/dev/drm2/radeon/ni.c
==
--- head/sys/dev/drm2/radeon/ni.c   Mon Feb  9 07:52:45 2015
(r278437)
+++ head/sys/dev/drm2/radeon/ni.c   Mon Feb  9 07:56:50 2015
(r278438)
@@ -190,23 +190,23 @@ int ni_mc_load_microcode(struct radeon_d
 
switch (rdev->family) {
case CHIP_BARTS:
-   io_mc_regs = (const u32 *)&barts_io_mc_regs;
+   io_mc_regs = &barts_io_mc_regs[0][0];
ucode_size = BTC_MC_UCODE_SIZE;
regs_size = BTC_IO_MC_REGS_SIZE;
break;
case CHIP_TURKS:
-   io_mc_regs = (const u32 *)&turks_io_mc_regs;
+   io_mc_regs = &turks_io_mc_regs[0][0];
ucode_size = BTC_MC_UCODE_SIZE;
regs_size = BTC_IO_MC_REGS_SIZE;
break;
case CHIP_CAICOS:
default:
-   io_mc_regs = (const u32 *)&caicos_io_mc_regs;
+   io_mc_regs = &caicos_io_mc_regs[0][0];
ucode_size = BTC_MC_UCODE_SIZE;
regs_size = BTC_IO_MC_REGS_SIZE;
break;
case CHIP_CAYMAN:
-   io_mc_regs = (const u32 *)&cayman_io_mc_regs;
+   io_mc_regs = &cayman_io_mc_regs[0][0];
ucode_size = CAYMAN_MC_UCODE_SIZE;
regs_size = BTC_IO_MC_REGS_SIZE;
break;

Modified: head/sys/dev/drm2/radeon/si.c
==
--- head/sys/dev/drm2/radeon/si.c   Mon Feb  9 07:52:45 2015
(r278437)
+++ head/sys/dev/drm2/radeon/si.c   Mon Feb  9 07:56:50 2015
(r278438)
@@ -190,18 +190,18 @@ static int si_mc_load_microcode(struct r
 
switch (rdev->family) {
case CHIP_TAHITI:
-   io_mc_regs = (const u32 *)&tahiti_io_mc_regs;
+   io_mc_regs = &tahiti_io_mc_regs[0][0];
ucode_size = SI_MC_UCODE_SIZE;
regs_size = TAHITI_IO_MC_REGS_SIZE;
break;
case CHIP_PITCAIRN:
-   io_mc_regs = (const u32 *)&pitcairn_io_mc_regs;
+   io_mc_regs = &pitcairn_io_mc_regs[0][0];
ucode_size = SI_MC_UCODE_SIZE;
regs_size = TAHITI_IO_MC_REGS_SIZE;
break;
case CHIP_VERDE:
default:
-   io_mc_regs = (const u32 *)&verde_io_mc_regs;
+   io_mc_regs = &verde_io_mc_regs[0][0];
ucode_size = SI_MC_UCODE_SIZE;
regs_size = TAHITI_IO_MC_REGS_SIZE;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278434 - head/sys/powerpc/pseries

2015-02-08 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb  9 07:08:54 2015
New Revision: 278434
URL: https://svnweb.freebsd.org/changeset/base/278434

Log:
  Fix typo in PTE insertion overflow handling: use the page we're actually
  returning, not the one we just looked at.

Modified:
  head/sys/powerpc/pseries/mmu_phyp.c

Modified: head/sys/powerpc/pseries/mmu_phyp.c
==
--- head/sys/powerpc/pseries/mmu_phyp.c Mon Feb  9 06:20:34 2015
(r278433)
+++ head/sys/powerpc/pseries/mmu_phyp.c Mon Feb  9 07:08:54 2015
(r278434)
@@ -299,7 +299,10 @@ mphyp_pte_spillable_ident(u_int ptegidx,
}
}
 
-   phyp_pft_hcall(H_READ, 0, slot, 0, 0, &to_evict->pte_hi,
+   if (k == -1)
+   return (k);
+
+   phyp_pft_hcall(H_READ, 0, k, 0, 0, &to_evict->pte_hi,
&to_evict->pte_lo, &junk);
return (k);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-08 Thread Rui Paulo
On Feb 8, 2015, at 22:20, Rui Paulo  wrote:
> 
> Author: rpaulo
> Date: Mon Feb  9 06:20:34 2015
> New Revision: 278433
> URL: https://svnweb.freebsd.org/changeset/base/278433
> 
> Log:
>  Merge xz 5.2.0.
> 
>  This brings support for multi-threaded compression.  This brings close
>  N times faster compression where N is the number of CPU cores.
>  Because of this, liblzma now depends on libthr.

Gah, terrible wording.  I bet I couldn't repeat the word "this" three times in 
a row if I wanted to...

--
Rui Paulo



___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz...

2015-02-08 Thread Rui Paulo
Author: rpaulo
Date: Mon Feb  9 06:20:34 2015
New Revision: 278433
URL: https://svnweb.freebsd.org/changeset/base/278433

Log:
  Merge xz 5.2.0.
  
  This brings support for multi-threaded compression.  This brings close
  N times faster compression where N is the number of CPU cores.
  Because of this, liblzma now depends on libthr.
  
  Soon libarchive will be modified to use the new lzma API.
  
  Thanks to antoine@ for the exp-run.
  
  Differential Revision: https://reviews.freebsd.org/D1786
  Reviewed by:  bapt

Added:
  head/contrib/xz/src/liblzma/api/lzma/lzma12.h
 - copied unchanged from r278308, 
vendor/xz/dist/src/liblzma/api/lzma/lzma12.h
  head/contrib/xz/src/liblzma/common/block_buffer_encoder.h
 - copied unchanged from r278308, 
vendor/xz/dist/src/liblzma/common/block_buffer_encoder.h
  head/contrib/xz/src/liblzma/common/hardware_cputhreads.c
 - copied unchanged from r278308, 
vendor/xz/dist/src/liblzma/common/hardware_cputhreads.c
  head/contrib/xz/src/liblzma/common/memcmplen.h
 - copied unchanged from r278308, 
vendor/xz/dist/src/liblzma/common/memcmplen.h
  head/contrib/xz/src/liblzma/common/outqueue.c
 - copied unchanged from r278308, 
vendor/xz/dist/src/liblzma/common/outqueue.c
  head/contrib/xz/src/liblzma/common/outqueue.h
 - copied unchanged from r278308, 
vendor/xz/dist/src/liblzma/common/outqueue.h
  head/contrib/xz/src/liblzma/common/stream_encoder_mt.c
 - copied unchanged from r278308, 
vendor/xz/dist/src/liblzma/common/stream_encoder_mt.c
  head/contrib/xz/src/liblzma/liblzma.map
 - copied unchanged from r278308, vendor/xz/dist/src/liblzma/liblzma.map
  head/contrib/xz/src/liblzma/validate_map.sh
 - copied unchanged from r278308, vendor/xz/dist/src/liblzma/validate_map.sh
  head/contrib/xz/src/xz/mytime.c
 - copied unchanged from r278308, vendor/xz/dist/src/xz/mytime.c
  head/contrib/xz/src/xz/mytime.h
 - copied unchanged from r278308, vendor/xz/dist/src/xz/mytime.h
Deleted:
  head/contrib/xz/src/liblzma/api/lzma/lzma.h
  head/contrib/xz/src/liblzma/common/stream_encoder.h
Modified:
  head/Makefile.inc1
  head/ObsoleteFiles.inc
  head/contrib/xz/ChangeLog
  head/contrib/xz/THANKS
  head/contrib/xz/TODO
  head/contrib/xz/src/common/mythread.h
  head/contrib/xz/src/common/sysdefs.h
  head/contrib/xz/src/common/tuklib_cpucores.c
  head/contrib/xz/src/common/tuklib_physmem.c
  head/contrib/xz/src/liblzma/api/lzma.h
  head/contrib/xz/src/liblzma/api/lzma/base.h
  head/contrib/xz/src/liblzma/api/lzma/block.h
  head/contrib/xz/src/liblzma/api/lzma/container.h
  head/contrib/xz/src/liblzma/api/lzma/filter.h
  head/contrib/xz/src/liblzma/api/lzma/hardware.h
  head/contrib/xz/src/liblzma/api/lzma/index.h
  head/contrib/xz/src/liblzma/api/lzma/index_hash.h
  head/contrib/xz/src/liblzma/api/lzma/version.h
  head/contrib/xz/src/liblzma/check/check.h
  head/contrib/xz/src/liblzma/check/sha256.c
  head/contrib/xz/src/liblzma/common/alone_decoder.c
  head/contrib/xz/src/liblzma/common/alone_decoder.h
  head/contrib/xz/src/liblzma/common/alone_encoder.c
  head/contrib/xz/src/liblzma/common/auto_decoder.c
  head/contrib/xz/src/liblzma/common/block_buffer_decoder.c
  head/contrib/xz/src/liblzma/common/block_buffer_encoder.c
  head/contrib/xz/src/liblzma/common/block_decoder.c
  head/contrib/xz/src/liblzma/common/block_decoder.h
  head/contrib/xz/src/liblzma/common/block_encoder.c
  head/contrib/xz/src/liblzma/common/block_encoder.h
  head/contrib/xz/src/liblzma/common/block_header_decoder.c
  head/contrib/xz/src/liblzma/common/block_header_encoder.c
  head/contrib/xz/src/liblzma/common/block_util.c
  head/contrib/xz/src/liblzma/common/common.c
  head/contrib/xz/src/liblzma/common/common.h
  head/contrib/xz/src/liblzma/common/easy_buffer_encoder.c
  head/contrib/xz/src/liblzma/common/easy_encoder.c
  head/contrib/xz/src/liblzma/common/filter_buffer_decoder.c
  head/contrib/xz/src/liblzma/common/filter_buffer_encoder.c
  head/contrib/xz/src/liblzma/common/filter_common.c
  head/contrib/xz/src/liblzma/common/filter_common.h
  head/contrib/xz/src/liblzma/common/filter_decoder.c
  head/contrib/xz/src/liblzma/common/filter_decoder.h
  head/contrib/xz/src/liblzma/common/filter_encoder.c
  head/contrib/xz/src/liblzma/common/filter_encoder.h
  head/contrib/xz/src/liblzma/common/filter_flags_decoder.c
  head/contrib/xz/src/liblzma/common/index.c
  head/contrib/xz/src/liblzma/common/index_decoder.c
  head/contrib/xz/src/liblzma/common/index_encoder.c
  head/contrib/xz/src/liblzma/common/index_encoder.h
  head/contrib/xz/src/liblzma/common/index_hash.c
  head/contrib/xz/src/liblzma/common/stream_buffer_decoder.c
  head/contrib/xz/src/liblzma/common/stream_buffer_encoder.c
  head/contrib/xz/src/liblzma/common/stream_decoder.c
  head/contrib/xz/src/liblzma/common/stream_decoder.h
  head/contrib/xz/src/liblzma/common/stream_encoder.c
  head/contrib/xz/src/liblzma/delta/delta_common.c
  head/contrib/xz/src/liblzma/delta/delta_decoder.c
  head/contrib/xz/src/li

Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm

2015-02-08 Thread Bruce Evans

On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote:


Log:
 Do not mark shared structures as __packed, it leads to race condition

 If structure packed as __packed clang (and probably gcc) generates
 code that loads word fields (e.g. tx_pos)  byte-by-byte and if it's
 modified by VideoCore in the same time as ARM loads the value result
 is going to be mixed combination of bytes from previous value and
 new one.


Most uses of __packed are bugs.  It gives pessimizations as well as
non-atomic accesses for sub-object accesses.

I think the full bugs only occur when arch has strict alignment
requirements and the alignment of the __packed objects is not known.
This means that only lesser bugs occur on x86 (unless you enable
alignment checking, but this arguably breaks the ABI).  The compiler
just generates possibly-misaligned full-width accesses if the arch
doesn't have strict alignment requirements.  Often the acceses turn
out to be aligned at runtime.  Otherwise, the hardware does them
atomically, with a smaller efficiency penalty than split accesses.

Many packed structs should also be declared as __aligned(N).  This is
rarely done.  Old networking code in  uses __packed just once,
and this also uses __aligned(4) (for struct ip)  Newer networking code
in  (for ipv6) is massively pessimized, with __packed used
extensively and __aligned(N) never used with __packed.  sctp is worse.
It uses its own macro that defeats grepping for __packed.  It has 82
instances of this in  where ipv6 has only 34.  Newer networking
should need __packed less than old ones, since no one would misdesign a
data struct so that it needs packing now.

gcc documents the -Wpacked flag for finding some cases of bogus packing.
It is rarely used.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm

2015-02-08 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb  9 02:31:27 2015
New Revision: 278431
URL: https://svnweb.freebsd.org/changeset/base/278431

Log:
  Do not mark shared structures as __packed, it leads to race condition
  
  If structure packed as __packed clang (and probably gcc) generates
  code that loads word fields (e.g. tx_pos)  byte-by-byte and if it's
  modified by VideoCore in the same time as ARM loads the value result
  is going to be mixed combination of bytes from previous value and
  new one.

Modified:
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h

Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h
==
--- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Feb  9 
02:27:33 2015(r278430)
+++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Feb  9 
02:31:27 2015(r278431)
@@ -280,7 +280,7 @@ typedef struct vchiq_slot_info_struct {
/* Use two counters rather than one to avoid the need for a mutex. */
short use_count;
short release_count;
-} __packed VCHIQ_SLOT_INFO_T; /* XXXGONZO: check it */
+}  VCHIQ_SLOT_INFO_T;
 
 typedef struct vchiq_service_struct {
VCHIQ_SERVICE_BASE_T base;
@@ -381,7 +381,7 @@ typedef struct vchiq_shared_state_struct
 
/* Debugging state */
int debug[DEBUG_MAX];
-} __packed VCHIQ_SHARED_STATE_T;
+} VCHIQ_SHARED_STATE_T;
 
 typedef struct vchiq_slot_zero_struct {
int magic;
@@ -395,7 +395,7 @@ typedef struct vchiq_slot_zero_struct {
VCHIQ_SHARED_STATE_T master;
VCHIQ_SHARED_STATE_T slave;
VCHIQ_SLOT_INFO_T slots[VCHIQ_MAX_SLOTS];
-} __packed VCHIQ_SLOT_ZERO_T;
+} VCHIQ_SLOT_ZERO_T;
 
 struct vchiq_state_struct {
int id;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278430 - head/sys/contrib/vchiq/interface/vchiq_arm

2015-02-08 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb  9 02:27:33 2015
New Revision: 278430
URL: https://svnweb.freebsd.org/changeset/base/278430

Log:
  Remove unused variables

Modified:
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c

Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c
==
--- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Feb  9 
02:17:21 2015(r278429)
+++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Feb  9 
02:27:33 2015(r278430)
@@ -252,7 +252,6 @@ VCHIQ_STATUS_T
 vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, VCHI_MEM_HANDLE_T memhandle,
void *offset, int size, int dir)
 {
-   PAGELIST_T *pagelist;
BULKINFO_T *bi;
int ret;
 
@@ -518,7 +517,6 @@ free_pagelist(BULKINFO_T *bi, int actual
 {
vm_page_t*pages;
unsigned int num_pages, i;
-   void *page_address;
PAGELIST_T *pagelist;
 
pagelist = bi->pagelist;

Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c
==
--- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c  Mon Feb  9 
02:17:21 2015(r278429)
+++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c  Mon Feb  9 
02:27:33 2015(r278430)
@@ -2387,7 +2387,6 @@ vchiq_release_internal(VCHIQ_STATE_T *st
VCHIQ_STATUS_T ret = VCHIQ_SUCCESS;
char entity[16];
int *entity_uc;
-   int local_uc, local_entity_uc;
 
if (!arm_state)
goto out;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278429 - head/sys/powerpc/powerpc

2015-02-08 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb  9 02:17:21 2015
New Revision: 278429
URL: https://svnweb.freebsd.org/changeset/base/278429

Log:
  Fix an extremely subtle concurrency bug triggered by running on 32-thread
  POWER8 systems. During thread switch, there was a very small window when
  the stack pointer was set to the stack pointer of the outgoing thread, but
  after the lock on that thread had already been released.
  
  If, during that window, the outgoing thread were rescheduled on another CPU
  and begin execution and an exception were taken on the original CPU, the
  trap handler and the outgoing thread would simultaneously execute on the same
  stack, causing memory corruption. Fix this by making sure to release the
  old thread only after cpu_switch() is done with its stack.
  
  MFC after:2 weeks
  Sponsored by: FreeBSD Foundation

Modified:
  head/sys/powerpc/powerpc/swtch64.S

Modified: head/sys/powerpc/powerpc/swtch64.S
==
--- head/sys/powerpc/powerpc/swtch64.S  Mon Feb  9 02:13:36 2015
(r278428)
+++ head/sys/powerpc/powerpc/swtch64.S  Mon Feb  9 02:17:21 2015
(r278429)
@@ -72,6 +72,8 @@ TOC_ENTRY(blocked_lock)
  */
 ENTRY(cpu_throw)
mr  %r13, %r4
+   li  %r14,0  /* Tell cpu_switchin not to release a thread */
+
b   cpu_switchin
 
 /*
@@ -139,10 +141,7 @@ ENTRY(cpu_switch)
bl  pmap_deactivate /* Deactivate the current pmap */
nop
 
-   addi%r1,%r1,48
-
sync/* Make sure all of that finished */
-   std %r16,TD_LOCK(%r14)  /* ULE: update old thread's lock */
 
 cpu_switchin:
 #if defined(SMP) && defined(SCHED_ULE)
@@ -154,14 +153,20 @@ blocked_loop:
beq-blocked_loop
isync
 #endif
+   
+   ld  %r17,TD_PCB(%r13)   /* Get new PCB */
+   ld  %r1,PCB_SP(%r17)/* Load the stack pointer */
 
-   mfsprg  %r7,0   /* Get the pcpu pointer */
+   /* Release old thread now that we have a stack pointer set up */
+   cmpdi   %r14,0
+   beq-1f
+   std %r16,TD_LOCK(%r14)  /* ULE: update old thread's lock */
+
+1: mfsprg  %r7,0   /* Get the pcpu pointer */
std %r13,PC_CURTHREAD(%r7)  /* Store new current thread */
ld  %r17,TD_PCB(%r13)   /* Store new current PCB */
std %r17,PC_CURPCB(%r7)
 
-   stdu%r1,-48(%r1)
-
mr  %r3,%r13/* Get new thread ptr */
bl  pmap_activate   /* Activate the new address space */
nop
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278428 - head/sys/powerpc/pseries

2015-02-08 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb  9 02:13:36 2015
New Revision: 278428
URL: https://svnweb.freebsd.org/changeset/base/278428

Log:
  Technically speaking, using one virtal processor area for all CPUs is a
  violation of the spec. Make duplicate entries for each CPU.

Modified:
  head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cMon Feb  9 02:12:38 2015
(r278427)
+++ head/sys/powerpc/pseries/platform_chrp.cMon Feb  9 02:13:36 2015
(r278428)
@@ -58,7 +58,7 @@ extern void *ap_pcpu;
 #endif
 
 #ifdef __powerpc64__
-static uint8_t splpar_vpa[640] __aligned(64);
+static uint8_t splpar_vpa[MAXCPU][640] __aligned(128); /* XXX: dpcpu */
 #endif
 
 static vm_offset_t realmaxaddr = VM_MAX_ADDRESS;
@@ -124,6 +124,8 @@ chrp_probe(platform_t plat)
 static int
 chrp_attach(platform_t plat)
 {
+   int i;
+
 #ifdef __powerpc64__
/* XXX: check for /rtas/ibm,hypertas-functions? */
if (!(mfmsr() & PSL_HV)) {
@@ -136,14 +138,19 @@ chrp_attach(platform_t plat)
cpu_idle_hook = phyp_cpu_idle;
 
/* Set up important VPA fields */
-   bzero(splpar_vpa, sizeof(splpar_vpa));
-   splpar_vpa[4] = (uint8_t)((sizeof(splpar_vpa) >> 8) & 0xff);
-   splpar_vpa[5] = (uint8_t)(sizeof(splpar_vpa) & 0xff);
-   splpar_vpa[0xba] = 1;   /* Maintain FPRs */
-   splpar_vpa[0xbb] = 1;   /* Maintain PMCs */
-   splpar_vpa[0xfc] = 0xff;/* Maintain full SLB */
-   splpar_vpa[0xfd] = 0xff;
-   splpar_vpa[0xff] = 1;   /* Maintain Altivec */
+   for (i = 0; i < MAXCPU; i++) {
+   bzero(splpar_vpa[i], sizeof(splpar_vpa));
+   /* First two: VPA size */
+   splpar_vpa[i][4] =
+   (uint8_t)((sizeof(splpar_vpa[i]) >> 8) & 0xff);
+   splpar_vpa[i][5] =
+   (uint8_t)(sizeof(splpar_vpa[i]) & 0xff);
+   splpar_vpa[i][0xba] = 1;/* Maintain FPRs */
+   splpar_vpa[i][0xbb] = 1;/* Maintain PMCs */
+   splpar_vpa[i][0xfc] = 0xff; /* Maintain full SLB */
+   splpar_vpa[i][0xfd] = 0xff;
+   splpar_vpa[i][0xff] = 1;/* Maintain Altivec */
+   }
mb();
 
/* Set up hypervisor CPU stuff */
@@ -492,11 +499,12 @@ static void
 chrp_smp_ap_init(platform_t platform)
 {
if (!(mfmsr() & PSL_HV)) {
+   /* Register VPA */
+   phyp_hcall(H_REGISTER_VPA, 1UL, PCPU_GET(cpuid),
+   splpar_vpa[PCPU_GET(cpuid)]);
+
/* Set interrupt priority */
phyp_hcall(H_CPPR, 0xff);
-
-   /* Register VPA */
-   phyp_hcall(H_REGISTER_VPA, 1UL, PCPU_GET(cpuid), splpar_vpa);
}
 }
 #else
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278427 - head/sys/powerpc/aim

2015-02-08 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb  9 02:12:38 2015
New Revision: 278427
URL: https://svnweb.freebsd.org/changeset/base/278427

Log:
  Simplify trapcode setup by placing a copy of the generic trap handler at
  every possible trap address by default. This also makes sure the kernel
  notices (and panics at) traps from newer CPUs that the kernel was not
  expecting rather than executing gibberish memory.

Modified:
  head/sys/powerpc/aim/machdep.c

Modified: head/sys/powerpc/aim/machdep.c
==
--- head/sys/powerpc/aim/machdep.c  Mon Feb  9 01:45:06 2015
(r278426)
+++ head/sys/powerpc/aim/machdep.c  Mon Feb  9 02:12:38 2015
(r278427)
@@ -256,6 +256,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_
vm_offset_t startkernel, endkernel;
void*generictrap;
size_t  trap_offset, trapsize;
+   vm_offset_t trap;
void*kmdp;
 char   *env;
register_t  msr, scratch;
@@ -481,20 +482,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_
#endif
 
/*
-* Copy a code snippet to restore 32-bit bridge mode
-* to the top of every non-generic trap handler
-*/
-
-   trap_offset += (size_t)&restorebridgesize;
-   bcopy(&restorebridge, (void *)EXC_RST, trap_offset); 
-   bcopy(&restorebridge, (void *)EXC_DSI, trap_offset); 
-   bcopy(&restorebridge, (void *)EXC_ALI, trap_offset); 
-   bcopy(&restorebridge, (void *)EXC_PGM, trap_offset); 
-   bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset); 
-   bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); 
-   bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); 
-
-   /*
 * Set the common trap entry point to the one that
 * knows to restore 32-bit operation on execution.
 */
@@ -507,14 +494,35 @@ powerpc_init(vm_offset_t fdt, vm_offset_
#else /* powerpc64 */
cpu_features |= PPC_FEATURE_64;
generictrap = &trapcode;
-
-   /* Set TOC base so that the interrupt code can get at it */
-   *((void **)TRAP_GENTRAP) = &trapcode2;
-   *((register_t *)TRAP_TOCBASE) = toc;
#endif
 
trapsize = (size_t)&trapcodeend - (size_t)&trapcode;
 
+   /*
+* Copy generic handler into every possible trap. Special cases will get
+* different ones in a minute.
+*/
+   for (trap = EXC_RST; trap < EXC_LAST; trap += 0x20)
+   bcopy(generictrap, (void *)trap, trapsize);
+
+   #ifndef __powerpc64__
+   if (cpu_features & PPC_FEATURE_64) {
+   /*
+* Copy a code snippet to restore 32-bit bridge mode
+* to the top of every non-generic trap handler
+*/
+
+   trap_offset += (size_t)&restorebridgesize;
+   bcopy(&restorebridge, (void *)EXC_RST, trap_offset); 
+   bcopy(&restorebridge, (void *)EXC_DSI, trap_offset); 
+   bcopy(&restorebridge, (void *)EXC_ALI, trap_offset); 
+   bcopy(&restorebridge, (void *)EXC_PGM, trap_offset); 
+   bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset); 
+   bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); 
+   bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); 
+   }
+   #endif
+
bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstcodeend -
(size_t)&rstcode);
 
@@ -527,31 +535,20 @@ powerpc_init(vm_offset_t fdt, vm_offset_
(size_t)&dblow);
bcopy(&dblow, (void *)(EXC_BPT + trap_offset), (size_t)&dbend -
(size_t)&dblow);
-#else
-   bcopy(generictrap, (void *)EXC_MCHK, trapsize);
-   bcopy(generictrap, (void *)EXC_PGM,  trapsize);
-   bcopy(generictrap, (void *)EXC_TRC,  trapsize);
-   bcopy(generictrap, (void *)EXC_BPT,  trapsize);
 #endif
bcopy(&alitrap,  (void *)(EXC_ALI + trap_offset),  (size_t)&aliend -
(size_t)&alitrap);
bcopy(&dsitrap,  (void *)(EXC_DSI + trap_offset),  (size_t)&dsiend -
(size_t)&dsitrap);
-   bcopy(generictrap, (void *)EXC_ISI,  trapsize);
+
#ifdef __powerpc64__
+   /* Set TOC base so that the interrupt code can get at it */
+   *((void **)TRAP_GENTRAP) = &trapcode2;
+   *((register_t *)TRAP_TOCBASE) = toc;
+
bcopy(&slbtrap, (void *)EXC_DSE,(size_t)&slbtrapend - (size_t)&slbtrap);
bcopy(&slbtrap, (void *)EXC_ISE,(size_t)&slbtrapend - (size_t)&slbtrap);
-   #endif
-   bcopy(generictrap, (void *)EXC_EXI,  trapsize);
-   bcopy(generictrap, (void *)EXC_FPU,  trapsize);
-   bcopy(generictrap, (void *)EXC_DECR, trapsize);
-   bcopy(generictrap, (void *)EXC_SC,   trapsize);
-   bcopy(generictrap, (void *)EXC_FPA,  trapsize)

svn commit: r278422 - head/lib/libedit

2015-02-08 Thread Baptiste Daroussin
Author: bapt
Date: Sun Feb  8 23:03:41 2015
New Revision: 278422
URL: https://svnweb.freebsd.org/changeset/base/278422

Log:
  revert r278414
  
  Reported by:  bz

Modified:
  head/lib/libedit/readline.c

Modified: head/lib/libedit/readline.c
==
--- head/lib/libedit/readline.c Sun Feb  8 22:47:34 2015(r278421)
+++ head/lib/libedit/readline.c Sun Feb  8 23:03:41 2015(r278422)
@@ -395,9 +395,6 @@ readline(const char *p)
char *buf;
static int used_event_hook;
 
-   if (line == NULL)
-   return 0;
-
if (e == NULL || h == NULL)
rl_initialize();
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278414 - head/lib/libedit

2015-02-08 Thread Baptiste Daroussin
Author: bapt
Date: Sun Feb  8 22:24:18 2015
New Revision: 278414
URL: https://svnweb.freebsd.org/changeset/base/278414

Log:
  Reapply r255891

Modified:
  head/lib/libedit/readline.c

Modified: head/lib/libedit/readline.c
==
--- head/lib/libedit/readline.c Sun Feb  8 22:24:03 2015(r278413)
+++ head/lib/libedit/readline.c Sun Feb  8 22:24:18 2015(r278414)
@@ -395,6 +395,9 @@ readline(const char *p)
char *buf;
static int used_event_hook;
 
+   if (line == NULL)
+   return 0;
+
if (e == NULL || h == NULL)
rl_initialize();
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278402 - head/sys/kern

2015-02-08 Thread Alan Cox
Author: alc
Date: Sun Feb  8 21:00:51 2015
New Revision: 278402
URL: https://svnweb.freebsd.org/changeset/base/278402

Log:
  Preset the object's color, or alignment, to maximize superpage usage.
  
  MFC after:5 days

Modified:
  head/sys/kern/uipc_shm.c

Modified: head/sys/kern/uipc_shm.c
==
--- head/sys/kern/uipc_shm.cSun Feb  8 20:48:17 2015(r278401)
+++ head/sys/kern/uipc_shm.cSun Feb  8 21:00:51 2015(r278402)
@@ -531,9 +531,10 @@ shm_alloc(struct ucred *ucred, mode_t mo
shmfd->shm_object = vm_pager_allocate(OBJT_DEFAULT, NULL,
shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred);
KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate"));
+   shmfd->shm_object->pg_color = 0;
VM_OBJECT_WLOCK(shmfd->shm_object);
vm_object_clear_flag(shmfd->shm_object, OBJ_ONEMAPPING);
-   vm_object_set_flag(shmfd->shm_object, OBJ_NOSPLIT);
+   vm_object_set_flag(shmfd->shm_object, OBJ_COLORED | OBJ_NOSPLIT);
VM_OBJECT_WUNLOCK(shmfd->shm_object);
vfs_timestamp(&shmfd->shm_birthtime);
shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime =
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278398 - head/sys/cam/ctl

2015-02-08 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Feb  8 19:18:23 2015
New Revision: 278398
URL: https://svnweb.freebsd.org/changeset/base/278398

Log:
  Fix ordering of "*logout" and "*terminate"; no functional changes.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Sun Feb  8 19:15:14 2015
(r278397)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Sun Feb  8 19:18:23 2015
(r278398)
@@ -1702,41 +1702,40 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci)
 }
 
 static void
-cfiscsi_ioctl_terminate(struct ctl_iscsi *ci)
+cfiscsi_ioctl_logout(struct ctl_iscsi *ci)
 {
struct icl_pdu *response;
struct iscsi_bhs_asynchronous_message *bhsam;
-   struct ctl_iscsi_terminate_params *citp;
+   struct ctl_iscsi_logout_params *cilp;
struct cfiscsi_session *cs;
struct cfiscsi_softc *softc;
int found = 0;
 
-   citp = (struct ctl_iscsi_terminate_params *)&(ci->data);
+   cilp = (struct ctl_iscsi_logout_params *)&(ci->data);
softc = &cfiscsi_softc;
 
mtx_lock(&softc->lock);
TAILQ_FOREACH(cs, &softc->sessions, cs_next) {
-   if (citp->all == 0 && cs->cs_id != citp->connection_id &&
-   strcmp(cs->cs_initiator_name, citp->initiator_name) != 0 &&
-   strcmp(cs->cs_initiator_addr, citp->initiator_addr) != 0)
+   if (cilp->all == 0 && cs->cs_id != cilp->connection_id &&
+   strcmp(cs->cs_initiator_name, cilp->initiator_name) != 0 &&
+   strcmp(cs->cs_initiator_addr, cilp->initiator_addr) != 0)
continue;
 
response = icl_pdu_new(cs->cs_conn, M_NOWAIT);
if (response == NULL) {
-   /*
-* Oh well.  Just terminate the connection.
-*/
-   } else {
-   bhsam = (struct iscsi_bhs_asynchronous_message *)
-   response->ip_bhs;
-   bhsam->bhsam_opcode = ISCSI_BHS_OPCODE_ASYNC_MESSAGE;
-   bhsam->bhsam_flags = 0x80;
-   bhsam->bhsam_0x = 0x;
-   bhsam->bhsam_async_event =
-   BHSAM_EVENT_TARGET_TERMINATES_SESSION;
-   cfiscsi_pdu_queue(response);
+   ci->status = CTL_ISCSI_ERROR;
+   snprintf(ci->error_str, sizeof(ci->error_str),
+   "Unable to allocate memory");
+   mtx_unlock(&softc->lock);
+   return;
}
-   cfiscsi_session_terminate(cs);
+   bhsam =
+   (struct iscsi_bhs_asynchronous_message *)response->ip_bhs;
+   bhsam->bhsam_opcode = ISCSI_BHS_OPCODE_ASYNC_MESSAGE;
+   bhsam->bhsam_flags = 0x80;
+   bhsam->bhsam_async_event = BHSAM_EVENT_TARGET_REQUESTS_LOGOUT;
+   bhsam->bhsam_parameter3 = htons(10);
+   cfiscsi_pdu_queue(response);
found++;
}
mtx_unlock(&softc->lock);
@@ -1752,40 +1751,41 @@ cfiscsi_ioctl_terminate(struct ctl_iscsi
 }
 
 static void
-cfiscsi_ioctl_logout(struct ctl_iscsi *ci)
+cfiscsi_ioctl_terminate(struct ctl_iscsi *ci)
 {
struct icl_pdu *response;
struct iscsi_bhs_asynchronous_message *bhsam;
-   struct ctl_iscsi_logout_params *cilp;
+   struct ctl_iscsi_terminate_params *citp;
struct cfiscsi_session *cs;
struct cfiscsi_softc *softc;
int found = 0;
 
-   cilp = (struct ctl_iscsi_logout_params *)&(ci->data);
+   citp = (struct ctl_iscsi_terminate_params *)&(ci->data);
softc = &cfiscsi_softc;
 
mtx_lock(&softc->lock);
TAILQ_FOREACH(cs, &softc->sessions, cs_next) {
-   if (cilp->all == 0 && cs->cs_id != cilp->connection_id &&
-   strcmp(cs->cs_initiator_name, cilp->initiator_name) != 0 &&
-   strcmp(cs->cs_initiator_addr, cilp->initiator_addr) != 0)
+   if (citp->all == 0 && cs->cs_id != citp->connection_id &&
+   strcmp(cs->cs_initiator_name, citp->initiator_name) != 0 &&
+   strcmp(cs->cs_initiator_addr, citp->initiator_addr) != 0)
continue;
 
response = icl_pdu_new(cs->cs_conn, M_NOWAIT);
if (response == NULL) {
-   ci->status = CTL_ISCSI_ERROR;
-   snprintf(ci->error_str, sizeof(ci->error_str),
-   "Unable to allocate memory");
-   mtx_unlock(&softc->lock);
-   return;
+   /*
+* Oh well.  Just ter

svn commit: r278397 - in head/sys: cam/ctl dev/iscsi

2015-02-08 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Feb  8 19:15:14 2015
New Revision: 278397
URL: https://svnweb.freebsd.org/changeset/base/278397

Log:
  Extend ICL to add receive offload methods.  For software ICL backend
  they are no-ops.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h
  head/sys/dev/iscsi/icl_conn_if.m
  head/sys/dev/iscsi/icl_soft.c
  head/sys/dev/iscsi/icl_wrappers.h
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi/iscsi.h

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Sun Feb  8 19:12:38 2015
(r278396)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Sun Feb  8 19:15:14 2015
(r278397)
@@ -164,6 +164,12 @@ static voidcfiscsi_pdu_handle_task_requ
 static voidcfiscsi_pdu_handle_data_out(struct icl_pdu *request);
 static voidcfiscsi_pdu_handle_logout_request(struct icl_pdu *request);
 static voidcfiscsi_session_terminate(struct cfiscsi_session *cs);
+static struct cfiscsi_data_wait*cfiscsi_data_wait_new(
+   struct cfiscsi_session *cs, union ctl_io *io,
+   uint32_t initiator_task_tag,
+   uint32_t *target_transfer_tagp);
+static voidcfiscsi_data_wait_free(struct cfiscsi_session *cs,
+   struct cfiscsi_data_wait *cdw);
 static struct cfiscsi_target   *cfiscsi_target_find(struct cfiscsi_softc
*softc, const char *name, uint16_t tag);
 static struct cfiscsi_target   *cfiscsi_target_find_or_create(
@@ -929,7 +935,7 @@ cfiscsi_pdu_handle_data_out(struct icl_p
CFISCSI_SESSION_UNLOCK(cs);
done = (io->scsiio.ext_data_filled != cdw->cdw_r2t_end ||
io->scsiio.ext_data_filled == io->scsiio.kern_data_len);
-   uma_zfree(cfiscsi_data_wait_zone, cdw);
+   cfiscsi_data_wait_free(cs, cdw);
if (done)
io->scsiio.be_move_done(io);
else
@@ -1067,6 +1073,45 @@ cfiscsi_callout(void *context)
cfiscsi_pdu_queue(cp);
 }
 
+static struct cfiscsi_data_wait *
+cfiscsi_data_wait_new(struct cfiscsi_session *cs, union ctl_io *io,
+uint32_t initiator_task_tag, uint32_t *target_transfer_tagp)
+{
+   struct cfiscsi_data_wait *cdw;
+   int error;
+
+   cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO);
+   if (cdw == NULL) {
+   CFISCSI_SESSION_WARN(cs,
+   "failed to allocate %zd bytes", sizeof(*cdw));
+   return (NULL);
+   }
+
+   error = icl_conn_transfer_setup(cs->cs_conn, io, target_transfer_tagp,
+   &cdw->cdw_icl_prv);
+   if (error != 0) {
+   CFISCSI_SESSION_WARN(cs,
+   "icl_conn_transfer_setup() failed with error %d", error);
+   uma_zfree(cfiscsi_data_wait_zone, cdw);
+   return (NULL);
+   }
+
+   cdw->cdw_ctl_io = io;
+   cdw->cdw_target_transfer_tag = *target_transfer_tagp;
+   cdw->cdw_initiator_task_tag = initiator_task_tag;
+
+   return (cdw);
+}
+
+static void
+cfiscsi_data_wait_free(struct cfiscsi_session *cs,
+struct cfiscsi_data_wait *cdw)
+{
+
+   icl_conn_transfer_done(cs->cs_conn, cdw->cdw_icl_prv);
+   uma_zfree(cfiscsi_data_wait_zone, cdw);
+}
+
 static void
 cfiscsi_session_terminate_tasks(struct cfiscsi_session *cs)
 {
@@ -1106,7 +1151,7 @@ cfiscsi_session_terminate_tasks(struct c
 */
cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42;
cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io);
-   uma_zfree(cfiscsi_data_wait_zone, cdw);
+   cfiscsi_data_wait_free(cs, cdw);
CFISCSI_SESSION_LOCK(cs);
}
CFISCSI_SESSION_UNLOCK(cs);
@@ -2600,13 +2645,8 @@ cfiscsi_datamove_out(union ctl_io *io)
 
target_transfer_tag =
atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1);
-
-#if 0
-   CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator "
-   "task tag 0x%x, target transfer tag 0x%x",
-   bhssc->bhssc_initiator_task_tag, target_transfer_tag);
-#endif
-   cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO);
+   cdw = cfiscsi_data_wait_new(cs, io, bhssc->bhssc_initiator_task_tag,
+   &target_transfer_tag);
if (cdw == NULL) {
CFISCSI_SESSION_WARN(cs, "failed to "
"allocate memory; dropping connection");
@@ -2615,6 +2655,12 @@ cfiscsi_datamove_out(union ctl_io *io)
cfiscsi_session_terminate(cs);
return;
}
+#if 0
+   CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator "
+   "task tag 0x%x, target transfer tag 0x%x",
+   bhssc->bhssc_initiator_task_tag, target_transfer_tag);
+#endif
+

Re: lost change 272451 - CAP_EVENT for tcpdump (Re: svn commit: r276788 - in head: contrib/tcpdump contrib/tcpdump/lbl contrib/tcpdump/missing usr.sbin/tcpdump/tcpdump

2015-02-08 Thread Dag-Erling Smørgrav
Bryan Drewery  writes:
> The problem is that pf is implemented differently on FreeBSD and OpenBSD
> for pid/uid tracking. The code would be overly complex to support both
> and I gave up on that. Even getting it to work on FreeBSD required the
> _KERNEL define hack for UID_MAX, which our pf uses to note 'no uid value'.

First-class stupidity on POSIX's part which defines FOO_MAX for almost
every single integer type but not for uid_t or gid_t.  FreeBSD has them,
but Linux doesn't, so I usually end up doing

#ifndef UID_MAX
#define UID_MAX ((uid_t)-1)
#endif

in cross-platform code.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r278389 - head/sys/powerpc/pseries

2015-02-08 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Feb  8 16:50:00 2015
New Revision: 278389
URL: https://svnweb.freebsd.org/changeset/base/278389

Log:
  Add some error checking on the supplied page size list. This makes sure
  that we (a) get the correct large page size to provide to pmap and (b)
  we can alert the user if running under incorrectly-configured PowerKVM
  on POWER7 and POWER8 systems.
  
  MFC after:1 week

Modified:
  head/sys/powerpc/pseries/mmu_phyp.c

Modified: head/sys/powerpc/pseries/mmu_phyp.c
==
--- head/sys/powerpc/pseries/mmu_phyp.c Sun Feb  8 16:30:44 2015
(r278388)
+++ head/sys/powerpc/pseries/mmu_phyp.c Sun Feb  8 16:50:00 2015
(r278389)
@@ -102,6 +102,7 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t 
char buf[8];
uint32_t prop[2];
uint32_t nptlp, shift = 0, slb_encoding = 0;
+   uint32_t lp_size, lp_encoding;
phandle_t dev, node, root;
int idx, len, res;
 
@@ -148,9 +149,9 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t 
 * We have to use a variable length array on the stack
 * since we have very limited stack space.
 */
-   cell_t arr[len/sizeof(cell_t)];
-   res = OF_getprop(node, "ibm,segment-page-sizes", &arr,
-sizeof(arr));
+   pcell_t arr[len/sizeof(cell_t)];
+   res = OF_getencprop(node, "ibm,segment-page-sizes", arr,
+   sizeof(arr));
len /= 4;
idx = 0;
while (len > 0) {
@@ -160,18 +161,26 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t 
idx += 3;
len -= 3;
while (len > 0 && nptlp) {
+   lp_size = arr[idx];
+   lp_encoding = arr[idx+1];
+   if (slb_encoding == SLBV_L && lp_encoding == 0)
+   break;
+
idx += 2;
len -= 2;
nptlp--;
}
+   if (nptlp && slb_encoding == SLBV_L && lp_encoding == 0)
+   break;
}
 
-   /* For now we allow shift only to be <= 0x18. */
-   if (shift >= 0x18)
-   shift = 0x18;
+   if (len == 0)
+   panic("Standard large pages (SLB[L] = 1, PTE[LP] = 0) "
+   "not supported by this system. Please enable huge "
+   "page backing if running under PowerKVM.");
 
moea64_large_page_shift = shift;
-   moea64_large_page_size = 1ULL << shift;
+   moea64_large_page_size = 1ULL << lp_size;
}
 
moea64_mid_bootstrap(mmup, kernelstart, kernelend);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278379 - in head/sys/dev/usb: . serial

2015-02-08 Thread Dmitry Chagin
Author: dchagin
Date: Sun Feb  8 11:55:29 2015
New Revision: 278379
URL: https://svnweb.freebsd.org/changeset/base/278379

Log:
  Add Neoway WM620 module ID.
  
  MFC after:1 Week

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Sun Feb  8 10:58:25 2015
(r278378)
+++ head/sys/dev/usb/serial/u3g.c   Sun Feb  8 11:55:29 2015
(r278379)
@@ -399,6 +399,7 @@ static const STRUCT_USB_HOST_ID u3g_devs
U3G_DEV(QUALCOMM2, AC8700, 0),
U3G_DEV(QUALCOMM2, MF330, 0),
U3G_DEV(QUALCOMM2, SIM5218, 0),
+   U3G_DEV(QUALCOMM2, WM620, 0),
U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT),
U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0),
U3G_DEV(QUALCOMM2, GOBI2000, 0),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Feb  8 10:58:25 2015(r278378)
+++ head/sys/dev/usb/usbdevsSun Feb  8 11:55:29 2015(r278379)
@@ -3577,6 +3577,7 @@ product QUALCOMM2 CDMA_MSM0x3196  CDMA T
 product QUALCOMM2 AC8700   0x6000  AC8700
 product QUALCOMM2 VW110L   0x1000  Vertex Wireless 110L modem
 product QUALCOMM2 SIM5218  0x9000  SIM5218
+product QUALCOMM2 WM6200x9002  Neoway WM620
 product QUALCOMM2 GOBI2000_QDL 0x9204  Qualcomm Gobi 2000 QDL
 product QUALCOMM2 GOBI2000 0x9205  Qualcomm Gobi 2000 modem
 product QUALCOMM2 VT80N0x6500  Venus VT80N
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278378 - head/sys/dev/iscsi

2015-02-08 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Feb  8 10:58:25 2015
New Revision: 278378
URL: https://svnweb.freebsd.org/changeset/base/278378

Log:
  Make output of "iscsictl -v" and "ctladm islist -v" a little prettier
  by capitalizing "None".
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/icl_soft.c

Modified: head/sys/dev/iscsi/icl.c
==
--- head/sys/dev/iscsi/icl.cSun Feb  8 10:17:20 2015(r278377)
+++ head/sys/dev/iscsi/icl.cSun Feb  8 10:58:25 2015(r278378)
@@ -96,7 +96,7 @@ icl_find(const char *name)
}
 
TAILQ_FOREACH(im, &sc->sc_modules, im_next) {
-   if (strcmp(im->im_name, name) == 0)
+   if (strcasecmp(im->im_name, name) == 0)
return (im);
}
 

Modified: head/sys/dev/iscsi/icl_soft.c
==
--- head/sys/dev/iscsi/icl_soft.c   Sun Feb  8 10:17:20 2015
(r278377)
+++ head/sys/dev/iscsi/icl_soft.c   Sun Feb  8 10:58:25 2015
(r278378)
@@ -1183,7 +1183,7 @@ icl_soft_new_conn(const char *name, stru
 #endif
ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH;
ic->ic_name = name;
-   ic->ic_offload = "none";
+   ic->ic_offload = "None";
 
return (ic);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278374 - in head/sys/dev/cxgbe: . iw_cxgbe tom

2015-02-08 Thread Navdeep Parhar
Author: np
Date: Sun Feb  8 09:28:55 2015
New Revision: 278374
URL: https://svnweb.freebsd.org/changeset/base/278374

Log:
  cxgbe(4): tidy up some of the interaction between the Upper Layer
  Drivers (ULDs) and the base if_cxgbe driver.
  
  Track the per-adapter activation of ULDs in a new "active_ulds" field.
  This was done pretty arbitrarily before this change -- via TOM_INIT_DONE
  in adapter->flags for TOM, and the (1 << MAX_NPORTS) bit in
  adapter->offload_map for iWARP.
  
  iWARP and hw-accelerated iSCSI rely on the TOE (supported by the TOM
  ULD).  The rules are:
  a) If the iWARP and/or iSCSI ULDs are available when TOE is enabled then
 iWARP and/or iSCSI are enabled too.
  b) When the iWARP and iSCSI modules are loaded they go looking for
 adapters with TOE enabled and enable themselves on that adapter.
  c) You cannot deactivate or unload the TOM module from underneath iWARP
 or iSCSI.  Any such attempt will fail with EBUSY.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/iw_cxgbe/device.c
  head/sys/dev/cxgbe/offload.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/tom/t4_listen.c
  head/sys/dev/cxgbe/tom/t4_tom.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hSun Feb  8 09:25:06 2015
(r278373)
+++ head/sys/dev/cxgbe/adapter.hSun Feb  8 09:28:55 2015
(r278374)
@@ -192,7 +192,7 @@ enum {
/* INTR_DIRECT  = (1 << 2), No longer used. */
MASTER_PF   = (1 << 3),
ADAP_SYSCTL_CTX = (1 << 4),
-   TOM_INIT_DONE   = (1 << 5),
+   /* TOM_INIT_DONE= (1 << 5), No longer used */
BUF_PACKING_OK  = (1 << 6),
 
CXGBE_BUSY  = (1 << 9),
@@ -758,7 +758,8 @@ struct adapter {
uint16_t doorbells;
int open_device_map;
 #ifdef TCP_OFFLOAD
-   int offload_map;
+   int offload_map;/* ports with IFCAP_TOE enabled */
+   int active_ulds;/* ULDs activated on this adapter */
 #endif
int flags;
 

Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/device.cSun Feb  8 09:25:06 2015
(r278373)
+++ head/sys/dev/cxgbe/iw_cxgbe/device.cSun Feb  8 09:28:55 2015
(r278374)
@@ -213,7 +213,7 @@ c4iw_activate(struct adapter *sc)
 
ASSERT_SYNCHRONIZED_OP(sc);
 
-   if (isset(&sc->offload_map, MAX_NPORTS)) {
+   if (uld_active(sc, ULD_IWARP)) {
KASSERT(0, ("%s: RDMA already eanbled on sc %p", __func__, sc));
return (0);
}
@@ -265,9 +265,9 @@ c4iw_activate_all(struct adapter *sc, vo
if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4iwact") != 0)
return;
 
-   if (!isset(&sc->offload_map, MAX_NPORTS) &&
-   t4_activate_uld(sc, ULD_IWARP) == 0)
-   setbit(&sc->offload_map, MAX_NPORTS);
+   /* Activate iWARP if any port on this adapter has IFCAP_TOE enabled. */
+   if (sc->offload_map && !uld_active(sc, ULD_IWARP))
+   (void) t4_activate_uld(sc, ULD_IWARP);
 
end_synchronized_op(sc, 0);
 }
@@ -279,9 +279,8 @@ c4iw_deactivate_all(struct adapter *sc, 
if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4iwdea") != 0)
return;
 
-   if (isset(&sc->offload_map, MAX_NPORTS) &&
-   t4_deactivate_uld(sc, ULD_IWARP) == 0)
-   clrbit(&sc->offload_map, MAX_NPORTS);
+   if (uld_active(sc, ULD_IWARP))
+   (void) t4_deactivate_uld(sc, ULD_IWARP);
 
end_synchronized_op(sc, 0);
 }

Modified: head/sys/dev/cxgbe/offload.h
==
--- head/sys/dev/cxgbe/offload.hSun Feb  8 09:25:06 2015
(r278373)
+++ head/sys/dev/cxgbe/offload.hSun Feb  8 09:28:55 2015
(r278374)
@@ -127,9 +127,10 @@ struct t4_virt_res {
 
 #ifdef TCP_OFFLOAD
 enum {
-   ULD_TOM = 1,
-   ULD_IWARP = 2,
-   ULD_ISCSI = 3,
+   ULD_TOM = 0,
+   ULD_IWARP,
+   ULD_ISCSI,
+   ULD_MAX = ULD_ISCSI
 };
 
 struct adapter;
@@ -156,5 +157,6 @@ int t4_unregister_uld(struct uld_info *)
 int t4_activate_uld(struct adapter *, int);
 int t4_deactivate_uld(struct adapter *, int);
 void t4_iscsi_init(struct ifnet *, unsigned int, const unsigned int *);
+int uld_active(struct adapter *, int);
 #endif
 #endif

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cSun Feb  8 09:25:06 2015
(r278373)
+++ head/sys/dev/cxgbe/t4_main.cSun Feb  8 09:28:55 2015
(r278374)
@@ -7144,7 +7144,7 @@ set_filter_mode(struct adapter *sc, uint
}
 
 #ifdef TCP_OFFLOAD
-   if (sc->offload_map) {

svn commit: r278372 - head/sys/dev/cxgbe

2015-02-08 Thread Navdeep Parhar
Author: np
Date: Sun Feb  8 08:52:18 2015
New Revision: 278372
URL: https://svnweb.freebsd.org/changeset/base/278372

Log:
  cxgbe(4): adapter_full_init is always a synchronized operation.
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cSun Feb  8 08:42:45 2015
(r278371)
+++ head/sys/dev/cxgbe/t4_main.cSun Feb  8 08:52:18 2015
(r278372)
@@ -3432,6 +3432,7 @@ adapter_full_init(struct adapter *sc)
 {
int rc, i;
 
+   ASSERT_SYNCHRONIZED_OP(sc);
ADAPTER_LOCK_ASSERT_NOTOWNED(sc);
KASSERT((sc->flags & FULL_INIT_DONE) == 0,
("%s: FULL_INIT_DONE already", __func__));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278371 - head/sys/dev/cxgbe

2015-02-08 Thread Navdeep Parhar
Author: np
Date: Sun Feb  8 08:42:45 2015
New Revision: 278371
URL: https://svnweb.freebsd.org/changeset/base/278371

Log:
  cxgbe(4): a change to the synchronization rules within the the driver.
  This is purely cosmetic because the new rules are already followed.
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hSun Feb  8 03:55:12 2015
(r278370)
+++ head/sys/dev/cxgbe/adapter.hSun Feb  8 08:42:45 2015
(r278371)
@@ -812,7 +812,6 @@ struct adapter {
 #define ADAPTER_LOCK_ASSERT_OWNED(sc)  mtx_assert(&(sc)->sc_lock, MA_OWNED)
 #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, 
MA_NOTOWNED)
 
-/* XXX: not bulletproof, but much better than nothing */
 #define ASSERT_SYNCHRONIZED_OP(sc) \
 KASSERT(IS_BUSY(sc) && \
(mtx_owned(&(sc)->sc_lock) || sc->last_op_thr == curthread), \

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cSun Feb  8 03:55:12 2015
(r278370)
+++ head/sys/dev/cxgbe/t4_main.cSun Feb  8 08:42:45 2015
(r278371)
@@ -3139,6 +3139,9 @@ mcfail:
return (rc);
 }
 
+/*
+ * {begin|end}_synchronized_op must be called from the same thread.
+ */
 int
 begin_synchronized_op(struct adapter *sc, struct port_info *pi, int flags,
 char *wmesg)
@@ -3194,6 +3197,9 @@ done:
return (rc);
 }
 
+/*
+ * {begin|end}_synchronized_op must be called from the same thread.
+ */
 void
 end_synchronized_op(struct adapter *sc, int flags)
 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278335 - head/sys/boot/forth

2015-02-08 Thread Alexey Dokuchaev
On Fri, Feb 06, 2015 at 11:19:18PM +, Devin Teske wrote:
> New Revision: 278335
> URL: https://svnweb.freebsd.org/changeset/base/278335
> 
> Log:
>   Revert SVN r277693.
>   
>   Discussed on:   src-committers
>   Approved by:core (emaste)

Why it was reverted, if I may ask?

./danfe
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278361 - in head/contrib/llvm: lib/Target/X86 patches

2015-02-08 Thread Roman Divacky
Fwiw, FastISel is only used for -O0, maybe the right way to "fix"
the breakage is to not use -O0 ?

On Sat, Feb 07, 2015 at 04:57:33PM +, Dimitry Andric wrote:
> Author: dim
> Date: Sat Feb  7 16:57:32 2015
> New Revision: 278361
> URL: https://svnweb.freebsd.org/changeset/base/278361
> 
> Log:
>   Back out r278349 and r278350 for now, since this apparently blows up the
>   kernel build in sys/dev/hptmv/hptproc.c for some people.
>   
>   Reported by:sbruno, Matthew Fuller 
> 
> Deleted:
>   head/contrib/llvm/patches/patch-32-llvm-r224884-invalid-reg-replacement.diff
> Modified:
>   head/contrib/llvm/lib/Target/X86/X86FastISel.cpp
> 
> Modified: head/contrib/llvm/lib/Target/X86/X86FastISel.cpp
> ==
> --- head/contrib/llvm/lib/Target/X86/X86FastISel.cpp  Sat Feb  7 14:31:51 
> 2015(r278360)
> +++ head/contrib/llvm/lib/Target/X86/X86FastISel.cpp  Sat Feb  7 16:57:32 
> 2015(r278361)
> @@ -2699,9 +2699,6 @@ bool X86FastISel::FastLowerCall(CallLowe
> TM.Options.GuaranteedTailCallOpt))
>  return false;
>  
> -  SmallVector OutVTs;
> -  SmallVector ArgRegs;
> -
>// If this is a constant i1/i8/i16 argument, promote to i32 to avoid an 
> extra
>// instruction. This is safe because it is common to all FastISel supported
>// calling conventions on x86.
> @@ -2719,34 +2716,28 @@ bool X86FastISel::FastLowerCall(CallLowe
>  
>  // Passing bools around ends up doing a trunc to i1 and passing it.
>  // Codegen this as an argument + "and 1".
> -MVT VT;
> -auto *TI = dyn_cast(Val);
> -unsigned ResultReg;
> -if (TI && TI->getType()->isIntegerTy(1) && CLI.CS &&
> -  (TI->getParent() == CLI.CS->getInstruction()->getParent()) &&
> -  TI->hasOneUse()) {
> -  Value *PrevVal = TI->getOperand(0);
> -  ResultReg = getRegForValue(PrevVal);
> -
> -  if (!ResultReg)
> -return false;
> +if (auto *TI = dyn_cast(Val)) {
> +  if (TI->getType()->isIntegerTy(1) && CLI.CS &&
> +  (TI->getParent() == CLI.CS->getInstruction()->getParent()) &&
> +  TI->hasOneUse()) {
> +Val = cast(Val)->getOperand(0);
> +unsigned ResultReg = getRegForValue(Val);
>  
> -  if (!isTypeLegal(PrevVal->getType(), VT))
> -return false;
> +if (!ResultReg)
> +  return false;
>  
> -  ResultReg =
> -FastEmit_ri(VT, VT, ISD::AND, ResultReg, hasTrivialKill(PrevVal), 1);
> +MVT ArgVT;
> +if (!isTypeLegal(Val->getType(), ArgVT))
> +  return false;
>  
> -  if (!ResultReg)
> -return false;
> -} else {
> -  if (!isTypeLegal(Val->getType(), VT))
> -return false;
> -  ResultReg = getRegForValue(Val);
> -}
> +ResultReg =
> +  FastEmit_ri(ArgVT, ArgVT, ISD::AND, ResultReg, Val->hasOneUse(), 
> 1);
>  
> -ArgRegs.push_back(ResultReg);
> -OutVTs.push_back(VT);
> +if (!ResultReg)
> +  return false;
> +UpdateValueMap(Val, ResultReg);
> +  }
> +}
>}
>  
>// Analyze operands of the call, assigning locations to each operand.
> @@ -2758,6 +2749,13 @@ bool X86FastISel::FastLowerCall(CallLowe
>if (IsWin64)
>  CCInfo.AllocateStack(32, 8);
>  
> +  SmallVector OutVTs;
> +  for (auto *Val : OutVals) {
> +MVT VT;
> +if (!isTypeLegal(Val->getType(), VT))
> +  return false;
> +OutVTs.push_back(VT);
> +  }
>CCInfo.AnalyzeCallOperands(OutVTs, OutFlags, CC_X86);
>  
>// Get a count of how many bytes are to be pushed on the stack.
> @@ -2779,7 +2777,9 @@ bool X86FastISel::FastLowerCall(CallLowe
>  if (ArgVT == MVT::x86mmx)
>return false;
>  
> -unsigned ArgReg = ArgRegs[VA.getValNo()];
> +unsigned ArgReg = getRegForValue(ArgVal);
> +if (!ArgReg)
> +  return false;
>  
>  // Promote the value if needed.
>  switch (VA.getLocInfo()) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"