Re: The imperfect beauty of NetBSD [Was: NetBSD vs. FreeBSD]

2010-01-05 Thread Matthias Drochner

alex-goncha...@comcast.net said:
> ACPI Error: No handler for Region [ERAM] (0x87b1ef00)
> [EmbeddedControl] (20090730/evregion-430)

The handler for the "EmbeddedControl" space is provided by the
"acpiec" driver. Your summary doesn't give any indication that
one was attached. This could be part of the problem.
Whether not configured or not probed correctly... I can't tell
about this driver's quality, none of my boxes uses an embedded
controller.
An ACPI DSDT table dump could be helpful.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




config_alldevs_lock is evil

2010-01-11 Thread Matthias Drochner

Just updated to -current and tried to fetch some photos from
my digicam. Got two panics in a row, like:
#10 0xc05ad629 in __kernassert (t=0xc068a17e "diagnostic ",
f=0xc06cef78 "../../../../kern/subr_autoconf.c", l=1835,
e=0xc06ceda8 "TAILQ_EMPTY(&devs_gclist)")
at ../../../../../../lib/libkern/__assert.c:50
#11 0xc04504b7 in config_alldevs_lock () at ../../../../kern/subr_autoconf.c:18
35
#12 0xc045058a in device_lookup (cd=0xc07005a0, unit=0)
at ../../../../kern/subr_autoconf.c:1888
#13 0xc0450641 in device_lookup_private (cd=0xc07005a0, unit=0)
at ../../../../kern/subr_autoconf.c:1909
#14 0xc057b6d3 in wsdisplaypoll (dev=12036, events=88, l=0xcc1edc80)
at ../../../../dev/wscons/wsdisplay.c:1054
#15 0xc04549dd in cdev_poll (dev=12036, flag=88, l=0xcc1edc80)
at ../../../../kern/subr_devsw.c:921

This shows two things:
- There is a blatant bug in the device g/c logics.
- Each device_lookup() as done by basically every device driver entry
  pulls config_alldevs_lock, which is at splhigh.

The first one is easily fixed hopefully, but the latter one points
to a design problem. The config_alldevs_lock at highest priority
shouldn't be used, at least not at runtime, the way it is used now.
I'm not sure it is necessary to do device addition/removal at
that high priority at all -- either it is done by normal threads
which can wait, or the bus already needs to deal with unexpected
removals in some way (like USB), and uses a helper thread.
Anyway, holding the global alldevs lock to look up a driver
specific instance is wrong.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: make module loading by boot installboot patchable?

2010-01-12 Thread Matthias Drochner

OK, here is an implementation which appears to work so far.
There are two new installboot(8) options, to toggle module
loading and boot.cfg evaluation. (I've added the latter because
an unsuspecting dhcpd setup will deliver a kernel binary if
a boot.cfg is tried to be read; there is a size check in the
boot code which prevents it from being parsed, but it is still
lost time in the boot process.)

Comments?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt


#
# old_revision [bcf74b5990cc6edc20df3263bac900d50dc2ba94]
#
# patch "sys/arch/i386/stand/boot/boot2.c"
#  from [58b7527140bba67edfc3d31e9544fa2855e016e1]
#to [81c9050e9af95c69a7ac6b3304c4e90181873cb2]
# 
# patch "sys/arch/i386/stand/lib/boot_params.S"
#  from [0e19a98b9611bae9e3e48251c60b8cde23863430]
#to [1fe70710ed9e4221bfa75d4a186452e892441801]
# 
# patch "sys/arch/i386/stand/pxeboot/Makefile"
#  from [c673736b7c1ab21c2780c8d5f6d0b80e7e266b13]
#to [fdbb894cde45ad54adf5d81353f24de3460f5caa]
# 
# patch "sys/arch/i386/stand/pxeboot/main.c"
#  from [eb22861c9bdcf54a557050e755913d00981531fb]
#to [d9734bc8fe39e081557368d44c0fbb4a3c4a113e]
# 
# patch "sys/sys/bootblock.h"
#  from [f62332a2865f37e80d78f66b16102ba46dba91fa]
#to [fce2103a8eb9b6f601dd8e193a94f6acfd905650]
# 
# patch "usr.sbin/installboot/arch/i386.c"
#  from [29e40c5c49c1c6f5397fae4e461595496d9860fd]
#to [96eb10e5176e4118bad8e6d09bcddc844d20ceec]
# 
# patch "usr.sbin/installboot/installboot.8"
#  from [75935addd933a8a57db34454a6ae2846cf644e0a]
#to [66f24084dbce7ad827e5646798a58ba782720c4e]
# 
# patch "usr.sbin/installboot/installboot.c"
#  from [0217e7022ba1b2305ae1e21225e462045e666c06]
#to [9b571dd9b228c7137fe32fba048c8ba6cc5ae2ca]
# 
# patch "usr.sbin/installboot/installboot.h"
#  from [1c8d7cc64741fcf00e45048d1a2438701230879a]
#to [efe5905f229f39581617a33ffb84d573ba83dca2]
#

--- sys/arch/i386/stand/boot/boot2.c58b7527140bba67edfc3d31e9544fa2855e016e1
+++ sys/arch/i386/stand/boot/boot2.c81c9050e9af95c69a7ac6b3304c4e90181873cb2
@@ -291,6 +291,8 @@ boot2(int biosdev, u_int biossector)
 #endif
gateA20();
 
+   boot_modules_enabled = !!(boot_params.bp_flags
+ & X86_BP_FLAGS_LOADMODULES);
if (boot_params.bp_flags & X86_BP_FLAGS_RESET_VIDEO)
biosvideomode();
 
@@ -308,7 +310,8 @@ boot2(int biosdev, u_int biossector)
default_filename = DEFFILENAME;
 
 #ifndef SMALL
-   parsebootconf(BOOTCONF);
+   if (boot_params.bp_flags & X86_BP_FLAGS_READBOOTCONF)
+   parsebootconf(BOOTCONF);
 
/*
 * If console set in boot.cfg, switch to it.

--- sys/arch/i386/stand/lib/boot_params.S   
0e19a98b9611bae9e3e48251c60b8cde23863430
+++ sys/arch/i386/stand/lib/boot_params.S   
1fe70710ed9e4221bfa75d4a186452e892441801
@@ -2,7 +2,11 @@
 
 /* Default boot parameters - must match struct x86_boot_params in bootblock.h 
*/
 
-   .long   0   /* flags */
+#ifdef BOOTPARAM_DEFFLAGS
+   .long   BOOTPARAM_DEFFLAGS
+#else
+   .long   0x0c/* flags: bootconf+modules */
+#endif
.long   5   /* timeout in seconds */
.long   0   /* console device 0 => CONSDEV_PC */
.long   9600/* serial baud rate */

--- sys/arch/i386/stand/pxeboot/Makefile
c673736b7c1ab21c2780c8d5f6d0b80e7e266b13
+++ sys/arch/i386/stand/pxeboot/Makefile
fdbb894cde45ad54adf5d81353f24de3460f5caa
@@ -63,6 +63,10 @@ CPPFLAGS+= -DEPIA_HACK
 CPPFLAGS+= -DPASS_MEMMAP
 CPPFLAGS+= -DEPIA_HACK
 
+# modules and boot.cfg need special DHCP server setup, disable
+# per default for compatibility with existing setups
+CPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0
+
 #CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main
 

--- sys/arch/i386/stand/pxeboot/main.c  eb22861c9bdcf54a557050e755913d00981531fb
+++ sys/arch/i386/stand/pxeboot/main.c  d9734bc8fe39e081557368d44c0fbb4

Re: config_alldevs_lock is evil

2010-01-12 Thread Matthias Drochner

dyo...@pobox.com said:
> How would you suggest to synchronize access to the device_t array in a
> cfdriver_t?  I could use a mutex per cfdriver_t, just for example, but
> maybe you have in mind a better way.

As Masao said, a per-cfdriver mutex is acceptable.
But I think there is a more general problem: The driver reads a pointer
which can become invalid immediately after the lock is released, no
matter how the locking is done. Or am I missing something?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: memory leak in USB stack

2010-01-12 Thread Matthias Drochner

bou...@antioche.eu.org said:
> The attached patch fixes this by freeing the xfer in
> [eou]hci_device_intr_abort() and [eou]hci_root_intr_abort() when the
> xfer to be aborted is the pipe's intrxfer.

Just for symmetry - can't this be done in usbd_abort_pipe(),
preferrably outside the splusb()?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: wsevent MP-safe

2010-01-18 Thread Matthias Drochner

rm...@netbsd.org said:
> Here is a patch (been forgotten and dusting in my tree for a while)

Hmm, yes, obviously...
So what is the substance? Replacing the splwsevent() by a mutex?
Sorry for sounding unfriendly, but it is hard to see what is
important within all the cosmetic nonsense, you should have
seperated it.
But about cosmetics -- I don't like the new name "wsevents_t"
for wseventsvar. If at all, it is a wsevent_queue or so, this
would describe what it is good for. As I understand it, the initial
plan was to have this queue mmap()able, or at least accessible
to kernel video drivers which can control a sprite, to avoid
system call latency for mouse movements. Noone did the work
to implement this, but seeing the trend to in-kernel video drivers
in Linux I'd at least not actively inhibit it.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: wsevent MP-safe

2010-01-18 Thread Matthias Drochner

rm...@netbsd.org said:
> > have this queue mmap()able,
> > or at least accessible to kernel video drivers
> Why do you think that patch inhibits it

Formerly, the structure was public. (Although I agree that it
was not terribly useful to be synchronized with a userspace
consumer as-is, but it was something to start with.) Now it
is private.
Just want to point out that I'm absolutely not certain whether
X servers etc support that kind of event interface now or in
future. It used to be the case a while ago, at least on DEC
(my mail server):

zelof1> file /dev/ws*
/dev/ws0: character special (33/1) VS_SLU #0 PMAGB-BA terminal #1
zelof1> uname -a
OSF1 zelof1 V5.0 910 alpha

