All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: amd64 bus error
From: James Courtier-Dutton @ 2006-04-05 20:34 UTC (permalink / raw)
  To: Eric Shattow; +Cc: alsa-devel
In-Reply-To: <2c746f620604051315w53d94a5bo5236778a28397959@mail.gmail.com>

Eric Shattow wrote:
> This may be a hardware error on your computer platform.  Is the bug
> reproducible? If not, you should try replacing the CPU/ram of your
> test machine.
> 
>  Eric
> 
> On 4/5/06, James Courtier-Dutton <James@superbug.co.uk> wrote:
>> Here is a backtrace of a alsa application that ran for about 1 hour
>> before giving this:
>>
>> [New Thread 1098918240 (LWP 23392)]
>>
>> Program received signal SIGBUS, Bus error.
>> [Switching to Thread 1098918240 (LWP 23392)]
>> 0x00002aaaac51bcc8 in ao_alsa_loop (iarg=<value optimized out>)
>>     at start_alsa.c:494
>> 494                     if (poll (pfd, nfds, 200000) < 0) {
>>
>>
>> Have we had any bus error type fixes to alsa-driver between the current
>> ubuntu alsa version and the latest?
>> The poll() call above is with alsa file descriptors.
>>
>> James
>>

I ran one cycle of memtest86+ on it, and it has no errors.
I don't think this is a hardware problem.

James




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply

* [PATCH] git-commit: document --amend
From: Marco Roeland @ 2006-04-05 20:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Marco Roeland, git
In-Reply-To: <7vacaz23wr.fsf@assigned-by-dhcp.cox.net>

The "--amend" option is used to amend the tip of the current branch. This
documentation text was copied straight from the commit that implemented it.

Some minor format tweaks for asciidoc were taken from work by Francis Daly
in commit b0d08a5.. It looks good now also in the html page.

Signed-off-by: Marco Roeland <marco.roeland@xs4all.nl>

---

 Documentation/git-commit.txt |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

293dccf6f8c47294a42376ad96d8c1130b06c9b9
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index d04b342..ec8b562 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -9,7 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
-	   [-e] [--author <author>] [--] [[-i | -o ]<file>...]
+	   [--no-verify] [--amend] [-e] [--author <author>]
+	   [--] [[-i | -o ]<file>...]
 
 DESCRIPTION
 -----------
@@ -70,6 +71,27 @@ OPTIONS
 	`-m`, and from file with `-C` are usually used as the
 	commit log message unmodified.  This option lets you
 	further edit the message taken from these sources.
+
+--amend::
+
+	Used to amend the tip of the current branch. Prepare the tree
+	object you would want to replace the latest commit as usual
+	(this includes the usual -i/-o and explicit paths), and the
+	commit log editor is seeded with the commit message from the
+	tip of the current branch. The commit you create replaces the
+	current tip -- if it was a merge, it will have the parents of
+	the current tip as parents -- so the current top commit is
+	discarded.
++
+It is a rough equivalent for:
++
+$ git reset --soft HEAD^
++
+$ ... do something else to come up with the right tree ...
++
+$ git commit -c ORIG_HEAD
++
+but can be used to amend a merge commit.
 
 -i|--include::
 	Instead of committing only the files specified on the
-- 
1.3.0.rc2.gca38

^ permalink raw reply related

* Re: Q on audit, audit-syscall
From: Robin Holt @ 2006-04-05 20:26 UTC (permalink / raw)
  To: Herbert Rosmanith; +Cc: Kyle Moffett, Robin Holt, linux-kernel
In-Reply-To: <200604052004.k35K4u56010157@wildsau.enemy.org>

On Wed, Apr 05, 2006 at 10:04:55PM +0200, Herbert Rosmanith wrote:
> >  Feel free to use  any one of those.  The only commonly-available
> > mainline mechanism to  _trace_ and _intercept_ syscalls is ptrace.  
> 
> with the limitation of ptrace, -EPERM -- see above.

I guess I am dense, but what is already tracing this process?

Thanks,
Robin

^ permalink raw reply

* Re: Help needed - RAID5 recovery from Power-fail - SOLVED
From: Nigel J. Terry @ 2006-04-05 20:26 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid, david, mhardy
In-Reply-To: <17457.46503.897583.343329@cse.unsw.edu.au>

Thanks for all the help. I am now up and running again and have been
stable for over a day. I will now install my new drive and add it to
give me an array of three drives.

I'll also learn more about Raid, mdadm and smartd so that I am better
prepared next time.

Thanks again

Nigel
Neil Brown wrote:
> On Monday April 3, nigel@nigelterry.net wrote:
>   
>> I wonder if you could help a Raid Newbie with a problem
>>
>> I had a power fail, and now I can't access my RAID array. It has been
>> working fine for months until I lost power... Being a fool, I don't have
>> a full backup, so I really need to get this data back.
>>
>> I run FC4 (64bit).
>> I have an array of two disks /dev/sda1 and /dev/sdb1 as a raid5 array
>> /dev/md0 on top of which I run lvm and mount the whole lot as /home. My
>> intention was always to add another disk to this array, and I purchased
>> one yesterday.
>>     
>
> 2 devices in a raid5??  Doesn't seem a lot of point it being raid5
> rather than raid1.
>
>   
>> When I boot, I get:
>>
>> md0 is not clean
>> Cannot start dirty degraded array
>> failed to run raid set md0
>>     
>
> This tells use that the array is degraded.  A dirty degraded array can
> have undetectable data corruption.  That is why it won't start it for
> you.
> However with only two devices, data corruption from this cause isn't
> actually possible. 
>
> The kernel parameter
>    md_mod.start_dirty_degraded=1
> will bypass this message and start the array anyway.
>
> Alternately:
>   mdadm -A --force /dev/md0 /dev/sd[ab]1
>
>   
>> # mdadm --examine /dev/sda1
>> /dev/sda1:
>>           Magic : a92b4efc
>>         Version : 00.90.02
>>            UUID : c57d50aa:1b3bcabd:ab04d342:6049b3f1
>>   Creation Time : Thu Dec 15 15:29:36 2005
>>      Raid Level : raid5
>>    Raid Devices : 2
>>   Total Devices : 2
>> Preferred Minor : 0
>>
>>     Update Time : Tue Mar 21 06:25:52 2006
>>           State : active
>>  Active Devices : 1
>>     
>
> So at 06:25:52, there was only one working devices, while...
>
>
>   
>> #mdadm --examine /dev/sdb1
>> /dev/sdb1:
>>           Magic : a92b4efc
>>         Version : 00.90.02
>>            UUID : c57d50aa:1b3bcabd:ab04d342:6049b3f1
>>   Creation Time : Thu Dec 15 15:29:36 2005
>>      Raid Level : raid5
>>    Raid Devices : 2
>>   Total Devices : 2
>> Preferred Minor : 0
>>
>>     Update Time : Tue Mar 21 06:23:57 2006
>>           State : active
>>  Active Devices : 2
>>     
>
> at 06:23:57 there were two.
>
> It looks like you lost a drive a while ago. Did you notice?
>
> Anyway, the 'mdadm' command I gave above should get the array working
> again for you.  Then you might want to
>    mdadm /dev/md0 -a /dev/sdb1
> is you trust /dev/sdb
>
> NeilBrown
>
>
>   

^ permalink raw reply

* [Xenomai-core] Mail list problem
From: Rodrigo Rosenfeld Rosas @ 2006-04-05 20:24 UTC (permalink / raw)
  To: Xenomai-core, Xenomai

Hi, I'm having huge delays in sending messages to these lists lately.

Does anybody know what could cause such behaviour?

BTW, about the message I sent yesterday (and that didn't arrive yet) about manual sti/cli doesn't
need to be answered since I've already got the answer in the adeos.pdf document on adeos.org.

Thanks in advance,

Rodrigo.



		
_______________________________________________________ 
Abra sua conta no Yahoo! Mail: 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz. 
http://br.info.mail.yahoo.com/


^ permalink raw reply

* Issues with symbol names
From: Kristis Makris @ 2006-04-05 20:27 UTC (permalink / raw)
  To: linux-kernel

Hello,

I'd like to bring to attention two issues with symbol names.



1) Duplicate symbol names in vmlinux in 2.4

I've come across cases where the kernel object file vmlinux may have
multiple symbols with the same name. For example, in kernel 2.4.2:

# nm /usr/src/linux-2.4.2-kpm/vmlinux |grep -i free_list 
c0130704 t __remove_from_free_list
c01bbc78 t aic7xxx_add_curscb_to_free_list
c015cfdc t blk_init_free_list
c02b4c74 d free_list
c031c8a0 b free_list

There are two "free_list" symbols, both in lowercase (meaning they are
both local to their respective files that declared them). They are
coming from:

fs/buffer.c:96:static struct bh_free_head free_list[NR_SIZES];
fs/file_table.c:21:static LIST_HEAD(free_list);

Running the linker with the argument "--warn-common" could warn about
such symbols. It'd be swell if the kernel was linked with --warn-common, and
duplicate symbols were renamed in the future.


The motivation behind this is one may build tools that consult the kernel object
file to determine while the kernel is live and running the memory addresses
of non-exported symbols. Then the kernel could be dynamically updated if those addresses
are known. If one is building a tool that automates this determination, duplicate
symbols bring this process to a halt and require manual resolution.



2) Unremoved symbol names in /proc/kallsyms for __init functions in 2.6

It appears that in 2.6.10 some symbol names that correspond to functions that
were declared as __init (thus were removed from the kernel) did not
get removed from the kernel's internal symbol table. e.g.

$ cat /proc/kallsyms |sort

We see:

e09141e0 t pipe_readv_v2        [final_benchmark_pipe]
e0914270 t ac6_proc_init        [ipv6]
e09142b0 t if6_proc_init        [ipv6]
e09142e8 t addrconf_init        [ipv6]
e0914360 t ipip6_fb_tunnel_init [ipv6]
e09143d0 t sit_init     [ipv6]
e0914480 t ip6_route_init       [ipv6]
e0914510 t fib6_init    [ipv6]
e0914544 t ipv6_packet_init     [ipv6]
e0914560 t ndisc_init   [ipv6]
e0914608 t udp6_proc_init       [ipv6]
e0914610 t pipe_readv_v2_endlabel       [final_benchmark_pipe]

The declaration for example of ac6_proc_init is:

int __init ac6_proc_init(void)

My goal here is to use /proc/kallsyms to determine the size of a function
image at runtime. For example, the size of pipe_readv_v2 should be
pipe_readv_v2_endlabel - pipe_readv_v2 + 1.

My approach in computing this value right now for symbols that were not
exported is to find the memory address of the symbol and then the
address of the next symbol and subtract one. So for example the size of
kmem_cache_create is 0xc0129f78 - 0xc0129bcc + 1, because /proc/kallsyms
(well /proc/ksyms -- I took this example from a 2.4)

c0129bcc kmem_cache_create_Rd1c0b4e6
c0129f78 kmem_cache_shrink_R12f7cf04

The problem here is that this approach is no longer sound if __init functions
remain listed somewhere in between symbols. So something like the following
would throw the logic off:

c0129bcc kmem_cache_create_Rd1c0b4e6
c0129dea some_module_function_init
c0129f78 kmem_cache_shrink_R12f7cf04

Again, the motivation is to automate the determination of the size of functions
during runtime.


So in summary:

 - Can the kernel from now on start being linked with --warn-common ?
 - Is the code that unloads __init functions lacking the logic to remove
   the symbols of the unloaded functions ? And if so, can this be fixed ?

Please CC me; I'm not on the list.

Thanks,
Kristis



^ permalink raw reply

* Re: How should I handle binary file with GIT
From: Junio C Hamano @ 2006-04-05 20:20 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Randal L. Schwartz, git
In-Reply-To: <Pine.LNX.4.64.0604051521480.2550@localhost.localdomain>

Nicolas Pitre <nico@cam.org> writes:

