Re: CVS commit: src/sys/arch/riscv/riscv

2015-03-31 Thread Reinoud Zandijk
Hi Matt,

On Tue, Mar 31, 2015 at 01:30:50AM +, Matt Thomas wrote:
 When the cpu gets an exception from kernel mode, the sscratch register will be
 0 and curlwp will be in the tp register.  When the cpu gets an exception 
 from
 user mode, the sscratch register will be a pointer to the current lwp.

Will the kernel not be confused and choose the wrong path if a userland
programs clears the sp register and gets an exception, say be storing a
stack frame? by accident or deliberately?

 Index: src/sys/arch/riscv/riscv/locore.S
 diff -u src/sys/arch/riscv/riscv/locore.S:1.1 
 src/sys/arch/riscv/riscv/locore.S:1.2
 --- src/sys/arch/riscv/riscv/locore.S:1.1 Sat Mar 28 16:13:56 2015
 +++ src/sys/arch/riscv/riscv/locore.S Tue Mar 31 01:30:50 2015
 @@ -1,4 +1,4 @@
 -/* $NetBSD: locore.S,v 1.1 2015/03/28 16:13:56 matt Exp $ */
 +/* $NetBSD: locore.S,v 1.2 2015/03/31 01:30:50 matt Exp $ */
  /*-
   * Copyright (c) 2014 The NetBSD Foundation, Inc.
   * All rights reserved.
 @@ -78,10 +78,10 @@ ENTRY_NP(start)
   callmemset  // zero through kernel_end
  
   // As a temporary hack, word 0 contains the amount of memory in MB
 - lw  a7, (zero)  // load memory size
 + INT_L   a7, (zero)  // load memory size
   sllia7, a7, (20-PGSHIFT)// convert MB to pages
 - auipc   t0, %pcrel_hi(physmem)
 - sw  a7, %pcrel_lo(physmem)(t0)  // store it in physmem
 +.L01:auipc   t0, %pcrel_hi(physmem)
 + INT_S   a7, %pcrel_lo(.L01)(t0) // store it in physmem

Why are you loading the lower PC relative part of .L01 in stead of physmem?
won't that give the wrong lower bits? Isn't there a PTR_S macro to handle
this?

With regards,
Reinoud



pgpjQXdqjH9e1.pgp
Description: PGP signature


Re: CVS commit: src/sys/dev/ic (spdmem.c)

2015-03-31 Thread Paul Goyette

Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 27 05:33:08 UTC 2015

Modified Files:
src/sys/dev/ic: spdmem.c spdmemreg.h

Log Message:
Add DDR4 support a bit.



Looking at the actual code change here

@@ -76,6 +76,7 @@ static const char* spdmem_basic_types[]
DDR2 SDRAM FB,
DDR2 SDRAM FB Probe,
DDR3 SDRAM
+   DDR4 SDRAM
 };

 static const char* spdmem_superset_types[] = {


There appears to be a missing comma, leading to the bug I just reported 
in


http://mail-index.netbsd.org/current-users/2015/04/01/msg027013.html



:)


I would fix it myself, but currently my NetBSD machine is not networked.



-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: CVS commit: src/usr.sbin/service

2015-03-31 Thread Alan Barrett

On Wed, 01 Apr 2015, Adrian Steinmann wrote:

Please could this be fixed to use shell quoting in a safe way.

OK, if that'll unstall the pullup-7.


I don't know.


Are you implying that the /etc/rc.d/ system supports space in filenames?


No, I am implying that somebody could create a file whose name 
contains a space.  Whether or not it's supported is separate from 
whether or not the service(8) script does strange things when it 
happens.


--apb (Alan Barrett)


Re: CVS commit: src/sys/net/if_vlan.c

2015-03-31 Thread Christoph Badura
On Tue, Mar 31, 2015 at 11:09:02AM +0900, Ryota Ozaki wrote:
 On Tue, Mar 31, 2015 at 1:42 AM, Matt Thomas m...@3am-software.com wrote:
  It lacks compensating for the fact the CRC has been stripped by the
  time vlan gets the packet.

 # matt@ explained well than me...

 Note that the issue was found by some strict packet capture software
 (not by me, so I don't know what it is); typical OSes don't complain
 the extra padding, so we didn't notice the issue until recently.

Yeah.  I misunderstood your message in the PR.  I read it as if
if_vlan.c should be sending 72 byte minimum size packets and the code
was doing something different.  That's why I asked.

Maybe we should update the PR.

--chris


Re: CVS commit: src/usr.sbin/service

2015-03-31 Thread Adrian Steinmann
 Please could this be fixed to use shell quoting in a safe way.
OK, if that'll unstall the pullup-7.

Are you implying that the /etc/rc.d/ system supports space in filenames?

Adrian