and I believe also on Sun hardware of that time.
And seeing the jerky mouse movements on my dual-core 2GHz
laptop I'm tempted to agree. (If this can't be solved
by NetBSD scheduler measures, which is something you can
certainly give a better answer for.)

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: wsevent MP-safe

2010-01-19 Thread Matthias Drochner

rm...@netbsd.org said:
> I made it private intentionally - in the current form it should not be
> exposed anywhere.  Might change in the future

OK.

> > Just want to point out that I'm absolutely not certain whether
> > X servers etc support that kind of event interface now or in
> > future. <...>
> That might be a good start to approach such project. ;)

Indeed, designing such a protocol which is efficient but doesn't
open security risks would be an interesting project.
Also worthwhile wrt system load and energy consumption.
Too bad I don't have time for it.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: check & reprogram PCI BAR

2010-01-19 Thread Matthias Drochner

bou...@antioche.eu.org said:
> For example, device for which the kernel has no drivers, but still
> have registers mapped in I/O or memory space.

Indeed, this is a problem we don't deal too well with.
(Or BARs on devices which we have drivers for but which
are not used, eg if there are mem and io BARS for the
same register space.)
These need to be accounted for.

> I'm sure PC hardware also have a few fun things I don't know about :)

What comes to mind is PCI devices which decode legacy address ranges,
which can conflict if more than one of a kind is present (VGA cards,
PCI-ISA bridges eg in docking stations).
And there are PCI devices which ACPI uses, so we can only touch them
with care.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




uvm_fault botch

2010-02-02 Thread Matthias Drochner

Hi -

just got

assertion "uobj == uobjpage->uobject" failed:
file ".../uvm_fault.c", line 1838

with -current/i386.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




regression (crash) in sysmon/acpiacad

2010-02-04 Thread Matthias Drochner

Hi -

my laptop (running -current) now crashes as soon as the
battery reaches warning level.
This is due to a jump to NULL in sysmon_envsys_events.c,
line 891 - an indirect call to sme->sme_refresh.
This is indeed 0 for acpiacad now, since the "refresh"
method was removed recently.
How is this intended to work?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: regression (crash) in sysmon/acpiacad

2010-02-04 Thread Matthias Drochner

p...@whooppee.com said:
> Either Jukka or I will get this fixed up shortly.

Thanks -- while we are here, I'm seeing another
problem, but I'm not sure whether this is due to
recent code changes or whether my laptop is getting
old: It happed two times within this week that the box
just rebooted at the moment I reconnected AC after running
on battery for a while.
As said, I can't rule out that the DC socket is
developing some contact problems or so. But this
never happened before, and it is at least a strange
coincidence that this starts just when some acpi
and sysmon code changed.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: regression (crash) in sysmon/acpiacad

2010-02-04 Thread Matthias Drochner

p...@whooppee.com said:
> Please update to rev 1.78 of src/sys/dev/sysmon/sysmon_envsys_events.c
>  and try again.

Thanks -- I just managed to run low on battery with a new kernel.
I can confirm that the problem is fixed, the box runs well until
graceful shutdown by the "sensor_battery" script.

But -- since my battery was low anyway I did another test, whether
it behaves well if the userland "powerd" is not running. It does not.
I'd expect it to hit the cpu_reboot() call in sysmon_penvsys_event()
eventually, but it did not. It didn't even update the "charge"
value visible in envstat(8) -- this stayed at "6.00%" (this is where
I killed "powerd") even when the red battery LED on my (Dell)
laptop started to light permanently, which happens below 3% (the
"low cap" limit).
This used to work, so there is another regression.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: regression (crash) in sysmon/acpiacad

2010-02-04 Thread Matthias Drochner

p...@whooppee.com said:
> Since the charge value was not updating, it  might be that the ACPI
> Notify isn't working here.

For the critical shutdown, a call to _BTP might help.
But anyway, from my limited experience with process control
("SCADA") systems, it makes sense to maintain a timestamp
for the last data value read (or delivered by asynchronous
notification) and force a fresh read if it is older than
a limit defined by the provider (and possibly overridden
by the consumer).

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: regression (crash) in sysmon/acpiacad

2010-02-04 Thread Matthias Drochner

p...@whooppee.com said:
> We already have a Poll timer, but it is only 30 seconds.

I'd add the timestamp on data values at a higher level, as
a general envsys property. This way all the "give me a data
value which is not older than xxx" can be handled early,
without even bothering the driver if a recent value is present.

> I don't know
> how ofter we should expect a Notify event, but I bet that it doesn't
> happen every 30 sec!

I didn't check in detail, but for the battery I'd only expect
Notify events on insertion/removal. Additionally when hitting
a critical limit, if _BTP was called before. Certainly not
on minor changes of the charge level.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: regression (crash) in sysmon/acpiacad

2010-02-05 Thread Matthias Drochner

p...@whooppee.com said:
> Regarding the earlier comment about your battery charge level not
> changing...  Is this still true?

Just checked again and found that the charge level is
updated now, but only every 30s. (The code in acpibat_refresh()
suggests that cached values are kept only for 5s, and I
believe that is how it did behave formerly.)

I definitely watched the battery state for a couple of
minutes yesterday, so something else must have happened.

Looking at acpibat_refresh()... the 5-seconds check uses
microtime() which is not necessarily monotonic. And, iirc,
I had booted Windows before, which sets the RTC to GMT+1,
so I had to force the clock back by a manual "ntpdate".
This might have killed status updating.
Well, just a hypothesis, but I'd suggest to use
getmicrouptime() for these checks.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Kernel loadable modules and missing symbols

2010-02-08 Thread Matthias Drochner

hsela...@c2i.net said:
> It would be nice if missing symbols could be printed to dmesg when
> loading  modules under NetBSD 5.x. This helps debugging problems.

I don't have a 5.x tree -- how far do you get if you try
to pull in rev. 1.28 of subr_kobj.c?
I agree that without getting the offending symbol named
it is tedious to find.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




assertion failed in fd_free()

2010-02-12 Thread Matthias Drochner

Hi -
just got a panic, the KASSERT at kern_descrip.c:1537
(!ff->ff_allocated) failed.
This is with -current/i386 (sources from one or two days ago).
Here is some stacktrace:

#10 0xc05b91e9 in kern_assert (t=0xc06990be "diagnostic ",
f=0xc06c0854 "../../../../kern/kern_descrip.c", l=1537,
e=0xc06c07a8 "!ff->ff_allocated")
at ../../../../../../lib/libkern/kern_assert.c:50
#11 0xc0305532 in fd_free () at ../../../../kern/kern_descrip.c:1537
#12 0xc030c451 in exit1 (l=0xdb7fd060, rv=256)
at ../../../../kern/kern_exit.c:276
#13 0xc030cc50 in sys_exit (l=0xdb7fd060, uap=0xd42bfd00, retval=0xd42bfd28)
at ../../../../kern/kern_exit.c:175

In case it helps, the fdfile structure is:
(gdb) print *ff
$1 = {ff_exclose = false, ff_allocated = true, ff_refcnt = 0, ff_file = 0x0,
  ff_knlist = {slh_first = 0x0}, ff_closing = {cv_opaque = {0x0, 0xdfe7a3d0,
  0xc06c05bb}}}

Race condition?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: sysctl node names (Re: CVS commit: src/sys/uvm)

2010-02-19 Thread Matthias Drochner

y...@mwd.biglobe.ne.jp said:
> the current mixture of "enable" vs "enabled" seems ugly to me. if my
> preference matters, i'd say "enable"/"disable".

For me, "enabled" sounds more logical because such a flag
refers to a state, not a process. But I'm ready to sacrifice
that for consistency. The "enable"s are the majority, and they
are the older ones.
In the "va0" case it is not too late -- if no native
speaker convinces me otherwise I'll change it to _disable.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: apm(4) fixes

2010-02-27 Thread Matthias Drochner

bou...@antioche.eu.org said:
> after updating my old laptop to netbsd-5, I did need to have a working
> APM again. I came up with the following patch, which makes standby,
> suspend to ram and suspend to disk work again for me.

Great - thanks for looking at that. I've also got a good old laptop
which I'd like to update but coudn't because APM got broken.

>  My fix is to call apm_resume() from within apm_suspend() or
>  apm_standby(), after aa_set_powstate() has returned.

This sounds reasonable.

> on this laptop the pfm handler are harmfull and I had to disable them:
> on reboot, the laptop gets stuck in BIOS

Can you add some kernel option which disables this? I've seen
similar trouble and thought about putting #ifdefs around the
more dangerous shutdown handler calls, but didn't find time
yet to do this in a clean way.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: (Semi-random) thoughts on device tree structure and devfs

2010-03-11 Thread Matthias Drochner

plu...@rya-online.net said:
> > We can discard the pseudo-devices concept, if need be.
> If a device has no parent, just attach it at root (similar to mainbus*),
> with parent == NULL, or even pseudo* at root, and pseudo-dev* at pseudo?

one can do so, but...

> it is not
> possible to pass configuration arguments from userland into the device
> attach routine..

you would set this in stone.
It would be easy to extend the current attach_pseudo() function by
an "attach args" argument. (An interface attribute should be passed
too for consistency because this is used as a qualifier for the
opaque "attach args" elsewhere.)
I think it hasn't been done just because noone needed it.

For the future, I'd think that the currently unstructured "attach args"
needs to be split into 3 parts:
1. Information about the device type, what is needed by child driver's
   "match" function to select the right driver. This is qualified
   by the interface attribute.
2. If the hardware supports it, information about the individual instance,
   as Ethernet HW address, or UUID for disk partitions, to allow drivers
   to recognize a device after temporary disconnection. This is qualified
   by the child device type (which can have multiple attachments).
3. everything else: handles, cookies, whatever needed for parent-child
   communication
For (1), it would make sense to make it a proplist, and pass it to
drvctl, along with locator information, to support on-demand loading
of drivers.

> I think the "pseudo-device" abstraction is unnecessary

I think it makes sense, because it allows to limit use of the
interface-attribute-less "root" to a minimum. There is a reason
that many/most ports use just one "mainbus" at root.

best regards
Matthias






Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: MI overrides of bus_dma(9), bus_space(9), pci(9)