> On Wed, 5 Apr 2006, Junio C Hamano wrote:
>
>> We've been trying to keep our diff output reversible (e.g. we
>> show what the filemode of the preimage is), so if we take the
>> above route, it probably should record deltas for both going
>> from preimage to postimage _and_ going the other way (unless
>> xdelta can be applied in-reverse, which I do not think is the
>> case).
>
> You cannot reverse a delta.  However if you were able to apply a delta 
> from preimage to postimage that means you must already have had preimage 
> in your object store.  Therefore reverting such a patch would simply 
> involve restoring preimage.

The case I had in mind was where you shipped a tarball of the
tip to somebody (or "a shallow clone"), and after seeing him
having problems with that release, sending him a patch telling
him "reverting this might help, could you please give it a try?"

Of course you could be nicer to him and generate the reverse
diff on your end in such a case instead.

^ permalink raw reply

* Re: [uml-devel] system call accessing the host os
From: Olivier Crameri @ 2006-04-05 20:20 UTC (permalink / raw)
  To: Jeff Dike; +Cc: user-mode-linux-devel
In-Reply-To: <20060405181812.GA5684@ccure.user-mode-linux.org>

Thanks for the answer. I bumped CONFIG_KERNEL_STACK_ORDER to 3, but it
doesn't help.

I have a system call that does nothing but execute my code to parse my
file in the host.
When I said that using malloc didn't work, I meant the following: I'm
using malloc to allocate a buffer in the UML kernel. I'm not passing a
user level buffer to the system call. Then, when I use fread to read
my file into this buffer, if I read a small number of bytes, it works.
However when I try to fread the entire file (38k), fread returns 0.
The same thing using a buffer returned by um_kmalloc works perfectly
(i.e. returns 1 and the buffer is filled with the file data).

Later on, I use sscanf to parse my buffer. No matter what happens,
sscanf returns 0, which is wrong even if there is no error. The exact
same code compiled in the host works perfectly.

Again, thank you for your help, I really appreciate.
Olivier

On 4/5/06, Jeff Dike <jdike@addtoit.com> wrote:
> On Wed, Apr 05, 2006 at 07:16:22PM +0200, Olivier Crameri wrote:
> > Unfortunately, I'm having some weird issues that I can't really
> > understand. I can read the file using fread, but only in a buffer
> > that I allocated using um_kmalloc. If I use a buffer allocated by
> > malloc, the fread fails. Then, even if I replace all  my mallocs by
> > um_kmallocs, some libc functions (such as sscanf) don't seem to work
> > properly. I guess I'm missing something, but I can't figure out what.
>
> Define "fails" and "don't seem to work properly".
>
> If your buffers are larger than 128K, then libc malloc gets turned into
> UML kernel vmalloc.  In this case, the buffer isn't mapped, and
> passing it into a system call will make it return -EFAULT.  The
> easiest workaround for this is to memset the thing immediately after
> allocating it.
>
> Also, if you're using the libc things you're talking about, watch out
> for your stack consumption.  By default, you get two pages (8K).
> printf will completely use it up, so it is unusable in kernel code.
>
> UML kernel stack size is configurable - CONFIG_KERNEL_STACK_ORDER -
> bumping that to 3 will double the kernel stack size.  If problems then
> go away, then you know that libc is overflowing your stack.
>
>                                 Jeff
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply

* Re: amd64 bus error
From: Eric Shattow @ 2006-04-05 20:15 UTC (permalink / raw)
  To: James Courtier-Dutton; +Cc: alsa-devel
In-Reply-To: <4433ABD2.6030704@superbug.co.uk>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1490 bytes --]

This may be a hardware error on your computer platform.  Is the bug
reproducible? If not, you should try replacing the CPU/ram of your
test machine.

 Eric

