Hi guys,
Sorry if i am on the wrong list :(
I found it hard to log on to ask.linaro.org to see if i can answer some queries.
Or even to ask some queries.
I would love to have a mail + mailing-list interface for it. Please point me to
one if available.
--
viresh
From: "hongbo.zhang" <hongbo.zhang(a)linaro.com>
V3->V4 Changes:
1. In previous patch set V3 "Fix thermal bugs and Upstream ST-Ericsson thermal
driver", there were 5 patches in total, since the first 3 for fixing thermal
layer bugs have been accepted by the maintainer, I'd like to send out the
updated last 2 only this time, for upstreaming ST-Ericsson thermal driver.
2. In patch "Thermal: Add ST-Ericsson DB8500 thermal driver"
- typo in commit message: diver -> driver;
- add more explanation of device tree properties are optional or required.
- in function db8500_thermal_match_cdev: remove cdev_name, use
trip_points->cdev_name[i] directly instead;
- in function db8500_cdev_bind: move cdev->ops->get_max_state(cdev,
&max_state) out of for loop to call it only once;
- in function db8500_thermal_parse_dt: update checking strlen(tmp_str) >=
THERMAL_NAME_LENGTH
- add Reviewed-by: Viresh Kumar <viresh.kumar(a)linaro.org>
- add Reviewed-by: Francesco Lavra <francescolavra.fl(a)gmail.com>
3. In patch "Thermal: Add ST-Ericsson DB8500 thermal properties and platform
data"
- add Reviewed-by: Viresh Kumar <viresh.kumar(a)linaro.org>
hongbo.zhang (2):
Thermal: Add ST-Ericsson DB8500 thermal driver.
Thermal: Add ST-Ericsson DB8500 thermal properties and platform data.
.../devicetree/bindings/thermal/db8500-thermal.txt | 44 ++
arch/arm/boot/dts/dbx5x0.dtsi | 14 +
arch/arm/boot/dts/snowball.dts | 31 ++
arch/arm/configs/u8500_defconfig | 2 +
arch/arm/mach-ux500/board-mop500.c | 64 +++
drivers/thermal/Kconfig | 20 +
drivers/thermal/Makefile | 2 +
drivers/thermal/db8500_cpufreq_cooling.c | 108 +++++
drivers/thermal/db8500_thermal.c | 530 +++++++++++++++++++++
include/linux/platform_data/db8500_thermal.h | 38 ++
10 files changed, 853 insertions(+)
create mode 100644 Documentation/devicetree/bindings/thermal/db8500-thermal.txt
create mode 100644 drivers/thermal/db8500_cpufreq_cooling.c
create mode 100644 drivers/thermal/db8500_thermal.c
create mode 100644 include/linux/platform_data/db8500_thermal.h
--
1.7.11.3
=== Highlights ===
* Sent imx multi-platform series to arm-soc for 3.8 merge window.
* Sent a series adding cpuidle driver for imx6q using coupled cpuidle,
implementation 3 C-states - wfi, clock gating and power gating.
* Gave FSL internal development team a training on device tree, and
spent time on the kernel 3.5 upgrade preparation.
Shawn
Hi,
I'm working with a dual Cortex-A9 system and I've been trying to
understand exactly why spinlock functions need to use DMB. It seems
that as long as the merging store buffer is flushed the lock value
should end up in the L1 on the unlocking core and the SCU should
either invalidate or update the value in the L1 of the other core.
This is enough to maintain coherency and safe locking right? And
doesn't STREX skip the merging store buffer anyway, meaning we don't
even need the flush?
DMB appears to be something of a blunt hammer, especially since it
defaults to the system domain, which likely means a write all the way
to main memory, which can be expensive.
Are the DMBs in the locks there as a workaround for drivers that don't
use smp_mb properly?
I'm currently seeing, based on the performance counters, about 5% of
my system cycles disappearing in stalls caused by DMB.
-Pete
== Highlights ==
* Got some positive reviews from Mel Gorman on the first RFC of vmevent
pressure attribute. Fixed most of implementation comments;
* Prepared and sent the second RFC of the pressure attribute support. The
new patch integrates Minchan's and Mel's ideas of using discrete
pressure levels. Also, now we use reclaimer's priority to detect pre-OOM
conditions. The second RFC got some positive feedback from Minchan and
Pekka;
* Sent accuracy improvements for the vmevent_fd (this fixes a long
standing issue noticed by Kosaki Motohiro);
* vmevent_fd cleanups were merged into Pekka Enberg's tree;
* All the pstore debugfs reworks landed into v3.7-rc1;
* Prepared two set of slides for the upcoming Connect: status updates for
my items, plus some generic notes on upstreaming;
* Resent ARM KDB FIQ support patches, ARM FIQ cleanups and KDB Kiosk mode
patches. Still no feedback;
* Got some very nice patches for pstore: MMC backend and a tasklist
dumper; briefly reviewed the patches, and hopefully they'll be merged in
v3.8.
Hi all,
So this is the second RFC. The main change is that I decided to go with
discrete levels of the pressure.
When I started writing the man page, I had to describe the 'reclaimer
inefficiency index', and while doing this I realized that I'm describing
how the kernel is doing the memory management, which we try to avoid in
the vmevent. And applications don't really care about these details:
reclaimers, its inefficiency indexes, scanning window sizes, priority
levels, etc. -- it's all "not interesting", and purely kernel's stuff. So
I guess Mel Gorman was right, we need some sort of levels.
What applications (well, activity managers) are really interested in is
this:
1. Do we we sacrifice resources for new memory allocations (e.g. files
cache)?
2. Does the new memory allocations' cost becomes too high, and the system
hurts because of this?
3. Are we about to OOM soon?
And here are the answers:
1. VMEVENT_PRESSURE_LOW
2. VMEVENT_PRESSURE_MED
3. VMEVENT_PRESSURE_OOM
There is no "high" pressure, since I really don't see any definition of
it, but it's possible to introduce new levels without breaking ABI. The
levels described in more details in the patches, and the stuff is still
tunable, but now via sysctls, not the vmevent_fd() call itself (i.e. we
don't need to rebuild applications to adjust window size or other mm
"details").
What I couldn't fix in this RFC is making vmevent_{scanned,reclaimed}
stuff per-CPU (there's a comment describing the problem with this). But I
made it lockless and tried to make it very lightweight (plus I moved the
vmevent_pressure() call to a more "cold" path).
Thanks,
Anton.
== Linus Walleij linusw ==
=== Highlights ===
* Drilled into the RCU lockup. With some help from Paul
McKenney we got a task dump from CPU0 (the CPU that is
locking) but not much more - only the swapper thread is
running there and we need to dump its stack.
* Puffed and pinged on the SPARSE_IRQ patch, yet no reaction
so far.
* Mainlining some stuff in the PL011 driver that has been
sitting internally for some time. Easy stuff went in first and
then we ran into the trickier patches - some odd baudrates
are impossible since th TTY layer will "snap" the baudrate
to a standard baudrate from a table if it's "close enough".
We used to work around this by not calling out to the
TTY layer in the PL011 driver for certain baudrates, but this
is duct-taping. Still debating the real solution with Alan
Cox and Russell King who help out a lot.
* Reviewed and merged various GPIO patches.
* Reviewed and merged various pinctrl patches.
* Reviewed some ux500 patches coming from Lee.
* Reviewed Arnd's iomem cleanups.
* Sent out Patrice Chotard's pinctrl patch for the PL022
SPI driver, Mark has merged it.
=== Plans ===
* Ongoing work on sparse IRQ for Nomadik and Ux500.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
* N/A
Thanks,
Linus Walleij
== Linus Walleij linusw ==
I realized that my [ACTIVITY] report appears to trigger everyone
else to send theirs so when I missed mine, no reports came
in, sorry! Here it goes, a weekend late, but still probably the
first one.
=== Highlights ===
* SPARSE_IRQ patch set for Ux500 ready and rolling, now
ready to look at multiplatform for Ux500.
* Reviewed and merged some GPIO patches, wrote some
GPIO driver patches trying to clean out some irqdomain
business, mainly because I don't fully understand the
semantics of that API myself.
Now I think I do.
* Wrote a few U300 patches cleaning up some pinctrl
business (irqdomains, nocheinmal).
* Again debated issues around runtime PM / suspend and
resume proper in the different drivers. We have planned
a runtime PM session @connect with Ulf and Amit.
* Some heavy lifting as internal adivisor and reviewer of
the pinctrl switch for the company.
=== Plans ===
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
N/A
Thanks,
Linus Walleij
After making some patch which adds a
x = y % z
statement in kernel, I get this linker error when trying to compile
for Pandboard (omap2plus)
undefined reference to `__aeabi_uldivmod'
make[1]: *** [vmlinux] Error 1
make: *** [sub-make] Error 2
Simple search revealed that it's been reported before in linaro gcc
and upstream gcc as well.
https://bugs.launchpad.net/gcc-linaro/+bug/771832 -> still not resolved.
I'm surprised that kernel doesn't use modulo for unsigned long
anywhere else except in my patch.
Has anyone else seen this or some weird issue in my (typical desktop) setup ?
Any workarounds ?
TIA,
Venkat.
Hi all,
For the single zImage demo @ Connect, our tentative plan is to have
multiple boards connected to a single host so we can just have one
monitor displaying multiple console sessions and then run 'uname -a'
to show that the kernels are the same (this will not win any awards
for visual appeal). I don't want to spend a week trying to get a
driver to work so looking for suggestions on specific brands of USB
multi-port serial adapters that are known to 100% work with Linux. As
in you've tried it, maybe own one (hey, how about your bring it with
you?!), and it worked, not as in "I read on google that it should
work" :).
Thanks,
~Deepak
Hello Russell,
As the merge window is over, and hopefully there are no more serious
regressions in the ARM land :-), maybe you'll find time to look into these
small cleanups...
The rationale is the same:
During KDB FIQ patches review you mentioned that I should not introduce
another FIQ_START. It seems that in v3.6-rc the FIQ_START issue was
somewhat band-aided, i.e. machines don't necessary need to define this
stuff any longer, but I also read the background of the issue, and you
once said that you don't want the FIQ subsystem to mess with genirq.
It is surely makes sense as FIQs are arch-specific, plus FIQs are special
in that way that platform makers are free to connects device directly
to the FIQ line, avoiding IC routing, and then enable_fiq(<IRQ>) would
look awkward, at the best.
So, given that, it seems that the only entity that knows for sure how
the particular FIQ is routed is whoever claims the FIQ and fills-in the
fiq_handler struct. It might make sense to introduce disable/enable
callbacks in the fiq_handler struct, and then prototypes for disable/
enable FIQ calls would look like this:
enable_fiq(struct fiq_handler *fh);
disable_fiq(struct fiq_handler *fh);
I.e. completely abstracted from the genirq.
Although, to not duplicate IC code, I think it's pretty legitimate to
call genirq functions iff the caller knows for sure that FIQ comes from
IRQ line and it is is routed through the well-known platform IC.
In that case (which is a majority), the typical user would do this:
static int irq_line;
void foo_enable_fiq(struct fiq_handler *fh)
{
enable_irq(irq_line);
}
static struct fiq_handler foo_fiq = {
.name = "foo",
.enable_fiq = foo_enable_fiq,
};
claim_fiq(&foo_fiq);
enable_fiq(&foo_fiq);
Obviously, it's needless indirection, so I don't do this. If we ever
pass 'foo_fiq' to some device, which does not know all the routing
details, then it would make sense to introduce it, but not now.
So, the patch set is pretty straightforward:
- Get rid of FIQ_START. Nobody but platform-specific code (and drivers)
should know the details about which interrupt can be routed to FIQ
and which cannot;
- Remove disable/enable_fiq() calls from the FIQ subsys (the calls can
be reintroduced w/ new prototypes when/if needed).
Does the approach make sense?
Thanks!
--
arch/arm/include/asm/fiq.h | 2 -
arch/arm/include/asm/mach/irq.h | 7 +++-
arch/arm/kernel/fiq.c | 37 +++++--------------
arch/arm/kernel/irq.c | 2 -
arch/arm/mach-omap1/include/mach/irqs.h | 4 --
arch/arm/mach-rpc/dma.c | 4 +-
arch/arm/mach-rpc/include/mach/irqs.h | 8 ++--
arch/arm/mach-rpc/irq.c | 21 ++---------
arch/arm/mach-s3c24xx/include/mach/irqs.h | 3 --
arch/arm/plat-mxc/avic.c | 5 ---
arch/arm/plat-mxc/include/mach/irqs.h | 2 -
arch/arm/plat-mxc/tzic.c | 5 ---
arch/arm/plat-s3c24xx/irq.c | 6 +--
.../media/platform/soc_camera/mx1_camera.c | 6 +--
sound/soc/fsl/imx-pcm-fiq.c | 4 +-
15 files changed, 31 insertions(+), 85 deletions(-)
== Deepak Saxena <dsaxena> ==
=== Highlights ===
* Finishing up Connect session planning
* Continued work on cleaning up existing BPs
* Working on breaking down single zImage work into BPs
* Completed https://wiki.linaro.org/WorkingGroups/Kernel/BlueprintProcess
* Created new roadmap card for eMMC 4.6 PM work
* Various emails and discussions on roadmap/BP process.
=== Plans ===
* Closeout on creating Android upstreaming roadmap cards
* Start work on Android Upstreaming slides for Connect
* Sort out Connect scheduling for KWG sessions
* Usual BPs, meetings, etc...
== Issues ===
=== Travel/Time Off ===
* Off this Friday Oct, 19th
* Connect Copenhagen
=== Highlights ===
* KVM/ARM VGIC state saving and restoring implementation.
KVM is a big new picture to me and i spent a lot time to read docs
and codes to
better understand it and setup test and debug environment.
For this week, i mainly completed reading both vgic code and qemu
in-kernel vgic implmentation code
for trying to know better what exactly states need to save and
restore for vgic and how save/restore works in system.
Since the kvm and qemu system is big, probably i need one more week
to know better on what's going on
on the whole process of virtual irq handling process via vgic.
I feel regret for the show process about this work.
* Help Reviewed [PATCH] flexcan: disable bus error interrupts for the
i.MX28. from Wolfgang Grandegger.
The issue was caused by an abnormal behavior of IP that it can not
generate rx/tx warning interrupt, finally
we found it's IC HW issue with our IP module owner's help that for
mx25/35/53 the rx/tx interrupt line actually
are not connected to ARM.
* Sent a simple regmap core fix patch:
[PATCH 1/1] regmap: select REGMAP if REGMAP_MMIO and REGMAP_IRQ enabled
Attendees: Alex Lemberg, Arnd Bergmann, Balaji TK, Jakub Pavelek, Luca
Porzio, Venkatraman S
(#linaro-storage: alex, arnd, balajitk, Xruxa, lupo, svenkatr)
Discussion Notes:-
1. Mini review of f2fs filesystem
* Limitation: Can only deal with power of 2 erase blocks
* Limitation: Needs 6 concurrent erase blocks - low end SD cards
might not have that many
* Good review in LWN; yet to read complete source code
2. Linaro Connect planning
* Need to shuffle around sessions due to limitation and travel logistics
* 3 sessions proposed.
** f2fs review
*** Need to confirm participation from Samsung, and
whether any BPs
will come out of the review.
*** Good to have benchmarking done by Linaro folks
(svenkatr -todo)
** eMMC4.6 features
*** Needs Jedec membership, should be made as private
/ invite only meeting
** Swap on flash
*** Will be a private session due to time constraints
* Further discussions over email on Connect session scheduling / logistics.
3. Need to change the weekly meeting time to account for Friday
holiday for Alex - to be discussed at Connect.
Regards,
Venkat.
==== Activity Summary ====
* Completed implementing review comments from lee Jones, patch
underwent enough optimization
* Discussion and internal review with lee Jones regarding review comments
* Spent some time on testing, observed expected interrupts from
fuel-gauge driver
==== Plan ====
* Implementing Legacy platform data support to co-exist with DT bindings.
==== Issues ====
-- NA --
Hello Pekka,
Just a few updates to vmevents:
- Some cleanups and refactorings -- needed for easier integration of
'memory pressure' work;
- Forward to newer Linus' tree, fix conflicts.
For convenience, the merge commit and all the patches can be pulled from
this repo:
git://git.infradead.org/users/cbou/linux-vmevent.git tags/vmevent-updates
Thanks,
Anton.
I think the actual intent was to report the number of used swap pages, not
just total swap size.
This patch fixes the issue.
Signed-off-by: Anton Vorontsov <anton.vorontsov(a)linaro.org>
---
mm/vmevent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmevent.c b/mm/vmevent.c
index 1c2e72e..a059bed 100644
--- a/mm/vmevent.c
+++ b/mm/vmevent.c
@@ -46,7 +46,7 @@ static u64 vmevent_attr_swap_pages(struct vmevent_watch *watch,
si_swapinfo(&si);
- return si.totalswap;
+ return si.totalswap - si.freeswap;
#else
return 0;
#endif
--
1.7.12.1
Hi all,
Some time ago KOSAKI Motohiro noticed[1] that vmevent might be very
inaccurate (up to 2GB inaccuracy on a very large machines) since per CPU
stats synchronization happens either on time basis or when we hit stat
thresholds.
KOSAKI also told that perf API might be a good inspirations for further
improvements, but I must admit I didn't fully get the idea, although I'm
open to investigate this route too, but I guess it needs a bit more
explanations.
Also note that this is just an RFC, I just show some ideas and wonder how
you feel about it. Since we now use memory pressure factor bolted into the
reclaimer code path, we don't desperately need the accurate stats, but
it's still nice thing to have/fix.
Anyway, here we take two approaches:
- Asynchronously sum vm_stat diffs and global stats. This is very similar
to what we already have for per-zone stats, implemented in
zone_page_state_snapshot(). The values still could be inaccurate, but
overall this makes things better;
- Implement configurable per CPU vmstat thresholds. This is much more
powerful tool to get accurate statistics, but it comes with a price: it
might cause some performance penalty as we'd update global stats more
frequently (in a fast path), so users have to be careful.
The two items are independent, so we might implement one or another, or
both, or none, if desired. ;-)
Thanks,
Anton.
p.s. Note that the patches are against my vmevent tree, i.e.:
git://git.infradead.org/users/cbou/linux-vmevent.git
[1] http://lkml.indiana.edu/hypermail/linux/kernel/1205.1/00062.html
== Linus Walleij linusw ==
=== Highlights ===
* Sent a second pull request to Torvalds for the v3.7 pinctrl
patches that involved the simplified irqdomain. Torvalds
pulled it in.
* SPARSE_IRQ patch set ready to be pulled into ARM
SoC when the merge window ends. Might need some
rebasing and editing.
* Back ported regmap MMIO from v3.5 to the internal v3.4
branch to help development of upstream kernel compliant
features.
* Resolved the issues around runtime PM / suspend and
resume proper in the PL022 driver (and others). Planned
a runtime PM session @connect with Ulf and Amit.
* Reviewed the second iteration of Synaptics' RMI4 patch
set.
* Reviewed, slammed, got a v2 and eventually merged the
pinctrl refactoring patches from Tomasz for the Samsung
platforms.
* Pulled in Jean-Christophe's AT91 pinctrl patch set,
had it explode in next and request it to be rebased for
inclusion past v3.7-rc1 or so.
* Submitted and fixed up a patch deleting the "Nomadik"
FSMC driver and replacing it with the one from SPEAr
just named fsmc_nand.c. Fixed up breakage after a
clash with a patch from Jean-Christophe.
* Reviewed Vipin Kumar's FSMC patch set digging around
details of userspace buffer mapping and why it doesn't
work.
* Reviewed a bunch of U9540 patches from Lee Jones
internally before sending them out to the public lists.
Debate continues on the lists.
* Hunted some regressions and fixups, git them out the
door.
=== Plans ===
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
* Some internal time stealing, for example ST-Ericsson
career development has taken some time this week.
Thanks,
Linus Walleij
hi
For A15 and A7, there three kinds of usage model.
1. the cluster switch
i found that there is the reference code about the switcher. So does
linaro has any development based on it?
2. cpu migration
It seems that only members can get the early code. Is that right?
3. MP mode
I find a git "http://git.linaro.org/git/arm/big.LITTLE/mp.git". So
does it contains the latest development of big and little system MP
mode?
Thanks.
== Highlights ==
* Prepared and sent out v9 of KGDB NMI core patches, nowadays they all are
in the mainline kernel;
* All previously submitted persistent storage reworks and fixes are also
in mainline now;
* Sent out and discussed vmevents pressure factor. So far only Mel and
John commented;
* Prepared and sent refactorings for vmevents, another step to make it
closer to the upstream. Also merged with the latest Linus' tree and
requested Pekka to pull;
== Plans ==
* Address Mel Gorman's implementation notes on vmevent's pressure factor.
* Send out vm_stat enhancements for vmevent (need to prepare a good
explanation);
* Perform vmevents pressure factor use-case tests on a desktop, tune
statistics (try Mel's idea of using multiple window sizes);
* I wonder if it makes sense to resend the KGDB FIQ ARM and kiosk patches
now, or maybe I should wait for the end of the merge window. I guess
resending them now would be OK, we're halfway to the -rc1 anyways;
Hi all,
This is just an RFC so far. It's an attempt to implement Mel Gorman's idea
of detecting and measuring memory pressure by calculating the ratio of
scanned vs. reclaimed pages in a given time frame.
The implemented approach can notify userland about two things:
- Constantly rising number of scanned pages shows that Linux is busy w/
rehashing pages in general. The more we scan, the more it's obvious that
we're out of unused pages, and we're draining caches. By itself it's not
critical, but for apps that want to maintain caches level (like Android)
it's quite useful. The notifications are ratelimited by a specified
amount of scanned pages.
- Next, we calculate pressure using '100 - reclaimed/scanned * 100'
formula. The value shows (in percents) how efficiently the kernel
reclaims pages. If we take number of scanned pages and think of them as
a time scale, then these percents basically would show us how much of
the time Linux is spending to find reclaimable pages. 0% means that
every page is a candidate for reclaim, 100% means that MM is not
recliaming at all, it spends all the time scanning and desperately
trying to find something to reclaim. The more time we're at the high
percentage level, the more chances that we'll OOM soon.
So, if we fail to find a page in a reasonable time frame, we're obviously
in trouble, no matter how much reclaimable memory we actually have --
we're too slow, and so we'd better free something.
Although it must be noted that the pressure factor might be affected by
reclaimable vs. non-reclaimable pages "fragmentation" in an LRU. If
there's a "hole" of reclaimable memory in an almost-OOMed system, the
factor will drop temporary. On the other hand, it just shows how
efficiently Linux is keeping the lists, it might be pretty inefficient,
and the factor will show it.
Some more notes:
- Although the scheme sounds good, I noticed that reclaimer 'priority'
level (i.e. scanning depth) better responds to pressure (it's more
smooth), and so far I'm not sure how to make the original idea to work
on a par w/ sc->priority level.
- I have an idea, which I might want to try some day. Currently, the
pressure callback is hooked into the inactive list reclaim path, it's
the last step in the 'to be reclaimed' page's life time. But we could
measure 'active -> inactive' migration speed, i.e. pages deactivation
rate. Or we could measure inactive/active LRU size ratio, ideally
behaving system would try to keep the ratio near 1, and it'll be close
to 0 when inactive list is getting short (for anon LRU it'd be not 1,
but zone->inactive_ratio actually).
Thanks,
Anton.
---
include/linux/vmevent.h | 36 ++++++++++
mm/vmevent.c | 179 +++++++++++++++++++++++++++++++++++++++++++++++-
mm/vmscan.c | 4 ++
3 files changed, 218 insertions(+), 1 deletion(-)
diff --git a/include/linux/vmevent.h b/include/linux/vmevent.h
index b1c4016..1397ade 100644
--- a/include/linux/vmevent.h
+++ b/include/linux/vmevent.h
@@ -10,6 +10,7 @@ enum {
VMEVENT_ATTR_NR_AVAIL_PAGES = 1UL,
VMEVENT_ATTR_NR_FREE_PAGES = 2UL,
VMEVENT_ATTR_NR_SWAP_PAGES = 3UL,
+ VMEVENT_ATTR_PRESSURE = 4UL,
VMEVENT_ATTR_MAX /* non-ABI */
};
@@ -46,6 +47,11 @@ struct vmevent_attr {
__u64 value;
/*
+ * Some attributes accept two configuration values.
+ */
+ __u64 value2;
+
+ /*
* Type of profiled attribute from VMEVENT_ATTR_XXX
*/
__u32 type;
@@ -97,4 +103,34 @@ struct vmevent_event {
struct vmevent_attr attrs[];
};
+#ifdef __KERNEL__
+
+struct mem_cgroup;
+
+extern void __vmevent_pressure(struct mem_cgroup *memcg,
+ ulong scanned,
+ ulong reclaimed);
+
+static inline void vmevent_pressure(struct mem_cgroup *memcg,
+ ulong scanned,
+ ulong reclaimed)
+{
+ if (!scanned)
+ return;
+
+ if (IS_BUILTIN(CONFIG_MEMCG) && memcg) {
+ /*
+ * The vmevent API reports system pressure, for per-cgroup
+ * pressure, we'll chain cgroups notifications, this is to
+ * be implemented.
+ *
+ * memcg_vm_pressure(target_mem_cgroup, scanned, reclaimed);
+ */
+ return;
+ }
+ __vmevent_pressure(memcg, scanned, reclaimed);
+}
+
+#endif
+
#endif /* _LINUX_VMEVENT_H */
diff --git a/mm/vmevent.c b/mm/vmevent.c
index d643615..12d0131 100644
--- a/mm/vmevent.c
+++ b/mm/vmevent.c
@@ -4,6 +4,7 @@
#include <linux/vmevent.h>
#include <linux/syscalls.h>
#include <linux/workqueue.h>
+#include <linux/interrupt.h>
#include <linux/file.h>
#include <linux/list.h>
#include <linux/poll.h>
@@ -30,6 +31,25 @@ struct vmevent_watch {
wait_queue_head_t waitq;
};
+struct vmevent_pwatcher {
+ struct vmevent_watch *watch;
+ struct vmevent_attr *attr;
+ struct vmevent_attr *samp;
+ struct list_head node;
+
+ uint scanned;
+ uint reclaimed;
+ uint window;
+};
+
+static LIST_HEAD(vmevent_pwatchers);
+static DEFINE_SPINLOCK(vmevent_pwatchers_lock);
+
+static uint vmevent_scanned;
+static uint vmevent_reclaimed;
+static uint vmevent_minwin = UINT_MAX; /* Smallest window in the list. */
+static DEFINE_SPINLOCK(vmevent_pressure_lock);
+
typedef u64 (*vmevent_attr_sample_fn)(struct vmevent_watch *watch,
struct vmevent_attr *attr);
@@ -141,6 +161,10 @@ static bool vmevent_match(struct vmevent_watch *watch)
struct vmevent_attr *samp = &watch->sample_attrs[i];
u64 val;
+ /* Pressure is event-driven, not polled */
+ if (attr->type == VMEVENT_ATTR_PRESSURE)
+ continue;
+
val = vmevent_sample_attr(watch, attr);
if (!ret && vmevent_match_attr(attr, val))
ret = 1;
@@ -204,6 +228,94 @@ static void vmevent_start_timer(struct vmevent_watch *watch)
vmevent_schedule_watch(watch);
}
+static ulong vmevent_calc_pressure(struct vmevent_pwatcher *pw)
+{
+ uint win = pw->window;
+ uint s = pw->scanned;
+ uint r = pw->reclaimed;
+ ulong p;
+
+ /*
+ * We calculate the ratio (in percents) of how many pages were
+ * scanned vs. reclaimed in a given time frame (window). Note that
+ * time is in VM reclaimer's "ticks", i.e. number of pages
+ * scanned. This makes it possible set desired reaction time and
+ * serves as a ratelimit.
+ */
+ p = win - (r * win / s);
+ p = p * 100 / win;
+
+ pr_debug("%s: %3lu (s: %6u r: %6u)\n", __func__, p, s, r);
+
+ return p;
+}
+
+static void vmevent_match_pressure(struct vmevent_pwatcher *pw)
+{
+ struct vmevent_watch *watch = pw->watch;
+ struct vmevent_attr *attr = pw->attr;
+ ulong val;
+
+ val = vmevent_calc_pressure(pw);
+
+ /* Next round. */
+ pw->scanned = 0;
+ pw->reclaimed = 0;
+
+ if (!vmevent_match_attr(attr, val))
+ return;
+
+ pw->samp->value = val;
+
+ atomic_set(&watch->pending, 1);
+ wake_up(&watch->waitq);
+}
+
+static void vmevent_pressure_tlet_fn(ulong data)
+{
+ struct vmevent_pwatcher *pw;
+ uint s;
+ uint r;
+
+ if (!vmevent_scanned)
+ return;
+
+ spin_lock(&vmevent_pressure_lock);
+ s = vmevent_scanned;
+ r = vmevent_reclaimed;
+ vmevent_scanned = 0;
+ vmevent_reclaimed = 0;
+ spin_unlock(&vmevent_pressure_lock);
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(pw, &vmevent_pwatchers, node) {
+ pw->scanned += s;
+ pw->reclaimed += r;
+ if (pw->scanned >= pw->window)
+ vmevent_match_pressure(pw);
+ }
+ rcu_read_unlock();
+}
+static DECLARE_TASKLET(vmevent_pressure_tlet, vmevent_pressure_tlet_fn, 0);
+
+void __vmevent_pressure(struct mem_cgroup *memcg,
+ ulong scanned,
+ ulong reclaimed)
+{
+ if (vmevent_minwin == UINT_MAX)
+ return;
+
+ spin_lock_bh(&vmevent_pressure_lock);
+
+ vmevent_scanned += scanned;
+ vmevent_reclaimed += reclaimed;
+
+ if (vmevent_scanned >= vmevent_minwin)
+ tasklet_schedule(&vmevent_pressure_tlet);
+
+ spin_unlock_bh(&vmevent_pressure_lock);
+}
+
static unsigned int vmevent_poll(struct file *file, poll_table *wait)
{
struct vmevent_watch *watch = file->private_data;
@@ -259,12 +371,40 @@ out:
return ret;
}
+static void vmevent_release_pwatcher(struct vmevent_watch *watch)
+{
+ struct vmevent_pwatcher *pw;
+ struct vmevent_pwatcher *tmp;
+ struct vmevent_pwatcher *del = NULL;
+ int last = 1;
+
+ spin_lock(&vmevent_pwatchers_lock);
+
+ list_for_each_entry_safe(pw, tmp, &vmevent_pwatchers, node) {
+ if (pw->watch != watch) {
+ vmevent_minwin = min(pw->window, vmevent_minwin);
+ last = 0;
+ continue;
+ }
+ WARN_ON(del);
+ list_del_rcu(&pw->node);
+ del = pw;
+ }
+
+ if (last)
+ vmevent_minwin = UINT_MAX;
+
+ spin_unlock(&vmevent_pwatchers_lock);
+ synchronize_rcu();
+ kfree(del);
+}
+
static int vmevent_release(struct inode *inode, struct file *file)
{
struct vmevent_watch *watch = file->private_data;
cancel_delayed_work_sync(&watch->work);
-
+ vmevent_release_pwatcher(watch);
kfree(watch);
return 0;
@@ -289,6 +429,36 @@ static struct vmevent_watch *vmevent_watch_alloc(void)
return watch;
}
+static int vmevent_setup_pwatcher(struct vmevent_watch *watch,
+ struct vmevent_attr *attr,
+ struct vmevent_attr *samp)
+{
+ struct vmevent_pwatcher *pw;
+
+ if (attr->type != VMEVENT_ATTR_PRESSURE)
+ return 0;
+
+ if (!attr->value2)
+ return -EINVAL;
+
+ pw = kzalloc(sizeof(*pw), GFP_KERNEL);
+ if (!pw)
+ return -ENOMEM;
+
+ pw->watch = watch;
+ pw->attr = attr;
+ pw->samp = samp;
+ pw->window = (attr->value2 + PAGE_SIZE - 1) / PAGE_SIZE;
+
+ vmevent_minwin = min(pw->window, vmevent_minwin);
+
+ spin_lock(&vmevent_pwatchers_lock);
+ list_add_rcu(&pw->node, &vmevent_pwatchers);
+ spin_unlock(&vmevent_pwatchers_lock);
+
+ return 0;
+}
+
static int vmevent_setup_watch(struct vmevent_watch *watch)
{
struct vmevent_config *config = &watch->config;
@@ -302,6 +472,7 @@ static int vmevent_setup_watch(struct vmevent_watch *watch)
struct vmevent_attr *attr = &config->attrs[i];
size_t size;
void *new;
+ int ret;
if (attr->type >= VMEVENT_ATTR_MAX)
continue;
@@ -322,6 +493,12 @@ static int vmevent_setup_watch(struct vmevent_watch *watch)
watch->config_attrs[nr] = attr;
+ ret = vmevent_setup_pwatcher(watch, attr, &attrs[nr]);
+ if (ret) {
+ kfree(attrs);
+ return ret;
+ }
+
nr++;
}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 99b434b..f4dd1e0 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/highmem.h>
#include <linux/vmstat.h>
+#include <linux/vmevent.h>
#include <linux/file.h>
#include <linux/writeback.h>
#include <linux/blkdev.h>
@@ -1334,6 +1335,9 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
nr_scanned, nr_reclaimed,
sc->priority,
trace_shrink_flags(file));
+
+ vmevent_pressure(sc->target_mem_cgroup, nr_scanned, nr_reclaimed);
+
return nr_reclaimed;
}
--
1.7.12.1
Attendees: Arnd Bergmann, Balaji TK, Jakub Pavelek, Luca Porzio, Venkatraman S
(#linaro-storage: arnd, balajitk, Xruxa, lupo, svenkatr)
Discussion notes:-
1. New members joining storage team - Balaji TK and Ulf Hansson
2. Linaro Connect - attendance:-
All above are planning to attend except Venkatraman S
3. Proposed topics to discuss at Connect and track leads
a) Kernel changes for eMMC4.6 support (Lupo )
b) ext4 optimizations for Flash (Arnd)
c) Swap on Flash optimizations (Venkatraman S)
d) review of Samsung's F2FS file system ( Samsung / Arnd)
4. Possibility to include SDIO v3 features in next cycle ? To check !
5. Discussion about eMMC4.6 FOTA feature and possible ways to implement
Is it really a Kernel feature (as eMMC will become offline
while updating) ?
Need to study SCSI / block subsystem's methods and take a
similar approach (IOCTL).
6. "ext4 move journal to enhanced area" BP is completed. Performance
comparison to be published and the BP to be closed. - (Balaji TK to
close)
7. core eMMC4.5 features to be reviewed and upstreamed with community
support. Need to focus on core FS / Block layer optimization for
flash. But still some features need attention (context ID and Power
Off Notify)
Regards,
Venkat.
== Deepak Saxena <dsaxena> ==
=== Highlights ===
* Started creating Connect sessions and fleshing out plans
* Looking at aarch64 SOC code, submitted a patch (!), and provided some feedback
* Continued work on cleaning up existing BPs
* Working on breaking down single zImage work into BPs
* More changes to https://wiki.linaro.org/WorkingGroups/Kernel/BlueprintProcess
=== Plans ===
* Finish Connection session creation
* Work with Jakub and engineers to fill in details of single zImage BPs
* Create some new roadmap cards:
- Existing Android BPs that are actively being worked on w/o a card
- Enabling of EMMC-4.6 Features
- EMMC Power Management
== Issues ===
=== Travel/Time Off ===
* Linaro US Holiday Monday Oct 8th
* Off Friday Oct, 19th
* Connect Copenhagen
=== Highlights ===
* Pinged tglx on maybe reducing my 3.7 queue and possibly pushing
directly to -next in the future to improve testing
* Briefly chatted with Zach on arm64 android
* Had to deal with internal infrastructure outage some this week.
* Responded to some limited comments on my volatile range patches that I
sent out
* Sent Taras Glek some pointers to other work being done in Linaro that
is relevant to Mozilla
* Reviewed some paravirt-clock patches, suggested alternative methods to
implement them.
* Assisted Matheiu on some questions wrt sending his patchset to akpm
* Sent Android subteam email & moved next weeks meeting to google
hangouts instead of mumble
* Started looking at madvise() volatile ranges
=== Plans ===
* Hopefully paternity leave?
=== Issues ===
* NA
== Linus Walleij linusw ==
=== Highlights ===
* Sent pull request to Torvalds for the v3.7 GPIO patch
queue. Torvalds pulled it in.
* Sent pull request to Torvalds for the v3.7 pinctrl patch
queue. Torvalds pulled it in.
* Rob Herring ACK:ed my patch to irqdomains to extend
the simple domain. Still seeking an ACK from Grant.
* SPARSE_IRQ patch set ready to be pulled into ARM
SoC when the merge window ends.
* Created and edited a few blueprints trying to follow
the new process.
* Strong progress on pinctrl adaption internally at
ST-Ericsson. Helped out with review and merge.
=== Plans ===
* Discussed handling for runtime PM and
ordinary suspend/resume in the PL022 SPI driver,
discussion ongoing with Ulf Hansson. I'm a bit
confused.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
* Some internal time stealing, for example ST-Ericsson
career development has taken some time this week.
Thanks,
Linus Walleij
Gotten in the bad habit of working until late on Friday and then just
dropping offline and forgetting to send out status.
=== Highlights ===
* Sent my 3.7 queue to Thomas, unfortunately he's not responded.
* Had dinner with Taras Glek of Mozilla to discuss the volatile range
changes and further details of how Mozilla uses Android functionality
both in Android as well as in FirefoxOS.
* Helped Mark in summarizing my role with Android Upstreaming.
* Ran the bi-weekly Upstreaming meeting on mumble
* Walked Jakub through some of the Android Upstreaming blueprints as
well as some of the history in Linaro's processes.
* Scratched out some more strategy thoughts on Linaro's roll in Android
upstreaming, and send the draft to Deepak.
* Implemented SIGBUS on volatile range access.
* Wrote up a large summary document on volatile ranges
* Sent out both v7 volatile range patches (including SIGBUS
functoinality) along with the long summary document to lkml
=== Plans ===
* Waiting for a baby
* Look at details on madvise() based volatile ranges on anonymous
memory, per Mozilla's preference
* 3.7 merge window work
=== Issues ===
* Some internal infrastructure snafus catching me atm. Hopefully won't
last too long.
== Linus Walleij linusw ==
=== Highlights ===
* Finally had the RCU lockup issue fixed - Paul McKenney found
the problem and fixed it. It turns out the same bug has been
seen on the OMAP, where Paul Walmsley, Becy Bruce et al
had reported it.
http://marc.info/?l=linux-kernel&m=134749030206016&w=2
Hunting and testing this took a lot of time.
* To progress on SPARSE_IRQ I proposed a patch to remove
the warning from the GIC, and alerted Rob Herring. He didn't
like that but proposed to fix the problem by fixing all
descriptor allocation, which will take more time.
* Proposed a patch fixing the pinctrl IRQ desc allocations
(these happen really early) and was adviced to introduce a
linear IRQ domain, did this, was proposed to refactor
IRQ domain core, proposed a patch for this, now following
up.
* Found out how to really get rid of the ugly workarounds in
the PL011 driver, only a small ST-Micro derivate-only patch
was needed in the end to adjust baud rate down with ~5%
on high baud rates. The rest of the patches were bogus,
we weren't interfacing the TTY layer correctly. Alan Cox
told me how to do it properly and lo and behold, it just
works now. (All work synchronized back to ST-Ericsson's
internal codebase.)
* Sent out a pinctrl patch for Nomadik I2C, but still
pondering this due to regressions.
* Discussed resource handling for runtime PM and
ordinary suspend/resume in the PL022 SPI driver,
discussion ongoing.
* Reviewed and merged various GPIO patches.
* Reviewed and merged various pinctrl patches.
Pondering PM semantics.
* Reviewed some ux500 patches coming from Lee.
=== Plans ===
* Ongoing work on sparse IRQ for Nomadik and Ux500
with the required IRQ domain refactorings.
* Follow up the rest of the above.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
* N/A
Thanks,
Linus Walleij
Hi all,
Here comes v9...
Greg, patches 1-7 have gotten all the needed acks from Alan and Jason, so
it would be awesome if you could apply them to your tty-next tree.
ARM patches still need Russell's acks, but these can wait, plus if the
core support hits v3.7, it would be much easier to handle the rest
(including the patches that add "kiosk mode" support for KDB).
Thanks!
In v9:
- KGDB patches got their Acked-by tags from Jason Wessel;
- A small 64 bit fixup for kgdb_nmi driver, thanks to Jason;
- Yet again rebased on the latest and greatest tty-next, just to make sure
everything applies cleanly.
These patches can be found in the following repo (based on tty-next):
git://git.infradead.org/users/cbou/linux-nmi-kdb.git master
Old changelogs and rationale for these patches can be found here:
v1-v5, rationale: http://lkml.org/lkml/2012/9/10/2
v6: http://lkml.org/lkml/2012/9/10/2
v7: http://lkml.org/lkml/2012/9/13/367
v8: http://lkml.org/lkml/2012/9/19/525
--
arch/arm/Kconfig | 19 ++
arch/arm/common/vic.c | 28 ++
arch/arm/include/asm/hardware/vic.h | 2 +
arch/arm/include/asm/kgdb.h | 8 +
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/entry-armv.S | 167 +-----------
arch/arm/kernel/entry-header.S | 170 ++++++++++++
arch/arm/kernel/kgdb_fiq.c | 124 +++++++++
arch/arm/kernel/kgdb_fiq_entry.S | 87 +++++++
arch/arm/mach-versatile/Makefile | 1 +
arch/arm/mach-versatile/kgdb_fiq.c | 31 +++
drivers/tty/serial/Kconfig | 19 ++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/amba-pl011.c | 73 +++++-
drivers/tty/serial/kgdb_nmi.c | 402 +++++++++++++++++++++++++++++
drivers/tty/serial/kgdboc.c | 9 +
drivers/tty/serial/serial_core.c | 17 ++
include/linux/kdb.h | 29 ++-
include/linux/kgdb.h | 13 +
include/linux/serial_core.h | 1 +
kernel/debug/debug_core.c | 14 +-
kernel/debug/kdb/kdb_main.c | 31 +++
22 files changed, 1054 insertions(+), 193 deletions(-)
== Highlights ==
* Performed some proof-of-concept tests on the Mel Gorman's idea of using
nr_scanned/(nr_reclaimed+1) ratio for memory pressure detection -- and
the idea seems to work great. Didn't have time to implement it in the
vmevent API, but hopefully this week I'll have something to show;
* Addressed Jason Wessel's comments on KDB FIQ debugger patches, i.e.
now we only register ttyNMI interface and disable_nmi command on arches
that actually support NMI rerouting, plus reworked enable_nmi callback;
* Got a bunch of new ideas from Android folks on KDB FIQ debugger,
cpufreq, low memory handling, and more. Lots of things to investigate
and implement;
* Some power supply and pstore maintenance activity, reviewed over 90
patches in total.
Hi all,
In v8, addressed Jason's comments:
- Changed kgdb_enable_nmi() weak function to kgdb_arch callbck;
- We no longer register disable_nmi command if arch does not register
KGDB NMI handling (i.e. not filling kgdb_arch.enable_nmi callback);
- The same is for ttyNMI: if architecure does not provide us with
enable_nmi call, we don't need the tty device. Of course, there is no
way to tell wether a specific serial device can be used for NMI
debugging, as it is not serial-device specific, but specific to
whether IRQ can be rerouted to an NMI (for most our cases, pretty
much every IRQ can be rerouted, e.g. a hot-pluggable serial device on
a PCI bus).
- Rebased on the latest and greatest tty-next, just in case.
These patches can be found in the following repo (based on tty-next):
git://git.infradead.org/users/cbou/linux-nmi-kdb.git master
Old changelogs and rationale for these patches can be found here:
v1-v5, rationale: http://lkml.org/lkml/2012/9/10/2
v6: http://lkml.org/lkml/2012/9/10/2
v7: http://lkml.org/lkml/2012/9/13/367
Thanks,
--
arch/arm/Kconfig | 19 ++
arch/arm/common/vic.c | 28 +++
arch/arm/include/asm/hardware/vic.h | 2 +
arch/arm/include/asm/kgdb.h | 8 +
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/entry-armv.S | 167 +------------
arch/arm/kernel/entry-header.S | 170 +++++++++++++
arch/arm/kernel/kgdb_fiq.c | 124 +++++++++
arch/arm/kernel/kgdb_fiq_entry.S | 87 +++++++
arch/arm/mach-versatile/Makefile | 1 +
arch/arm/mach-versatile/kgdb_fiq.c | 31 +++
drivers/tty/serial/Kconfig | 19 ++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/amba-pl011.c | 73 +++++-
drivers/tty/serial/kgdb_nmi.c | 402 ++++++++++++++++++++++++++++++
drivers/tty/serial/kgdboc.c | 9 +
drivers/tty/serial/serial_core.c | 17 ++
include/linux/kdb.h | 29 ++-
include/linux/kgdb.h | 13 +
include/linux/serial_core.h | 1 +
kernel/debug/debug_core.c | 14 +-
kernel/debug/kdb/kdb_main.c | 31 +++
22 files changed, 1054 insertions(+), 193 deletions(-)
The Virtualization Extensions introduce the requirement for an ARMv7-A
implementation to include SDIV and UDIV. Any implementation of the
Virtualization Extensions must include the SDIV and UDIV instructions
in the Thumb and ARM instruction sets.
In an ARMv7-A implementation that does not include the Virtualization
Extensions, it is IMPLEMENTATION DEFINED whether:
* SDIV and UDIV are not implemented
* SDIV and UDIV are implemented only in the Thumb instruction set
* SDIV and UDIV are implemented in the Thumb and ARM instruction sets.
This patch adds a handler to trap and emulate unimplemented SDIV and
UDIV instructions in ARM and Thumb modes. Also some basic statistic is
exported via /proc/cpu/idiv_emulation
Signed-off-by: Vladimir Murzin <murzin.v(a)gmail.com>
---
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/idiv_emulate.c | 194 ++++++++++++++++++++++++++++++++++++++++
arch/arm/mm/Kconfig | 26 ++++++
3 files changed, 221 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/kernel/idiv_emulate.c
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 7ad2d5c..057a630 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_OF) += devtree.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o
CFLAGS_swp_emulate.o := -Wa,-march=armv7-a
+obj-$(CONFIG_IDIV_EMULATE) += idiv_emulate.o
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
diff --git a/arch/arm/kernel/idiv_emulate.c b/arch/arm/kernel/idiv_emulate.c
new file mode 100644
index 0000000..f021d0e
--- /dev/null
+++ b/arch/arm/kernel/idiv_emulate.c
@@ -0,0 +1,195 @@
+/*
+ * linux/arch/arm/kernel/idiv_emulate.c
+ *
+ * This code is based on swp_emulate.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Implements emulation of the SDIV/UDIV instructions. They are defined for
+ * ARMv7-R and ARMv7-M profiles (in Thumb state only) and are UNDEFINED in the
+ * ARMv7-A profile. SDIV/UDIV are present by default on Cortex-A15.
+ *
+ * This emulation allow using integer divide instructions in case hardware is
+ * not presented
+ *
+ * Syntax of SDIV/UDIV instructions: SDIV/UDIV<c> <Rd>,<Rn>,<Rm>
+ * Where: Rd = the destination register.
+ * Rn = the register that contains the dividend.
+ * Rm = the register that contains the divisor.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/proc_fs.h>
+#include <linux/sched.h>
+#include <linux/syscalls.h>
+#include <linux/perf_event.h>
+
+#include <asm/opcodes.h>
+#include <asm/traps.h>
+#include <asm/uaccess.h>
+
+/*
+ * Macros/defines for extracting register numbers from instruction.
+ */
+#define EXTRACT_REG_NUM(instruction, offset) \
+ (((instruction) & (0xf << (offset))) >> (offset))
+
+/*
+ * Offsets for ARM mode
+ */
+#define RD_OFFSET 16
+#define RN_OFFSET 0
+#define RM_OFFSET 8
+
+/*
+ * Offsets for Thumb mode
+ */
+#define RD_T_OFFSET 8
+#define RN_T_OFFSET 16
+#define RM_T_OFFSET 0
+
+#define TYPE_OF_DIV (1 << 21)
+
+static unsigned long sdivcounter;
+static unsigned long udivcounter;
+static pid_t previous_pid;
+
+#ifdef CONFIG_PROC_FS
+static int proc_read_status(char *page, char **start, off_t off, int count,
+ int *eof, void *data)
+{
+ char *p = page;
+ int len;
+
+ p += sprintf(p, "Emulated UDIV:\t\t%lu\n", udivcounter);
+ p += sprintf(p, "Emulated SDIV:\t\t%lu\n", sdivcounter);
+ if (previous_pid != 0)
+ p += sprintf(p, "Last process:\t\t%d\n", previous_pid);
+
+ len = (p - page) - off;
+ if (len < 0)
+ len = 0;
+
+ *eof = (len <= count) ? 1 : 0;
+ *start = page + off;
+
+ return len;
+}
+#endif
+
+static u32 emulate_udiv(u32 n, u32 base)
+{
+ udivcounter++;
+
+ return n/base;
+}
+
+static s32 emulate_sdiv(s32 n, s32 base)
+{
+ sdivcounter++;
+
+ return n/base;
+}
+
+static int idiv_handler(struct pt_regs *regs, unsigned int instr)
+{
+ long dividend, divisor, dest, res;
+
+ perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc);
+
+ res = arm_check_condition(instr, regs->ARM_cpsr);
+
+ switch (res) {
+ case ARM_OPCODE_CONDTEST_PASS:
+ break;
+ case ARM_OPCODE_CONDTEST_FAIL:
+ /* Condition failed - return to next instruction */
+ regs->ARM_pc += 4;
+ return 0;
+ case ARM_OPCODE_CONDTEST_UNCOND:
+ if (!thumb_mode(regs))
+ return -EFAULT;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if (current->pid != previous_pid) {
+ pr_debug("\"%s\" (%ld) uses idiv instruction\n",
+ current->comm, (unsigned long)current->pid);
+ previous_pid = current->pid;
+ }
+
+ if (!thumb_mode(regs)) {
+ dividend = regs->uregs[EXTRACT_REG_NUM(instr, RN_OFFSET)];
+ divisor = regs->uregs[EXTRACT_REG_NUM(instr, RM_OFFSET)];
+ dest = EXTRACT_REG_NUM(instr, RD_OFFSET);
+ } else {
+ dividend = regs->uregs[EXTRACT_REG_NUM(instr, RN_T_OFFSET)];
+ divisor = regs->uregs[EXTRACT_REG_NUM(instr, RM_T_OFFSET)];
+ dest = EXTRACT_REG_NUM(instr, RD_T_OFFSET);
+ }
+
+/*
+ * In an ARMv7-A profile implementation that supports the SDIV and UDIV
+ * instructions, divide-by-zero always returns a zero result.
+ * In fact, integer division emulation provided by gcc lib has already handle
+ * division by zero case sending the signal to the caused process. Emulate this
+ * behavior here as well.
+ */
+ if (!divisor) {
+ siginfo_t info;
+
+ info.si_code = FPE_INTDIV;
+ info.si_signo = SIGFPE;
+ info.si_errno = 0;
+
+ arm_notify_die("Division by zero", regs, &info, 0, 0);
+
+ goto out;
+ }
+
+ if (instr & TYPE_OF_DIV)
+ res = emulate_udiv((u32)dividend, (u32)divisor);
+ else
+ res = emulate_sdiv((s32)dividend, (s32)divisor);
+
+ regs->ARM_pc += 4;
+ regs->uregs[dest] = res;
+
+out:
+ return 0;
+}
+
+static struct undef_hook idiv_hook = {
+ .instr_mask = 0x0310f010,
+ .instr_val = 0x0310f010,
+ .cpsr_mask = MODE_MASK,
+ .cpsr_val = USR_MODE,
+ .fn = idiv_handler
+};
+
+static int __init idiv_emulation_init(void)
+{
+#ifdef CONFIG_PROC_FS
+ struct proc_dir_entry *res;
+
+ res = create_proc_entry("cpu/idiv_emulation", S_IRUGO, NULL);
+
+ if (!res)
+ return -ENOMEM;
+
+ res->read_proc = proc_read_status;
+#endif /* CONFIG_PROC_FS */
+
+ pr_notice("Registering SDIV/UDIV emulation handler\n");
+
+ register_undef_hook(&idiv_hook);
+
+ return 0;
+}
+
+late_initcall(idiv_emulation_init);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 101b968..8e2fa94 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -651,6 +651,32 @@ config SWP_EMULATE
If unsure, say Y.
+config IDIV_EMULATE
+ bool "Emulate SDIV/UDIV instructions"
+ depends on !CPU_USE_DOMAINS && CPU_V7
+ select HAVE_PROC_CPU if PROC_FS
+ default y if SMP
+ help
+
+ The Virtualization Extensions introduce the requirement for an
+ ARMv7-A implementation to include SDIV and UDIV. Any
+ implementation of the Virtualization Extensions must include
+ the SDIV and UDIV instructions in the Thumb and ARM
+ instruction sets.
+
+ In an ARMv7-A implementation that does not include the
+ Virtualization Extensions, it is IMPLEMENTATION DEFINED whether:
+ * SDIV and UDIV are not implemented
+ * SDIV and UDIV are implemented only in the Thumb instruction set
+ * SDIV and UDIV are implemented in the Thumb and ARM
+ instruction sets.
+
+ This option allows to handle exeptions due to unimplemented
+ SDIV and UDIV instructions in ARM and Thumb modes.
+
+ If unsure, say Y.
+
+
config CPU_BIG_ENDIAN
bool "Build big-endian kernel"
depends on ARCH_SUPPORTS_BIG_ENDIAN
--
1.7.8.6
Hi all,
Here comes the lucky v7:
- Per Alan Cox's suggestion added hangup method and removed a small
leftover;
- Per Colin Cross' suggestion moved IRQ quiescing logic into
poll_get_char routine. IIUC, Alan is less unhappy about it. As a
result, clear_irq() callback dropped.
These patches can be found in the following repo (based on tty-next):
git://git.infradead.org/users/cbou/linux-nmi-kdb.git master
Old changelogs and rationale for these patches can be found here:
v1-v5, rationale: http://lkml.org/lkml/2012/9/10/2
v6: http://lkml.org/lkml/2012/9/10/2
Thanks,
--
arch/arm/Kconfig | 19 ++
arch/arm/common/vic.c | 28 ++
arch/arm/include/asm/hardware/vic.h | 2 +
arch/arm/include/asm/kgdb.h | 8 +
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/entry-armv.S | 167 +-----------
arch/arm/kernel/entry-header.S | 170 +++++++++++++
arch/arm/kernel/kgdb_fiq.c | 99 ++++++++
arch/arm/kernel/kgdb_fiq_entry.S | 87 +++++++
arch/arm/mach-versatile/Makefile | 1 +
arch/arm/mach-versatile/kgdb_fiq.c | 31 +++
drivers/tty/serial/Kconfig | 19 ++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/amba-pl011.c | 73 +++++-
drivers/tty/serial/kgdb_nmi.c | 396 +++++++++++++++++++++++++++++
drivers/tty/serial/kgdboc.c | 6 +
drivers/tty/serial/serial_core.c | 17 ++
include/linux/kdb.h | 29 ++-
include/linux/kgdb.h | 33 +++
include/linux/serial_core.h | 1 +
kernel/debug/debug_core.c | 36 ++-
kernel/debug/kdb/kdb_main.c | 29 +++
22 files changed, 1060 insertions(+), 193 deletions(-)
Whoops. Sorry this is late.
=== Highlights ===
* Attended a connect planning meeting
* Sent out first pass of refinied jiffies patch (help kill
CLOCK_TICK_RATE for unified-zImage)
* Sent out half of the -stable backports
* Debugged and fixed a 32bit time regression in 3.6-rc, got it merged in
tip for upstream.
* Arve pinged me on an issue they were seeing with the upstream
alarmtimer code. Implemented a solution and will be sending it out for
discussion shortly.
* Discussed with Mel Gorman on his approach to low-memory notification
* Emailed Colin Cross and AntonV to get a coffee meeting scheduled.
=== Plans ===
* Make first pass at sending SIGBUS on accessing purged volatile pages
* Send out alarmtimer fix for discussion
* Send out vsyscall update patches for discussion
* Finish testing and sending -stable backports
=== Issues ===
* NA
== Deepak Saxena <dsaxena> ==
=== Highlights ===
* Got mostly caught up on all email, minus upstream mailing lists
* Had initial discussions with Jakub on project management
* OPSCOM roadmap card review
=== Plans ===
* Update roadmap cards as per OPSCOM review
* Go through all old blueprints and clean them up
* Create BPs for currently untracked work (single zImage, aarch64)
* Catch up on Linux Plumber's Conf and Kernel Summit presentations
* Write up blueprint process for project status tracking
* Get caught up on linux-arm-kernel list
=== Issues ===
=== Travel/Time Off ===
* Travelling to NYC for 1 week,Sept 22nd - 28th, will be working half time
* Copenhagen Connect
== Status ==
* Started working on common clock support for Exynos4 platforms.
== Next Week ==
* Complete initial implementation of the common clock support for
Exynos4 platforms.
== Misc ==
* Was on leave from Sept-11 to Sept-14.
=== Highlights ===
* Setup kvm development environment.
1) build Cortex A15x1 fast model simulator
2) Successfully ran A15x1 simulator on ubuntu PC
3) Ran A15 kernel via qemu-system-arm within simulator environment
* Research kvm subsystem and qemu (read doc and code)
* Research big.LITTLE tech, read ARM doc on it and some online
technical articles
on switcher and bit.LITTLE MP scheduler, started to read ARM
reference switcher code from:
http://git.linaro.org/gitweb?p=arm/big.LITTLE/switcher.git;a=summary
== Highlights ==
* Lots of work for KDB FIQ/NMI debugger, sent out v5, v6 and v7.
Switched NMI console driver to tty_port infrastructure, discussed the
ways to handle serial interrupts quiescing, made magic sequence
configurable. TTY patches got Alan Cox's ack.
* Looked into timer slack support for cgroups. While it's indeed
somewhat close to deferrable timers, it's still not exactly what we
need. Timer slack let us group wakeups, but there is still no way to
tell that the timer/poll/select itself should not cause wakeups. As
for deferrable timers, there are still no comments.
* Looked into ideas on early OOM detection from the userland. There are
a lot of inspirational thoughts on measuring memory stress levels,
and I definitely need to perform some tests. I'll prepare a detailed
answer to the ideas, but the most interesting part is that the ideas
are based on vmstat monitoring, which is important: if we're going to
use vmstat, we'll eventually get beaten by vmstat downsides:
slow/expensive updates (so the latency if the pre-OOM detection would
be equal to vmstat_update_time). And for Android low memory killer
use case, pre-OOM condition is important, but not the main problem:
the main "problem" is to monitor memory level when there is no stress
at all (but deferrable timers would solve this).
* Rebased and applied pstore/ftrace debugfs rework, this is now in
linux-next. Also reviewed/fixed FDT support for pstore, by Bryan
Freed @ Chromium.org.
Hi all,
This patch set implements a userland-side API for generic deferrable
timers, per linux/timer.h:
* A deferrable timer will work normally when the system is busy, but
* will not cause a CPU to come out of idle just to service it; instead,
* the timer will be serviced when the CPU eventually wakes up with a
* subsequent non-deferrable timer.
These timers are crucial for power saving, i.e. periodic tasks that want
to work in background when the system is under use, but don't want to
cause wakeups themselves.
The deferred timers are somewhat orthogonal to high-res external timers,
since the deferred timer is tied to the system load, not just to some
external decrementer source.
So, currently, the implementation has a HZ precision, and the maximum
interval is jiffies resolution (i.e. with HZ=1000, on 32 bit that would
be around max 49 days). Of course we can implement longer timeouts by
rearming the timer, although it probably wouldn't make much sense in
real world, so we keep it simple and just return E2BIG if we don't like
the interval.
Note that the code is still using time calculation that is done by the
hrtimer routines, so we pretty much reuse everything except for the
timer events themselves (i.e. we use calculation results of
hrtimer_forward_now() and hrtimer_expires_remaining(), but never start
the hrtimer). So the code path is pretty much the same for both hrtimers
and deferrable timers.
We will use the timers to periodically read /proc/vmstat without
forcibly waking up the system; but let's see, maybe there are other use
cases that might be interesting for PM folks.
Thanks!
Anton.
--
fs/timerfd.c | 87 +++++++++++++++++++++++++++++++++++++++++++------
include/linux/jiffies.h | 3 ++
include/linux/ktime.h | 3 +-
include/linux/timerfd.h | 4 ++-
kernel/time.c | 23 +++++++++++++
5 files changed, 108 insertions(+), 12 deletions(-)
== Linus Walleij linusw ==
=== Highlights ===
* Finally sent out a patch for SPARSE_IRQ on the Nomadik
and ux500. Sadly it seems that to get a kernel that isn't screaming
at you, transitioning to sparse IRQ can not be done unless you
move over to irqdomains, all dynamic IRQ numbers and device
tree at the same time. This puzzled me for a long time.
* Started to drill into a RCU lockup regression that is still in the
v3.6-rc series, but I'm uncertain if it only affects ux500 or if
it's a generic problem. John Stultz has seen the same message.
* Helped Benjamin with pre-review of a patch to genalloc.
* First review of Lee's patch set for HREF/MOP500 device tree
support for the parts that I understand.
* Fixed a smallish regression on the ks8695 watchdog that
came as fallout from the timer patches.
* Reviewed and merged various GPIO patches.
* Reviewed and merged various pinctrl patches. Currently
the Marvell patch set is taking up a lot of bandwidth but
starting to look really nice.
* Attended an internal workshop on kernel architecture that
stole away some three working days or so, but hey, we get
to influence the ST-Ericsson internal kernel.
=== Plans ===
* Ongoing work on sparse IRQ for Nomadik and Ux500.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
* N/A
Thanks,
Linus Walleij
Hi All,
I was trying booting 3.1.5 linaro kernel with wheezy debian filesystem on
pandaboard, but I found ethernet is not working.
On further check I found, there is no net interface under /sys/class/net/
except loopback. Though I have checked kernel config is having scm91x (and
scm911x) enabled.
I am really not sure about net driver details but I could not see these
drivers are getting probed at kernel boot.
Whereas, I have taken 3.2 kernel from kernel.org and it worked perfectly
fine and there is no change in defconfig file from 3.1.5.
I also observed the code structure for ethernet drivers are different
between 3.1.5 and 3.2 but driver files are same except
*ndo_set_rx_mode* has been implemented in 3.2 in place of *
ndo_set_multicast_list.*
any idea, about this problem? is it known???
Or is it something I am missing??
Thanks in advance
--
With Best Regards,
*Tirtha*
[image: Nico Nico animated GIF --]
Hi All,
I was trying booting 3.1.5 linaro kernel with wheezy debian filesystem on
pandaboard, but I found ethernet is not working.
On further check I found, there is no net interface under /sys/class/net/
except loopback. Though I have checked kernel config is having scm91x (and
scm911x) enabled.
I am really not sure about net driver details but I could not see these
drivers are getting probed at kernel boot.
Whereas, I have taken 3.2 kernel from kernel.org and it worked perfectly
fine and there is no change in defconfig file from 3.1.5.
I also observed the code structure for ethernet drivers are different
between 3.1.5 and 3.2 but driver files are same except
*ndo_set_rx_mode* has been implemented in 3.2 in place of *
ndo_set_multicast_list.*
any idea, about this problem? is it known???
Or is it something I am missing??
Thanks in advance
--
With Best Regards,
*Tirtha*
[image: Nico Nico animated GIF --]
Hi all,
Here is a new revision, mostly tty reworks. The new tty_port stuff is a
bliss: no more per-driver mutex, no more counting for open(),
well-separated initialization callbacks (I hope I got them right :-).
But since I now use a lot of new tty_port stuff, I had to rebase the
patch set on top of tty-next, so there's no point in cherry-picking
anymore.
So, in v6:
- Converted the NMI tty driver to use tty_port helpers, per Alan Cox's
suggestions;
- In uart's poll_init callback fixed a race, spotted by Alan;
- Use test_bit instead of touching port->flags directly;
These patches can be found in the following repo (based on tty-next):
git://git.infradead.org/users/cbou/linux-nmi-kdb.git master
Old changelogs and rationale for these patches can be found here:
v1-v5: http://lkml.org/lkml/2012/9/10/2
Thanks,
--
arch/arm/Kconfig | 19 ++
arch/arm/common/vic.c | 28 +++
arch/arm/include/asm/hardware/vic.h | 2 +
arch/arm/include/asm/kgdb.h | 8 +
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/entry-armv.S | 167 +------------
arch/arm/kernel/entry-header.S | 170 +++++++++++++
arch/arm/kernel/kgdb_fiq.c | 99 ++++++++
arch/arm/kernel/kgdb_fiq_entry.S | 87 +++++++
arch/arm/mach-versatile/Makefile | 1 +
arch/arm/mach-versatile/kgdb_fiq.c | 31 +++
drivers/tty/serial/Kconfig | 19 ++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/amba-pl011.c | 66 ++++-
drivers/tty/serial/kgdb_nmi.c | 391 ++++++++++++++++++++++++++++++
drivers/tty/serial/kgdboc.c | 16 ++
drivers/tty/serial/serial_core.c | 32 +++
include/linux/kdb.h | 29 ++-
include/linux/kgdb.h | 34 +++
include/linux/serial_core.h | 2 +
include/linux/tty_driver.h | 1 +
kernel/debug/debug_core.c | 36 ++-
kernel/debug/kdb/kdb_main.c | 29 +++
23 files changed, 1076 insertions(+), 193 deletions(-)
Hi all,
There wasn't much feedback on v4, the only comment was from Brian
Swetland concerning async console (I explained how we deal with it).
It would be really great if the core functionality could make it into
v3.7. Which raises the question: if the patches are OK, who should take
them? They touch 3 subsystems: KGDB, TTY and ARM.
Taking the patches via -mm or TTY trees would be the easiest way as this
way we'll avoid having to deal with conflicts (see changelog*). But
merging via ARM or KDB will also work.
Russell, Jason, naively presuming that the ARM & KDB patches are OK,
would you be willing to ack ARM/KDB patches? Or, in case if it goes via
KDB or ARM tree, we'll need acks from Greg and Alan on tty patches...
Anyways, here goes the shiny v5:
- *I took two amba-pl1011 patches from Greg's tty tree. This is needed
to ease Stephen Rothwell's life in case if this goes into -next via
non-tty or non-mm tree.
The problem is that we now touch the same lines as tty tree, and
conflicts are not trivial. But by taking the two patches and rebasing
my work on top, we turn the conflicts into trivial ones.
- There were some concerns that '$3#33' might be not lengthy enough
(i.e., it's a bit shorter than '\nreboot\n'). Reading 2GB of
/dev/urandom couldn't find $3#33 sequence, but I made the magic phrase
configurable via kgdb_nmi.magic kernel command line option, just in
case.
These patches can be found in the following repo:
git://git.infradead.org/users/cbou/linux-nmi-kdb.git master
Boilerplate:
These patches introduce KGDB FIQ debugger support. The idea (and some
code, of course) comes from Google's FIQ debugger[2]. There are some
differences (mostly implementation details, feature-wise they're almost
equivalent, or can be made equivalent, if desired).
The FIQ debugger is a facility that can be used to debug situations when
the kernel stuck in uninterruptable sections, e.g. the kernel infinitely
loops or deadlocked in an interrupt or with interrupts disabled. On some
development boards there is even a special NMI button, which is very
useful for debugging weird kernel hangs.
And FIQ is basically an NMI, it has a higher priority than IRQs, and
upon IRQ exception FIQs are not disabled. It is still possible to
disable FIQs (as well as some "NMIs" on other architectures), but via
special means.
So, here FIQs and NMIs are synonyms, but in the code I use NMI term for
arch-independent code, and FIQs for ARM code.
A few years ago KDB wasn't yet ready for production, or even not
well-known, so originally Google implemented its own FIQ debugger that
included its own shell, ring-buffer, commands, dumping, backtracing
logic and whatnot. This is very much like PowerPC's xmon
(arch/powerpc/xmon), except that xmon was there for a decade, so it even
predates KDB.
Anyway, nowadays KGDB/KDB is the cross-platform debugger, and the only
feature that was missing is NMI handling. This is now fixed for ARM.
There are a few differences comparing to the original (Google's) FIQ
debugger:
- Doing stuff in FIQ context is dangerous, as there we are not allowed
to cause aborts or faults. In the original FIQ debugger there was a
"signal" software-induced interrupt, upon exit from FIQ it would fire,
and we would continue to execute "dangerous" commands from there.
In KGDB/KDB we don't use signal interrupts. We can do easier: set up a
breakpoint, continue, and you'll trap into KGDB again in a safe
context.
It works for most cases, but I can imagine cases when you can't set up
a breakpoint. For these cases we'd better introduce a KDB command
"exit_nmi", that will rise the SW IRQ, after which we're allowed to do
anything.
- KGDB/KDB FIQ debugger shell is synchronous. In Google's version you
could have a dedicated shell always running in the FIQ context, so
when you type something on a serial line, you won't actually cause any
debugging actions, FIQ would save the characters in its own buffer and
continue execution normally. But when you hit return key after the
command, then the command is executed.
In KGDB/KDB FIQ debugger it is different. Once you enter KGDB, the
kernel will stop until you instruct it to continue.
This might look as a drastic change, but it is not. There is actually
no difference whether you have sync or async shell, or at least I
couldn't find any use-case where this would matter at all. Anyways, it
is still possible to do async shell in KDB, just don't see any need
for this.
- Original FIQ debugger used a custom FIQ vector handling code, w/ a lot
of logic in it. In this approach I'm using the fact that FIQs are
basically IRQs, except that we there are a bit more registers banked,
and we can actually trap from the IRQ context.
But this all does not prevent us from using a simple jump-table based
approach as used in the generic ARM entry code. So, here I just reuse
the generic approach.
Note that I test the code on a modelled ARM machine (QEMU Versatile), so
there might be some issues on a real HW, but it works in QEMU tho. :-)
Assuming you have QEMU >= 1.1.0, you can easily play with the code using
ARM/versatile defconfig and command like this:
qemu-system-arm -nographic -machine versatilepb -kernel
linux/arch/arm/boot/zImage -append "console=ttyAMA0 kgdboc=ttyAMA0
kgdb_fiq.enable=1"
Thanks,
--
arch/arm/Kconfig | 19 ++
arch/arm/common/vic.c | 28 +++
arch/arm/include/asm/hardware/vic.h | 2 +
arch/arm/include/asm/kgdb.h | 8 +
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/entry-armv.S | 167 +-------------
arch/arm/kernel/entry-header.S | 170 +++++++++++++++
arch/arm/kernel/kgdb_fiq.c | 99 +++++++++
arch/arm/kernel/kgdb_fiq_entry.S | 87 ++++++++
arch/arm/mach-versatile/Makefile | 1 +
arch/arm/mach-versatile/kgdb_fiq.c | 31 +++
drivers/tty/serial/Kconfig | 19 ++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/amba-pl010.c | 15 +-
drivers/tty/serial/amba-pl011.c | 106 +++++----
drivers/tty/serial/kgdb_nmi.c | 352 ++++++++++++++++++++++++++++++
drivers/tty/serial/kgdboc.c | 16 ++
drivers/tty/serial/serial_core.c | 30 +++
include/linux/kdb.h | 29 +--
include/linux/kgdb.h | 34 +++
include/linux/serial_core.h | 2 +
include/linux/tty_driver.h | 1 +
kernel/debug/debug_core.c | 36 ++-
kernel/debug/kdb/kdb_main.c | 29 +++
24 files changed, 1051 insertions(+), 232 deletions(-)
In v4:
- Implemented kgdb_nmi serial driver, it provides 'nmi_console' KDB
command. With the driver we can use our debugger port as a normal
console, except that we can always get back to the debugger using the
magic sequence. Note that I still somewhat reluctant to introduce
software-raised interrupts, as they're arch-specific and not always
possible. So today the driver uses a tasklet, it should be pretty
cheap: we're checking for the input on timer interrupts, but we don't
cause needless wakeups. The pro of this is that it works everywhere
(but arches still have an option to optimize things, of course);
- Two new patches added to propagate init_poll() callbacks from tty to
uart drivers. As a side-effect, a long-standing bug fixed in
amba-pl1011 driver;
- Dropped patch 'Get rid of .LCcralign local label';
- Some more fixes in SVC return path. Now it seems rock-solid;
In v3:
- Per Colin Cross suggestion, added a way to release a debug console for
normal use. This is done via 'disable_nmi' command (in the original
FIQ debugger it was 'console' command). For this I added a new
callback in the tty ops, and serial drivers have to provide a way to
clear its interrupts. The patch 'tty/serial/kgdboc: Add and wire up
clear_irqs callback' explains the concept in details.
- Made the debug entry prompt more shell-like;
- A new knocking mode '-1'. It disables the feature altogether, and thus
makes it possible to hook KDB entry to a dedicated button.
- The code was rebased on 'v3.5 + kdb kiosk'[1] patches;
In v2:
- Per Colin Cross' suggestion, we should not enter the debugger on any
received byte (this might be a problem when there's a noise on the
serial line). So there is now an additional patch that implements
"knocking" to the KDB (either via $3#33 command or return key, this is
configurable);
- Reworked {enable,select}_fiq/is_fiq callbacks, now multi-mach kernels
should not be a problem;
- For versatile machines there are run-time checks for proper UART port
(kernel will scream aloud if out of range port is specified);
- Added some __init annotations;
- Since not every architecture defines FIQ_START, we can't just blindly
select CONFIG_FIQ symbol. So ARCH_MIGHT_HAVE_FIQ introduced;
- Add !THUMB2_KERNEL dependency for KGDB_FIQ, we don't support Thumb2
kernels;
- New patch that is used to get rid of LCcralign label in alignment_trap
macro.
[1] https://lkml.org/lkml/2012/7/26/260
[2] Original Google's FIQ debugger, fiq_* files:
http://android.git.linaro.org/gitweb?p=kernel/common.git;a=tree;f=arch/arm/…
And board support as an example of using it:
http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=commitdiff;h=461cb80c1…
=== Highlights ===
Get LTP-DDT Test Working in LAVA:
1.Investigation on LTP-DDT, how to build it, run it, configure it :
Completed
2.Get ltp-ddt running successfully on a snowball locally(Limited
Testcases): Completed
3.Create a wrapper for LTP-DDT in lava-test: Started
=== Plans ===
Add ltp-ddt to appropriate kernel and/or daily runs as needed.
Documentation for Driver test cases.
Thanks,
Appala
== Deepak Saxena <dsaxena> ==
=== Highlights ===
* Returned from two weeks of vacation, so not much to report here
=== Plans ===
* Catch up with all email
* Brainstorm with Jakub on kernel project management
* Roadmap card review with OPSCOM
* Start planning for Connect
* Usual 1:1's/meetings
=== Issues ===
=== Travel/Time Off ===
* Travelling to NYC for 1 week, Sept 22nd - 28th, will be working
half/three-fourth time.
(This may get cancelled)
* Cambridge, UK first week of October for AArch64 discussion/bring up
* Copenhagen Connect
=== omarrmz ===
* ARMv8t
- Compile aarch64 binutils. DONE
- Need to recompile the toolchain using the aarch64 binutils. DONE
- Compile the aarch64 kernel with aarch64 toolchain: DONE.
- Plain config generated through menuconfig.
* Mailbox runtime OFF mode: DONE.
- Tested on OMAP3 and OMAP4
- Needs to be submitted to LO.
* Consolidate iommu changes into original series: IN PROGRESS.
* Get some time to do an omap mailbox cleanup: NO UPDATE.
- Low priority.
* Review patches from Laurent on tidspbridge: IN PROGRESS.
- Reviewed 4 fo 13 patches so far.
- Review a separate bug he is reporting.
=== Plans ===
* Continue to ping Paul for my reset patches in the mailing list.
* Keep on looking at aarch64 patches.
Regards,
Omar
=== Highlights ===
* Sent v4 generic cpufreq driver cpufreq-cpu0. Rafael queued it for
3.7 for linux-pm tree.
* Running into a sleep-in-atomic warning with cpufreq-cpu0 driver.
It turns out that smp_twd driver calls clk_get_rate which holds
a mutex in interrupt context. Dug and sent out a patch from Mike
which could be a fix for review.
* Mike applied patch of_clk_src_onecell_get() which is required by
imx/mxs DT clk lookup.
* Sent a patch on kernel/sys.c to call disable_nonboot_cpus in
kernel_restart, which can help one reboot issue seen on imx6q.
Andrew had it applied on -mm tree.
* Reviewed patch series "Add device tree support for on-chip SRAM"
from Philipp Zabel.
* Reviewed a series adding device tree support for imx pwm driver
from Sascha.
* Reviewed a series from Dong, adding syscon driver based on regmap
for general registers access.
--
Regards,
Shawn