2010-03-11 Thread Matthias Drochner

dyo...@pobox.com said:
> PCI-* bridges can override bus_space_alloc(9)/bus_space_free(9)
> in order to (1) allocate space from the upstream bus, (2)
> widen/narrow its I/O- or memory-space window.  Then we can
> provide a reliable rbus-like facility to detachable buses
> through bus_space(9).

This should be a separate set of methods, for two reasons:
-It is unneeded if no device hotplug is intended. NetBSD used to be
 useful for small/embedded systems, so it should be possible to
 leave unneeded code out.
-The bus_space_* functions assume a platform dependent bus_addr_t
 width. This doesn't make sense for buses behind some bridge.
 Examples like 1394 and SCI come to mind which are wider than
 any practical processor bus (sparsely populated of course).
 Use of bus_addr_t et al. should be limited to md code.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: (Semi-random) thoughts on device tree structure and devfs

2010-03-11 Thread Matthias Drochner

mo...@rodents-montreal.org said:
> have pseudo0 attach at mainbus0 and then my device attach at pseudo0

If we are taking the "interface attribute" abstraction serious this
doesn't work easily: A device doesn't attach at a device but at
an interface attribute (which is usually provided by a device but
can come out of the blue in the pseudo-device case).
The "mainbus" and the interfaces provided by it are platform
specific and mostly static.

> I did this because I needed a struct device

That's what attach_pseudo does... I think it makes sense to
have some way to create a device hierarchy without pretending
that it is connected to the platform's physical main bus.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: MI overrides of bus_dma(9), bus_space(9), pci(9)

2010-03-11 Thread Matthias Drochner

dyo...@pobox.com said:
> (1) If a bus-bridge driver is not configured in the kernel, or if its
> module is unloaded, then the code is left out.

I know... but if you add this to the commonly used "ppb" driver
there is no way to avoid it.

> (2) Do you intend for the new methods to belong to a new API, or to
> bus_space(9)?  What would the methods' names and contracts be?

The new methods should be part of the pci(9) API. That kind of
bus space management is inherently bus specific.

> I think that you are trying to tell me about some existing limitation to
> bus_space(9)?
> [...]
> > This type is primarily used when mapping and unmap-
> >  ping bus space.

Yes, this is a limitation of the idea of a universal bus_space type.
It doesn't consider bridges which map things differently, eg by using
split transactions.
Generally I find the idea of making the bus methods more MI as you
propose a good thing. It just needs to be done in a way which doesn't
hurt users with tradiditional/embedded/low memory systems.

> on i386, where bus_addr_t was until very recently 32 bits wide, we will
> need to extend bus_addr_t to 64 bits.

I've seen the mails about this -- if things were designed well, the change
for PAE would only affect uvm and the pmap functions dealing with it.
A single #define would switch between 32-bit and 64-bit physical addresses,
without affecting drivers or userland.
(I know that bus_dma_segment_t uses bus_addr_t which is wrong because
a DMA address refers to a bus address of the actual device rather than
a main bus address of the platform. That's a motivation to refine that
interface rather than drawing more design compromises from it.)

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: MI overrides of bus_dma(9), bus_space(9), pci(9)

2010-03-12 Thread Matthias Drochner

[pci bus space alloc]
dyo...@pobox.com said:
> > The new methods should be part of the pci(9) API. That kind of
> > bus space management is inherently bus specific.
> Do you think that bus_space_alloc(9) should go away, then?

It shouldn't go away, it it needed where the MI pci hierarchy meets
MD semantics, at the host bridge.

For me, bus_space_* and the bus_addr_t types refer to a platforms
native "main bus" which is basically what comes out of the MMU.
MI buses should use fixed width types to describe their interfaces.

> And what about bus_space_map(9)?

Here is the question whether we want to support PCI where it is not
a "native" bus and mapped by a MD host bridge. I don't see any
hardware support which could do this in NetBSD currently, but
there are some ways to connect a PCI bus hierarchy to an MI bus:
-Some PCI-VME bridges can be used the other way - controlling a PCI
 bus from VME. Haven't tried that.
-remote PCI bus mastering through 1394/firewire
-InfiniBand
In these cases, the PCI bus isn't just mapped 1:1 to the mainbus,
but through a bridge which does some translation.
So one can also connect a bus with a larger address width to
a 32-bit system with 32-bit bus_addr_t.

> Certainly I could introduce pci_space_alloc(9) with a similar signature
> as bus_space_alloc().

There is no guarantee anyway that eg. the PCI I/O space corresponds
to an I/O space known to bus_space_alloc()...
I've tried to get that abstraction clean for VME bus support a while
ago. Have a look at dev/vme/vmevar.h.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: (Semi-random) thoughts on device tree structure and devfs

2010-03-12 Thread Matthias Drochner

mo...@rodents-montreal.org said:
> mainbus0 does not necessarily correspond to any physical bus.

Well, not physical in a sense that you can look at the wires, but
commonly it has a number of interface attributes which match the
capabilities of the the host bridge and some more platform
specific things, eg the firmware's autoconfiguration support.

> There is
> other precedent for things in the autoconf tree that do not correspond
> to anything physical, such as wsdisplay

Yes, devices in the autoconf tree are connected by interfaces (named
by interface attributes) which are primarily APIs. Sometimes they
correspond to some physical bus semantics, sometimes it is just
a software abstraction.

Anyway - the interface attributes of "mainbus" are fixed by the
platform which makes it a bad choice to attach random MI things at.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: (Semi-random) thoughts on device tree structure and devfs

2010-03-12 Thread Matthias Drochner

dyo...@pobox.com said:
> Then we can, as you suggested at the top of this thread, create the
> ether(4) pseudo-device that is analogous to audio(4).  Let us attach a
> particular ether(4) instance to an ethernet h/w instance according to
> the h/w's properties.

This looks somewhat shortsighted. "ethernet" is no interface in a
technical sense anymore. It is just perhaps a tag put at protocols
which use 48-bit MAC addresses and can be bridged to other protocols
of that kind. But then, where do draw the line? FDDI can be bridged
to ethernet as well, so would you call it "ether"?

Besides that, I don't see how this could solve any real-world problem
which a trivial shell script can't deal with.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Using proplist ioctl's from within the kernel

2010-03-25 Thread Matthias Drochner

jeanyves.mig...@free.fr said:
> There should be some way to serialize/deserialize prop/plistref
> objects  within the kernel, but I never found a solution. I suppose
> you will have  to dig deeper than I did :/

I think it should be avoided at all costs. With proplists, you give up type
safety
and you create a lot of overhead. This is acceptable for kernel-user interfaces
in some cases but not within the kernel.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Forcing a serial console for the kernel

2010-03-28 Thread Matthias Drochner

s...@cirr.com said:
> The issue I have is that if I use 'consdev com0' at the boot prompt,
> should I not be able to redirect console output to the serial port on
> a PC for   any kernel regardless of whether as long as their is driver
> support for   'com'?