On 4/5/06, James Courtier-Dutton <James@superbug.co.uk> wrote:
> Here is a backtrace of a alsa application that ran for about 1 hour
> before giving this:
>
> [New Thread 1098918240 (LWP 23392)]
>
> Program received signal SIGBUS, Bus error.
> [Switching to Thread 1098918240 (LWP 23392)]
> 0x00002aaaac51bcc8 in ao_alsa_loop (iarg=<value optimized out>)
>     at start_alsa.c:494
> 494                     if (poll (pfd, nfds, 200000) < 0) {
>
>
> Have we had any bus error type fixes to alsa-driver between the current
> ubuntu alsa version and the latest?
> The poll() call above is with alsa file descriptors.
>
> James
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
N\x18¬HS^µéšŠX¬²š'²ŠÞu¼±<ÂÚ‚º.Öëy©"ž\v\x1c®*mŠx%jx.j\a­…«^Æ×§vÆ©¦XœjبžÈ§¶Œ\x1em©Ýš†â•éžv&€¶×§vØ^–+ÞÁæÜjËZØèŠ{azšâ™ç^½éh¥ê஋©n·š’)àŠ{h¶\x18¬ì\x1c¡Ø§‚׫®+h¯(m¶Ÿÿ±éZ²ë\x1fjY\x1a‚w­þÇ¥rg

^ permalink raw reply

* Re: [Qemu-devel] qemu-0.8.0 and vde-1.5.9 question
From: Bakul Shah @ 2006-04-05 20:15 UTC (permalink / raw)
  To: qemu-devel
In-Reply-To: <Pine.LNX.4.56.0604051521320.29607@pali.cps.cmich.edu>

> The system is Kanotix-2005-4
> Qemu-0.8.0
> Vde-1.5.9
> 
> I setup the bridge and add interface tun0 to the bridge
> (have done it before correctly)
> 
> but
> 
> /usr/bin/vdeqemu -hda disk-image -m256 -localtime -net vde -net nic,macaddr=5
> 4:52:00:12:34:62
> 
> reports error:
> qemu: invalid option -- '-tun-fd'
> qemu exited: vdeqemu quits
> 
> I seem to reacall that it worked with qemu-0.7.2 ?
> 
> Any ideas?

Just type qemu and look at its options.  They changed since
0.7.2.  Likely you want something like

	-net socket,fd=5

Also AFAIK you don't need vde anymore since qemu can do the bridging
for you (but I haven't used it so take this with a grain of salt).

In general you want to look at what changed when you update s/w.

^ permalink raw reply

* Re: PATCH 6/7] tpm: new 1.2 sysfs files - Updated patch
From: Greg KH @ 2006-04-05 20:08 UTC (permalink / raw)
  To: Kylene Jo Hall
  Cc: linux-kernel, akpm, TPM Device Driver List, Marcel Selhorst
In-Reply-To: <1144266504.5235.44.camel@localhost.localdomain>

On Wed, Apr 05, 2006 at 02:48:24PM -0500, Kylene Jo Hall wrote:
> On Mon Apr 03, 2006 at 21:47:25 Greg KH wrote:
> <snip>
> > > +EXPORT_SYMBOL_GPL(tpm_show_state);
> > 
> > That is more than one value per file.  Please make unique files for the
> > different capabilities.  As it stands the file doesn't make too much
> > sense for someone reading it and not understanding that each line is a
> > different portion of the state.
> > 
> > thanks,
> > 
> > greg k-h
> tpm_show_state removed in this patch in favor of separate files.

Thanks for changing this, looks much better now.

greg k-h

^ permalink raw reply

* Re: Q on audit, audit-syscall
From: Herbert Rosmanith @ 2006-04-05 20:04 UTC (permalink / raw)
  To: Kyle Moffett; +Cc: Robin Holt, linux-kernel
In-Reply-To: <296FAFD9-3D3E-421C-A474-1998BCB8F718@mac.com>

> On Apr 5, 2006, at 09:50:17, Herbert Rosmanith wrote:
> >> On Apr 5, 2006, at 08:06:30, Herbert Rosmanith wrote:
> >>> as I said, "ptrace" is not an option.
> >>
> >> Why not, exactly?  (No, we don't know why).
> >
> > according to the man-page:
> >
> > RETURN VALUES
> >      EPERM   The specified process [...] is already being traced.
> >
> > this makes it unusable for me.
> 
> Please stop being unclear and describe _exactly_ what you want to do;  
                                         ^^^^^^^^^

Check my initial email, you'll see that I've been pretty _clear_ and
I've _exactly_ described what I am looking for: for description of
interfaces and software.  I cannot find good (if any) documentation on
this (see below), neither via google, nor by examining the
kernel-sources.

You see, I am asking for documentation. I am not asking "please solve my
problem."

Or is the LKML the wrong place to ask this kind of question?

okay then:

(1) CONFIG_AUDIT and CONFIG_AUDITSYSCALL: how do I use that from
    userspace? is it possible at all (1.1) to use this from userspace or
    (1.2) is this a "kernel-only" infrastructure provided for other
    kernel-modules only (such as e.g. LSM?). is there a description
    of this interface and how and where to use it? I cannot find it.
    clear enough?

(2) in linux/Documentation/devices.txt I've found an "audit device":

        103 block       Audit device
                          0 = /dev/audit        Audit device

    which software implements this device? I see no block-device
    registration in linux/kernel/audit.c nor in linux/kernel/auditsc.c.
    Booting a kernel with CONFIG_AUDIT* enabled does not show this
    device in /proc/devices.

    so, what the deal with this block device? clear enough?


(3) audit-1.1.5/lib is using "socket(PF_NETLINK,SOCK_RAW,NETLINK_AUDIT)"
    is this the way to communicate with the audit-system enabled by
    CONFIG_AUDIT/_AUDITSYSCALL? or is this something different.
    (thanks to auto-tools, compilation of audit-1.1.5 fails, so unfortunately
    I could not watch it running until now. God, I hate automake!)

> otherwise it's impossible to help you.  You want to trace and  
> intercept syscalls, no?

> It implicitly doesn't make any sense to try to trace and intercept syscalls
> from one process in more than one other.

I'm pretty sure I can find a quote from the fortune program saying
that "if something does not make sense for you, that doesnt mean that it wont
make sense for someone else". In fact, it makes sense for me.
  
> >> ptrace is _the_ Linux  mechanism to trace and intercept syscalls.   
> >> There is no other way.
> > "there is no other way": [1,2,3,4]
> >
> > [1] http://www.uniforum.chi.il.us/slides/HardeningLinux/LAuS- 
> > Design.pdf
> > [2] http://www.usenix.org/publications/library/proceedings/als01/ 
> > full_papers/edwards/edwards.pdf
> > [3] http://www.citi.umich.edu/u/provos/papers/systrace.pdf
> > [4] http://www.nsa.gov/selinux/papers/freenix01.pdf
> 
> It looks like you solved your own problem, then!

obviously not, because then I would not be asking question on LKML.
Of course I have read these papers before, but I am not 100% satisfied.

>  Feel free to use  any one of those.  The only commonly-available
> mainline mechanism to  _trace_ and _intercept_ syscalls is ptrace.  

with the limitation of ptrace, -EPERM -- see above.

> If you happen to be  looking for how to implement extra process
> security checks, might I suggest looking at Linux Security Modules?  On
> the other hand, I  think LSMs may never even see some requests if they
> fail access- restrictions before calling into the LSM.  I believe
> there's  documentation on them in the linux/Documentation dir of your
                                        ^^^^^^^^^^^^^^^^^^^

hm, yes, maybe, on the other hand:

/usr/src/linux/Documentation$ grep -i audit *
devices.txt:103 block   Audit device
devices.txt:              0 = /dev/audit        Audit device
/usr/src/linux/Documentation$ find -type d | grep -i audit
/usr/src/linux/Documentation$ 

that's not much. a textual search through linux/Documentation shows hits
in RCU/listRCU.txt mostly, which doesnt seem to deal with auditing. In my
experience, linux/Documentation is not a full documentation.
I wonder if IBM and SuSE/Novell are right when they write in~\ref{1}:

\begin{quote}
The vanilla 2.6 Linux kernel does not provide a mechanism to
trace syscalls in the desired way, nor does it contain the
capability to to track process and generate an audit trail.
\end{quote}

But on the other hand, we see kernel-options like CONFIG_AUDIT,
CONFIG_AUDITSYSCALL, CONFIG_SECURITY etc. etc. So, how can IBM & SuSE
argue this way? The attempt to review their statement is one
reason for my email to LKML.

> copies  of the linux sources.

regards,
h.rosmanith

[1] http://www.uniforum.chi.il.us/slides/HardeningLinux/LAuS-Design.pdf

^ permalink raw reply

* bug-report (kernel-oops)
From: l7or @ 2006-04-05 20:07 UTC (permalink / raw)
  To: linux-kernel

1. After having watched a movie with kaffeine-0.8.1 using xine-lib-1.1.1 I got a kernel-oops when closing kaffeine
2. After the kernel-oops I was able to continue to use the system without problems. I went online with a normal 56K-Modem connected to the pl2303-USB2Serial-Converter. After 		   having been online for a while I got the following message from my internet-connection-program (slylcr): "appear to have received our own echo-reply!" (I don't know whether        
   this has to do with the kernel-oops, but I never got that message before...
   Perhaps the problem is related to my vp7045 (TwinhanDTV-Alpha-DVB-T-Card), I had it connected to the computer but I removed it when it wasn't needed any more. However 
   kaffeine might have been started with the card connected and closed with the card having been removed while kaffeine was running...

4./7.1
Linux Notebook 2.6.16.1 #1 Thu Mar 30 19:54:24 CEST 2006 x86_64 x86_64 x86_64 GNU/Linux

Gnu C                  4.0.2
Gnu make               3.80
binutils               2.16.91.0.2
util-linux             2.12q
mount                  2.12q
module-init-tools      3.2-pre8
e2fsprogs              1.38
jfsutils               1.1.8
reiserfsprogs          3.6.18
reiser4progs           1.0.5
PPP                    2.4.3
nfs-utils              1.0.7
Linux C Library        2.3.5
Dynamic linker (ldd)   2.3.5
Linux C++ Library      6.0.6
Procps                 3.2.5
Net-tools              1.60
Kbd                    1.12
Sh-utils               5.3.0
udev                   068
Modules Loaded         ppp_async crc_ccitt ppp_generic slhc pl2303 ntfs dvb_usb_vp7045 dvb_usb dvb_core dvb_pll isofs udf loop

5.
Apr  5 21:17:09 Notebook kernel: Unable to handle kernel paging request at ffffc20000065060 RIP: 
Apr  5 21:17:09 Notebook kernel: <ffffffff8803ed10>{:dvb_core:dvb_demux_release+15}
Apr  5 21:17:09 Notebook kernel: PGD 1fae067 PUD 1fad067 PMD 1fac067 PTE 0
Apr  5 21:17:09 Notebook kernel: Oops: 0000 [1] 
Apr  5 21:17:09 Notebook kernel: CPU 0 
Apr  5 21:17:09 Notebook kernel: Modules linked in: ntfs dvb_usb_vp7045 dvb_usb dvb_core dvb_pll isofs udf ppp_async crc_ccitt ppp_generic slhc pl2303 loop
Apr  5 21:17:09 Notebook kernel: Pid: 6908, comm: kaffeine Not tainted 2.6.16.1 #1
Apr  5 21:17:09 Notebook kernel: RIP: 0010:[<ffffffff8803ed10>] <ffffffff8803ed10>{:dvb_core:dvb_demux_release+15}
Apr  5 21:17:09 Notebook kernel: RSP: 0018:ffff810005ae9ed8  EFLAGS: 00010282
Apr  5 21:17:09 Notebook kernel: RAX: ffffffff8803ed01 RBX: ffffc20000065000 RCX: 0000000000000000
Apr  5 21:17:09 Notebook kernel: RDX: 0000000000000000 RSI: ffff8100223f04c0 RDI: ffff81000364db00
Apr  5 21:17:09 Notebook kernel: RBP: ffff8100223f04c0 R08: 000000000000000a R09: 0000000000001afc
Apr  5 21:17:09 Notebook kernel: R10: 00007fffffded0b8 R11: 0000000000000206 R12: ffff81000364db00
Apr  5 21:17:09 Notebook kernel: R13: ffff81000364db00 R14: ffff810001fbf280 R15: ffff81003ad160c0
Apr  5 21:17:09 Notebook kernel: FS:  00002b8cc07ec620(0000) GS:ffffffff80420000(0000) knlGS:00000000562e27e0
Apr  5 21:17:09 Notebook kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
Apr  5 21:17:09 Notebook kernel: CR2: ffffc20000065060 CR3: 0000000006040000 CR4: 00000000000006e0
Apr  5 21:17:09 Notebook kernel: Process kaffeine (pid: 6908, threadinfo ffff810005ae8000, task ffff81000c6ba890)
Apr  5 21:17:09 Notebook kernel: Stack: 0000000000000206 0000000000000008 ffff8100223f04c0 ffff81000364db00 
Apr  5 21:17:09 Notebook kernel:        ffff81000364db00 ffffffff80157112 ffff81001e44dc40 ffff8100223f04c0 
Apr  5 21:17:09 Notebook kernel:        0000000000000000 ffff81001e44dc40 
Apr  5 21:17:09 Notebook kernel: Call Trace: <ffffffff80157112>{__fput+168} <ffffffff801550b9>{filp_close+89}
Apr  5 21:17:09 Notebook kernel:        <ffffffff801558a1>{sys_close+112} <ffffffff8010a4ea>{system_call+126}
Apr  5 21:17:09 Notebook kernel: 
Apr  5 21:17:09 Notebook kernel: Code: 4c 8b 6b 60 e8 7c d8 2b f8 49 8d 6d 68 48 89 ef 41 ff 4d 68 
Apr  5 21:17:09 Notebook kernel: RIP <ffffffff8803ed10>{:dvb_core:dvb_demux_release+15} RSP <ffff810005ae9ed8>
Apr  5 21:17:09 Notebook kernel: CR2: ffffc20000065060

6. -
7. SuSE Linux 10.0 with many updated packages
  I did compile kaffeine and xine myself, I didn't take the RPMs

7.2
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 4
model name      : AMD Athlon(tm) 64 Processor 3400+
stepping        : 10
cpu MHz         : 800.000
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips        : 1597.84
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

7.3 see 4.

7.4

/proc/iomem:

00000000-0009fbff : System RAM
0009fc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000cffff : Video ROM
000d0000-000d9fff : Adapter ROM
000f0000-000fffff : System ROM
00100000-3ffcffff : System RAM
 00100000-002ffbaa : Kernel code
 002ffbab-003e73bf : Kernel data
3ffd0000-3ffdefff : ACPI Tables
3ffdf000-3fffffff : ACPI Non-volatile Storage
50000000-51ffffff : PCI CardBus #02
52000000-53ffffff : PCI CardBus #02
54000000-55ffffff : PCI CardBus #06
56000000-57ffffff : PCI CardBus #06
58000000-58000fff : 0000:00:09.0
58001000-58001fff : 0000:00:09.1
e0000000-e7ffffff : 0000:00:00.0
 e0000000-e7ffffff : aperture
ee900000-fe8fffff : PCI Bus #01
 f0000000-f7ffffff : 0000:01:00.0
   f0000000-f7ffffff : radeonfb framebuffer
fea00000-feafffff : PCI Bus #01
 feac0000-feadffff : 0000:01:00.0
 feaf0000-feafffff : 0000:01:00.0
   feaf0000-feafffff : radeonfb mmio
febc0000-febdffff : 0000:00:04.0
febf4000-febf7fff : 0000:00:06.0
febf8000-febf9fff : 0000:00:0b.0
febfa000-febfafff : 0000:00:09.2
febfb800-febfbfff : 0000:00:06.0
febfc000-febfcfff : 0000:00:04.0
 febfc000-febfcfff : sis900
febfd000-febfdfff : 0000:00:03.0
 febfd000-febfdfff : ohci_hcd
febfe000-febfefff : 0000:00:03.1
 febfe000-febfefff : ohci_hcd
febff000-febfffff : 0000:00:03.3
 febff000-febfffff : ehci_hcd
fff80000-ffffffff : reserved


/proc/ioports:

0000-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-006f : keyboard
0070-0077 : rtc
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
0376-0376 : ide1
03c0-03df : vga+
03f6-03f6 : ide0
0800-0803 : PM1a_EVT_BLK
0804-0805 : PM1a_CNT_BLK
0808-080b : PM_TMR
0810-0815 : ACPI CPU throttle
0816-0816 : PM2_CNT_BLK
0820-0823 : GPE0_BLK
0830-0833 : GPE1_BLK
0cf8-0cff : PCI conf1
1000-10ff : PCI CardBus #02
1400-14ff : PCI CardBus #02
1800-18ff : PCI CardBus #06
1c00-1cff : PCI CardBus #06
c000-cfff : PCI Bus #01
 c800-c8ff : 0000:01:00.0
d800-d8ff : 0000:00:04.0
 d800-d8ff : sis900
e000-e07f : 0000:00:02.6
e400-e4ff : 0000:00:02.6
e800-e8ff : 0000:00:02.7
 e800-e8ff : SiS SI7012
ec00-ec7f : 0000:00:02.7
 ec00-ec7f : SiS SI7012
ffa0-ffaf : 0000:00:02.5
 ffa0-ffa7 : ide0
 ffa8-ffaf : ide1


7.5

lspci -vvv
00:00.0 Host bridge: Silicon Integrated Systems [SiS] 755 Host (rev 01)
       Subsystem: Silicon Integrated Systems [SiS] 755 Host
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-
       Latency: 32
       Region 0: Memory at 00000000e0000000 (32-bit, non-prefetchable) [size=128M]
       Capabilities: [a0] AGP version 3.0
               Status: RQ=32 Iso- ArqSz=2 Cal=3 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3+ Rate=x4,x8
               Command: RQ=1 ArqSz=0 Cal=0 SBA+ AGP- GART64- 64bit- FW- Rate=<none>
       Capabilities: [d0] HyperTransport: Slave or Primary Interface
               !!! Possibly incomplete decoding
               Command: BaseUnitID=0 UnitCnt=9 MastHost- DefDir-
               Link Control 0: CFlE- CST- CFE- <LkFail- Init+ EOC+ TXO- <CRCErr=0
               Link Config 0: MLWI=16bit MLWO=16bit LWI=16bit LWO=16bit
               Link Control 1: CFlE- CST- CFE- <LkFail+ Init- EOC+ TXO+ <CRCErr=0
               Link Config 1: MLWI=N/C MLWO=N/C LWI=N/C LWO=N/C
               Revision ID: 1.02
       Capabilities: [f0] HyperTransport: Interrupt Discovery and Configuration

00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SG86C202 (prog-if 00 [Normal decode])
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64
       Bus: primary=00, secondary=01, subordinate=01, sec-latency=64
       I/O behind bridge: 0000c000-0000cfff
       Memory behind bridge: fea00000-feafffff
       Prefetchable memory behind bridge: ee900000-fe8fffff
       Secondary status: 66MHz+ FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- <SERR- <PERR-
       BridgeCtl: Parity- SERR+ NoISA- VGA+ MAbort- >Reset- FastB2B-

00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS963 [MuTIOL Media IO] (rev 25)
       Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 0

00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (prog-if 80 [Master])
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 128
       Region 4: I/O ports at ffa0 [size=16]

00:02.6 Modem: Silicon Integrated Systems [SiS] AC'97 Modem Controller (rev a0) (prog-if 00 [Generic])
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (13000ns min, 2750ns max)
       Interrupt: pin C routed to IRQ 10
       Region 0: I/O ports at e400 [size=256]
       Region 1: I/O ports at e000 [size=128]
       Capabilities: [48] Power Management version 2
               Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=55mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] Sound Controller (rev a0)
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (13000ns min, 2750ns max)
       Interrupt: pin C routed to IRQ 22
       Region 0: I/O ports at e800 [size=256]
       Region 1: I/O ports at ec00 [size=128]
       Capabilities: [48] Power Management version 2
               Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=55mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI])
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (20000ns max)
       Interrupt: pin A routed to IRQ 20
       Region 0: Memory at 00000000febfd000 (32-bit, non-prefetchable) [size=4K]

00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI])
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (20000ns max)
       Interrupt: pin B routed to IRQ 21
       Region 0: Memory at 00000000febfe000 (32-bit, non-prefetchable) [size=4K]

