<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/efi.h, branch v3.13-rc5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.13-rc5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.13-rc5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2013-11-28T20:16:55+00:00</updated>
<entry>
<title>efivars, efi-pstore: Hold off deletion of sysfs entry until the scan is completed</title>
<updated>2013-11-28T20:16:55+00:00</updated>
<author>
<name>Seiji Aguchi</name>
<email>seiji.aguchi@hds.com</email>
</author>
<published>2013-10-30T19:27:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0d59733f6b1796b8d6692642c87d7dd862c3e3a'/>
<id>urn:sha1:e0d59733f6b1796b8d6692642c87d7dd862c3e3a</id>
<content type='text'>
Currently, when mounting pstore file system, a read callback of
efi_pstore driver runs mutiple times as below.

- In the first read callback, scan efivar_sysfs_list from head and pass
  a kmsg buffer of a entry to an upper pstore layer.
- In the second read callback, rescan efivar_sysfs_list from the entry
  and pass another kmsg buffer to it.
- Repeat the scan and pass until the end of efivar_sysfs_list.

In this process, an entry is read across the multiple read function
calls. To avoid race between the read and erasion, the whole process
above is protected by a spinlock, holding in open() and releasing in
close().

At the same time, kmemdup() is called to pass the buffer to pstore
filesystem during it. And then, it causes a following lockdep warning.

To make the dynamic memory allocation runnable without taking spinlock,
holding off a deletion of sysfs entry if it happens while scanning it
via efi_pstore, and deleting it after the scan is completed.

To implement it, this patch introduces two flags, scanning and deleting,
to efivar_entry.

On the code basis, it seems that all the scanning and deleting logic is
not needed because __efivars-&gt;lock are not dropped when reading from the
EFI variable store.

But, the scanning and deleting logic is still needed because an
efi-pstore and a pstore filesystem works as follows.

In case an entry(A) is found, the pointer is saved to psi-&gt;data.  And
efi_pstore_read() passes the entry(A) to a pstore filesystem by
releasing  __efivars-&gt;lock.

And then, the pstore filesystem calls efi_pstore_read() again and the
same entry(A), which is saved to psi-&gt;data, is used for resuming to scan
a sysfs-list.

So, to protect the entry(A), the logic is needed.

[    1.143710] ------------[ cut here ]------------
[    1.144058] WARNING: CPU: 1 PID: 1 at kernel/lockdep.c:2740 lockdep_trace_alloc+0x104/0x110()
[    1.144058] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
[    1.144058] Modules linked in:
[    1.144058] CPU: 1 PID: 1 Comm: systemd Not tainted 3.11.0-rc5 #2
[    1.144058]  0000000000000009 ffff8800797e9ae0 ffffffff816614a5 ffff8800797e9b28
[    1.144058]  ffff8800797e9b18 ffffffff8105510d 0000000000000080 0000000000000046
[    1.144058]  00000000000000d0 00000000000003af ffffffff81ccd0c0 ffff8800797e9b78
[    1.144058] Call Trace:
[    1.144058]  [&lt;ffffffff816614a5&gt;] dump_stack+0x54/0x74
[    1.144058]  [&lt;ffffffff8105510d&gt;] warn_slowpath_common+0x7d/0xa0
[    1.144058]  [&lt;ffffffff8105517c&gt;] warn_slowpath_fmt+0x4c/0x50
[    1.144058]  [&lt;ffffffff8131290f&gt;] ? vsscanf+0x57f/0x7b0
[    1.144058]  [&lt;ffffffff810bbd74&gt;] lockdep_trace_alloc+0x104/0x110
[    1.144058]  [&lt;ffffffff81192da0&gt;] __kmalloc_track_caller+0x50/0x280
[    1.144058]  [&lt;ffffffff815147bb&gt;] ? efi_pstore_read_func.part.1+0x12b/0x170
[    1.144058]  [&lt;ffffffff8115b260&gt;] kmemdup+0x20/0x50
[    1.144058]  [&lt;ffffffff815147bb&gt;] efi_pstore_read_func.part.1+0x12b/0x170
[    1.144058]  [&lt;ffffffff81514800&gt;] ? efi_pstore_read_func.part.1+0x170/0x170
[    1.144058]  [&lt;ffffffff815148b4&gt;] efi_pstore_read_func+0xb4/0xe0
[    1.144058]  [&lt;ffffffff81512b7b&gt;] __efivar_entry_iter+0xfb/0x120
[    1.144058]  [&lt;ffffffff8151428f&gt;] efi_pstore_read+0x3f/0x50
[    1.144058]  [&lt;ffffffff8128d7ba&gt;] pstore_get_records+0x9a/0x150
[    1.158207]  [&lt;ffffffff812af25c&gt;] ? selinux_d_instantiate+0x1c/0x20
[    1.158207]  [&lt;ffffffff8128ce30&gt;] ? parse_options+0x80/0x80
[    1.158207]  [&lt;ffffffff8128ced5&gt;] pstore_fill_super+0xa5/0xc0
[    1.158207]  [&lt;ffffffff811ae7d2&gt;] mount_single+0xa2/0xd0
[    1.158207]  [&lt;ffffffff8128ccf8&gt;] pstore_mount+0x18/0x20
[    1.158207]  [&lt;ffffffff811ae8b9&gt;] mount_fs+0x39/0x1b0
[    1.158207]  [&lt;ffffffff81160550&gt;] ? __alloc_percpu+0x10/0x20
[    1.158207]  [&lt;ffffffff811c9493&gt;] vfs_kern_mount+0x63/0xf0
[    1.158207]  [&lt;ffffffff811cbb0e&gt;] do_mount+0x23e/0xa20
[    1.158207]  [&lt;ffffffff8115b51b&gt;] ? strndup_user+0x4b/0xf0
[    1.158207]  [&lt;ffffffff811cc373&gt;] SyS_mount+0x83/0xc0
[    1.158207]  [&lt;ffffffff81673cc2&gt;] system_call_fastpath+0x16/0x1b
[    1.158207] ---[ end trace 61981bc62de9f6f4 ]---