Generally yes, but two cases come to mind where this doesn't work:
-If the kernel configuration defines CONS_OVERRIDE, the bootblock's
 information is ignored. (shouldn't be the case for an INSTALL kernel)
-If the BIOS does some weird console redirection, it might manipulate
 the IO address table in the BIOS data area, to hide the serial port
 from users. In this case, only a bootblock which has the console's
 "ioaddr" explicitely set (eg by installboot(8)) can take over
 the serial port. (I've recently seen such a case.)

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Adding clock_gettime1() to be shared with emulations ?

2010-04-08 Thread Matthias Drochner

jo...@britannica.bec.de said:
> The SoC project is about avoiding the system call overhead. It is not
> about a minor micro optimisation in the kernel. So please just go on.

...but read the thread starting at
http://lists.freebsd.org/pipermail/freebsd-hackers/2009-March/028066.html
before

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Forcing a serial console for the kernel

2010-04-08 Thread Matthias Drochner

s...@cirr.com said:
> Unfortunately this older version of installboot does not support the
> "ioaddr" option.  If I'm running into the weird problem you state, is
> there   another work around?

If you can compile a bootloader from sources, you can set the address
using a CONSADDR definition. See i386/stand/lib/pcio.c.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: allocating memory during kernel startup

2010-05-07 Thread Matthias Drochner

macal...@netbsd.org said:
> the parts that need uvm are strictly optional - not needed at   all
> for basic kernel output. We only need to know if we can use them   or
> not.

So as Martin said: if called from consinit(), static memory should
be used. At autoconf time and later, *alloc is OK. If we can get away
with that simple scheme, we shouldn't complicate things needlessly.
(which means that it might make sense to carry a flag around if some
helper function can be called in both contexts)

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Using coccinelle for (quick?) syntax fixing

2010-08-10 Thread Matthias Drochner

jeanyves.mig...@free.fr said:
> But the NULL deref fixes will go in eventually, and I will probably
> ask for a pull up too ;)

But then...

algo = esp_algorithm_lookup(sav->alg_enc);
-   if (!algo) {
+   if (algo == NULL) {
ipseclog((LOG_ERR,
-   "esp_cbc_mature %s: unsupported algorithm.\n", algo->name));
+   "esp_cbc_mature: NULL is not a valid algorithm.\n"));
return 1;

The new error message if not helpful. How about printing alg_enc
instead which is in a well-defined namespace.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: EHCI of SoC

2010-09-11 Thread Matthias Drochner

kiyoh...@kk.iij4u.or.jp said:
> +   if (sc->sc_flags & EHCIF_HAVE_TT)
> [...]
> +#define EHCI_PS_PSPD_HS0x0800  /*  High speed */

The way this is put into the "ehci" namespage suggests that
there is only a single blessed way to have a Transaction
Translator as an integral part of an EHCI. In the spec I know,
these bits are "reserved".
Are these extensions somehow on a standards track? If not,
I suggest to use a naming which makes clear that this is
just a vendor extension. Or better, add only hooks to
ehci.c and put the code into a new attachment frontend.

The reset change looks OK, but it needs testing. This can
be done independently. (A comment would be useful though.)

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: radix tree implementation for quota ?

2010-11-29 Thread Matthias Drochner

da...@l8s.co.uk said:
> Integer divide (effectively) need a compare/subtract loop

Getting off-topic, but  one can do a division by a table lookup for
an approximation of 1/divisor and about two iteration steps. Seen
that in some DSP where there was even a hardware asm instruction
for the initial lookup.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Softfloat userland needing to properly deliver SIGFPE traps

2011-01-14 Thread Matthias Drochner

mar...@duskware.de said:
> sparc64 uses softfloat for 128 bit long double

If you have some basic FPU available, you could just cause
matching SIGFPEs using eg doubles. Eg assign
HUGE_VAL*HUGE_VAL to a double, or divide a double by zero.
The sun libm code does this in some cases.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: turning off COMPAT_386BSD_MBRPART in disklabel

2011-01-31 Thread Matthias Drochner

dholland-t...@netbsd.org said:
> PR 44496 notes that COMPAT_386BSD_MBRPART is still enabled in
> disklabel(8), even though it was turned off by default in the kernel
> early in 4.99.x. The PR also notes that it's not harmless to leave it
> on.

The PR rather leads to the conclusion that the support for
old Partition IDs in disklabel(8) is suboptimal.
Originally, the code did only consider a partition with the
old ID if no new one was found. This apparently got broken
when extended partition support was added years later.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: [patch] PCI memory & i/o enables

2011-04-08 Thread Matthias Drochner

dyo...@pobox.com said:
> If the flag isn't set, the driver has no business setting it.  Also,
> if the flag isn't set, there's not much use in the driver setting the
> corresponding bit in the PCI CSR.

I don't think this goes into the right direction. The driver shouldn't
have a business setting flags in the attach args, except in rare,
mostly historical cases like indirect configuration. And the driver
shouldn't enable address decoding in the PCI CSR because it has
no way to check whether the BARs are set to reasonable values.
Such things belong into the framework, the mapreg_map() or so functions.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de


Re: [patch] PCI memory & i/o enables

2011-04-08 Thread Matthias Drochner

dyo...@pobox.com said:
> The patch stops drivers from setting flags in the attach args, which I
> think that you will agree is a step in the right direction.

It seems you already know the suspects... If you think they
ignore the unset enable bits for a good reason you
can eg. introduce an IKNOWWHATIMDOING flag to mapreg_map.
Still better than making such a mess.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de


uvm locking inconsistency

2011-06-15 Thread Matthias Drochner

A fresh kernel panics for me with a KASSERT about a lock
not held - see attachment.
uvm_pgalloc() was called from amap_cow_now() -- the anon is
freshly allocated, so the reason for the panic is obvious.
(and it seems better to relax the check than to acquire the
lock for no good reason)
Am I the only one using DIAGNOSTIC kernels?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de


Re: uvm locking inconsistency

2011-06-15 Thread Matthias Drochner

m.droch...@fz-juelich.de said:
> see attachment

here is it





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de
diff -r 54f44408f17e sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.cWed Jun 15 19:07:45 2011 +0200
+++ b/sys/uvm/uvm_page.cWed Jun 15 19:55:45 2011 +0200
@@ -1192,7 +1192,7 @@
KASSERT(anon == NULL || (flags & UVM_FLAG_COLORMATCH) || off == 0);
KASSERT(off == trunc_page(off));
KASSERT(obj == NULL || mutex_owned(obj->vmobjlock));
-   KASSERT(anon == NULL || mutex_owned(anon->an_lock));
+   /*KASSERT(anon == NULL || mutex_owned(anon->an_lock));*/
 
mutex_spin_enter(&uvm_fpageqlock);
 


Re: diagnostic assertion "anon->an_lock == amap->am_lock"

2011-06-16 Thread Matthias Drochner

dieter.net...@pandora.be said:
> "anon->an_lock == amap->am_lock" in sys/uvm/uvm_fault.c line 1228

just got this too, on i386

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de


Re: diagnostic assertion "anon->an_lock == amap->am_lock"

2011-06-16 Thread Matthias Drochner

rm...@netbsd.org said:
> Can you please get a backtrace?

#10 0xc05b2209 in kern_assert (t=0xc0623102 "diagnostic ",
f=0xc06874d8 "../../../../uvm/uvm_fault.c", l=1228,
e=0xc06870ac "anon->an_lock == amap->am_lock")
at ../../../../../../lib/libkern/kern_assert.c:50
#11 0xc052b5c6 in uvm_fault_internal (orig_map=0xe6dc2930, vaddr=134635520,
access_type=2, fault_flag=0) at ../../../../uvm/uvm_fault.c:1228
#12 0xc04a0736 in trap (frame=0xe6b7ed48) at ../../../../arch/i386/i386/trap.c:
678
#13 0xc010d08f in calltrap ()

(gdb) print flt
$2 = {access_type = 2, enter_prot = 3, startva = 134635520, npages = 1,
  centeridx = 0, anon_spare = 0x0, wire_mapping = false, narrow = true,
  wire_paging = false, cow_now = true, promote = false}
(gdb) print *anons[flt->centeridx]
$4 = {an_lock = 0xe712a580, an_u = {au_ref = 1, au_link = 0x1}, an_page =
0xc0d078c0,
  an_swslot = 0}
(gdb) print ufi
$5 = {orig_map = 0xe6dc2930, orig_rvaddr = 134635520, orig_size = 4096,
  map = 0xe6dc2930, mapv = 18, entry = 0xe6bb1598, size = 4096}
(gdb) print *ufi->entry
$7 = {rb_node = {rb_nodes = {0xe6a3b10c, 0xe6a3bb38}, rb_info = 3856464112},
gap = 0,
  maxgap = 3010461696, prev = 0xe6a3b10c, next = 0xe6a3bb38, start = 134635520,
  end = 134639616, object = {uvm_obj = 0x0, sub_map = 0x0}, offset = 0, etype
= 4,
  protection = 3, max_protection = 7, inheritance = 1, wired_count = 0, aref =
{
ar_pageoff = 0, ar_amap = 0xe6a84ec0}, advice = 0, flags = 0 '\0'}
(gdb) print *ufi->entry->aref.ar_amap
$9 = {am_lock = 0xe71a5800, am_ref = 1, am_flags = 0, am_maxslot = 1, am_nslot
= 1,
  am_nused = 1, am_slots = 0xe6b78ef0, am_bckptr = 0xe6a68d40, am_anon =
0xe6a68670,
  am_ppref = 0x0, am_list = {le_next = 0xe5c5c554, le_prev = 0xe576fd7c}}

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de


Re: diagnostic assertion "anon->an_lock == amap->am_lock"

2011-06-16 Thread Matthias Drochner

[backtrace]

and in case it helps:

(gdb) print *anons[flt->centeridx]->an_lock
$1 = {u = {mtxa_owner = 0}}
(gdb) print  *ufi->entry->aref.ar_amap->am_lock
$2 = {u = {mtxa_owner = 3856404512}}

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de


Re: pchb@acpi

2011-07-29 Thread Matthias Drochner

mar...@duskware.de said:
> This sounds like strictly structured one-time used data. Using
> property lists here seems like an unecessary waste (data and code
> size) to me.

Agreed. Property lists should be used where data exchange with
userland is of primary concern, or where data are so variadic
that the proplist overhead appears as the lesser evil.

Besides that, the common pci code should not be bloated with
code for dynamic address space management. We've got attachments
which is a powerful tool to keep driver code modular without #ifdefs.
Since ACPI uses pci buses as entities in its namespace, "pci@acpi"
would be the natural implementation.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: pchb@acpi

2011-07-29 Thread Matthias Drochner

dyo...@pobox.com said:
> typedef enum pci_alloc_regtype {
>   PCI_ALLOC_REGTYPE_NONE = 0
> , PCI_ALLOC_REGTYPE_BAR = 1

I'm not sure this is general enough. I've worked with some industrial
x86 systems arecently which had two ISA buses -- one internal
(physically an LPC bus) and one with real ISA slots. Each one behind
a PCI-ISA bridge. Seems that a generic framework should have an
idea about subtractive decoding.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Adding linux_link(2) system call, second round

2011-08-01 Thread Matthias Drochner

m...@netbsd.org said:
> Both behaviors are standard compliant, since SUSv2 says nothing about
> resolving symlinks or not.

While the "DESCRIPTION" chapter doesn't tell it explicitely,
we have the following in "ERRORS":

[ELOOP]
 A loop exists in symbolic links encountered during resolution of the path1
 or path2 argument.

This implies that the intention is that symlinks are followed.

el...@imrryr.org said:
> Or perhaps llink(2) for symmetry with lchmod(2) and lstat(2).

This looks reasonable.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: pchb@acpi

2011-08-01 Thread Matthias Drochner

bou...@antioche.eu.org said:
> device_properties() uses property lists, so I think poplists is right
> for your usage too. It looks like it's a property of a bus node and I
> can't see why it should be different from a device node. It should
> probably be in the device property of the bus node's device_t.

I can't follow this logics. Since almost everything in a device's
softc is a property of the device, we could stop using C structures
completely then...

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: pchb@acpi

2011-08-01 Thread Matthias Drochner

bou...@antioche.eu.org said:
> up to now, device_properties() has been used to pass informations
> which doesn't comes directly from the parent (as opposed to the attach
> structure)

If we allow to attach pci at acpi, the information would come
directly from the parent. It is not only address space usage
but also interrupt routing and power management.

> It looks like this fits device_properties(), much more than and extention
> of the pci attach args.

It would not be "the" pci attach args. That's the power of multiple
frontends that we can have special attach args, the softc extended
as needed and the extra code in its own source file which gets
only compiled if the kernel is configured that way.
With properties, you would have all that nasty parsing code in the
common sources. And no compile time type checks.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: pchb@acpi

2011-08-01 Thread Matthias Drochner