00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller (prog-if 20 [EHCI])
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (20000ns max)
       Interrupt: pin D routed to IRQ 19
       Region 0: Memory at 00000000febff000 (32-bit, non-prefetchable) [size=4K]
       Capabilities: [50] Power Management version 2
               Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (13000ns min, 2750ns max)
       Interrupt: pin A routed to IRQ 18
       Region 0: I/O ports at d800 [size=256]
       Region 1: Memory at 00000000febfc000 (32-bit, non-prefetchable) [size=4K]
       Expansion ROM at 00000000febc0000 [disabled] [size=128K]
       Capabilities: [40] Power Management version 2
               Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:06.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link) (prog-if 10 [OHCI])
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (500ns min, 1000ns max), Cache Line Size 10
       Interrupt: pin A routed to IRQ 5
       Region 0: Memory at 00000000febfb800 (32-bit, non-prefetchable) [size=2K]
       Region 1: Memory at 00000000febf4000 (32-bit, non-prefetchable) [size=16K]
       Capabilities: [44] Power Management version 2
               Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:09.0 CardBus bridge: O2 Micro, Inc. OZ711M1/MC1 4-in-1 MemoryCardBus Controller (rev 20)
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64
       Interrupt: pin A routed to IRQ 16
       Region 0: Memory at 0000000058000000 (32-bit, non-prefetchable) [size=4K]
       Bus: primary=00, secondary=02, subordinate=05, sec-latency=176
       Memory window 0: 50000000-51fff000 (prefetchable)
       Memory window 1: 52000000-53fff000
       I/O window 0: 00001000-000010ff
       I/O window 1: 00001400-000014ff
       BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt+ PostWrite-
       16-bit legacy interface ports at 0001

00:09.1 CardBus bridge: O2 Micro, Inc. OZ711M1/MC1 4-in-1 MemoryCardBus Controller (rev 20)
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64
       Interrupt: pin A routed to IRQ 16
       Region 0: Memory at 0000000058001000 (32-bit, non-prefetchable) [size=4K]
       Bus: primary=00, secondary=06, subordinate=09, sec-latency=176
       Memory window 0: 54000000-55fff000 (prefetchable)
       Memory window 1: 56000000-57fff000
       I/O window 0: 00001800-000018ff
       I/O window 1: 00001c00-00001cff
       BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt+ PostWrite-
       16-bit legacy interface ports at 0001

00:09.2 System peripheral: O2 Micro, Inc. OZ711Mx 4-in-1 MemoryCardBus Accelerator
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Interrupt: pin A routed to IRQ 11
       Region 0: Memory at 00000000febfa000 (32-bit, non-prefetchable) [size=4K]
       Capabilities: [a0] Power Management version 2
               Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0b.0 Network controller: RaLink Ralink RT2500 802.11 Cardbus Reference Card (rev 01)
       Subsystem: Micro-Star International Co., Ltd.: Unknown device 6833
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64, Cache Line Size 10
       Interrupt: pin A routed to IRQ 5
       Region 0: Memory at 00000000febf8000 (32-bit, non-prefetchable) [size=8K]
       Capabilities: [40] Power Management version 2
               Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
       Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Capabilities: [80] HyperTransport: Host or Secondary Interface
               !!! Possibly incomplete decoding
               Command: WarmRst+ DblEnd-
               Link Control: CFlE- CST- CFE- <LkFail- Init+ EOC- TXO- <CRCErr=0
               Link Config: MLWI=16bit MLWO=16bit LWI=16bit LWO=16bit
               Revision ID: 1.02

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
       Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
       Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
       Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

01:00.0 VGA compatible controller: ATI Technologies Inc RV350 [Mobility Radeon 9600 M10] (prog-if 00 [VGA])
       Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 105f
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
       Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 64 (2000ns min), Cache Line Size 10
       Interrupt: pin A routed to IRQ 17
       Region 0: Memory at 00000000f0000000 (32-bit, prefetchable) [size=128M]
       Region 1: I/O ports at c800 [size=256]
       Region 2: Memory at 00000000feaf0000 (32-bit, non-prefetchable) [size=64K]
       Expansion ROM at 00000000feac0000 [disabled] [size=128K]
       Capabilities: [58] AGP version 3.0
               Status: RQ=256 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3+ Rate=x4,x8
               Command: RQ=1 ArqSz=0 Cal=0 SBA+ AGP- GART64- 64bit- FW- Rate=<none>
       Capabilities: [50] Power Management version 2
               Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME-

7.6 I don't have scsi

7.7 I'm using the reiser4-patch from namesys and my root-filesystem is using the reiser4-filesystem


I'm sorry, this is my first bug-report and I'm sure I included too much worthless information. If you've still got questions/found out the reason please email me.

Regards,

Lorenz






^ permalink raw reply

* Re: [patch 03/26] sysfs: zero terminate sysfs write buffers (CVE-2006-1055)
From: Greg KH @ 2006-04-05 20:07 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Al Viro, Jon Smirl, linux-kernel, stable
In-Reply-To: <200604051958.k35JwF0M019652@turing-police.cc.vt.edu>

On Wed, Apr 05, 2006 at 03:58:15PM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Wed, 05 Apr 2006 16:39:57 BST, Al Viro said:
> 
> > How about _NOT_ using sysfs and just having ->read()/->write() on a file in fs
> > of your own?  ~20 lines for all of it, not counting #include...
> 
> Great.  Instead of everybody using the same piece-of-manure sysfs interface,
> each driver carries around its 20 lines to implement read() and write() in
> subtly buggy and incompatible ways.
> 
> % grep nodev /proc/filesystems | wc -l
> 19
> 
> That's fsck'ing insane already.

What is insane is using sysfs in ways it was not designed to do so.  The
color map is clearly not a "single, small value".  I have recommended
that the binary file in sysfs be used instead, as that is a designed
solution, but the authors do not want to do so for some odd reason.

So, we have a number of proposed solutions:
	- custom fs
	- binary sysfs file
	- configfs
and yet, people still complain...

bleah.

greg k-h

^ permalink raw reply

* ethernet not workingfor u-boot  on mpc8280 rattler
From: vikas mak @ 2006-04-05 19:58 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

  
i'm trying to port U-boot on rattler mpc8280 board. u-boot has been ported but its ethernet interface is not running. when i checked mii info command it said error in phy. i tried to reinitialize phy but i'm stuck if anybody could please help 

the u boot output on minicom is as shown
> => mii info 0
> Error reading info from the PHY
> => mii read
> Error reading from the PHY addr=00 reg=00
> => ping 10.114.15.21
> Using FCC1 ETHERNET device
> ping failed; host 10.114.15.21 is not alive

please help
thanx and regards
Vikas Makhija

[-- Attachment #2: Type: text/html, Size: 974 bytes --]

^ permalink raw reply

* Re: [Qemu-devel] SPARC iommu mapping
From: Joerg Platte @ 2006-04-05 20:03 UTC (permalink / raw)
  To: qemu-devel
In-Reply-To: <BAY104-F2926FE4988EEFCC93C59DFFFCB0@phx.gbl>

Am Mittwoch, 5. April 2006 19:36 schrieb Blue Swirl:
Hi!

> The DMA controllers for both ESP and Lance are within the same page. This
> means that in Qemu, DMA controller register accesses for either of them go
> to just one of these. It just happens to work, but maybe this causes the
> problem. You could try to confirm this by enabling also DEBUG_LANCE and see
> if there is troublesome activity in the Lance direction near the bad
> accesses.

Lance is only used during system startup. Then there is no more debugging 
output. Looks like ethernet is not causing any problems. 

Can you reproduce my problems, or is it caused by the kernel? But the same 
kernel works without problems on a SS4...

regards,
Jörg

^ permalink raw reply

* Re: : IA64 ISOs based on Fedora Core 5
From: Axel Thimm @ 2006-04-05 19:59 UTC (permalink / raw)
  To: linux-ia64
In-Reply-To: <20060405163521.GS30438@neu.nirvana>

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

On Wed, Apr 05, 2006 at 08:30:13PM +0100, David Woodhouse wrote:
> On Wed, 2006-04-05 at 18:35 +0200, Axel Thimm wrote:
> > > Aside from the updates, the next task is building Extras and Livna 
> > > for IA64, of course...
> > 
> > and who's going to do ATrpms? ;)
> 
> ATrpms hasn't even caught up with the platform support we had in the
> final release of FC4 yet -- I don't think there's any need to worry
> about building for IA64 for now.

While the above was more of a joke, I do have access to an Altix, but
unfortunately no ppc. Some scientific apps at ATrpms might soon see
ia64 rpm archs.
-- 
Axel.Thimm at ATrpms.net

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply

* Re: [patch 03/26] sysfs: zero terminate sysfs write buffers (CVE-2006-1055)
From: Valdis.Kletnieks @ 2006-04-05 19:58 UTC (permalink / raw)
  To: Al Viro; +Cc: Jon Smirl, gregkh, linux-kernel, stable
In-Reply-To: <20060405153957.GI27946@ftp.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

On Wed, 05 Apr 2006 16:39:57 BST, Al Viro said:

> How about _NOT_ using sysfs and just having ->read()/->write() on a file in fs
> of your own?  ~20 lines for all of it, not counting #include...

Great.  Instead of everybody using the same piece-of-manure sysfs interface,
each driver carries around its 20 lines to implement read() and write() in
subtly buggy and incompatible ways.

% grep nodev /proc/filesystems | wc -l
19

That's fsck'ing insane already.

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply

* Re: [PATCH] git-commit: document --append (amend really!)
From: Junio C Hamano @ 2006-04-05 19:55 UTC (permalink / raw)
  To: Marco Roeland; +Cc: git
In-Reply-To: <20060405194607.GB20854@fiberbit.xs4all.nl>

Marco Roeland <marco.roeland@xs4all.nl> writes:

> Here with asciidoc 7.1.2 (Debian 'sid') it looks good in the generated
> man page. But I'll investigate if nobody beats me to it.

Please see below for an example.

> Oops. Well I suppose I could use "git commit --amend" and then run "git
> format-patch" again I suppose. ;-)

Yup ;-).

diff-tree b0d08a504bee17dfc46f761e166ff2c20c59a91a (from 3103cf9e1e09b0045a60542f24a2a1e4ed7b1237)
Author: Francis Daly <francis@daoine.org>
Date:   Wed Mar 22 09:53:57 2006 +0000

    Format tweaks for asciidoc.
    
    Some documentation "options" were followed by independent preformatted
    paragraphs. Now they are associated plain text paragraphs. The
    difference is clear in the generated html.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>

diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index fbd2394..d55456a 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -24,13 +24,13 @@ OPTIONS
 
 <option>...::
 	Either an option to pass to `grep` or `git-ls-files`.
-
-	The following are the specific `git-ls-files` options
-	that may be given: `-o`, `--cached`, `--deleted`, `--others`,
-	`--killed`, `--ignored`, `--modified`, `--exclude=*`,
-	`--exclude-from=*`, and `--exclude-per-directory=*`.
-
-	All other options will be passed to `grep`.
++
+The following are the specific `git-ls-files` options
+that may be given: `-o`, `--cached`, `--deleted`, `--others`,
+`--killed`, `--ignored`, `--modified`, `--exclude=\*`,
+`--exclude-from=\*`, and `--exclude-per-directory=\*`.
++
+All other options will be passed to `grep`.
 
 <pattern>::
 	The pattern to look for.  The first non option is taken

^ permalink raw reply related

* Re: [PATCH 7/7] tpm: Driver for next generation TPM chips
From: Kylene Jo Hall @ 2006-04-05 19:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, TPM Device Driver List, Marcel Selhorst, Leendert Van Doorn

This patch contains the driver for the next generation of TPM chips
version 1.2 including support for interrupts.  The Trusted Computing
Group has written the TPM Interface Specification (TIS) which defines a
common interface for all manufacturer's 1.2 TPM's thus the name
tpm_tis.

This updated version of the patch uses the new sysfs files that came
about from the comments and changes in patch 6/7.  It replaces the 7/7
patch from the original set.

Signed-off-by: Leendert van Doorn <leendert@watson.ibm.com>
Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---
 drivers/char/tpm/tpm_tis.c |  636 +++++++++++++++++++++++++++++++++++
 drivers/char/tpm/Kconfig   |   11
 drivers/char/tpm/Makefile  |    1
 drivers/char/tpm/tpm.c     |    3
 drivers/char/tpm/tpm.h     |    9
 5 files changed, 659 insertions(+), 1 deletion(-)

--- linux-2.6.16/drivers/char/tpm/tpm.h	2006-03-30 17:08:49.315065750 -0600
+++ linux-2.6.16-rc1-tpm/drivers/char/tpm/tpm.h	2006-03-29 14:16:30.119053500 -0600
@@ -57,6 +57,8 @@ struct tpm_vendor_specific {
 	void __iomem *iobase;		/* ioremapped address */
 	unsigned long base;		/* TPM base address */
 
+	int irq;
+
 	int region_size;
 	int have_region;
 
@@ -66,8 +68,13 @@ struct tpm_vendor_specific {
 	u8 (*status) (struct tpm_chip *);
 	struct miscdevice miscdev;
 	struct attribute_group *attr_group;
+	struct list_head list;
+	int locality;
 	u32 timeout_a, timeout_b, timeout_c, timeout_d;
 	u32 duration[3];
+
+	wait_queue_head_t read_queue;
+	wait_queue_head_t int_queue;
 };
 
 struct tpm_chip {
@@ -93,6 +100,8 @@ struct tpm_chip {
 	struct list_head list;
 };
 
+#define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
+
 static inline int tpm_read_index(int base, int index)
 {
 	outb(index, base);
--- linux-2.6.16/drivers/char/tpm/tpm.c	2006-03-30 17:08:49.315065750 -0600
+++ linux-2.6.16-rc1-tpm/drivers/char/tpm/tpm.c	2006-03-30 16:51:48.567273000 -0600
@@ -391,6 +391,9 @@ static ssize_t tpm_transmit(struct tpm_c
 		goto out;
 	}
 
+	if (chip->vendor.irq)
+		goto out_recv;
+
 	stop = jiffies + tpm_calc_ordinal_duration(chip, ordinal);
 	do {
 		u8 status = chip->vendor.status(chip);
--- linux-2.6.16/drivers/char/tpm/Makefile	2006-03-19 23:53:29.000000000 -0600
+++ linux-2.6.16-rc1-tpm/drivers/char/tpm/Makefile	2006-03-02 16:20:06.002087500 -0600
@@ -5,6 +5,7 @@ obj-$(CONFIG_TCG_TPM) += tpm.o
 ifdef CONFIG_ACPI
 	obj-$(CONFIG_TCG_TPM) += tpm_bios.o
 endif
+obj-$(CONFIG_TCG_TIS) += tpm_tis.o
 obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
--- linux-2.6.16/drivers/char/tpm/Kconfig	2006-03-19 23:53:29.000000000 -0600
+++ linux-2.6.16-rc1-tpm/drivers/char/tpm/Kconfig	2006-03-02 16:19:05.730320750 -0600
@@ -20,9 +20,18 @@ config TCG_TPM
 	  Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
 	  and CONFIG_PNPACPI.
 
+config TCG_TIS
+	tristate "TPM Interface Specification 1.2 Interface"
+	depends on TCG_TPM
+	---help---
+	  If you have a TPM security chip that is compliant with the
+	  TCG TIS 1.2 TPM specification say Yes and it will be accessible
+	  from within Linux.  To compile this driver as a module, choose
+	  M here; the module will be called tpm_tis.
+
 config TCG_NSC
 	tristate "National Semiconductor TPM Interface"
-	depends on TCG_TPM
+	depends on TCG_TPM && PNPACPI
 	---help---
 	  If you have a TPM security chip from National Semicondutor 
 	  say Yes and it will be accessible from within Linux.  To 
--- linux-2.6.16/drivers/char/tpm/tpm_tis.c	1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.16-44/drivers/char/tpm/tpm_tis.c	2006-04-04 14:12:29.701783000 -0500
@@ -0,0 +1,636 @@
+/*
+ * Copyright (C) 2005, 2006 IBM Corporation
+ *
+ * Authors:
+ * Leendert van Doorn <leendert@watson.ibm.com>
+ * Kylene Hall <kjhall@us.ibm.com>
+ *
+ * Device driver for TCG/TCPA TPM (trusted platform module).
+ * Specifications at www.trustedcomputinggroup.org	 
+ *
+ * This device driver implements the TPM interface as defined in
+ * the TCG TPM Interface Spec version 1.2, revision 1.0.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ */
+#include <linux/pnp.h>
+#include <linux/interrupt.h>
+#include <linux/wait.h>
+#include "tpm.h"
+
+#define TPM_HEADER_SIZE 10
+
+enum tis_access {
+	TPM_ACCESS_VALID = 0x80,
+	TPM_ACCESS_ACTIVE_LOCALITY = 0x20,
+	TPM_ACCESS_REQUEST_PENDING = 0x04,
+	TPM_ACCESS_REQUEST_USE = 0x02,
+};
+
+enum tis_status {
+	TPM_STS_VALID = 0x80,
+	TPM_STS_COMMAND_READY = 0x40,
+	TPM_STS_GO = 0x20,
+	TPM_STS_DATA_AVAIL = 0x10,
+	TPM_STS_DATA_EXPECT = 0x08,
+};
+
+enum tis_int_flags {
+	TPM_GLOBAL_INT_ENABLE = 0x80000000,
+	TPM_INTF_BURST_COUNT_STATIC = 0x100,
+	TPM_INTF_CMD_READY_INT = 0x080,
+	TPM_INTF_INT_EDGE_FALLING = 0x040,
+	TPM_INTF_INT_EDGE_RISING = 0x020,
+	TPM_INTF_INT_LEVEL_LOW = 0x010,
+	TPM_INTF_INT_LEVEL_HIGH = 0x008,
+	TPM_INTF_LOCALITY_CHANGE_INT = 0x004,
+	TPM_INTF_STS_VALID_INT = 0x002,
+	TPM_INTF_DATA_AVAIL_INT = 0x001,
+};
+
+#define	TPM_ACCESS(l)			(0x0000 | ((l) << 12))
+#define	TPM_INT_ENABLE(l)		(0x0008 | ((l) << 12))
+#define	TPM_INT_VECTOR(l)		(0x000C | ((l) << 12))
+#define	TPM_INT_STATUS(l)		(0x0010 | ((l) << 12))
+#define	TPM_INTF_CAPS(l)		(0x0014 | ((l) << 12))
+#define	TPM_STS(l)			(0x0018 | ((l) << 12))
+#define	TPM_DATA_FIFO(l)		(0x0024 | ((l) << 12))
+
+#define	TPM_DID_VID(l)			(0x0F00 | ((l) << 12))
+#define	TPM_RID(l)			(0x0F04 | ((l) << 12))
+
+static LIST_HEAD(tis_chips);
+static DEFINE_SPINLOCK(tis_lock);
+
+static int check_locality(struct tpm_chip *chip, int l)
+{
+	if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
+	     (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
+	    (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))
+		return chip->vendor.locality = l;
+
+	return -1;
+}
+
+static void release_locality(struct tpm_chip *chip, int l)
+{
+	if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
+	     (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
+	    (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))
+		iowrite8(TPM_ACCESS_ACTIVE_LOCALITY,
+			 chip->vendor.iobase + TPM_ACCESS(l));
+}
+
+static int request_locality(struct tpm_chip *chip, int l)
+{
+	unsigned long stop;
+
+	if (check_locality(chip, l) >= 0)
+		return l;
+
+	iowrite8(TPM_ACCESS_REQUEST_USE,
+		 chip->vendor.iobase + TPM_ACCESS(l));
+
+	if (chip->vendor.irq) {
+		interruptible_sleep_on_timeout(&chip->vendor.int_queue,
+					       HZ *
+					       chip->vendor.timeout_a /
+					       1000);
+		if (check_locality(chip, l) >= 0)
+			return l;
+
+	} else {
+		/* wait for burstcount */
+		stop = jiffies + (HZ * chip->vendor.timeout_a / 1000);
+		do {
+			if (check_locality(chip, l) >= 0)
+				return l;
+			msleep(TPM_TIMEOUT);
+		}
+		while (time_before(jiffies, stop));
+	}
+	release_locality(chip, l);
+	return -1;
+}
+
+static u8 tpm_tis_status(struct tpm_chip *chip)
+{
+	return ioread8(chip->vendor.iobase +
+		       TPM_STS(chip->vendor.locality));
+}
+
+static void tpm_tis_ready(struct tpm_chip *chip)
+{
+	/* this causes the current command to be aborted */
+	iowrite8(TPM_STS_COMMAND_READY,
+		 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
+}
+
+static int get_burstcount(struct tpm_chip *chip)
+{
+	unsigned long stop;
+	int burstcnt;
+
+	/* wait for burstcount */
+	/* which timeout value, spec has 2 answers (c & d) */
+	stop = jiffies + (HZ * chip->vendor.timeout_d / 1000);
+	do {
+		burstcnt = ioread8(chip->vendor.iobase +
+				   TPM_STS(chip->vendor.locality) + 1);
+		burstcnt += ioread8(chip->vendor.iobase +
+				    TPM_STS(chip->vendor.locality) +
+				    2) << 8;
+		if (burstcnt)
+			return burstcnt;
+		msleep(TPM_TIMEOUT);
+	} while (time_before(jiffies, stop));
+	return -EBUSY;
+}
+
+static int wait_for_stat(struct tpm_chip *chip, u8 mask, u32 timeout,
+			 wait_queue_head_t * queue)
+{
+	unsigned long stop;
+	u8 status;
+
+	/* check current status */
+	status = tpm_tis_status(chip);
+	if ((status & mask) == mask)
+		return 0;
+
+	if (chip->vendor.irq) {
+		interruptible_sleep_on_timeout(queue, HZ * timeout / 1000);
+		status = tpm_tis_status(chip);
+		if ((status & mask) == mask)
+			return 0;
+	} else {
+		stop = jiffies + (HZ * timeout / 1000);
+		do {
+			msleep(TPM_TIMEOUT);
+			status = tpm_tis_status(chip);
+			if ((status & mask) == mask)
+				return 0;
+		} while (time_before(jiffies, stop));
+	}
+	return -ETIME;
+}
+
+static int recv_data(struct tpm_chip *chip, u8 * buf, size_t count)
+{
+	int size = 0, burstcnt;
+	while (size < count &&
+	       wait_for_stat(chip,
+			     TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+			     chip->vendor.timeout_c,
+			     &chip->vendor.read_queue)
+	       == 0) {
+		burstcnt = get_burstcount(chip);
+		for (; burstcnt > 0 && size < count; burstcnt--)
+			buf[size++] = ioread8(chip->vendor.iobase +
+					      TPM_DATA_FIFO(chip->vendor.
+							    locality));
+	}
+	return size;
+}
+
+static int tpm_tis_recv(struct tpm_chip *chip, u8 * buf, size_t count)
+{
+	int size = 0;
+	int expected, status;
+
+	if (count < TPM_HEADER_SIZE) {
+		size = -EIO;
+		goto out;
+	}
+
+	/* read first 10 bytes, including tag, paramsize, and result */
+	if ((size =
+	     recv_data(chip, buf, TPM_HEADER_SIZE)) < TPM_HEADER_SIZE) {
+		dev_err(chip->dev, "Unable to read header\n");
+		goto out;
+	}
+
+	expected = be32_to_cpu(*(__be32 *) (buf + 2));
+	if (expected > count) {
+		size = -EIO;
+		goto out;
+	}
+
+	if ((size +=
+	     recv_data(chip, &buf[TPM_HEADER_SIZE],
+		       expected - TPM_HEADER_SIZE)) < expected) {
+		dev_err(chip->dev, "Unable to read remainder of result\n");
+		size = -ETIME;
+		goto out;
+	}
+
+	wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
+		      &chip->vendor.int_queue);
+	status = tpm_tis_status(chip);
+	if (status & TPM_STS_DATA_AVAIL) {	/* retry? */
+		dev_err(chip->dev, "Error left over data\n");
+		size = -EIO;
+		goto out;
+	}
+
+out:
+	tpm_tis_ready(chip);
+	release_locality(chip, chip->vendor.locality);
+	return size;
+}
+
+/* 
+ * If interrupts are used (signaled by an irq set in the vendor structure)
+ * tpm.c can skip polling for the data to be available as the interrupt is
+ * waited for here 
+ */
+static int tpm_tis_send(struct tpm_chip *chip, u8 * buf, size_t len)
+{
+	int rc, status, burstcnt;
+	size_t count = 0;
+	u32 ordinal;
+
+	if (request_locality(chip, 0) < 0)
+		return -EBUSY;
+
+	status = tpm_tis_status(chip);
+	if ((status & TPM_STS_COMMAND_READY) == 0) {
+		tpm_tis_ready(chip);
+		if (wait_for_stat
+		    (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b,
+		     &chip->vendor.int_queue) < 0) {
+			rc = -ETIME;
+			goto out_err;
+		}
+	}
+
+	while (count < len - 1) {
+		burstcnt = get_burstcount(chip);
+		for (; burstcnt > 0 && count < len - 1; burstcnt--) {
+			iowrite8(buf[count], chip->vendor.iobase +
+				 TPM_DATA_FIFO(chip->vendor.locality));
+			count++;
+		}
+
+		wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
+			      &chip->vendor.int_queue);
+		status = tpm_tis_status(chip);
+		if ((status & TPM_STS_DATA_EXPECT) == 0) {
+			rc = -EIO;
+			goto out_err;
+		}
+	}
+
+	/* write last byte */
+	iowrite8(buf[count],
+		 chip->vendor.iobase +
+		 TPM_DATA_FIFO(chip->vendor.locality));
+	wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
+		      &chip->vendor.int_queue);
+	status = tpm_tis_status(chip);
+	if ((status & TPM_STS_DATA_EXPECT) != 0) {
+		rc = -EIO;
+		goto out_err;
+	}
+
+	/* go and do it */
+	iowrite8(TPM_STS_GO,
+		 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
+
+	if (chip->vendor.irq) {
+		ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
+		if (wait_for_stat
+		    (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+		     tpm_calc_ordinal_duration(chip, ordinal),
+		     &chip->vendor.read_queue) < 0) {
+			rc = -ETIME;
+			goto out_err;
+		}
+	}
+	return len;
+out_err:
+	tpm_tis_ready(chip);
+	release_locality(chip, chip->vendor.locality);
+	return rc;
+}
+
+static struct file_operations tis_ops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.open = tpm_open,
+	.read = tpm_read,
+	.write = tpm_write,
+	.release = tpm_release,
+};
+
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute *tis_attrs[] = {
+	&dev_attr_pubek.attr, 
+	&dev_attr_pcrs.attr,
+	&dev_attr_enabled.attr, 
+	&dev_attr_active.attr, 
+	&dev_attr_owned.attr, 
+	&dev_attr_temp_deactivated.attr, 
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr, NULL,
+};
+
+static struct attribute_group tis_attr_grp = {
+	.attrs = tis_attrs
+};
+
+static struct tpm_vendor_specific tpm_tis = {
+	.status = tpm_tis_status,
+	.recv = tpm_tis_recv,
+	.send = tpm_tis_send,
+	.cancel = tpm_tis_ready,
+	.req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+	.req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+	.req_canceled = TPM_STS_COMMAND_READY,
+	.attr_group = &tis_attr_grp,
+	.miscdev = {
+		    .fops = &tis_ops,},
+};
+
+static irqreturn_t tis_int_probe(int irq, void *dev_id, struct pt_regs
+				 *regs)
+{
+	struct tpm_chip *chip = (struct tpm_chip *) dev_id;
+	u32 interrupt;
+
+	interrupt = ioread32(chip->vendor.iobase +
+			     TPM_INT_STATUS(chip->vendor.locality));
+
+	if (interrupt == 0)
+		return IRQ_NONE;
+
+	chip->vendor.irq = irq;
+
+	/* Clear interrupts handled with TPM_EOI */
+	iowrite32(interrupt,
+		  chip->vendor.iobase +
+		  TPM_INT_STATUS(chip->vendor.locality));
+	return IRQ_HANDLED;
+}
+
+static irqreturn_t tis_int_handler(int irq, void *dev_id, struct pt_regs
+				   *regs)
+{
+	struct tpm_chip *chip = (struct tpm_chip *) dev_id;
+	u32 interrupt;
+	int i;
+
+	interrupt = ioread32(chip->vendor.iobase +
+			     TPM_INT_STATUS(chip->vendor.locality));
+
+	if (interrupt == 0)
+		return IRQ_NONE;
+
+	if (interrupt & TPM_INTF_DATA_AVAIL_INT)
+		wake_up_interruptible(&chip->vendor.read_queue);
+	if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
+		for (i = 0; i < 5; i++)
+			if (check_locality(chip, i) >= 0)
+				break;
+	if (interrupt &
+	    (TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_STS_VALID_INT |
+	     TPM_INTF_CMD_READY_INT))
+		wake_up_interruptible(&chip->vendor.int_queue);
+
+	/* Clear interrupts handled with TPM_EOI */
+	iowrite32(interrupt,
+		  chip->vendor.iobase +
+		  TPM_INT_STATUS(chip->vendor.locality));
+	return IRQ_HANDLED;
+}
+
+static int __devinit tpm_tis_pnp_init(struct pnp_dev
+				      *pnp_dev, const struct
+				      pnp_device_id
+				      *pnp_id)
+{
+	u32 vendor, intfcaps, intmask;
+	int rc, i;
+	unsigned long start, len;
+	struct tpm_chip *chip;
+
+	start = pnp_mem_start(pnp_dev, 0);
+	len = pnp_mem_len(pnp_dev, 0);
+
+	if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis)))
+		return -ENODEV;
+
+	chip->vendor.iobase = ioremap(start, len);
+	if (!chip->vendor.iobase) {
+		rc = -EIO;
+		goto out_err;
+	}
+
+	vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
+	if ((vendor & 0xFFFF) == 0xFFFF) {
+		rc = -ENODEV;
+		goto out_err;
+	}
+
+	/* Default timeouts */
+	chip->vendor.timeout_a = 750;	/* ms */
+	chip->vendor.timeout_b = 2000;	/* 2 sec */
+	chip->vendor.timeout_c = 750;	/* ms */
+	chip->vendor.timeout_d = 750;	/* ms */
+
+	dev_info(&pnp_dev->dev,
+		 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
+		 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
+
+	/* Figure out the capabilities */
+	intfcaps =
+	    ioread32(chip->vendor.iobase +
+		     TPM_INTF_CAPS(chip->vendor.locality));
+	dev_dbg(&pnp_dev->dev, "TPM interface capabilities (0x%x):\n",
+		intfcaps);
+	if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
+		dev_dbg(&pnp_dev->dev, "\tBurst Count Static\n");
+	if (intfcaps & TPM_INTF_CMD_READY_INT)
+		dev_dbg(&pnp_dev->dev, "\tCommand Ready Int Support\n");
+	if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
+		dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Falling\n");
+	if (intfcaps & TPM_INTF_INT_EDGE_RISING)
+		dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Rising\n");
+	if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
+		dev_dbg(&pnp_dev->dev, "\tInterrupt Level Low\n");
+	if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
+		dev_dbg(&pnp_dev->dev, "\tInterrupt Level High\n");
+	if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
+		dev_dbg(&pnp_dev->dev, "\tLocality Change Int Support\n");
+	if (intfcaps & TPM_INTF_STS_VALID_INT)
+		dev_dbg(&pnp_dev->dev, "\tSts Valid Int Support\n");
+	if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
+		dev_dbg(&pnp_dev->dev, "\tData Avail Int Support\n");
+
+	if (request_locality(chip, 0) != 0) {
+		rc = -ENODEV;
+		goto out_err;
+	}
+
+	/* INTERRUPT Setup */
+	init_waitqueue_head(&chip->vendor.read_queue);
+	init_waitqueue_head(&chip->vendor.int_queue);
+
+	intmask =
+	    ioread32(chip->vendor.iobase +
+		     TPM_INT_ENABLE(chip->vendor.locality));
+
+	intmask |= TPM_INTF_CMD_READY_INT
+	    | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
+	    | TPM_INTF_STS_VALID_INT;
+
+	iowrite32(intmask,
+		  chip->vendor.iobase +
+		  TPM_INT_ENABLE(chip->vendor.locality));
+
+	chip->vendor.irq =
+	    ioread8(chip->vendor.iobase +
+		    TPM_INT_VECTOR(chip->vendor.locality));
+
+	for (i = 3; i < 16 && chip->vendor.irq == 0; i++) {
+		iowrite8(i,
+			 chip->vendor.iobase +
+			 TPM_INT_VECTOR(chip->vendor.locality));
+		if (request_irq
+		    (i, tis_int_probe, SA_SHIRQ,
+		     chip->vendor.miscdev.name, chip) != 0) {
+			dev_info(chip->dev,
+				 "Unable to request irq: %d for probe\n",
+				 i);
+			continue;
+		}
+
+		/* Clear all existing */
+		iowrite32(ioread32
+			  (chip->vendor.iobase +
+			   TPM_INT_STATUS(chip->vendor.locality)),
+			  chip->vendor.iobase +
+			  TPM_INT_STATUS(chip->vendor.locality));
+
+		/* Turn on */
+		iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
+			  chip->vendor.iobase +
+			  TPM_INT_ENABLE(chip->vendor.locality));
+
+		/* Generate Interrupts */
+		tpm_gen_interrupt(chip);
+
+		/* Turn off */
+		iowrite32(intmask,
+			  chip->vendor.iobase +
+			  TPM_INT_ENABLE(chip->vendor.locality));
+		free_irq(i, chip);
+	}
+	if (chip->vendor.irq) {
+		iowrite8(chip->vendor.irq,
+			 chip->vendor.iobase +
+			 TPM_INT_VECTOR(chip->vendor.locality));
+		if (request_irq
+		    (chip->vendor.irq, tis_int_handler, SA_SHIRQ,
+		     chip->vendor.miscdev.name, chip) != 0) {
+			dev_info(chip->dev,
+				 "Unable to request irq: %d for use\n", i);
+			chip->vendor.irq = 0;
+		} else {
+			/* Clear all existing */
+			iowrite32(ioread32
+				  (chip->vendor.iobase +
+				   TPM_INT_STATUS(chip->vendor.locality)),
+				  chip->vendor.iobase +
+				  TPM_INT_STATUS(chip->vendor.locality));
+
+			/* Turn on */
+			iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
+				  chip->vendor.iobase +
+				  TPM_INT_ENABLE(chip->vendor.locality));
+		}
+	}
+
+	INIT_LIST_HEAD(&chip->vendor.list);
+	spin_lock(&tis_lock);
+	list_add(&chip->vendor.list, &tis_chips);
+	spin_unlock(&tis_lock);
+
+	tpm_get_timeouts(chip);
+
+	return 0;
+out_err:
+	if (chip->vendor.iobase)
+		iounmap(chip->vendor.iobase);
+	tpm_remove_hardware(chip->dev);
+	return rc;
+}
+
+static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
+{
+	return tpm_pm_suspend(&dev->dev, msg);
+}
+
+static int tpm_tis_pnp_resume(struct pnp_dev *dev)
+{
+	return tpm_pm_resume(&dev->dev);
+}
+
+static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {
+	{"PNP0C31", 0},		/* TPM */
+	{"", 0}
+};
+
+static struct pnp_driver tis_pnp_driver = {
+	.name = "tpm_tis",
+	.id_table = tpm_pnp_tbl,
+	.probe = tpm_tis_pnp_init,
+	.suspend = tpm_tis_pnp_suspend,
+	.resume = tpm_tis_pnp_resume,
+};
+
+static int __init init_tis(void)
+{
+	return pnp_register_driver(&tis_pnp_driver);
+}
+
+static void __exit cleanup_tis(void)
+{
+	struct tpm_vendor_specific *i, *j;
+	struct tpm_chip *chip;
+	spin_lock(&tis_lock);
+	list_for_each_entry_safe(i, j, &tis_chips, list) {
+		chip = to_tpm_chip(i);
+		iowrite32(~TPM_GLOBAL_INT_ENABLE &
+			  ioread32(chip->vendor.iobase +
+				   TPM_INT_ENABLE(chip->vendor.
+						  locality)),
+			  chip->vendor.iobase +
+			  TPM_INT_ENABLE(chip->vendor.locality));
+		if (chip->vendor.irq)
+			free_irq(chip->vendor.irq, chip);
+		iounmap(i->iobase);
+		list_del(&i->list);
+		tpm_remove_hardware(chip->dev);
+	}
+	spin_unlock(&tis_lock);
+	pnp_unregister_driver(&tis_pnp_driver);
+}
+
+module_init(init_tis);
+module_exit(cleanup_tis);
+MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)");
+MODULE_DESCRIPTION("TPM Driver");
+MODULE_VERSION("2.0");
+MODULE_LICENSE("GPL");