Signed-off-by: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Tested-by: Madper Xie &lt;cxie@redhat.com&gt;
Cc: stable@kernel.org
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efi: Add proper definitions for some EFI function pointers.</title>
<updated>2013-09-25T11:34:33+00:00</updated>
<author>
<name>Roy Franz</name>
<email>roy.franz@linaro.org</email>
</author>
<published>2013-09-22T22:45:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ed37ddffe201bfad7be3c45bc08bd65b5298adca'/>
<id>urn:sha1:ed37ddffe201bfad7be3c45bc08bd65b5298adca</id>
<content type='text'>
The x86/AMD64 EFI stubs must use a call wrapper to convert between
the Linux and EFI ABIs, so void pointers are sufficient.  For ARM,
the ABIs are compatible, so we can directly invoke the function
pointers.  The functions that are used by the ARM stub are updated
to match the EFI definitions.
Also add some EFI types used by EFI functions.

Signed-off-by: Roy Franz &lt;roy.franz@linaro.org&gt;
Acked-by: Mark Salter &lt;msalter@redhat.com&gt;
Reviewed-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efi: x86: make efi_lookup_mapped_addr() a common function</title>
<updated>2013-09-05T12:29:29+00:00</updated>
<author>
<name>Leif Lindholm</name>
<email>leif.lindholm@linaro.org</email>
</author>
<published>2013-09-05T10:34:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=258f6fd738221766b512cd8c7120563b78d62829'/>
<id>urn:sha1:258f6fd738221766b512cd8c7120563b78d62829</id>
<content type='text'>
efi_lookup_mapped_addr() is a handy utility for other platforms than
x86. Move it from arch/x86 to drivers/firmware. Add memmap pointer
to global efi structure, and initialise it on x86.

Signed-off-by: Leif Lindholm &lt;leif.lindholm@linaro.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efi: x86: ia64: provide a generic efi_config_init()</title>
<updated>2013-09-05T12:29:29+00:00</updated>
<author>
<name>Leif Lindholm</name>
<email>leif.lindholm@linaro.org</email>
</author>
<published>2013-09-05T10:34:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=272686bf46a34f86d270cf192f68769667792026'/>
<id>urn:sha1:272686bf46a34f86d270cf192f68769667792026</id>
<content type='text'>
Common to (U)EFI support on all platforms is the global "efi" data
structure, and the code that parses the System Table to locate
addresses to populate that structure with.

This patch adds both of these to the global EFI driver code and
removes the local definition of the global "efi" data structure from
the x86 and ia64 code.

Squashed into one big patch to avoid breaking bisection.

Signed-off-by: Leif Lindholm &lt;leif.lindholm@linaro.org&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2013-07-06T21:09:38+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-07-06T21:09:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=21884a83b2192a00885d7244a1dda32debd2fbc7'/>
<id>urn:sha1:21884a83b2192a00885d7244a1dda32debd2fbc7</id>
<content type='text'>
Pull timer core updates from Thomas Gleixner:
 "The timer changes contain:

   - posix timer code consolidation and fixes for odd corner cases

   - sched_clock implementation moved from ARM to core code to avoid
     duplication by other architectures

   - alarm timer updates

   - clocksource and clockevents unregistration facilities

   - clocksource/events support for new hardware

   - precise nanoseconds RTC readout (Xen feature)

   - generic support for Xen suspend/resume oddities

   - the usual lot of fixes and cleanups all over the place

  The parts which touch other areas (ARM/XEN) have been coordinated with
  the relevant maintainers.  Though this results in an handful of
  trivial to solve merge conflicts, which we preferred over nasty cross
  tree merge dependencies.

  The patches which have been committed in the last few days are bug
  fixes plus the posix timer lot.  The latter was in akpms queue and
  next for quite some time; they just got forgotten and Frederic
  collected them last minute."

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (59 commits)
  hrtimer: Remove unused variable
  hrtimers: Move SMP function call to thread context
  clocksource: Reselect clocksource when watchdog validated high-res capability
  posix-cpu-timers: don't account cpu timer after stopped thread runtime accounting
  posix_timers: fix racy timer delta caching on task exit
  posix-timers: correctly get dying task time sample in posix_cpu_timer_schedule()
  selftests: add basic posix timers selftests
  posix_cpu_timers: consolidate expired timers check
  posix_cpu_timers: consolidate timer list cleanups
  posix_cpu_timer: consolidate expiry time type
  tick: Sanitize broadcast control logic
  tick: Prevent uncontrolled switch to oneshot mode
  tick: Make oneshot broadcast robust vs. CPU offlining
  x86: xen: Sync the CMOS RTC as well as the Xen wallclock
  x86: xen: Sync the wallclock when the system time is set
  timekeeping: Indicate that clock was set in the pvclock gtod notifier
  timekeeping: Pass flags instead of multiple bools to timekeeping_update()
  xen: Remove clock_was_set() call in the resume path
  hrtimers: Support resuming with two or more CPUs online (but stopped)
  timer: Fix jiffies wrap behavior of round_jiffies_common()
  ...
</content>
</entry>
<entry>
<title>efi: Convert runtime services function ptrs</title>
<updated>2013-06-11T06:39:26+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2013-06-02T12:56:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=43ab0476a648053e5998bf081f47f215375a4502'/>
<id>urn:sha1:43ab0476a648053e5998bf081f47f215375a4502</id>
<content type='text'>
... to void * like the boot services and lose all the void * casts. No
functionality change.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>x86: Increase precision of x86_platform.get/set_wallclock()</title>
<updated>2013-05-28T21:00:59+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2013-05-13T17:56:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3565184ed0c1ea46bea5b792da5f72a83c43e49b'/>
<id>urn:sha1:3565184ed0c1ea46bea5b792da5f72a83c43e49b</id>
<content type='text'>
All the virtualized platforms (KVM, lguest and Xen) have persistent
wallclocks that have more than one second of precision.

read_persistent_wallclock() and update_persistent_wallclock() allow
for nanosecond precision but their implementation on x86 with
x86_platform.get/set_wallclock() only allows for one second precision.
This means guests may see a wallclock time that is off by up to 1
second.

Make set_wallclock() and get_wallclock() take a struct timespec
parameter (which allows for nanosecond precision) so KVM and Xen
guests may start with a more accurate wallclock time and a Xen dom0
can maintain a more accurate wallclock for guests.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>efi, pstore: Read data from variable store before memcpy()</title>
<updated>2013-04-30T15:03:10+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2013-04-29T19:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a415b8c05f261a52f45f2271b6c4731376fd5b5'/>
<id>urn:sha1:8a415b8c05f261a52f45f2271b6c4731376fd5b5</id>
<content type='text'>
Seiji reported getting empty dmesg-* files, because the data was never
actually read in efi_pstore_read_func(), and so the memcpy() was copying
garbage data.

This patch necessitated adding __efivar_entry_get() which is callable
between efivar_entry_iter_{begin,end}(). We can also delete
__efivar_entry_size() because efi_pstore_read_func() was the only
caller.

Reported-by: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Tested-by: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Matthew Garrett &lt;matthew.garrett@nebula.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v3.9' into efi-for-tip2</title>
<updated>2013-04-30T10:42:13+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2013-04-30T10:30:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a614e1923d5389d01f3545ee4a90e39a04d0c90d'/>
<id>urn:sha1:a614e1923d5389d01f3545ee4a90e39a04d0c90d</id>
<content type='text'>
Resolve conflicts for Ingo.

Conflicts:
	drivers/firmware/Kconfig
	drivers/firmware/efivars.c

Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efi: split efisubsystem from efivars</title>
<updated>2013-04-17T12:27:06+00:00</updated>
<author>
<name>Tom Gundersen</name>
<email>teg@jklm.no</email>
</author>
<published>2013-02-08T15:37:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a9499fa7cd3fd4824a7202d00c766b269fa3bda6'/>
<id>urn:sha1:a9499fa7cd3fd4824a7202d00c766b269fa3bda6</id>
<content type='text'>
This registers /sys/firmware/efi/{,systab,efivars/} whenever EFI is enabled
and the system is booted with EFI.

This allows
 *) userspace to check for the existence of /sys/firmware/efi as a way
    to determine whether or it is running on an EFI system.
 *) 'mount -t efivarfs none /sys/firmware/efi/efivars' without manually
    loading any modules.

[ Also, move the efivar API into vars.c and unconditionally compile it.
  This allows us to move efivars.c, which now only contains the sysfs
  variable code, into the firmware/efi directory. Note that the efivars.c
  filename is kept to maintain backwards compatability with the old
  efivars.ko module. With this patch it is now possible for efivarfs
  to be built without CONFIG_EFI_VARS - Matt ]

Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Mike Waychison &lt;mikew@google.com&gt;
Cc: Kay Sievers &lt;kay@vrfy.org&gt;
Cc: Jeremy Kerr &lt;jk@ozlabs.org&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Chun-Yi Lee &lt;jlee@suse.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Cc: Tobias Powalowski &lt;tpowa@archlinux.org&gt;
Signed-off-by: Tom Gundersen &lt;teg@jklm.no&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
</feed>
