linux.kernel - 26 new messages in 21 topics - digest
linux.kernel
http://groups.google.com/group/linux.kernel?hl=en
Today's topics:
* Reposting: [PATCH v1] serial: Add OMAP high-speed UART driver. - 1 messages,
1 author
http://groups.google.com/group/linux.kernel/t/9800da1317981df4?hl=en
* - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/8247ac8cce474453?hl=en
* USBFS Memory allocation Bug - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/92045a3fe917200e?hl=en
* memcg: disable irq at page cgroup lock (Re: [PATCH -mmotm 3/4] memcg: dirty
pages accounting and limiting infrastructure) - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/eb7661b915f1ef96?hl=en
* ata2: lost interrupt with kernel 2.6.34-rc1 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/ba9fce8983cdb84e?hl=en
* linux-next: manual merge of the omap_dss2 tree with the omap tree - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/03d8f952f85eba07?hl=en
* x86,perf: Implement minimal P4 PMU driver v14 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/56fce9a45008d100?hl=en
* howto combat highly pathologic latencies on a server? - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/f30708899ac8dd76?hl=en
* Please pull UDF updates for 2.6.34-rc1 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/66e69c067889e7b9?hl=en
* Race condition in TTY ldisc layer in 2.6.33 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/0dd856e75c9c2098?hl=en
* mtd/nand/r852: fix build for CONFIG_PCI disabled - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/56fd47df335c0b65?hl=en
* WebCT Service Helpdesk - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/0c6d3265a038f6ce?hl=en
* Document Linux's circular buffering capabilities - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/1e678f41e15225ea?hl=en
* of/flattree: Make unflatten_device_tree() safe to call from any arch - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/d12b4e1e1a3528b9?hl=en
* GFS2: Pre-pull patch posting - 4 messages, 1 author
http://groups.google.com/group/linux.kernel/t/58c53e06d9077a4f?hl=en
* tcp: bugs and cleanup for 2.6.34-rc1 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/c35ca27b143f9a64?hl=en
* kmemleak: Is DMI supported ? - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/6f26b3e04bccb7fa?hl=en
* Various OF cleanups - 3 messages, 1 author
http://groups.google.com/group/linux.kernel/t/790064108de540ad?hl=en
* DMA_ERROR_CODE (was: Re: linux-next: build failure after merge of the final
tree) - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/82c37a065d8310bd?hl=en
* Staging: comedi: fix coding style in range.c - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/6fc19bb750d47fc4?hl=en
* Code 2:3:5 {urgent} - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/ff9aae9a6c17f402?hl=en
==============================================================================
TOPIC: Reposting: [PATCH v1] serial: Add OMAP high-speed UART driver.
http://groups.google.com/group/linux.kernel/t/9800da1317981df4?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Mar 11 2010 8:40 am
From: Tony Lindgren
* Govindraj.R <govindraj.raja@ti.com> [100311 05:11]:
>
> Hi Greg,
>
> Could you please have this patch into your tty tree now?
>
> As I do not see any further comment in community on this
> for quite long time now.
There are still outstanding comments. I've commented several
times that this patch needs to be posted with the related
patches so people can actually try it out.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC:
http://groups.google.com/group/linux.kernel/t/8247ac8cce474453?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Mar 11 2010 8:50 am
From: "Monica D."
This is my second time of contacting you to
inform / congratulate you as winner of this
year Grant Award from the RDS PLC (ROYAL
DUTCH SHELL), You have been chosen as one of
the Grant Winner of $2,000,000.00 USD. for
more details contact the Remittance officer
Mr. Janick Delarche on
<royal14@btinternet.com> for claim procedure.
COMPLETE THE CLAIM PROCESSING FORM BELOW:
1.FULL NAME: 2.COUNTRY: 3.TEL:
4.SEX: 5.AGE: 6.OCCUPATION: 7. ALTERNATIVE E-
MAIL ADDRESS(YOHOO OR GMAIL):
Regards.
Monica D.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: USBFS Memory allocation Bug
http://groups.google.com/group/linux.kernel/t/92045a3fe917200e?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Mar 11 2010 9:00 am
From: Alan Stern
On Wed, 10 Mar 2010, Mel Gorman wrote:
> > > Is there any means for the driver to take the large request, break it up
> > > into multiple smaller requests and submit them one at a time?
> >
> > In theory almost anything is possible. But it would be a big effort
> > and not consistent with the way the rest of the driver works.
> >
>
> Then about the only other suggestion would be a mempool containing a small
> number of largest-possible buffers that is enabled if there is no swap
> available.
Considering that this is the first report I have heard about this sort
of problem, and that adding swap space would probably fix it, I'm not
inclined to make any changes.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: memcg: disable irq at page cgroup lock (Re: [PATCH -mmotm 3/4] memcg:
dirty pages accounting and limiting infrastructure)
http://groups.google.com/group/linux.kernel/t/eb7661b915f1ef96?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Mar 11 2010 9:00 am
From: Vivek Goyal
On Thu, Mar 11, 2010 at 01:49:08PM +0900, KAMEZAWA Hiroyuki wrote:
> On Thu, 11 Mar 2010 13:31:23 +0900
> Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
>
> > On Wed, 10 Mar 2010 09:26:24 +0530, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> > > * nishimura@mxp.nes.nec.co.jp <nishimura@mxp.nes.nec.co.jp> [2010-03-10 10:43:09]:
>
> > I made a patch(attached) using both local_irq_disable/enable and local_irq_save/restore.
> > local_irq_save/restore is used only in mem_cgroup_update_file_mapped.
> >
> > And I attached a histogram graph of 30 times kernel build in root cgroup for each.
> >
> > before_root: no irq operation(original)
> > after_root: local_irq_disable/enable for all
> > after2_root: local_irq_save/restore for all
> > after3_root: mixed version(attached)
> >
> > hmm, there seems to be a tendency that before < after < after3 < after2 ?
> > Should I replace save/restore version to mixed version ?
> >
>
> IMHO, starting from after2_root version is the easist.
> If there is a chance to call lock/unlock page_cgroup can be called in
> interrupt context, we _have to_ disable IRQ, anyway.
> And if we have to do this, I prefer migration_lock rather than this mixture.
>
> BTW, how big your system is ? Balbir-san's concern is for bigger machines.
> But I'm not sure this change is affecte by the size of machines.
> I'm sorry I have no big machine, now.
FWIW, I took andrea's patches (local_irq_save/restore solution) and
compiled the kernel on 32 cores hyperthreaded (64 cpus) with make -j32
in /dev/shm/. On this system, I can't see much difference.
I compiled the kernel 10 times and took average.
Without andrea's patches: 28.698 (seconds)
With andrea's patches: 28.711 (seconds).
Diff is .04%
This is all should be in root cgroup. Note, I have not mounted memory cgroup
controller but it is compiled in. So I am assuming that root group
accounting will still be taking place. Also assuming that it is not
required to do actual IO to disk and /dev/shm is enough to see the results
of local_irq_save()/restore.
Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: ata2: lost interrupt with kernel 2.6.34-rc1
http://groups.google.com/group/linux.kernel/t/ba9fce8983cdb84e?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Mar 11 2010 9:00 am
From: Andrew Benton
Hello,
I'm not subscribed to this list, sorry if it's the wrong place to send this.
I've been having problems with 2.6.34-rc1, when the system tries to access a
lot of files (eg, if I recompile the kernel) it freezes for about 10 seconds
or so and then I get a message like this in the sys.log:
ata2: lost interrupt (Status 0x50)
ata2.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 frozen
ata2.01: failed command: WRITE DMA
ata2.01: cmd ca/00:08:4c:37:6f/00:00:00:00:00/fd tag 0 dma 4096 out
res 40/00:00:00:00:00/00:00:00:00:00/10 Emask 0x4 (timeout)
ata2.01: status: { DRDY }
ata2.00: hard resetting link
ata2.01: hard resetting link
ata2.00: SATA link down (SStatus 0 SControl 300)
ata2.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata2.01: configured for UDMA/133
ata2.01: device reported invalid CHS sector 0
ata2: EH complete
or this:
ata2: lost interrupt (Status 0x50)
ata2.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 frozen
ata2.01: failed command: READ DMA EXT
ata2.01: cmd 25/00:08:1b:90:4d/00:00:1a:00:00/f0 tag 0 dma 4096 in
res 40/00:00:00:00:00/00:00:00:00:00/10 Emask 0x4 (timeout)
ata2.01: status: { DRDY }
ata2.00: hard resetting link
ata2.01: hard resetting link
ata2.00: SATA link down (SStatus 0 SControl 300)
ata2.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata2.01: configured for UDMA/133
ata2.01: device reported invalid CHS sector 0
ata2: EH complete
It works fine with 2.6.33
lspci | grep ATA gives:
00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller #1
00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller #2
zgrep ATA /proc/config.gz gives:
# CONFIG_RELOCATABLE is not set
# CONFIG_ATALK is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_PMP is not set
# CONFIG_SATA_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y
# CONFIG_SATA_SVW is not set
CONFIG_ATA_PIIX=y
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SX4 is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_PATA_ACPI is not set
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CS5535 is not set
# CONFIG_PATA_CS5536 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_ATA_GENERIC is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_LEGACY is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_RZ1000 is not set
# CONFIG_PATA_SC1200 is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
# CONFIG_PATA_SCH is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: linux-next: manual merge of the omap_dss2 tree with the omap tree
http://groups.google.com/group/linux.kernel/t/03d8f952f85eba07?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Mar 11 2010 9:00 am
From: Tony Lindgren
* Stephen Rothwell <sfr@canb.auug.org.au> [100310 20:15]:
> Hi Tomi,
>
> Today's linux-next merge of the omap_dss2 tree got a conflict in
> drivers/video/omap2/vram.c between commit
> 4ff6baf45cd23593592e5786ccd607bdc8785f4c ("omap: Fix compile for
> early_param and omap_smc1") from the omap tree and commit
> 5c1f96f4cffbdde9e194f3ae5373953f3fa12836 ("OMAP: DSS2: VRAM: Fix
> early_param for vram") from the omap_dss2 tree.
>
> Just two versions of the same fix to omap_vram_early_vram(). I used the
> omap tree version.
I'll split my patch in two parts, and let Tomi queue this fix.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: x86,perf: Implement minimal P4 PMU driver v14
http://groups.google.com/group/linux.kernel/t/56fce9a45008d100?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Mar 11 2010 9:00 am
From: Cyrill Gorcunov
On Thu, Mar 11, 2010 at 10:32:55AM +0800, Lin Ming wrote:
> commit ca03770(perf, x86: Add PEBS infrastructure) introduces a new
> function validate_event that calls x86_pmu.get_event_constraints.
>
> static int validate_event(struct perf_event *event)
> {
> ...
> c = x86_pmu.get_event_constraints(fake_cpuc, event);
> ...
> }
>
> So we need to add .get_event_constraints to p4_pmu.
>
> diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c
> index 4eb79b1..99a2a7c 100644
> --- a/arch/x86/kernel/cpu/perf_event_p4.c
> +++ b/arch/x86/kernel/cpu/perf_event_p4.c
> @@ -586,6 +586,7 @@ static __initconst struct x86_pmu p4_pmu = {
> .max_period = (1ULL << 39) - 1,
> .hw_config = p4_hw_config,
> .schedule_events = p4_pmu_schedule_events,
> + .get_event_constraints = x86_get_event_constraints,
> };
>
> static __init int p4_pmu_init(void)
>
> ---
> Lin Ming
>
>
Patch is updated (and latest -tip/master is taken into account
as well).
Robert, introducing additional logic instead of function pointers
would lead to a valuable code duplication.
But I'll think about it anyway. Perhaps there is a way (still)
to implement it with a minimal former code intersection.
Also note that the patch squash really a small change into
former code, which make pretty easy to step back if we will need
it (for some reason).
And naming issue of header file is addressed too.
-- Cyrill
---
x86,perf: Implement minimal P4 PMU driver v15
Netburst PMU is a way differ from "architectural perfomance
monitoring" specfication. P4 uses a tuple of ESCR+CCCR+COUNTER
MSR registers to handle perfomance monitoring events.
A few implementation details:
1) We need a separate x86_pmu::hw_config helper in struct x86_pmu
since register bit-fields are quite different from P6, Core
and later cpu series.
2) For the same reason x86_pmu::schedule_events helper introduced.
3) hw_perf_event::config consists of packed ESCR+CCCR value.
It's allowed since in real both registers use only a half
of their size. Of course before make a real write into a
particular MSR we need to unpack value and extend it to
a proper size.
4) The tuple of packed ESCR+CCCR in hw_perf_event::config
doesn't describe the memory address of ESCR MSR register
so that we need to keep a mapping between this tuples
used and available ESCR (various P4 events may use same
ESCRs but not simultaneously), for this sake every active
event has a per-cpu map of hw_perf_event::idx <--> ESCR address.
5) Since hw_perf_event::idx is an offset to counter/control register
we need to lift X86_PMC_MAX_GENERIC up, otherwise kernel strip it down
to 8 registers and event armed may never be turned off (ie the bit
in active_mask is set but cycle never reach this index to check),
thanks to Peter Zijlstra
Restrictions:
- No cascaded counters support (do we ever need them?)
- No dependant events support (so PERF_COUNT_HW_INSTRUCTIONS
doesn't work for now)
- There are events with same counters which can't work simultaneously
(need to use intersected ones due to broken counter 1)
- No PERF_COUNT_HW_CACHE_ events yet
Todo:
- Implement dependant events
- Need proper hashing for event opcodes (no linear search, good for
debugging stage but not in real loads)
- Some events counted during a clock cycle -- need to set threshold
for them and count every clock cycle just to get summary statistics
(ie to behave the same way as other PMUs do)
- Need to swicth to use event_constraints
- To support RAW events we need to encode a global list of P4 events
into p4_templates
- Chache events need to be added
[Event status matrix]
Event status
-----------------------------
cycles works
cache-references works
cache-misses works
branch-misses works
bus-cycles partially (not work on 64bit cpu with HT enabled)
instruction doesnt work (needs dependant event [mop tagging])
branches doesnt work
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
|
| Updated on top of -tip/master
| commit 2a1ca9948b3ec63c31974725cf364fec029760f5
| Merge: bbf7ae6 41acab8
| Author: Ingo Molnar <mingo@elte.hu>
| Date: Thu Mar 11 15:23:42 2010 +0100
|
| Merge branch 'sched/core'
|
arch/x86/include/asm/perf_event.h | 2
arch/x86/include/asm/perf_event_p4.h | 707 +++++++++++++++++++++++++++++++++
arch/x86/kernel/cpu/perf_event.c | 46 +-
arch/x86/kernel/cpu/perf_event_amd.c | 2
arch/x86/kernel/cpu/perf_event_intel.c | 15
arch/x86/kernel/cpu/perf_event_p4.c | 607 ++++++++++++++++++++++++++++
arch/x86/kernel/cpu/perf_event_p6.c | 2
7 files changed, 1358 insertions(+), 23 deletions(-)
Index: linux-2.6.git/arch/x86/include/asm/perf_event.h
=====================================================================
--- linux-2.6.git.orig/arch/x86/include/asm/perf_event.h
+++ linux-2.6.git/arch/x86/include/asm/perf_event.h
@@ -5,7 +5,7 @@
* Performance event hw details:
*/
-#define X86_PMC_MAX_GENERIC 8
+#define X86_PMC_MAX_GENERIC 32
#define X86_PMC_MAX_FIXED 3
#define X86_PMC_IDX_GENERIC 0
Index: linux-2.6.git/arch/x86/include/asm/perf_event_p4.h
=====================================================================
--- /dev/null
+++ linux-2.6.git/arch/x86/include/asm/perf_event_p4.h
@@ -0,0 +1,707 @@
+/*
+ * Netburst Perfomance Events (P4, old Xeon)
+ */
+
+#ifndef PERF_EVENT_P4_H
+#define PERF_EVENT_P4_H
+
+#include <linux/cpu.h>
+#include <linux/bitops.h>
+
+/*
+ * NetBurst has perfomance MSRs shared between
+ * threads if HT is turned on, ie for both logical
+ * processors (mem: in turn in Atom with HT support
+ * perf-MSRs are not shared and every thread has its
+ * own perf-MSRs set)
+ */
+#define ARCH_P4_TOTAL_ESCR (46)
+#define ARCH_P4_RESERVED_ESCR (2) /* IQ_ESCR(0,1) not always present */
+#define ARCH_P4_MAX_ESCR (ARCH_P4_TOTAL_ESCR - ARCH_P4_RESERVED_ESCR)
+#define ARCH_P4_MAX_CCCR (18)
+#define ARCH_P4_MAX_COUNTER (ARCH_P4_MAX_CCCR / 2)
+
+#define P4_EVNTSEL_EVENT_MASK 0x7e000000U
+#define P4_EVNTSEL_EVENT_SHIFT 25
+#define P4_EVNTSEL_EVENTMASK_MASK 0x01fffe00U
+#define P4_EVNTSEL_EVENTMASK_SHIFT 9
+#define P4_EVNTSEL_TAG_MASK 0x000001e0U
+#define P4_EVNTSEL_TAG_SHIFT 5
+#define P4_EVNTSEL_TAG_ENABLE 0x00000010U
+#define P4_EVNTSEL_T0_OS 0x00000008U
+#define P4_EVNTSEL_T0_USR 0x00000004U
+#define P4_EVNTSEL_T1_OS 0x00000002U
+#define P4_EVNTSEL_T1_USR 0x00000001U
+
+/* Non HT mask */
+#define P4_EVNTSEL_MASK \
+ (P4_EVNTSEL_EVENT_MASK | \
+ P4_EVNTSEL_EVENTMASK_MASK | \
+ P4_EVNTSEL_TAG_MASK | \
+ P4_EVNTSEL_TAG_ENABLE | \
+ P4_EVNTSEL_T0_OS | \
+ P4_EVNTSEL_T0_USR)
+
+/* HT mask */
+#define P4_EVNTSEL_MASK_HT \
+ (P4_EVNTSEL_MASK | \
+ P4_EVNTSEL_T1_OS | \
+ P4_EVNTSEL_T1_USR)
+
+#define P4_CCCR_OVF 0x80000000U
+#define P4_CCCR_CASCADE 0x40000000U
+#define P4_CCCR_OVF_PMI_T0 0x04000000U
+#define P4_CCCR_OVF_PMI_T1 0x08000000U
+#define P4_CCCR_FORCE_OVF 0x02000000U
+#define P4_CCCR_EDGE 0x01000000U
+#define P4_CCCR_THRESHOLD_MASK 0x00f00000U
+#define P4_CCCR_THRESHOLD_SHIFT 20
+#define P4_CCCR_THRESHOLD(v) ((v) << P4_CCCR_THRESHOLD_SHIFT)
+#define P4_CCCR_COMPLEMENT 0x00080000U
+#define P4_CCCR_COMPARE 0x00040000U
+#define P4_CCCR_ESCR_SELECT_MASK 0x0000e000U
+#define P4_CCCR_ESCR_SELECT_SHIFT 13
+#define P4_CCCR_ENABLE 0x00001000U
+#define P4_CCCR_THREAD_SINGLE 0x00010000U
+#define P4_CCCR_THREAD_BOTH 0x00020000U
+#define P4_CCCR_THREAD_ANY 0x00030000U
+
+/* Non HT mask */
+#define P4_CCCR_MASK \
+ (P4_CCCR_OVF | \
+ P4_CCCR_CASCADE | \
+ P4_CCCR_OVF_PMI_T0 | \
+ P4_CCCR_FORCE_OVF | \
+ P4_CCCR_EDGE | \
+ P4_CCCR_THRESHOLD_MASK | \
+ P4_CCCR_COMPLEMENT | \
+ P4_CCCR_COMPARE | \
+ P4_CCCR_ESCR_SELECT_MASK | \
+ P4_CCCR_ENABLE)
+
+/* HT mask */
+#define P4_CCCR_MASK_HT \
+ (P4_CCCR_MASK | \
+ P4_CCCR_THREAD_ANY)
+
+/*
+ * format is 32 bit: ee ss aa aa
+ * where
+ * ee - 8 bit event
+ * ss - 8 bit selector
+ * aa aa - 16 bits reserved for tags/attributes
+ */
+#define P4_EVENT_PACK(event, selector) (((event) << 24) | ((selector) << 16))
+#define P4_EVENT_UNPACK_EVENT(packed) (((packed) >> 24) & 0xff)
+#define P4_EVENT_UNPACK_SELECTOR(packed) (((packed) >> 16) & 0xff)
+#define P4_EVENT_PACK_ATTR(attr) ((attr))
+#define P4_EVENT_UNPACK_ATTR(packed) ((packed) & 0xffff)
+#define P4_MAKE_EVENT_ATTR(class, name, bit) class##_##name = (1 << bit)
+#define P4_EVENT_ATTR(class, name) class##_##name
+#define P4_EVENT_ATTR_STR(class, name) __stringify(class##_##name)
+
+/*
+ * config field is 64bit width and consists of
+ * HT << 63 | ESCR << 32 | CCCR
+ * where HT is HyperThreading bit (since ESCR
+ * has it reserved we may use it for own purpose)
+ *
+ * note that this is NOT the addresses of respective
+ * ESCR and CCCR but rather an only packed value should
+ * be unpacked and written to a proper addresses
+ *
+ * the base idea is to pack as much info as
+ * possible
+ */
+#define p4_config_pack_escr(v) (((u64)(v)) << 32)
+#define p4_config_pack_cccr(v) (((u64)(v)) & 0xffffffffULL)
+#define p4_config_unpack_escr(v) (((u64)(v)) >> 32)
+#define p4_config_unpack_cccr(v) (((u64)(v)) & 0xffffffffULL)
+
+#define p4_config_unpack_emask(v) \
+ ({ \
+ u32 t = p4_config_unpack_escr((v)); \
+ t &= P4_EVNTSEL_EVENTMASK_MASK; \
+ t >>= P4_EVNTSEL_EVENTMASK_SHIFT; \
+ t; \
+ })
+
+#define P4_CONFIG_HT_SHIFT 63
+#define P4_CONFIG_HT (1ULL << P4_CONFIG_HT_SHIFT)
+
+static inline u32 p4_config_unpack_opcode(u64 config)
+{
+ u32 e, s;
+
+ /*
+ * we don't care about HT presence here since
+ * event opcode doesn't depend on it
+ */
+ e = (p4_config_unpack_escr(config) & P4_EVNTSEL_EVENT_MASK) >> P4_EVNTSEL_EVENT_SHIFT;
+ s = (p4_config_unpack_cccr(config) & P4_CCCR_ESCR_SELECT_MASK) >> P4_CCCR_ESCR_SELECT_SHIFT;
+
+ return P4_EVENT_PACK(e, s);
+}
+
+static inline bool p4_is_event_cascaded(u64 config)
+{
+ u32 cccr = p4_config_unpack_cccr(config);
+ return !!(cccr & P4_CCCR_CASCADE);
+}
+
+static inline int p4_ht_config_thread(u64 config)
+{
+ return !!(config & P4_CONFIG_HT);
+}
+
+static inline u64 p4_set_ht_bit(u64 config)
+{
+ return config | P4_CONFIG_HT;
+}
+
+static inline u64 p4_clear_ht_bit(u64 config)
+{
+ return config & ~P4_CONFIG_HT;
+}
+
+static inline int p4_ht_active(void)
+{
+#ifdef CONFIG_SMP
+ return smp_num_siblings > 1;
+
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home