^ permalink raw reply

* Re: PATCH 6/7] tpm: new 1.2 sysfs files - Updated patch
From: Kylene Jo Hall @ 2006-04-05 19:48 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, akpm, TPM Device Driver List, Marcel Selhorst

On Mon Apr 03, 2006 at 21:47:25 Greg KH wrote:
<snip>
> > +EXPORT_SYMBOL_GPL(tpm_show_state);
> 
> That is more than one value per file.  Please make unique files for the
> different capabilities.  As it stands the file doesn't make too much
> sense for someone reading it and not understanding that each line is a
> different portion of the state.
> 
> thanks,
> 
> greg k-h
tpm_show_state removed in this patch in favor of separate files.

From: Kylene Hall <kjhall@us.ibm.com>

Many of the sysfs files were calling the TPM_GetCapability command with
different options and each command layed out in its own static const
array.  Since for 1.2 more sysfs files of this type are coming I am
generalizing the array so there can be one array and the unique parts
can be filled in just before the command is called.

This updated version of the patch breaks the multi-value sysfs file into
separate files pointed out by Greg.  It also addresses the code
redundancy and ugliness in the tpm_show_* functions pointed out on
another patch by Dave Hansen.  It replaces the 6/7 patch from the
original set.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---
 drivers/char/tpm/tpm.c |  219 +++++++++++++++++++++++++++++++++++++++
 drivers/char/tpm/tpm.h |   13 ++
 2 files changed, 232 insertions(+)