bou...@antioche.eu.org said:
> To me it's not clear if it's the way to go (and I guess we'd need a
> pci@pcibios as well ...

I think the pcibios gives so little value that it doesn't deserve
an extra attachment. ACPI is another league - it is essential
for interrupt routing and power management. Without it, you don't
get correct interrupt routing on MP systems (unless you resort
to MPIs...), and no system-wide power management on x86.

> It has been argued before that attachement
> at apci should go away

I think it is OK to attach the PCI buses which are defined by ACPI
at acpi. The attachment frontend can install hooks to get interrupt
routing right. This would also help wakeup support for eg USB
and ethernet devices.

> and use apci to drive the isa autoconf instead ...

My opinion on this is that we should get chips which are part
of the platform (timer/RTC/PICs/npx) out of the "isa" section,
so that one can use a modern PC without any isa bus configured.
ACPI's help might or might be useful for that -- at least it would
not be needed for a real ISA bus.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Patch: rework kernel random number subsystem (*nearly final*)

2011-11-08 Thread Matthias Drochner

t...@panix.com said:
> There's a new patch at http://www.panix.com/~tls/rnd4.diff

I've been running a system with this for a couple of hours now and it appears
stable. (With "rnd3.diff" I got locking related panics indeed.)
Just some mostly formal comments:
-shouldn't the remaining uses of arc4random() be converted to cprng_strong/fast
 as appropriate (what I noticed was in "opencrypto") and arc4random removed
 from public namespace?
-not a big issue, but it seems wrong to me that the arc4random implementation
 in lib/libkern calls back into the kernel's rngtest(). I'd suggest to move
 rngtest() to libkern as well -- it doesn't have any connection to kernel
 specific services.
-while the NIST thing is approved and so, arc4random is still strong enough
 for most uses, as I understand it. The mapping cprng_fast/strong to
 arc4random/nist_ctr could be controlled by some kernel defines, with the
 option to map both to arc4random. At least I wouldn't remove all the
 infrastructure which makes rijndael an optional kernel component, in case
 someone wants to do this later.
-would it be feasible to use the opencrypto framework for AES stuff, to
 get crypto hardware support? From a brief look at the code, my impression
 is that key scheduling code may be called at random number extraction
 time. With opencrypto, as it looks now, this would mean memory allocations
 etc. which would be too expensive. Did you look at this?
-the aes256 header seems to be unused.
-not directly related: What is the "Mersenne Twister" code in libkern
 good for?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: Kernel RNG rework; when opencrypto really doesn't win

2011-11-09 Thread Matthias Drochner

t...@panix.com said:
> > The mapping cprng_fast/strong to
> > arc4random/nist_ctr could be controlled by some kernel defines, with the
> > option to map both to arc4random
> I don't particularly want to jam another layer of runtime indirection
> in the middle.

I wasn't thinking of runtime indirection. Just a build time option,
let's name it "ARC4RANDOM_IS_OK", and then some #ifdefs where
cprng_strong/fast are defined.
The strong cprng code could then be pulled in with a !arc4random_is_ok
condition in files.*, and the condition for rijndael would
be OR'ed with a similar one.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




Re: heads-up: IPSEC is now FAST_IPSEC

2012-01-16 Thread Matthias Drochner

rm...@netbsd.org said:
>  Are you planning to remove old IPSEC code?

We should provide the KAME code as fallback for at least one
major release. Not that I don't trust the new code, but as
a matter of solid engineering.

> I think post-netbsd-6 branch (or even now?)
> would be a very good time.

Post-6-branch would be OK if no serious problems show up.

While we are here -- there are two places in the KAME code
where it interacts withe the "pf" packet filter:
-For policy lookup, a pf packet tag can be used as condition.
-There is some ifdefd code in sys/dist/pf/net/pf.c
 which has probebly never worked in NetBSD, apparently
 for interfaces with HW crypto support. (It does not get
 compiled because someone forgot to include "opt_ipsec.h".)
Can you tell whether this should be pulled into FAST_IPSEC?
Policy lookup is actually something which could need some
improvement, because it is performance critical even is
IPSEC is not used for the connection in question. OpenBSD
has integrated this with the routing framework, but using
a packet filter as packet classifier would also be
a conceivable option. What are your plans with npf?

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Kennen Sie schon unsere app? http://www.fz-juelich.de/app


malloc(9) alignment (was: Re: CVS commit: src/sys/external/bsd/drm/dist/bsd-core)

2012-01-30 Thread Matthias Drochner

lars.heidie...@googlemail.com said:
> the problem ist malloc(9) does not return page aligned memory as kmem
> does now, for allocations >= PAGE_SIZE and that break drm mmap

I see. drm wants both alignment semantics and a realloc().
Since it is 3rd party stuff, it sucks to add NetBSD specific
modifications and workaround.

Wouldn't make it most sense to either give malloc(9) its old
alignment semantics back, or revert it to the old code?
I'd assume that performance critical code in NetBSD has
switched to kmem_alloc anyway, and the remaining uses are
mostly legacy and 3rd party code. Breaking alignment
assumptions in that code shortly before a release branch
is quite dangerous. And forcing it to convert to kmem_alloc
in a hurry isn't much better.

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2012-01-31 Thread Matthias Drochner

lars.heidie...@googlemail.com said:
> we should fix the inconsistent use then, the problem ist malloc(9)
> does not return page aligned memory as kmem does now, for allocations >
> = PAGE_SIZE and that break drm mmap

So I've tried to get DRM working again, both with your original
patch (modifying the drm code to use kmem_alloc), and with
a modification to kern_malloc to return page aligned memory
for allocations >=NBPG. Both ways could work.
I'm running into another problem now: KVM shortage or fragmentation.
The agp code tries a bus_dmamem_map() which calls
uvm_km_alloc(..., UVM_KMF_VAONLY)
The size is about 40MB. This request fails, and the X server
doesn't start.

Any ideas how to reduce KVA usage?

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2012-01-31 Thread Matthias Drochner

t...@panix.com said:
> This is on i386, or amd64?

i386, with i945 graphics.

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2012-01-31 Thread Matthias Drochner

l...@heidieker.de said:
> you can change the amount of memory allocated to the kmem_arena in
> uvm_km.c currently it's 2/3 of kva-space, probably it needs to be a
> bit lower on kva limited machines.

Thanks - I've just changed the "2/3" to "2/4", and now
my X server works again with DRI. This certainly needs
some good heuristics to get the right balance.
As said elsewhere, I'd prefer to give malloc(9) its old
alignment semantics back. There might be more code out there
which relies on it. Here is my patch. This can be somewhat
wasteful for allocation sizes which are just a little bit
larger than a multiple of the page size. For exact
multiples, it should be not different from the existing
code because a page is wasted for bookkeeping anyway.

best regards
Matthias


---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app
# HG changeset patch
# Parent b72467925a50848b94d77e1963b1a08b4801ae44

diff -r b72467925a50 sys/kern/kern_malloc.c
--- a/sys/kern/kern_malloc.cTue Jan 31 13:28:26 2012 +0100
+++ b/sys/kern/kern_malloc.cTue Jan 31 18:34:17 2012 +0100
@@ -108,10 +108,13 @@
 #endif /* MALLOCLOG */
 {
const int kmflags = (flags & M_NOWAIT) ? KM_NOSLEEP : KM_SLEEP;
-   const size_t allocsize = sizeof(struct malloc_header) + size;
+   size_t allocsize = sizeof(struct malloc_header) + size;
struct malloc_header *mh;
void *p;
 
+   if (size >= NBPG)
+   allocsize = size + NBPG;
+
p = kmem_intr_alloc(allocsize, kmflags);
if (p == NULL)
return NULL;
@@ -119,6 +122,10 @@
if ((flags & M_ZERO) != 0) {
memset(p, 0, allocsize);
}
+   if (size >= NBPG) {
+   p = (char *)p + NBPG - sizeof(*mh);
+   allocsize = size + sizeof(*mh);
+   }
mh = (void *)p;
mh->mh_size = allocsize;
 
@@ -137,11 +144,20 @@
 #endif /* MALLOCLOG */
 {
struct malloc_header *mh;
+   size_t allocsize;
 
mh = addr;
mh--;
 
-   kmem_intr_free(mh, mh->mh_size);
+   if (mh->mh_size >= NBPG + sizeof(*mh)) {
+   addr = (char *)addr - NBPG;
+   allocsize = mh->mh_size + NBPG - sizeof(*mh);
+   } else {
+   addr = mh;
+   allocsize = mh->mh_size;
+   }
+   
+   kmem_intr_free(addr, allocsize);
 }
 
 /*


SSD "trim" support

2012-02-28 Thread Matthias Drochner

Here is a prototype implementation for TRIM (or DELETE or how you
call it) support for ffs.
It is inspired by the FreeBSD implementation as this is done
asynchronously in ffs_blkfree(), before the blocks are actually
marked free in the filesystem.
Since ffs (at least NetBSD's) frees blocks in reverse order
I thought it was a good idea to collapse adjacent blocks
already at the ffs level where this a-priori knowledge is
present. This is different from FreeBSD; whether this is worth
the effort is subject to research.
This implementation handled only a single block range
per transaction. SSDs can handle at least 64 vectors with
one command. Extending the code should be simple.

I've given this some testing on an Intel and a Kingston
SSD. Anyone interested in reviewing this, or more tests
and optimizations?
(The md(4) backend is for testing only, nothing serious.)

best regards
Matthias


---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app
# HG changeset patch
# Parent 1d86822e09d45741e2a6270e799eaecddf808c10

diff -r 1d86822e09d4 sbin/atactl/atactl.c
--- a/sbin/atactl/atactl.c  Mon Feb 27 16:37:53 2012 +0100
+++ b/sbin/atactl/atactl.c  Tue Feb 28 22:57:23 2012 +0100
@@ -177,6 +177,7 @@
{ WDC_VER_ATA5, "ATA-5" },
{ WDC_VER_ATA6, "ATA-6" },
{ WDC_VER_ATA7, "ATA-7" },
+   { WDC_VER_ATA8, "ATA-8" },
{ 0, NULL },
 };
 
@@ -1041,6 +1042,10 @@
inqbuf->atap_sata_features_supp, ata_sata_feat);
}
 
+   if ((inqbuf->atap_ata_major & WDC_VER_ATA8) &&
+   (inqbuf->support_dsm & ATA_SUPPORT_DSM_TRIM))
+   printf("TRIM supported\n");
+
return;
 }
 
diff -r 1d86822e09d4 sys/dev/ata/atareg.h
--- a/sys/dev/ata/atareg.h  Mon Feb 27 16:37:53 2012 +0100
+++ b/sys/dev/ata/atareg.h  Tue Feb 28 22:57:23 2012 +0100
@@ -90,6 +90,7 @@
 
 /* Commands for Disk Controller. */
 #defineWDCC_NOP0x00/* Always fail with "aborted 
command" */
+#define ATA_DATA_SET_MANAGEMENT0x06
 #defineWDCC_RECAL  0x10/* disk restore code -- resets 
cntlr */
 
 #defineWDCC_READ   0x20/* disk read code */
@@ -387,6 +388,7 @@
 #defineWDC_VER_ATA50x0020
 #defineWDC_VER_ATA60x0040
 #defineWDC_VER_ATA70x0080
+#defineWDC_VER_ATA80x0100
 uint16_t   atap_ata_minor; /* 81: Minor version number */
 uint16_t   atap_cmd_set1;  /* 82: command set supported */
 #defineWDC_CMD1_NOP0x4000  /*  NOP */
@@ -451,7 +453,8 @@
 uint16_t   atap_apm_val;   /* 91: current APM value */
 uint16_t   __reserved5[8]; /* 92-99: reserved */
 uint16_t   atap_max_lba[4];/* 100-103: Max. user LBA addr */
-uint16_t   __reserved6[2]; /* 104-105: reserved */
+uint16_t   __reserved6;/* 104: reserved */
+uint16_t   max_dsm_blocks; /* 105: DSM (ATA-8/ACS-2) */
 uint16_t   atap_secsz; /* 106: physical/logical sector size */
 #define ATA_SECSZ_VALID_MASK 0xc000
 #define ATA_SECSZ_VALID  0x4000
@@ -480,7 +483,10 @@
 #define ATA_CFA_MODE1_DIS 0x1000   /* CFA Mode 1 Disabled */
 #define ATA_CFA_MODE1_REQ 0x2000   /* CFA Mode 1 Required */
 #define ATA_CFA_WORD160   0x8000   /* Word 160 supported */
-uint16_t   __reserved10[15];   /* 161-175: reserved for CFA */
+uint16_t   __reserved10[8];/* 161-168: reserved for CFA */
+uint16_t   support_dsm;/* 169: DSM (ATA-8/ACS-2) */
+#define ATA_SUPPORT_DSM_TRIM   0x0001
+uint16_t   __reserved10a[6];   /* 170-175: reserved for CFA */
 uint8_tatap_media_serial[60];  /* 176-205: media serial number */
 uint16_t   __reserved11[3];/* 206-208: */
 uint16_t   atap_logical_align; /* 209: logical/physical alignment */
diff -r 1d86822e09d4 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Mon Feb 27 16:37:53 2012 +0100
+++ b/sys/dev/ata/wd.c  Tue Feb 28 22:57:23 2012 +0100
@@ -178,6 +178,7 @@
 void  wddone(void *);
 int   wd_get_params(struct wd_softc *, u_int8_t, struct ataparams *);
 int   wd_flushcache(struct wd_softc *, int);
+int   wd_trim(struct wd_softc *, int, struct disk_trim_range *);
 bool  wd_shutdown(device_t, int);
 
 

Re: heads-up: IPSEC is now FAST_IPSEC

2012-03-05 Thread Matthias Drochner

rm...@netbsd.org said:
> Do you have plans to remove old IPSEC since netbsd-6 was branched now?

I'll try to prepare it. I'll be on travel next week, that's why
I won't commit anything before Mar 19.

> We can still
> use mbuf tags as a generic mechanism to communicate between different
> components in the network stack, and thus perform routing based on tags

So will npf be able to attach arbitrary tags to packets?

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: SSD "trim" support

2012-03-05 Thread Matthias Drochner

sim...@netbsd.org said:
> the use of the name "TRIM" in the UFS layer could be a bit more
> generic.  This same VOP could be used for example to handle freeing up
> blocks with a flash device backing a UFS filesystem.  Maybe use
> something like DIOCFREEBLOCKS instead of DIOCTRIM?

Yes, "TRIM" is ATA specific. It was just lazyness because it was
the shortest name, thus less to type.
Other possible names would be "discard" or "delete".
(FreeBSD uses the latter.)

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: SSD "trim" support

2012-03-05 Thread Matthias Drochner

y...@mwd.biglobe.ne.jp said:
> what's the expected behaviour when you read DIOCTRIM'ed blocks?

It depends on the disk. There are 2 bits in indentification data
which tell how it behaves: read zeroes, undefined or undefined-
but-consistent. (The difference between the latter two is whether
one gets the same result if one reads the block twice.)
I didn't bother yet to check what my two disks do.

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: SSD "trim" support

2012-03-05 Thread Matthias Drochner

dholland-t...@netbsd.org said:
> How does that interact with fsck? (both with and without wapbl)

I didn't try wapbl yet, but since the trim stuff happens within
ffs_blkfree() which is only called at the end when a transaction
gets committed (as I understand the code), it should just work -
in theory.
Didn't see any problems with fsck yet. The filesystem did always
check cleanly after unmount.
The amount of free blocks which gets queued for TRIM might need
some consideration and tuning. On a disk I checked one can have
256 vectors with 64k-1 (disk) blocks each within one TRIM
command. This would be about 8Gb (with 512-byte blocks), in the
(unlikely) case that that many contiguous ranges are freed. But
anuway, it is a significant fraction of the disk and might lead
to strange behavior if the disk gets full. So some extra flushes,
timer based or on space shortage, might be a good idea.

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: SSD "trim" support

2012-03-06 Thread Matthias Drochner

macallan1...@gmail.com said:
> do you know if there's an equivalent command for Compact Flash cards?

Yes, I know. "erase sectors", part of the CFA command set. To use
this, more changes to the wd@ata code are needed, eg use of
"write without erase" instead of just "write".

> Those I have report ATA-4 support only though.

According to the CF spec (rev.2), the ATA version fields in
the ID data are irrelevant for CF-ATA mode.

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: SSD "trim" support

2012-03-08 Thread Matthias Drochner

da...@l8s.co.uk said:
> Do any CF cards actually support 'erase'

I've got a couple of CF cards which announce the "CFA"
command extension and thus should support it.
Two cards don't announce it -- a very old 512MB one
and a 1G IBM Microdrive. For the latter it wouldn't
make much sense obviously.

best regards
Matthias



---
---
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
---
---

Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: GSOC 2012 project clarification

2012-04-02 Thread Matthias Drochner

I'm not the originator of that project, but I've recently worked on
support for SSD trim/erase commands which is quite similar technically.
If this project materializes, I do offer my help. For now just two
comments:

On Sun, 1 Apr 2012 13:04:13 -0400
Sanket Padawe  wrote:
> whenever that flag is set and a file/folder
> gets deleted i.e. at the point of unlink system call we just need to
> rewrite all the blocks of that file with some random data and then
> release those blocks.

The deletion is generally not at the time of "unlink". It happens when
the file isn't referenced by anything anymore. It needs to happen
after that point, but before the file system's allocation management
gets notified that the data blocks can be reused.
For performance, this needs to be dove asynchronously. It needs some
knowledge about kernel locking and signaling mechanisms to implement.

> So by
> generating some pseudo random numbers we can erase the previous secure
> data.

I'm not sure that pseudo-random numbers help security in the general
case, compared to just zeros. For a plain harddisk, either one is
good enough. For a SSD, both are useless. A difference would be
if the device was an encrypted disk because all-0 would be a perfect
"known plaintext". It should be configurable.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Kennen Sie schon unsere app? http://www.fz-juelich.de/app


add disk size to "struct disk"?

2012-04-26 Thread Matthias Drochner

I think it would be useful to add the total disk size to the common
"struct disk". It could be used in wedge discovery to reject
partitions which don't fit into the usable disk space.

The reason I'm proposing this is that I just had a case where
such a check would avoid unexpected behavior: I've attached
a GPT-formatted disk (used with XenServer before) to a RAID
controller; since the controller (LSI9260-8i, supported by
the mfi(4) driver) doesn't support transparent mode it was
just added as a single-disk RAID0. This makes that the
controller cuts off some megabytes at the end.
The kernel did still attach dk devices, even for the last,
partially unaccessible, partition.
The gpt(8) tool was even worse - it refused to deal with the
disk completely, with a less helpful "bogus map" error message,
so that one can't even truncate or delete the last partition.
This would be the next thing to fix.

The first step would be to keep the kernel to attach
wedges to impossible partition entries. What do you think?

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: add disk size to "struct disk"?

2012-04-27 Thread Matthias Drochner

On Fri, 27 Apr 2012 01:02:46 +0200
Jean-Yves Migeon  wrote:
> Why push it to struct disk rather than letting backends handle it?

As the code looks now, the functions which scan disklabels
(sys/dev/dkwedge/dkwedge_*.c) get a "struct disk *". To get
the actual size, it would need to open the device and call
an ioctl. As I see it, the only ioctls available for now are
disklabel related, thus limited to 32-bit sector numbers.
So it would need a new ioctl.
Or the disk size would have to be passed down the API
(driver->dkwedge_discover()->dkwedge_discovery_method).
There is also dkwedge_add() which can be called from
userland dkctl(8). For useful checks, it should also get
the total disk size. Atm, it fails to do even simple
overflow and overlap checks, as you can see here:

# dkctl sd0 listwedges
/dev/rsd0d: 3 wedges:
dk5: zzz, 2000 blocks at 500, type: ffs
dk3: xxx, 1000 blocks at 1000, type: ffs
dk4: yyy, 11529215046068469760 blocks at 8070450532247928832, type: ffs

This code certainly needs some design work.

> Having total disk size in struct disk means you have to keep it in
> sync some way or another (ie. callback maybe).
> Resizing disks can be a common operation

This would have to deal with open partitions or attached
wedges on disks being shrunk. So perhaps a callback into
the other direction, from the driver into the dk subsystem,
if a disk is being resized?

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: add disk size to "struct disk"?

2012-04-30 Thread Matthias Drochner

On Sat, 28 Apr 2012 15:55:35 +0200
Jean-Yves Migeon  wrote:
> do you expect the checks to be performed in
> userland, so anyone can be free to have overlaps/overflows, or let
> the kernel do the checks and return errors using the size obtained
> through disk(9)?

The kernel does already do check, see dev/dkwedge/dk.c:dkwedge_add().
There is clearly the intent to catch overlaps, so some design
decision (not necessary final of course) has been done before.
It did just not have the full effect due to implementation bugs.

Is there something like a design document, to see the big plan?

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: SSD "trim" support

2012-10-19 Thread Matthias Drochner

On Wed, 29 Feb 2012 15:02:46 +1100
Simon Burge  wrote:
> I did need to adjust the TRIMDEBUG printfs to use "PRId64" instead of
> "lld" to get it to compile on my amd64.

Thanks, I've done so in the version just committed.

> One comment - the use of the name "TRIM" in the UFS layer could be a
> bit more generic.  This same VOP could be used for example to handle
> freeing up blocks with a flash device backing a UFS filesystem.  Maybe
> use something like DIOCFREEBLOCKS instead of DIOCTRIM?

I've replaced the term 'trim" with "discard" in interfaces and
ufs code. This seems to be a common name for this. "freeblocks"
is a bit misleading IMHO because it is just a hint to the driver,
which is free to ignore it or to do something else, eg overwrite
it to avoid traces.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Kennen Sie schon unsere app? http://www.fz-juelich.de/app


Re: Linux bug in USB timeout on wakeup

2013-08-23 Thread Matthias Drochner

On Fri, 23 Aug 2013 11:50:27 +0200
Thomas Klausner  wrote:

> It seems there was a bug in Linux's code after wakeup where it
> expected devices to be available too soon.
>
> Details at
> https://plus.google.com/116960357493251979546/posts/RZpndv4BCCD
>
> Just posted here so someone knowledgable in the USB stack can check if
> NetBSD has a similar problem or not.

Afaict, NetBSD doesn't use individual port suspends.The power management
framework does just enough to get the machine into ACPU S3, which
means that the host controller is suspended and ports cut off from
power.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Das Forschungszentrum oeffnet seine Tueren am Sonntag, 29. September, von 10:00 
bis 17:00 Uhr: http://www.tagderneugier.de


Re: DIOCGDISCARDINFO and DIOCDISCARD

2013-10-22 Thread Matthias Drochner

On Fri, 11 Oct 2013 10:31:39 -0400
Michael  wrote:
> Something related - how difficult would it be to support something
> TRIM-ish on CompactFlash? Not that I have the faintest clue about ATA
> in general, let alone the CF-specific extensions...

The CF part should be easy to do. To be useful in practice, it would
also be necessary to add calls to it from msdosfs. This code is
a mess. Also, common USB card readers don't support the commands
needed AFAIK.
While we are here... I've found some problems with CF cards
when I plugged them into a PCMCIA slot. First was that it was not
correctly identified by "atactl". The other that the machine crashed
on shutdown if the card's filesystem was not mounted, so that
the slot was powered down.
If you have your CF cards connected in a similar way (i.e. not
translated into an "sd" SCSI device), could you try the appended
patch and see that it does no damage?

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



# HG changeset patch
# Parent 24bbe2c07df0865de34a29b0279a2cbb52bbddc4

diff -r 24bbe2c07df0 distrib/utils/sysinst/disks.c
--- a/distrib/utils/sysinst/disks.c Tue Aug 13 12:24:16 2013 +0200
+++ b/distrib/utils/sysinst/disks.c Tue Aug 13 15:05:05 2013 +0200
@@ -259,7 +259,8 @@
 * Mitsumi ATAPI devices
 */
 
-   if (!((inqbuf->atap_config & WDC_CFG_ATAPI_MASK) == WDC_CFG_ATAPI &&
+   if (!(inqbuf->atap_config != WDC_CFG_CFA_MAGIC &&
+ (inqbuf->atap_config & WDC_CFG_ATAPI) &&
  ((inqbuf->atap_model[0] == 'N' &&
  inqbuf->atap_model[1] == 'E') ||
   (inqbuf->atap_model[0] == 'F' &&
diff -r 24bbe2c07df0 sbin/atactl/atactl.c
--- a/sbin/atactl/atactl.c  Tue Aug 13 12:24:16 2013 +0200
+++ b/sbin/atactl/atactl.c  Tue Aug 13 15:05:05 2013 +0200
@@ -947,7 +947,8 @@
 * Mitsumi ATAPI devices
 */
 
-   if (!((inqbuf->atap_config & WDC_CFG_ATAPI_MASK) == WDC_CFG_ATAPI &&
+   if (!(inqbuf->atap_config != WDC_CFG_CFA_MAGIC &&
+ (inqbuf->atap_config & WDC_CFG_ATAPI) &&
  ((inqbuf->atap_model[0] == 'N' &&
  inqbuf->atap_model[1] == 'E') ||
   (inqbuf->atap_model[0] == 'F' &&
@@ -980,9 +981,13 @@
((uint64_t)inqbuf->atap_wwn[2] << 16) |
((uint64_t)inqbuf->atap_wwn[3] <<  0));
 
-   printf("Device type: %s, %s\n", inqbuf->atap_config & WDC_CFG_ATAPI ?
-  "ATAPI" : "ATA", inqbuf->atap_config & ATA_CFG_FIXED ? "fixed" :
-  "removable");
+   printf("Device type: %s",
+   inqbuf->atap_config == WDC_CFG_CFA_MAGIC ? "CF-ATA" :
+(inqbuf->atap_config & WDC_CFG_ATAPI ? "ATAPI" : "ATA"));
+   if (inqbuf->atap_config != WDC_CFG_CFA_MAGIC)
+   printf(", %s",
+inqbuf->atap_config & ATA_CFG_FIXED ? "fixed" : "removable");
+   printf("\n");
 
compute_capacity(inqbuf, &capacity, §ors, &secsize);
 
diff -r 24bbe2c07df0 sys/dev/ata/atareg.h
--- a/sys/dev/ata/atareg.h  Tue Aug 13 12:24:16 2013 +0200
+++ b/sys/dev/ata/atareg.h  Tue Aug 13 15:05:05 2013 +0200
@@ -284,7 +284,7 @@
 struct ataparams {
 /* drive info */
 uint16_t   atap_config;/* 0: general configuration */
-#define WDC_CFG_ATAPI_MASK 0xc000
+#define WDC_CFG_CFA_MAGIC  0x848a
 #define WDC_CFG_ATAPI  0x8000
 #defineATA_CFG_REMOVABLE   0x0080
 #defineATA_CFG_FIXED   0x0040
diff -r 24bbe2c07df0 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Tue Aug 13 12:24:16 2013 +0200
+++ b/sys/dev/ata/wd.c  Tue Aug 13 15:05:05 2013 +0200
@@ -408,8 +408,14 @@
 {
struct wd_softc *sc = device_private(dv);
 
+   /* the adapter needs to be enabled */
+   if (sc->atabus->ata_addref(sc->drvp))
+   return true; /* no need to complain */
+
wd_flushcache(sc, AT_WAIT);
wd_standby(sc, AT_WAIT);
+
+   sc->atabus->ata_delref(sc->drvp);
return true;
 }
 
diff -r 24bbe2c07df0 sys/dev/usb/umass_isdata.c
--- a/sys/dev/usb/umass_isdata.cTue Aug 13 12:24:16 2013 +0200
+++ b/sys/dev/usb/umass_isdata.cTue Aug 13 15:05:05 2013 +0200
@@ -546,8 +546,8 @@
 * Shuffle string byte order.
 * ATAPI Mi

Re: DIOCGDISCARDINFO and DIOCDISCARD

2013-10-23 Thread Matthias Drochner

On Wed, 23 Oct 2013 03:07:59 -0400
Michael  wrote:
> I use mine with PATA adaptors:
> wd0 at atabus0 drive 0
> wd0: 

It it identified as "ATAPI" by "atactl identify"? If yes, does the
patch help?
If it identifies as CF-ATA, one could add support for the "Erase",
and possibly "Write Sectors without Erase" to the wd driver (or
possibly an autoconf attachment, to avoid bloat).
There is also some "true IDE" mode mentioned in the spec, which seems
to mean that drive looks exactly like a conventional disk. It is
switched on by pin strapping, so it depends on the adapter.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Closing a serial device takes one second

2014-02-06 Thread Matthias Drochner

On Thu, 6 Feb 2014 18:51:38 +0100
Marc Balmer  wrote:
> I see the 1 sec delay also when the device is set to local mode.

Also with softcar? From my /etc/ttys:
tty00   "/usr/libexec/getty std.9600"   unknown off secure local softcar

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Closing a serial device takes one second

2014-02-06 Thread Matthias Drochner

On Thu, 6 Feb 2014 19:50:04 +0100
Marc Balmer  wrote:
> If I find the spot, I will probably remove it.

It is line 784 in dev/ic/com.c. It depends on the HUPCL
flag unset which is done around line 1344, depending
on SOFTCAR.
The comment in com_shutdown() makes some sense, but
it could be done more elegantly, eg set a timer and
do the delay on next open if it is done immediately.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Closing a serial device takes one second

2014-02-06 Thread Matthias Drochner

On Thu, 6 Feb 2014 20:24:52 +0100
Marc Balmer  wrote:
> If, at all, the application using the driver should sleep for one
> second after closing the device before reopening it.

Not that I care too much about modems these days, but rather than
taking the risk to break it for someone who needs it, why don't
you just clear the HUPCL flag as part of terminal setup in
your application? AFAIK this is POSIX, so it should be portable.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Does "options P1003_1B_SEMAPHORE" still exist?

2014-05-06 Thread Matthias Drochner

On Tue, 6 May 2014 10:51:43 -0400
Matthew Mondor  wrote:
> I have the impression that those syscalls should all be documented in
> a section 2 manual page instead (kern/37427).

As has been mentioned before, the (kernel) semaphore implementation
in -current doesn't work well. In pkgsrc Python, use of semaphores
was disabled because threaded Python scripts didn't work. I also found
that disabling semaphore use in gcc/libgomp fixes crashes of programs
using OMP (eg darktable).
It worked with userland semaphores until NetBSD-6, so I'd wait for
a resolution before burning bridges.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Does "options P1003_1B_SEMAPHORE" still exist?

2014-05-06 Thread Matthias Drochner

On Tue, 6 May 2014 19:43:24 +0200
Joerg Sonnenberger  wrote:
> > As has been mentioned before, the (kernel) semaphore implementation
> > in -current doesn't work well.
>
> I haven't seen any such mentioning. PR?

I didn't find a PR, but there was at least some discussion when I
added the pkgsrc Python fix, starting here:
http://mail-index.netbsd.org/current-users/2012/08/15/msg020907.html

While I don't think that it causes these problems, an obvious
deficiency is that our kernel semaphores get inherited to child
processes, while Posix says that they should be closed on exec.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Does "options P1003_1B_SEMAPHORE" still exist?

2014-05-06 Thread Matthias Drochner

On Tue, 6 May 2014 21:05:00 +0200
Thomas Klausner  wrote:
> I didn't know about this. Does this look similar to
>
> http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=25475
>
> ?

Hmm - this is NetBSD-6, but the stacktrace shows that the crash happens
in the ksem code path which is used for named/shared semaphores only.
So it seems that gomp is using these... it might be worth a try to
make libgomp use its own implementation.
The appended patch is for -current of about 3 months ago, with
gcc-4.5.4. The only change to original code is that to
libgomp/configure, the rest is generated, but the generation process
is somewhat complex (using the "mknative script"). And I've generated
it only for i386 -- for a quick try it should work to apply the
"config.h" change manually.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



# HG changeset patch
# Parent 70685c5d8471ebf56889df2fd7153f4ce133f522

diff -r 70685c5d8471 external/gpl3/gcc/dist/libgomp/configure
--- a/external/gpl3/gcc/dist/libgomp/configure  Fri Dec 07 19:38:42 2012 +0100
+++ b/external/gpl3/gcc/dist/libgomp/configure  Sat Dec 08 15:47:57 2012 +0100
@@ -15043,7 +15043,7 @@
 # Check for broken semaphore implementation on darwin.
 # sem_init returns: sem_init error: Function not implemented.
 case "$host" in
-  *-darwin*)
+  *-darwin* | *-netbsd*)
 
 $as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h
 
diff -r 70685c5d8471 external/gpl3/gcc/lib/libgomp/arch/i386/config.h
--- a/external/gpl3/gcc/lib/libgomp/arch/i386/config.h  Fri Dec 07 19:38:42 
2012 +0100
+++ b/external/gpl3/gcc/lib/libgomp/arch/i386/config.h  Sat Dec 08 15:47:57 
2012 +0100
@@ -18,7 +18,7 @@
 #define HAVE_ATTRIBUTE_VISIBILITY 1
 
 /* Define if the POSIX Semaphores do not work on your system. */
-/* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
+#define HAVE_BROKEN_POSIX_SEMAPHORES 1
 
 /* Define to 1 if the target assembler supports thread-local storage. */
 /* #undef HAVE_CC_TLS */
diff -r 70685c5d8471 external/gpl3/gcc/lib/libgomp/arch/i386/libgomp_f.h
--- a/external/gpl3/gcc/lib/libgomp/arch/i386/libgomp_f.h   Fri Dec 07 
19:38:42 2012 +0100
+++ b/external/gpl3/gcc/lib/libgomp/arch/i386/libgomp_f.h   Sat Dec 08 
15:47:57 2012 +0100
@@ -1,7 +1,3 @@
-/* This file is automatically generated.  DO NOT EDIT! */
-/* Generated from: NetBSD: mknative-gcc,v 1.62 2011/08/17 18:34:13 matt 
Exp  */
-/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp  
*/
-
 /* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
Contributed by Jakub Jelinek .
 
@@ -34,8 +30,8 @@
 
 #include "libgomp.h"
 
-#if (4 == 4) \
-&& (4 <= 4)
+#if (28 == 8) \
+&& (4 <= 28)
 # define OMP_LOCK_DIRECT
 typedef omp_lock_t *omp_lock_arg_t;
 # define omp_lock_arg(arg) (arg)
@@ -44,8 +40,8 @@
 # define omp_lock_arg(arg) ((arg)->lock)
 # endif
 
-#if (12 == 8) \
-&& (4 <= 12)
+#if (36 == 8) \
+&& (4 <= 36)
 # define OMP_NEST_LOCK_DIRECT
 typedef omp_nest_lock_t *omp_nest_lock_arg_t;
 # define omp_nest_lock_arg(arg) (arg)
@@ -77,11 +73,11 @@
 static inline void
 omp_check_defines (void)
 {
-  char test[(4 != sizeof (omp_lock_t)
+  char test[(28 != sizeof (omp_lock_t)
 || 4 != __alignof (omp_lock_t)
-|| 12 != sizeof (omp_nest_lock_t)
+|| 36 != sizeof (omp_nest_lock_t)
 || 4 != __alignof (omp_nest_lock_t)
-|| 4 != sizeof (*(omp_lock_arg_t) 0)
+|| 8 != sizeof (*(omp_lock_arg_t) 0)
 || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
? -1 : 1] __attribute__ ((__unused__));
   char test2[(28 != sizeof (omp_lock_25_t)


Re: Does "options P1003_1B_SEMAPHORE" still exist?

2014-05-06 Thread Matthias Drochner

On Tue, 6 May 2014 21:27:27 +0200
Joerg Sonnenberger  wrote:
> > While I don't think that it causes these problems, an obvious
> > deficiency is that our kernel semaphores get inherited to child
> > processes, while Posix says that they should be closed on exec.
>
> Where?

In
http://pubs.opengroup.org/onlinepubs/009604499/functions/sem_open.html
right in the first chapter:

The semaphore remains usable by this process until the semaphore is
closed by a successful call to sem_close(), _exit(), or one of the exec
functions.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Does "options P1003_1B_SEMAPHORE" still exist?

2014-05-06 Thread Matthias Drochner

On Tue, 6 May 2014 21:52:53 +0200
Matthias Drochner  wrote:
> In
> http://pubs.opengroup.org/onlinepubs/009604499/functions/sem_open.html
> right in the first chapter:
>
> The semaphore remains usable by this process until the semaphore is
> closed by a successful call to sem_close(), _exit(), or one of the
> exec functions.

And, if one takes it strictly - this would also mean that a semaphore
should not become unusable by any other call, in particular not by one
to close(2).

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Does "options P1003_1B_SEMAPHORE" still exist?

2014-05-06 Thread Matthias Drochner

On Tue, 6 May 2014 20:57:47 +0100
Mindaugas Rasiukevicius  wrote:
> Our sem_open(3) provides slightly different behaviour than
> POSIX requires, but it is more sane i.e. it basically provides a file
> descriptor (and OS X implements it this way too).

And, as you see in the context diff, gcc considers "darwin" a platform
with broken semaphore implementation too. Didn't check yet how libgomp
is using semaphores - just an observation.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Does "options P1003_1B_SEMAPHORE" still exist?

2014-05-06 Thread Matthias Drochner

On Tue, 6 May 2014 23:17:53 +0200
Joerg Sonnenberger  wrote:
> > The semaphore remains usable by this process until the semaphore is
> > closed by a successful call to sem_close(), _exit(), or one of the
> > exec functions.
>
> Well, the attached patch would do that...

I've tried exactly that (+/- lines up/down), and while it didn't cause
problems in the beginning, it violated some refcounting or so assumption
in more generic code causing a diagnostic panic -- unfortunately I can't
remember what it was exactly, just that a fix would need some serious
abstraction violation in generic code, so I dropped it.
So, well, sorry - best thing would be to try and run all kinds of tests,
but iirc the problem was not obvious and showed up much later.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: Problem in msdosfs_moutfs

2014-07-15 Thread Matthias Drochner


While we are here...
(Sorry, I'm too busy with other things, otherwise I'd do it myself.)

I found that msdosfs mount fails for some pre-formatted USB thumb drives
due to a too strict bpb check. See attachment, but it might make sense
to find another limit, or to kill pm_SecPerTrack completely.
Aiui, the <=63 limit makes only sense if the file system is used to
boot from, without int13 extensions. One can safely assume that a PC
with USB ports also implements int13 extensions...

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



# HG changeset patch
# Parent 57c15f727f2caa91ee4cac3bc51096ef5b311b40
diff -r 57c15f727f2c -r 62d8682d656d sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c   Thu Feb 06 18:37:08 2014 +0100
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c   Thu Jun 05 19:50:47 2014 +0200
@@ -556,7 +556,7 @@
if (!(argp->flags & MSDOSFSMNT_GEMDOSFS)) {
/* XXX - We should probably check more values here */
if (!pmp->pm_BytesPerSec || !SecPerClust
-   || pmp->pm_SecPerTrack > 63) {
+   /*|| pmp->pm_SecPerTrack > 63*/) {
DPRINTF(("bytespersec %d secperclust %d "
"secpertrack %d\n", 
pmp->pm_BytesPerSec, SecPerClust,


Re: ixg(4) performances

2014-08-30 Thread Matthias Drochner

On Fri, 29 Aug 2014 15:51:14 +
Emmanuel Dreyfus  wrote:
> I found this, but the result does not make sense: negociated > max ...
>
> Link Capabilities Ragister (0xAC): 0x00027482
> bits 3:0   Supprted Link speed:  0010 = 5 GbE and 2.5 GbE speed
> supported bits 9:4   Max link width: 001000 = x4

Wrong -- this means x8.

> bits 14:12 L0s exit lattency: 101 = 1 µs - 2 µs
> bits 17:15 L1 Exit lattency: 011 = 4 µs - 8 µs
>
> Link Status Register (0xB2): 0x1081
> bits 3:0   Current Link speed:  0001 = 2.5 GbE PCIe link
> bits 9:4   Negociated link width: 001000 = x8

So it makes sense.

best regards
Matthias




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt