* linux-next: manual merge of the sparseirq tree
@ 2008-08-25 9:32 Stephen Rothwell
2008-08-25 19:37 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2008-08-25 9:32 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-next, Yinghai Lu, Jeremy Fitzhardinge
[Ingo, thanks for the heads up about this ...]
Hi Ingo,
Today's linux-next merge of the sparseirq tree got a conflict in
arch/x86/xen/spinlock.c between commit
168d2f464ab9860f0d1e66cf1f9684973222f1c6 ("xen: save previous spinlock
when blocking") from the x86 tree and commit
fb6dc57946f9ebfeac546dd0698d9f065c191668 ("x86: move kstat_irqs from
kstat to irq_desc") from the sparseirq tree.
I fixed it up (see below) and can carry it.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff --cc arch/x86/xen/spinlock.c
index d072823,5a48aba..0000000
--- a/arch/x86/xen/spinlock.c
+++ b/arch/x86/xen/spinlock.c
@@@ -194,60 -73,24 +194,60 @@@ static noinline int xen_spin_lock_slow(
if (irq == -1)
return 0;
+ start = spin_time_start();
+
/* announce we're spinning */
- spinning_lock(xl);
+ prev = spinning_lock(xl);
+
+ flags = __raw_local_save_flags();
+ if (irq_enable) {
+ ADD_STATS(taken_slow_irqenable, 1);
+ raw_local_irq_enable();
+ }
+
+ ADD_STATS(taken_slow, 1);
+ ADD_STATS(taken_slow_nested, prev != NULL);
- /* clear pending */
- xen_clear_irq_pending(irq);
+ do {
+ /* clear pending */
+ xen_clear_irq_pending(irq);
+
+ /* check again make sure it didn't become free while
+ we weren't looking */
+ ret = xen_spin_trylock(lock);
+ if (ret) {
+ ADD_STATS(taken_slow_pickup, 1);
+
+ /*
+ * If we interrupted another spinlock while it
+ * was blocking, make sure it doesn't block
+ * without rechecking the lock.
+ */
+ if (prev != NULL)
+ xen_set_irq_pending(irq);
+ goto out;
+ }
- /* check again make sure it didn't become free while
- we weren't looking */
- ret = xen_spin_trylock(lock);
- if (ret)
- goto out;
+ /*
+ * Block until irq becomes pending. If we're
+ * interrupted at this point (after the trylock but
+ * before entering the block), then the nested lock
+ * handler guarantees that the irq will be left
+ * pending if there's any chance the lock became free;
+ * xen_poll_irq() returns immediately if the irq is
+ * pending.
+ */
+ xen_poll_irq(irq);
+ ADD_STATS(taken_slow_spurious, !xen_test_irq_pending(irq));
+ } while (!xen_test_irq_pending(irq)); /* check for spurious wakeups */
- kstat_this_cpu.irqs[irq]++;
- /* block until irq becomes pending */
- xen_poll_irq(irq);
+ kstat_irqs_this_cpu(irq_to_desc(irq))++;
out:
- unspinning_lock(xl);
+ raw_local_irq_restore(flags);
+ unspinning_lock(xl, prev);
+ spin_time_accum_blocked(start);
+
return ret;
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: linux-next: manual merge of the sparseirq tree
2008-08-25 9:32 linux-next: manual merge of the sparseirq tree Stephen Rothwell
@ 2008-08-25 19:37 ` Jeremy Fitzhardinge
2008-08-25 23:48 ` Stephen Rothwell
0 siblings, 1 reply; 10+ messages in thread
From: Jeremy Fitzhardinge @ 2008-08-25 19:37 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Ingo Molnar, linux-next, Yinghai Lu
Stephen Rothwell wrote:
> [Ingo, thanks for the heads up about this ...]
>
> Hi Ingo,
>
> Today's linux-next merge of the sparseirq tree got a conflict in
> arch/x86/xen/spinlock.c between commit
> 168d2f464ab9860f0d1e66cf1f9684973222f1c6 ("xen: save previous spinlock
> when blocking") from the x86 tree and commit
> fb6dc57946f9ebfeac546dd0698d9f065c191668 ("x86: move kstat_irqs from
> kstat to irq_desc") from the sparseirq tree.
>
> I fixed it up (see below) and can carry it.
>
This is a diff-diff? The change:
- kstat_this_cpu.irqs[irq]++;
- /* block until irq becomes pending */
- xen_poll_irq(irq);
+ kstat_irqs_this_cpu(irq_to_desc(irq))++;
looks fine.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: linux-next: manual merge of the sparseirq tree
2008-08-25 19:37 ` Jeremy Fitzhardinge
@ 2008-08-25 23:48 ` Stephen Rothwell
0 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2008-08-25 23:48 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Ingo Molnar, linux-next, Yinghai Lu
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
Hi Jeremy,
On Mon, 25 Aug 2008 12:37:27 -0700 Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
> This is a diff-diff? The change:
Its from "git diff" of the merge itself (which implies the -cc option of
git diff).
>
> - kstat_this_cpu.irqs[irq]++;
> - /* block until irq becomes pending */
> - xen_poll_irq(irq);
> + kstat_irqs_this_cpu(irq_to_desc(irq))++;
>
>
> looks fine.
Thanks.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* linux-next: manual merge of the sparseirq tree
@ 2008-09-15 14:58 Stephen Rothwell
0 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2008-09-15 14:58 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-next, Sheng Yang, Avi Kivity
[-- Attachment #1: Type: text/plain, Size: 551 bytes --]
Hi Ingo,
Today's linux-next merge of the sparseirq tree got a trivial conflict in
arch/x86/kvm/vmx.h and include/asm-x86/msr-index.h between commit
f5dd05a1980ab0770f1889fbc3ad2daa5ff89d6d ("x86: Move FEATURE_CONTROL bits
to msr-index.h") from the kvm tree and commit
315a6558f30a264c88274fa70626615d1c7851c7 ("x86: move VMX MSRs to
msr-index.h") from the sparseirq tree.
Just context changes. I fixed it up and can carry the fix.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* linux-next: manual merge of the sparseirq tree
@ 2008-09-15 15:19 Stephen Rothwell
2008-09-15 18:35 ` Roland McGrath
0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2008-09-15 15:19 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-next, Markus Metzger, Thomas Gleixner, Roland McGrath
[-- Attachment #1: Type: text/plain, Size: 4339 bytes --]
Hi Inog,
Today's linux-next merge of the sparseirq tree got a conflict in
arch/x86/kernel/ptrace.c between commit
393084e9e8c20c63cef574a6466ec0e59c711727 ("x86: ioperm user_regset") from
the x86 tree and commit 93fa7636dfdc059b25df148f230c0991096afdef ("x86,
ptrace: PEBS support") from the sparseirq tree.
Mostly overlapping additions/changes. I fixed it up (see below) and can
carry the fix.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff --cc arch/x86/kernel/ptrace.c
index 6b7ab0b,58ce4b5..0000000
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@@ -557,41 -554,87 +557,110 @@@ static int ptrace_set_debugreg(struct t
return 0;
}
+/*
+ * These access the current or another (stopped) task's io permission
+ * bitmap for debugging or core dump.
+ */
+static int ioperm_active(struct task_struct *target,
+ const struct user_regset *regset)
+{
+ return target->thread.io_bitmap_max / regset->size;
+}
+
+static int ioperm_get(struct task_struct *target,
+ const struct user_regset *regset,
+ unsigned int pos, unsigned int count,
+ void *kbuf, void __user *ubuf)
+{
+ if (!target->thread.io_bitmap_ptr)
+ return -ENXIO;
+
+ return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
+ target->thread.io_bitmap_ptr,
+ 0, IO_BITMAP_BYTES);
+}
+
- #ifdef X86_BTS
+ #ifdef CONFIG_X86_PTRACE_BTS
+ /*
+ * The configuration for a particular BTS hardware implementation.
+ */
+ struct bts_configuration {
+ /* the size of a BTS record in bytes; at most BTS_MAX_RECORD_SIZE */
+ unsigned char sizeof_bts;
+ /* the size of a field in the BTS record in bytes */
+ unsigned char sizeof_field;
+ /* a bitmask to enable/disable BTS in DEBUGCTL MSR */
+ unsigned long debugctl_mask;
+ };
+ static struct bts_configuration bts_cfg;
+
+ #define BTS_MAX_RECORD_SIZE (8 * 3)
+
+
+ /*
+ * Branch Trace Store (BTS) uses the following format. Different
+ * architectures vary in the size of those fields.
+ * - source linear address
+ * - destination linear address
+ * - flags
+ *
+ * Later architectures use 64bit pointers throughout, whereas earlier
+ * architectures use 32bit pointers in 32bit mode.
+ *
+ * We compute the base address for the first 8 fields based on:
+ * - the field size stored in the DS configuration
+ * - the relative field position
+ *
+ * In order to store additional information in the BTS buffer, we use
+ * a special source address to indicate that the record requires
+ * special interpretation.
+ *
+ * Netburst indicated via a bit in the flags field whether the branch
+ * was predicted; this is ignored.
+ */
- static int ptrace_bts_get_size(struct task_struct *child)
+ enum bts_field {
+ bts_from = 0,
+ bts_to,
+ bts_flags,
+
+ bts_escape = (unsigned long)-1,
+ bts_qual = bts_to,
+ bts_jiffies = bts_flags
+ };
+
+ static inline unsigned long bts_get(const char *base, enum bts_field field)
{
- if (!child->thread.ds_area_msr)
- return -ENXIO;
+ base += (bts_cfg.sizeof_field * field);
+ return *(unsigned long *)base;
+ }
- return ds_get_bts_index((void *)child->thread.ds_area_msr);
+ static inline void bts_set(char *base, enum bts_field field, unsigned long val)
+ {
+ base += (bts_cfg.sizeof_field * field);;
+ (*(unsigned long *)base) = val;
}
- static int ptrace_bts_read_record(struct task_struct *child,
- long index,
+ /*
+ * Translate a BTS record from the raw format into the bts_struct format
+ *
+ * out (out): bts_struct interpretation
+ * raw: raw BTS record
+ */
+ static void ptrace_bts_translate_record(struct bts_struct *out, const void *raw)
+ {
+ memset(out, 0, sizeof(*out));
+ if (bts_get(raw, bts_from) == bts_escape) {
+ out->qualifier = bts_get(raw, bts_qual);
+ out->variant.jiffies = bts_get(raw, bts_jiffies);
+ } else {
+ out->qualifier = BTS_BRANCH;
+ out->variant.lbr.from_ip = bts_get(raw, bts_from);
+ out->variant.lbr.to_ip = bts_get(raw, bts_to);
+ }
+ }
+
+ static int ptrace_bts_read_record(struct task_struct *child, size_t index,
struct bts_struct __user *out)
{
struct bts_struct ret;
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: linux-next: manual merge of the sparseirq tree
2008-09-15 15:19 Stephen Rothwell
@ 2008-09-15 18:35 ` Roland McGrath
2008-09-17 10:20 ` Ingo Molnar
0 siblings, 1 reply; 10+ messages in thread
From: Roland McGrath @ 2008-09-15 18:35 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Ingo Molnar, linux-next, Markus Metzger, Thomas Gleixner
The ioperm patch (tip/x86/ptrace) adds the new ioperm_* functions, which
could go anywhere in the file (before the *_regsets[] decls). It might be
simplest to just change the patch to put them earlier or later where the
patch text is not near the lines touched by BTS patches.
Thanks,
Roland
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: linux-next: manual merge of the sparseirq tree
2008-09-15 18:35 ` Roland McGrath
@ 2008-09-17 10:20 ` Ingo Molnar
0 siblings, 0 replies; 10+ messages in thread
From: Ingo Molnar @ 2008-09-17 10:20 UTC (permalink / raw)
To: Roland McGrath
Cc: Stephen Rothwell, linux-next, Markus Metzger, Thomas Gleixner
* Roland McGrath <roland@redhat.com> wrote:
> The ioperm patch (tip/x86/ptrace) adds the new ioperm_* functions,
> which could go anywhere in the file (before the *_regsets[] decls).
> It might be simplest to just change the patch to put them earlier or
> later where the patch text is not near the lines touched by BTS
> patches.
yeah - but these are old commits, we better not upset them.
I've carried that conflict fixup for a long time and made it visible
because i updated sparseirq tree to propagate a fix but the x86 tree for
linux-next was at an older version (with PEBS topic not integrated yet)
- so Stephen got to see this conflict.
It should disappear on the next integration run this week. (the
frequency of integration runs is weekly - the frequency of bugfix/hotfix
propagation is daily/hourly)
Thanks Stephen for taking care of it.
Ingo
^ permalink raw reply [flat|nested] 10+ messages in thread
* linux-next: manual merge of the sparseirq tree
@ 2008-10-16 8:08 Stephen Rothwell
2008-10-16 8:13 ` Ingo Molnar
0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2008-10-16 8:08 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-next
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
Hi Ingo,
Today's linux-next merge of the sparseirq tree got a lot of conflicts
with various other trees. For today, I will drop it and maybe have
another look tomorrow when things are (hopefully) less busy. If you
could fix up any internal-to-tip and Linus conflicts, that would be great.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: linux-next: manual merge of the sparseirq tree
2008-10-16 8:08 Stephen Rothwell
@ 2008-10-16 8:13 ` Ingo Molnar
2008-10-16 8:30 ` Stephen Rothwell
0 siblings, 1 reply; 10+ messages in thread
From: Ingo Molnar @ 2008-10-16 8:13 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, Thomas Gleixner, H. Peter Anvin
* Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Ingo,
>
> Today's linux-next merge of the sparseirq tree got a lot of conflicts
> with various other trees. For today, I will drop it and maybe have
> another look tomorrow when things are (hopefully) less busy. [...]
okay, agreed - i've just reset auto-sparseirq-next to Linus and will
update it with a merged up tree. (which we have in the works)
> [...] If you could fix up any internal-to-tip and Linus conflicts,
> that would be great.
no other topic should be conflicting that i know of.
Ingo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: linux-next: manual merge of the sparseirq tree
2008-10-16 8:13 ` Ingo Molnar
@ 2008-10-16 8:30 ` Stephen Rothwell
0 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2008-10-16 8:30 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-next, Thomas Gleixner, H. Peter Anvin
[-- Attachment #1: Type: text/plain, Size: 428 bytes --]
Hi Ingo,
On Thu, 16 Oct 2008 10:13:47 +0200 Ingo Molnar <mingo@elte.hu> wrote:
>
> okay, agreed - i've just reset auto-sparseirq-next to Linus and will
> update it with a merged up tree. (which we have in the works)
OK, thanks.
> no other topic should be conflicting that i know of.
I was guessing :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-10-16 8:30 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-25 9:32 linux-next: manual merge of the sparseirq tree Stephen Rothwell
2008-08-25 19:37 ` Jeremy Fitzhardinge
2008-08-25 23:48 ` Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2008-09-15 14:58 Stephen Rothwell
2008-09-15 15:19 Stephen Rothwell
2008-09-15 18:35 ` Roland McGrath
2008-09-17 10:20 ` Ingo Molnar
2008-10-16 8:08 Stephen Rothwell
2008-10-16 8:13 ` Ingo Molnar
2008-10-16 8:30 ` Stephen Rothwell
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.