--- linux-2.6.16/drivers/char/tpm/tpm.c	2006-04-04 13:33:22.031062750 -0500
+++ linux-2.6.16-44/drivers/char/tpm/tpm.c	2006-04-04 13:29:09.019250500 -0500
@@ -431,17 +431,27 @@ out:
 #define TPM_GET_CAP_RET_UINT32_2_IDX 18
 #define TPM_GET_CAP_RET_UINT32_3_IDX 22
 #define TPM_GET_CAP_RET_UINT32_4_IDX 26
+#define TPM_GET_CAP_PERM_DISABLE_IDX 16
+#define TPM_GET_CAP_PERM_INACTIVE_IDX 18
+#define TPM_GET_CAP_RET_BOOL_1_IDX 14
+#define TPM_GET_CAP_TEMP_INACTIVE_IDX 16
 
 #define TPM_CAP_IDX 13
 #define TPM_CAP_SUBCAP_IDX 21
 
 enum tpm_capabilities {
+	TPM_CAP_FLAG = 4,
 	TPM_CAP_PROP = 5,
 };
 
 enum tpm_sub_capabilities {
 	TPM_CAP_PROP_PCR = 0x1,
 	TPM_CAP_PROP_MANUFACTURER = 0x3,
+	TPM_CAP_FLAG_PERM = 0x8,
+	TPM_CAP_FLAG_VOL = 0x9,
+	TPM_CAP_PROP_OWNER = 0x11,
+	TPM_CAP_PROP_TIS_TIMEOUT = 0x15,
+	TPM_CAP_PROP_TIS_DURATION = 0x20,
 };
 
 /*
@@ -475,6 +485,168 @@ static ssize_t transmit_cmd(struct tpm_c
 	return 0;
 }
 
+void tpm_gen_interrupt(struct tpm_chip *chip)
+{
+	u8 data[30];
+	ssize_t rc;
+
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_PROP;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the timeouts");
+}
+EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
+
+void tpm_get_timeouts(struct tpm_chip *chip)
+{
+	u8 data[30];
+	ssize_t rc;
+	u32 timeout;
+
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_PROP;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the timeouts");
+	if (rc)
+		goto duration;
+
+	if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX)))
+	    != 4 * sizeof(u32))
+		goto duration;
+
+	/* Don't overwrite default if value is 0 */
+	timeout = 
+	    be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX)));
+	if (timeout)
+		chip->vendor.timeout_a = timeout;
+	timeout =
+	    be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_2_IDX)));
+	if (timeout)
+		chip->vendor.timeout_b = timeout;
+	timeout =
+	    be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_3_IDX)));
+	if (timeout)
+		chip->vendor.timeout_c = timeout;
+	timeout =
+	    be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_4_IDX)));
+	if (timeout)
+		chip->vendor.timeout_d = timeout;
+
+duration:
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_PROP;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_DURATION;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the durations");
+	if (rc)
+		return;
+
+	if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX)))
+	    != 3 * sizeof(u32))
+		return;
+
+	chip->vendor.duration[TPM_SHORT] =
+	    be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX)));
+	chip->vendor.duration[TPM_MEDIUM] =
+	    be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_2_IDX)));
+	chip->vendor.duration[TPM_LONG] =
+	    be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_3_IDX)));
+}
+EXPORT_SYMBOL_GPL(tpm_get_timeouts);
+
+ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
+			char *buf)
+{
+	u8 data[35];
+	ssize_t rc;
+
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	if (chip == NULL)
+		return -ENODEV;
+
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_FLAG;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attemtping to determine the permanent state");
+	if (rc)
+		return 0;
+	return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_DISABLE_IDX]);
+}
+EXPORT_SYMBOL_GPL(tpm_show_enabled);
+
+ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
+			char *buf)
+{
+	u8 data[35];
+	ssize_t rc;
+
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	if (chip == NULL)
+		return -ENODEV;
+
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_FLAG;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attemtping to determine the permanent state");
+	if (rc)
+		return 0;
+	return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_INACTIVE_IDX]);
+}
+EXPORT_SYMBOL_GPL(tpm_show_active);
+
+ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
+			char *buf)
+{
+	u8 data[sizeof(tpm_cap)];
+	ssize_t rc;
+
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	if (chip == NULL)
+		return -ENODEV;
+
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_PROP;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_OWNER;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the owner state");
+	if (rc)
+		return 0;
+	return sprintf(buf, "%d\n", data[TPM_GET_CAP_RET_BOOL_1_IDX]);
+}
+EXPORT_SYMBOL_GPL(tpm_show_owned);
+
+ssize_t tpm_show_temp_deactivated(struct device * dev, 
+				struct device_attribute * attr, char *buf)
+{
+	u8 data[sizeof(tpm_cap)];
+	ssize_t rc;
+
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	if (chip == NULL)
+		return -ENODEV;
+
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_FLAG;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_VOL;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the temporary state");
+	if (rc)
+		return 0;
+	return sprintf(buf, "%d\n", data[TPM_GET_CAP_TEMP_INACTIVE_IDX]);
+}
+EXPORT_SYMBOL_GPL(tpm_show_temp_deactivated);
+			
 static const u8 pcrread[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 14,		/* length */
@@ -589,6 +761,7 @@ out:
 EXPORT_SYMBOL_GPL(tpm_show_pubek);
 
 #define CAP_VERSION_1_1 6
+#define CAP_VERSION_1_2 0x1A
 #define CAP_VERSION_IDX 13
 static const u8 cap_version[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
@@ -638,6 +811,52 @@ out:
 }
 EXPORT_SYMBOL_GPL(tpm_show_caps);
 
+ssize_t tpm_show_caps_1_2(struct device * dev,
+			  struct device_attribute * attr, char *buf)
+{
+	u8 data[30];
+	ssize_t len;
+	char *str = buf;
+
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	if (chip == NULL)
+		return -ENODEV;
+
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_PROP;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER;
+
+	if ((len = tpm_transmit(chip, data, sizeof(data))) <=
+	    TPM_ERROR_SIZE) {
+		dev_dbg(chip->dev, "A TPM error (%d) occurred "
+			"attempting to determine the manufacturer\n",
+			be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
+		return 0;
+	}
+
+	str += sprintf(str, "Manufacturer: 0x%x\n",
+		       be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX))));
+
+	memcpy(data, cap_version, sizeof(cap_version));
+	data[CAP_VERSION_IDX] = CAP_VERSION_1_2;
+
+	if ((len = tpm_transmit(chip, data, sizeof(data))) <=
+	    TPM_ERROR_SIZE) {
+		dev_err(chip->dev, "A TPM error (%d) occurred "
+			"attempting to determine the 1.2 version\n",
+			be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
+		goto out;
+	}
+	str += sprintf(str,
+		       "TCG version: %d.%d\nFirmware version: %d.%d\n",
+		       (int) data[16], (int) data[17], (int) data[18],
+		       (int) data[19]);
+
+out:
+	return str - buf;
+}
+EXPORT_SYMBOL_GPL(tpm_show_caps_1_2);
+
 ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
 			const char *buf, size_t count)
 {
--- linux-2.6.16/drivers/char/tpm/tpm.h	2006-04-04 13:33:22.031062750 -0500
+++ linux-2.6.16-44/drivers/char/tpm/tpm.h	2006-04-04 13:09:14.328587000 -0500
@@ -41,8 +41,18 @@ extern ssize_t tpm_show_pcrs(struct devi
 				char *);
 extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr,
 				char *);
+extern ssize_t tpm_show_caps_1_2(struct device *, struct device_attribute *attr,
+				char *);
 extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr,
 				const char *, size_t);
+extern ssize_t tpm_show_enabled(struct device *, struct device_attribute *attr,
+				char *);
+extern ssize_t tpm_show_active(struct device *, struct device_attribute *attr,
+				char *);
+extern ssize_t tpm_show_owned(struct device *, struct device_attribute *attr,
+				char *);
+extern ssize_t tpm_show_temp_deactivated(struct device *,
+					 struct device_attribute *attr, char *);
 
 struct tpm_chip;
 
@@ -62,6 +72,7 @@ struct tpm_vendor_specific {
 	u8 (*status) (struct tpm_chip *);
 	struct miscdevice miscdev;
 	struct attribute_group *attr_group;
+	u32 timeout_a, timeout_b, timeout_c, timeout_d;
 	u32 duration[3];
 };
 
@@ -100,6 +111,8 @@ static inline void tpm_write_index(int b
 	outb(value & 0xFF, base+1);
 }
 
+extern void tpm_get_timeouts(struct tpm_chip *);
+extern void tpm_gen_interrupt(struct tpm_chip *);
 extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
 extern struct tpm_chip* tpm_register_hardware(struct device *,
 				 const struct tpm_vendor_specific *);



^ permalink raw reply

* Re: [PATCH 2/7] tpm: reorganize sysfs files - Updated patch
From: Kylene Jo Hall @ 2006-04-05 19:48 UTC (permalink / raw)
  To: haveblue; +Cc: linux-kernel, akpm, TPM Device Driver List, Marcel Selhorst

On Mon, 2006-04-03 at 16:54  Dave Hansen wrote:
> On Mon, 2006-04-03 at 11:42 -0500, Kylene Jo Hall wrote: 
> >  ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
> >  		      char *buf)
> >  {
> > -	u8 data[READ_PCR_RESULT_SIZE];
> > +	u8 data[30];
>
> Is this correct?  Are you guaranteed that this data read will never,
> ever exceed 30 bytes?  Any reason it shouldn't be a variable?
It is correct.  The function is calling TPM commands that have a fixed
structure of data they return and I know that won't exceed 30 bytes in
this case.  The receive function is also smart enough to not read more
data than the buffer size it is passed.  I removed the #define size
becuase I realized I could check the return to be bigger than the error
return size thus this was the only place the #define was being used.  If
others like I can return the #define for readability.

<snip>
> 
> I know this is old code, but I see this little 
> 
> 	be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
>
> snippet at least twice.  It is also a bit hard to read.  Seems likt it
> would be a great candidate for a little helper function.
> 
> Come to think of it, that entire if() sequence appears to be repeated
> quite a few times.
>
This patch will turn this into a function.

<snip>
> > +	if ((len = tpm_transmit(chip, data, sizeof(data))) <=
> > +	    TPM_ERROR_SIZE) {
> > +		dev_dbg(chip->dev, "A TPM error (%d) occurred "
> > +			"attempting to determine the manufacturer\n",
> > +			be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
> > +		return 0;
> > +	}
> 
> Since you're going through and modifying these, it might be nice to
> change them to the more normal (and readable) style of 
> 
> 
> 	len = tpm_transmit(chip, data, sizeof(data));
> 	if (len < CAP_MANUFACTURER_RESULT_SIZE)
> 		return len;
> 
> Note that that doesn't even increase the number of lines of code.
> 
The patch will fix this style issue for these calls.

> -- Dave

From: Kylene Hall <kjhall@us.ibm.com>

Many of the sysfs files were calling the TPM_GetCapability command with
different options and each command layed out in its own static const
array.  Since for 1.2 more sysfs files of this type are coming I am
generalizing the array so there can be one array and the unique parts
can be filled in just before the command is called.

This updated version of the patch addresses the code redundancy and
ugliness in the tpm_show_* functions pointed out by Dave.  It replaces
the 2/7 patch from the original set.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---
 drivers/char/tpm/tpm.c |  147 +++++++++++++++++++++++----------------
 1 files changed, 87 insertions(+), 60 deletions(-)

--- linux-2.6.16/drivers/char/tpm/tpm.c	2006-04-03 17:15:58.815947500 -0500
+++ linux-2.6.16-43/drivers/char/tpm/tpm.c	2006-04-03 17:14:02.620685750 -0500
@@ -119,17 +119,57 @@ out:
 }
 
 #define TPM_DIGEST_SIZE 20
-#define CAP_PCR_RESULT_SIZE 18
-static const u8 cap_pcr[] = {
+#define TPM_ERROR_SIZE 10
+#define TPM_RET_CODE_IDX 6
+#define TPM_GET_CAP_RET_SIZE_IDX 10
+#define TPM_GET_CAP_RET_UINT32_1_IDX 14
+#define TPM_GET_CAP_RET_UINT32_2_IDX 18
+#define TPM_GET_CAP_RET_UINT32_3_IDX 22
+#define TPM_GET_CAP_RET_UINT32_4_IDX 26
+
+#define TPM_CAP_IDX 13
+#define TPM_CAP_SUBCAP_IDX 21
+
+enum tpm_capabilities {
+	TPM_CAP_PROP = 5,
+};
+
+enum tpm_sub_capabilities {
+	TPM_CAP_PROP_PCR = 0x1,
+	TPM_CAP_PROP_MANUFACTURER = 0x3,
+};
+
+/*
+ * This is a semi generic GetCapability command for use
+ * with the capability type TPM_CAP_PROP or TPM_CAP_FLAG
+ * and their associated sub_capabilities.
+ */
+
+static const u8 tpm_cap[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 22,		/* length */
 	0, 0, 0, 101,		/* TPM_ORD_GetCapability */
-	0, 0, 0, 5,
-	0, 0, 0, 4,
-	0, 0, 1, 1
+	0, 0, 0, 0,		/* TPM_CAP_<TYPE> */
+	0, 0, 0, 4,		/* TPM_CAP_SUB_<TYPE> size */
+	0, 0, 1, 0		/* TPM_CAP_SUB_<TYPE> */
 };
 
-#define READ_PCR_RESULT_SIZE 30
+static ssize_t transmit_cmd(struct tpm_chip *chip, u8 *data, int len,
+			    char *desc)
+{
+	int err;
+
+	len = tpm_transmit(chip, data, len);
+	if (len <  0)
+		return len;
+	if (len == TPM_ERROR_SIZE) {
+		err = be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX)));
+		dev_dbg(chip->dev, "A TPM error (%d) occurred %s\n", err, desc);
+		return err;
+	}
+	return 0;
+}
+
 static const u8 pcrread[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 14,		/* length */
@@ -140,8 +180,8 @@ static const u8 pcrread[] = {
 ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
 		      char *buf)
 {
-	u8 data[READ_PCR_RESULT_SIZE];
-	ssize_t len;
+	u8 data[30];
+	ssize_t rc;
 	int i, j, num_pcrs;
 	__be32 index;
 	char *str = buf;
@@ -150,29 +190,24 @@ ssize_t tpm_show_pcrs(struct device *dev
 	if (chip == NULL)
 		return -ENODEV;
 
-	memcpy(data, cap_pcr, sizeof(cap_pcr));
-	if ((len = tpm_transmit(chip, data, sizeof(data)))
-	    < CAP_PCR_RESULT_SIZE) {
-		dev_dbg(chip->dev, "A TPM error (%d) occurred "
-				"attempting to determine the number of PCRS\n",
-			be32_to_cpu(*((__be32 *) (data + 6))));
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_PROP;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_PCR;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the number of PCRS");
+	if (rc)
 		return 0;
-	}
 
 	num_pcrs = be32_to_cpu(*((__be32 *) (data + 14)));
-
 	for (i = 0; i < num_pcrs; i++) {
 		memcpy(data, pcrread, sizeof(pcrread));
 		index = cpu_to_be32(i);
 		memcpy(data + 10, &index, 4);
-		if ((len = tpm_transmit(chip, data, sizeof(data)))
-		    < READ_PCR_RESULT_SIZE){
-			dev_dbg(chip->dev, "A TPM error (%d) occurred"
-				" attempting to read PCR %d of %d\n",
-				be32_to_cpu(*((__be32 *) (data + 6))),
-				i, num_pcrs);
+		rc = transmit_cmd(chip, data, sizeof(data),
+				"attempting to read a PCR");
+		if (rc)
 			goto out;
-		}
 		str += sprintf(str, "PCR-%02d: ", i);
 		for (j = 0; j < TPM_DIGEST_SIZE; j++)
 			str += sprintf(str, "%02X ", *(data + 10 + j));
@@ -194,7 +229,7 @@ ssize_t tpm_show_pubek(struct device *de
 		       char *buf)
 {
 	u8 *data;
-	ssize_t len;
+	ssize_t err; 
 	int i, rc;
 	char *str = buf;
 
@@ -208,14 +243,10 @@ ssize_t tpm_show_pubek(struct device *de
 
 	memcpy(data, readpubek, sizeof(readpubek));
 
-	if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) <
-	    READ_PUBEK_RESULT_SIZE) {
-		dev_dbg(chip->dev, "A TPM error (%d) occurred "
-				"attempting to read the PUBEK\n",
-			    be32_to_cpu(*((__be32 *) (data + 6))));
-		rc = 0;
+	err = transmit_cmd(chip, data, READ_PUBEK_RESULT_SIZE,
+			"attempting to read the PUBEK");
+	if (err)
 		goto out;
-	}
 
 	/* 
 	   ignore header 10 bytes
@@ -245,63 +276,59 @@ ssize_t tpm_show_pubek(struct device *de
 		if ((i + 1) % 16 == 0)
 			str += sprintf(str, "\n");
 	}
-	rc = str - buf;
 out:
+	rc = str - buf;
 	kfree(data);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(tpm_show_pubek);
 
-#define CAP_VER_RESULT_SIZE 18
+#define CAP_VERSION_1_1 6
+#define CAP_VERSION_IDX 13
 static const u8 cap_version[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 18,		/* length */
 	0, 0, 0, 101,		/* TPM_ORD_GetCapability */
-	0, 0, 0, 6,
+	0, 0, 0, 0,
 	0, 0, 0, 0
 };
 
-#define CAP_MANUFACTURER_RESULT_SIZE 18
-static const u8 cap_manufacturer[] = {
-	0, 193,			/* TPM_TAG_RQU_COMMAND */
-	0, 0, 0, 22,		/* length */
-	0, 0, 0, 101,		/* TPM_ORD_GetCapability */
-	0, 0, 0, 5,
-	0, 0, 0, 4,
-	0, 0, 1, 3
-};
-
 ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr,
 		      char *buf)
 {
-	u8 data[sizeof(cap_manufacturer)];
-	ssize_t len;
+	u8 data[30];
+	ssize_t rc;
 	char *str = buf;
 
 	struct tpm_chip *chip = dev_get_drvdata(dev);
 	if (chip == NULL)
 		return -ENODEV;
 
-	memcpy(data, cap_manufacturer, sizeof(cap_manufacturer));
-
-	if ((len = tpm_transmit(chip, data, sizeof(data))) <
-	    CAP_MANUFACTURER_RESULT_SIZE)
-		return len;
+	memcpy(data, tpm_cap, sizeof(tpm_cap));
+	data[TPM_CAP_IDX] = TPM_CAP_PROP;
+	data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER;
+
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the manufacturer");
+	if (rc)
+		return 0;
 
 	str += sprintf(str, "Manufacturer: 0x%x\n",
-		       be32_to_cpu(*((__be32 *) (data + 14))));
+		       be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX))));
 
 	memcpy(data, cap_version, sizeof(cap_version));
+	data[CAP_VERSION_IDX] = CAP_VERSION_1_1;
+	rc = transmit_cmd(chip, data, sizeof(data),
+			"attempting to determine the 1.1 version");
+	if (rc)
+		goto out;
 
-	if ((len = tpm_transmit(chip, data, sizeof(data))) <
-	    CAP_VER_RESULT_SIZE)
-		return len;
-
-	str +=
-	    sprintf(str, "TCG version: %d.%d\nFirmware version: %d.%d\n",
-		    (int) data[14], (int) data[15], (int) data[16],
-		    (int) data[17]);
+	str += sprintf(str,
+		       "TCG version: %d.%d\nFirmware version: %d.%d\n",
+		       (int) data[14], (int) data[15], (int) data[16],
+		       (int) data[17]);
 
+out:
 	return str - buf;
 }
 EXPORT_SYMBOL_GPL(tpm_show_caps);



^ permalink raw reply

* Re: [PATCH] git-commit: document --append (amend really!)
From: Marco Roeland @ 2006-04-05 19:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Marco Roeland, git
In-Reply-To: <7vfykr24wi.fsf@assigned-by-dhcp.cox.net>

On Wednesday April 5th 2006 Junio C Hamano wrote:

> Thanks for resurrecting this.
> 
> I suspect that some formatting tweak is needed; I recall
> asciidoc needs some special formatting when multi- paragraph
> description is involved in the list.

Here with asciidoc 7.1.2 (Debian 'sid') it looks good in the generated
man page. But I'll investigate if nobody beats me to it. Perhaps we
should develop a "sparse" like module for asciidoc.

> Of course, munging the patch title with s/append/amend/ would
> not hurt ;-).

Oops. Well I suppose I could use "git commit --amend" and then run "git
format-patch" again I suppose. ;-)
-- 
Marco Roeland

^ permalink raw reply

* Restore your Chase Internet Banking account !
From: Chase Online Banking @ 2006-04-05 19:41 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/html, Size: 13974 bytes --]

^ permalink raw reply

* Re: [ANNOUNCE] udev 089 release
From: Marco d'Itri @ 2006-04-05 19:36 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <20060403171123.GA24860@vrfy.org>

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

On Apr 05, Scott James Remnant <scott@ubuntu.com> wrote:

> In the initramfs, we exercise a little more caution; making sure that we
> only probe PCI IDE or SCSI controllers first before we move on to
> probing for USB buses.  The reasoning for this is that we don't want
> someone's fast USB pen drive beating their SATA or SCSI disk to
> getting /dev/sda1
Why would this be a bad?

> This may be unique to Ubuntu where we try to have an initramfs image
> that can do everything, rather than customising it per-install; but then
Debian does too, and it loads everything.

-- 
ciao,
Marco

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.