* [PATCH 2/6] ARM: dts: da850: add a node for the LCD controller
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
From: Karl Beldan <kbeldan@baylibre.com>
Add a disabled LCDC node to be reused in device trees including
da850.dtsi for boards equipped with tilcdc enabled.
Signed-off-by: Karl Beldan <kbeldan@baylibre.com>
[Bartosz: added the commit description]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/boot/dts/da850.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index f79e1b9..9f39296 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -399,6 +399,14 @@
<&edma0 0 1>;
dma-names = "tx", "rx";
};
+
+ lcdc: lcdc at 213000 {
+ compatible = "ti,am33xx-tilcdc";
+ reg = <0x213000 0x1000>;
+ interrupt-parent = <&intc>;
+ interrupts = <52>;
+ status = "disabled";
+ };
};
aemif: aemif at 68000000 {
compatible = "ti,da850-aemif";
--
2.7.4
^ permalink raw reply related
* [PATCH 1/6] ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for lcdc
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
From: Karl Beldan <kbeldan@baylibre.com>
This is required for tilcdc to be able to acquire a functional clock.
Signed-off-by: Karl Beldan <kbeldan@baylibre.com>
[Bartosz: added the commit description]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/mach-davinci/da8xx-dt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index c9f7e92..f8ecc02 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -38,6 +38,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
NULL),
OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL),
OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL),
+ OF_DEV_AUXDATA("ti,am33xx-tilcdc", 0x01e13000, "da8xx_lcdc.0", NULL),
{}
};
--
2.7.4
^ permalink raw reply related
* [PATCH 0/6] ARM: davinci: da850-lcdk: add support for tilcdc
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
This series enables the tilcdc support for da850-lcdk. Besides the
device tree changes it contains some tweaks needed to make it work.
Tested with a da850-lcdk board with an LCD display connected over
VGA with the following modes:
modetest -M tilcdc -s 26:800x600 at RG16
modetest -M tilcdc -s 26:1024x768 at RG16
Rebased on top of some necessary changes in the tilcdc drm driver.
These changes will go upstream through the drm tree.
Bartosz Golaszewski (3):
ARM: dts: da850-lcdk: add support for 1024x768 resolution
ARM: davinci: enable the LCDC DRM driver in defconfig
ARM: da850: adjust memory settings for tilcdc
Karl Beldan (3):
ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for lcdc
ARM: dts: da850: add a node for the LCD controller
ARM: dts: da850-lcdk: enable the LCD controller
arch/arm/boot/dts/da850-lcdk.dts | 71 ++++++++++++++++++++++++++++++
arch/arm/boot/dts/da850.dtsi | 8 ++++
arch/arm/configs/davinci_all_defconfig | 2 +
arch/arm/mach-davinci/da8xx-dt.c | 44 ++++++++++++++++++
arch/arm/mach-davinci/include/mach/da8xx.h | 4 ++
5 files changed, 129 insertions(+)
--
2.7.4
^ permalink raw reply
* [PATCH] KVM: arm/arm64: Fix occasional warning from the timer work function
From: Christoffer Dall @ 2016-09-29 16:26 UTC (permalink / raw)
To: linux-arm-kernel
When a VCPU blocks (WFI) we arm (the verb, not the architecture) any
timers scheduled to expire in the future to wake up the vcpu thread when
appropriate. Because such as wake up involves a vcpu kick, and the
timer expire function can get called from interrupt context, and the
kick may sleep, we have to schedule the kick in the work function.
The work function currently has a warning that gets raised if it turns
out that the timer shouldn't fire when it's run, which was added because
the idea was that then the work should never have been cancelled.
However, the work function can run long after a vcpu thread gets
scheduled again and the timer conditions can have changed as a result of
running the vcpu, which would raise this warning. This can happen on a
busy system, for example.
The solution is to simply not raise this warning, because a kick is
never harmful. Also, cancel any scheduled work when the vcpu thread is
running anyway, since there is no need to run the work function anymore.
Reported-by: Matthias Brugger <mbrugger@suse.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
virt/kvm/arm/arch_timer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 27a1f63..e136902 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -91,8 +91,6 @@ static void kvm_timer_inject_irq_work(struct work_struct *work)
vcpu = container_of(work, struct kvm_vcpu, arch.timer_cpu.expired);
vcpu->arch.timer_cpu.armed = false;
- WARN_ON(!kvm_timer_should_fire(vcpu));
-
/*
* If the vcpu is blocked we want to wake it up so that it will see
* the timer has expired when entering the guest.
@@ -240,6 +238,9 @@ void kvm_timer_unschedule(struct kvm_vcpu *vcpu)
{
struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
timer_disarm(timer);
+
+ /* No need for another thread to kick us if we're already running */
+ cancel_work_sync(&timer->expired);
}
/**
--
2.9.0
^ permalink raw reply related
* [PATCH] clocksource: arm_arch_timer: Don't assume clock runs in suspend
From: Marc Zyngier @ 2016-09-29 16:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160928012309.GA29518@localhost>
On Tue, 27 Sep 2016 18:23:11 -0700
Brian Norris <briannorris@chromium.org> wrote:
Hi Brian,
> Hi Marc,
>
> Thanks again for the help. I was checking with Rockchip on the details.
>
> On Tue, Sep 20, 2016 at 08:47:07AM +0100, Marc Zyngier wrote:
> > The counter is allowed to be clocked at a different rate, as long as it
> > is incremented by the frequency ratio on each tick of the new frequency.
> > In your case, the counter should increment by 750 on each tick of the
> > 32kHz clock. If the rk3399 implementation doesn't do this, then this is
> > a bug, and we need a quirk to work around it.
>
> I had hope that we could find a switch that would do the above for
> rk3399, since other parts of the system (e.g., the PMU itself) support
> switching from the 24MHz to 32KHz clock, but Rockchip confirmed that it
> is indeed a HW quirk that the arch timer's counter does not support
> clocking out ticks based on the 32KHz clock. So I'm planning to send a
> v2 that adds a "arm,no-tick-in-suspend" property.
Fair enough.
>
> <Begin side note>
> rk3288 (ARMv7 system widely used for our Chromebooks) has the same
> issue, except the kernel we're using for production (based on v3.14)
> doesn't have the following commit, which stopped utilizing the RTC:
>
> commit 0fa88cb4b82b5cf7429bc1cef9db006ca035754e
> Author: Xunlei Pang <pang.xunlei@linaro.org>
> Date: Wed Apr 1 20:34:38 2015 -0700
>
> time, drivers/rtc: Don't bother with rtc_resume() for the nonstop clocksource
>
> And any mainline testing on rk3288 doesn't see the problem, because
> mainline doesn't support its lowest-power sleep modes well enough (see
> ROCKCHIP_ARM_OFF_LOGIC_DEEP in arch/arm/mach-rockchip/pm.c).
Arghh... So even my favourite Chromebook (from which I'm typing this
email) is affected? Not very nice...
> <End side note>
>
> > Note that such a quirk will have some other impacts, such as the
> > gettimeofday implementation in the VDSO (which relies on the counter
> > making forward progress). There could be other issues in the timer
> > subsystem as well... This doesn't look like a pleasant thing to fix.
>
> How sure are you of these problems? I'm a bit new to the kernel
> timekeeping subsystem, but doesn't this kind of code already have to
> handle time adjustments like this when reprogramming the system time
> (settimeofday())? And might we be covered for the suspend/resume case
> when we allow the kernel to fall back to the RTC instead, which adjusts
> the sleep delta with timekeeping_inject_sleeptime64()? And (weaker
> evidence here) we haven't seen problems on rk3288 so far, at least
> without the above referenced rtc commit 0fa88cb4b82. But admittedly
> there are some differences between arch/{arm,arm64}/.
The 32bit port only gained a VDSO recently (3.14 doesn't have it), and
mainline doesn't switch the counter off, as you noted above.
As for the 64bit kernel, it would be interesting to verify that on
resume, the VDSO does return the right (corrected) value, and not
something stale.
Thanks,
M.
--
Jazz is not dead. It just smells funny.
^ permalink raw reply
* [PATCH] dmaengine: pxa_dma: remove unused function
From: Robert Jarzmik @ 2016-09-29 15:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475154561-12327-1-git-send-email-baoyou.xie@linaro.org>
Baoyou Xie <baoyou.xie@linaro.org> writes:
> We get 1 warning when building kernel with W=1:
> drivers/dma/pxa_dma.c:1525:5: warning: no previous prototype for 'pxad_toggle_reserved_channel' [-Wmissing-prototypes]
>
> In fact, this function is called by no one, so this patch removes it.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Okay, yet I'd rather have a revert of commit c91134d91944 ("dmaengine: pxa_dma:
add support for legacy transition") , with the commit message saying:
The conversion of the pxa architecture is now finished for all drivers, so this
functions has fullfilled its purpose and can now be removed.
I have a similar patch in my internal tree, but yours can very well go in, as
long as it is a revert with a statement explaining why it is necessary now and
not before.
Cheers.
--
Robert
^ permalink raw reply
* [PATCH] arm64: KVM: Take S1 walks into account when determining S2 write faults
From: Marc Zyngier @ 2016-09-29 15:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475149021-13288-1-git-send-email-will.deacon@arm.com>
On Thu, 29 Sep 2016 12:37:01 +0100
Will Deacon <will.deacon@arm.com> wrote:
> The WnR bit in the HSR/ESR_EL2 indicates whether a data abort was
> generated by a read or a write instruction. For stage 2 data aborts
> generated by a stage 1 translation table walk (i.e. the actual page
> table access faults at EL2), the WnR bit therefore reports whether the
> instruction generating the walk was a load or a store, *not* whether the
> page table walker was reading or writing the entry.
>
> For page tables marked as read-only at stage 2 (e.g. due to KSM merging
> them with the tables from another guest), this could result in livelock,
> where a page table walk generated by a load instruction attempts to
> set the access flag in the stage 1 descriptor, but fails to trigger
> CoW in the host since only a read fault is reported.
>
> This patch modifies the arm64 kvm_vcpu_dabt_iswrite function to
> take into account stage 2 faults in stage 1 walks. Since DBM cannot be
> disabled at EL2 for CPUs that implement it, we assume that these faults
> are always causes by writes, avoiding the livelock situation at the
> expense of occasional, spurious CoWs.
>
> We could, in theory, do a bit better by checking the guest TCR
> configuration and inspecting the page table to see why the PTE faulted.
> However, I doubt this is measurable in practice, and the threat of
> livelock is real.
>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Cc: Julien Grall <julien.grall@arm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm64/include/asm/kvm_emulate.h | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
> index 4cdeae3b17c6..948a9a8a9297 100644
> --- a/arch/arm64/include/asm/kvm_emulate.h
> +++ b/arch/arm64/include/asm/kvm_emulate.h
> @@ -167,11 +167,6 @@ static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);
> }
>
> -static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
> -{
> - return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR);
> -}
> -
> static inline bool kvm_vcpu_dabt_issext(const struct kvm_vcpu *vcpu)
> {
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SSE);
> @@ -192,6 +187,12 @@ static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);
> }
>
> +static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
> +{
> + return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) ||
> + kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */
> +}
> +
> static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu)
> {
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Thanks,
M.
--
Jazz is not dead. It just smells funny.
^ permalink raw reply
* [PATCH 0/3] Support userspace irqchip with arch timers
From: Alexander Graf @ 2016-09-29 15:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160927190806.22988-1-christoffer.dall@linaro.org>
On 09/27/2016 09:08 PM, Christoffer Dall wrote:
> Hi Alex,
>
> Marc and I have been looking at this during Linaro connect and have
> slightly reworked your patch into this small series.
>
> It would be good if you could have a look at it and test it out.
Tested-by: Alexander Graf <agraf@suse.de>
Works fine so far :).
> I've tested it with your QEMU, and it works for UP, but secondary CPUs
> fail to come up, and it looks like the kernel never gets an IPI for
> those CPUs from userspace. Any chance you're willing to take a look at
> that?
I can try, but not very soon. I doubt it's something fundamental - we
probably just don't synchronize kvm/qemu state properly on IPIs (read: a
QEMU bug).
> Also, let me know if the split of your patch with preserving your
> authorship is ok with you.
Works for me :)
Alex
^ permalink raw reply
* [PATCH v2] arm64: make rpm failed due to incorrect path to Image.gz
From: Vadim Lomovtsev @ 2016-09-29 14:46 UTC (permalink / raw)
To: linux-arm-kernel
The "make rpm" and "make rpm-pkg" commands for arm64 platform
are broken due to rpmbuild couldn't find Image.gz file at
default location (which is kernel src root):
cp: cannot stat 'Image.gz': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.ocFBmP (%install)
While the correct path to arm64 kernel image file
is "arch/arm64/boot/Image.gz".
The exact file name (Image.gz) is stored at KBUILD_IMAGE variable
and read by rpmbuild with "make image_name" command at
install phase after kernel build is complete.
Accordingly to Michal's Marek comment the KBUILD_IMAGE
variable has to be set to point to actual file.
Since the KBUILD_IMAGE variable is used in general cases of
build we need to prevent other build types breakage by changing it.
The solution is to add to arch/arm64/Makefie extra target "image_name"
with dependency "KBUILD_IMAGE:=<proper path to Image.gz file>".
Thus it will allow to set proper path to Image.gz file only for
the "image_name" build target and this exact value will be picked up
while rpm build install phase.
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
arch/arm64/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index ab51aed..09926d3 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -101,6 +101,8 @@ all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
boot := arch/arm64/boot
+image_name: KBUILD_IMAGE :=$(boot)/$(KBUILD_IMAGE)
+
Image: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
--
1.8.3.1
^ permalink raw reply related
* [PULL 00/50] KVM/ARM Changes for v4.9
From: Radim Krčmář @ 2016-09-29 14:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160927180558.14699-1-christoffer.dall@linaro.org>
2016-09-27 20:05+0200, Christoffer Dall:
> Hi Paolo and Radim,
>
> Here are the KVM/ARM Changes for v4.9. They include:
>
> - Various cleanups and removal of redundant code
> - Two important fixes for not using an in-kernel irqchip
> - A bit of optimizations
> - Handle SError exceptions and present them to guests if appropriate
> - Proxying of GICV access at EL2 if guest mappings are unsafe
> - GICv3 on AArch32 on ARMv8
> - Preparations for GICv3 save/restore, including ABI docs
Pulled to kvm/next, thanks.
^ permalink raw reply
* [PATCH] arm64: make rpm failed due to incorrect path to Image.gz
From: Lomovtsev, Vadim @ 2016-09-29 14:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159543-2519-1-git-send-email-Vadim.Lomovtsev@caviumnetworks.com>
The mcommit message is not correct.
Sorry guys, please ignore this.
Vadim.
________________________________________
From: Lomovtsev, Vadim
Sent: Thursday, September 29, 2016 5:32:23 PM
To: linux-arm-kernel at lists.infradead.org; mmarek at suse.com
Cc: Lomovtsev, Vadim
Subject: [PATCH] arm64: make rpm failed due to incorrect path to Image.gz
The "make rpm" and "make rpm-pkg" commands for arm64 platform are broken
due to rpmbuild couldn't find Image.gz file at default location (which
is kernel src root):
cp: cannot stat 'Image.gz': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.ocFBmP (%install)
While the correct path to arm64 kernel image file
is "arch/arm64/boot/Image.gz".
The exact file name (Image.gz) is stored at KBUILD_IMAGE variable
and read by rpmbuild with "make image_name" command at
install phase after kernel build is complete.
Accordingly to Michal's Marek comment it is necesary
that the KBUILD_IMAGE variable value has to be set
accordingly to point to actual file and thus fix that issue.
Since the KBUILD_IMAGE variable is used in general cases of
build we need to prevent other build types breakage by changing it.
The solution is to add to arch/arm64/Makefie extra target "image_name"
with dependency "KBUILD_IMAGE:=<proper path to Image.gz file>".
Thus it will allow to set proper path to Image.gz file only for
the "image_name" build target and this exact value will be picked up
while rpm build install phase.
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
arch/arm64/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index ab51aed..09926d3 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -101,6 +101,8 @@ all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
boot := arch/arm64/boot
+image_name: KBUILD_IMAGE :=$(boot)/$(KBUILD_IMAGE)
+
Image: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
--
1.8.3.1
^ permalink raw reply related
* [PATCH 08/27] perf evsel: Add support for address filters
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159756-21326-1-git-send-email-acme@kernel.org>
From: Mathieu Poirier <mathieu.poirier@linaro.org>
This patch makes it possible to use the current filter framework with
address filters. That way address filters for HW tracers such as
CoreSight and Intel PT can be communicated to the kernel drivers.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel at lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-4-git-send-email-mathieu.poirier at linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evsel.c | 5 +++++
tools/perf/util/evsel.h | 2 ++
tools/perf/util/parse-events.c | 39 ++++++++++++++++++++++++++++++++++-----
3 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 3b4e7c452e43..380e84c3af3d 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1067,6 +1067,11 @@ int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
}
+int perf_evsel__append_addr_filter(struct perf_evsel *evsel, const char *filter)
+{
+ return perf_evsel__append_filter(evsel, "%s,%s", filter);
+}
+
int perf_evsel__enable(struct perf_evsel *evsel)
{
int nthreads = thread_map__nr(evsel->threads);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 1f8c48f87f7d..b1503b0ecdff 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -236,6 +236,8 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
+int perf_evsel__append_addr_filter(struct perf_evsel *evsel,
+ const char *filter);
int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
const char *filter);
int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 16bf09cc3e8d..33546c3ac1fe 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1760,20 +1760,49 @@ foreach_evsel_in_last_glob(struct perf_evlist *evlist,
static int set_filter(struct perf_evsel *evsel, const void *arg)
{
const char *str = arg;
+ bool found = false;
+ int nr_addr_filters = 0;
+ struct perf_pmu *pmu = NULL;
- if (evsel == NULL || evsel->attr.type != PERF_TYPE_TRACEPOINT) {
- fprintf(stderr,
- "--filter option should follow a -e tracepoint option\n");
- return -1;
+ if (evsel == NULL)
+ goto err;
+
+ if (evsel->attr.type == PERF_TYPE_TRACEPOINT) {
+ if (perf_evsel__append_tp_filter(evsel, str) < 0) {
+ fprintf(stderr,
+ "not enough memory to hold filter string\n");
+ return -1;
+ }
+
+ return 0;
}
- if (perf_evsel__append_tp_filter(evsel, str) < 0) {
+ while ((pmu = perf_pmu__scan(pmu)) != NULL)
+ if (pmu->type == evsel->attr.type) {
+ found = true;
+ break;
+ }
+
+ if (found)
+ perf_pmu__scan_file(pmu, "nr_addr_filters",
+ "%d", &nr_addr_filters);
+
+ if (!nr_addr_filters)
+ goto err;
+
+ if (perf_evsel__append_addr_filter(evsel, str) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
}
return 0;
+
+err:
+ fprintf(stderr,
+ "--filter option should follow a -e tracepoint or HW tracer option\n");
+
+ return -1;
}
int parse_filter(const struct option *opt, const char *str,
--
2.7.4
^ permalink raw reply related
* [PATCH 07/27] perf evsel: New tracepoint specific function
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159756-21326-1-git-send-email-acme@kernel.org>
From: Mathieu Poirier <mathieu.poirier@linaro.org>
Making function perf_evsel__append_filter() static and introducing a new
tracepoint specific function to append filters. That way we eliminate
redundant code and avoid formatting mistake.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel at lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-3-git-send-email-mathieu.poirier at linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 7 +++----
tools/perf/util/evsel.c | 9 +++++++--
tools/perf/util/evsel.h | 3 +--
tools/perf/util/parse-events.c | 4 ++--
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index e04ba9d852d4..c298bd3e1d90 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2151,11 +2151,10 @@ static int trace__set_ev_qualifier_filter(struct trace *trace)
if (filter == NULL)
goto out_enomem;
- if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter,
- "(%s) && (%s)", filter)) {
+ if (!perf_evsel__append_tp_filter(trace->syscalls.events.sys_enter,
+ filter)) {
sys_exit = trace->syscalls.events.sys_exit;
- err = perf_evsel__append_filter(sys_exit,
- "(%s) && (%s)", filter);
+ err = perf_evsel__append_tp_filter(sys_exit, filter);
}
free(filter);
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 4f327b522e5c..3b4e7c452e43 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1045,8 +1045,8 @@ int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
return -1;
}
-int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *fmt, const char *filter)
+static int perf_evsel__append_filter(struct perf_evsel *evsel,
+ const char *fmt, const char *filter)
{
char *new_filter;
@@ -1062,6 +1062,11 @@ int perf_evsel__append_filter(struct perf_evsel *evsel,
return -1;
}
+int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
+{
+ return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
+}
+
int perf_evsel__enable(struct perf_evsel *evsel)
{
int nthreads = thread_map__nr(evsel->threads);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 7ef960298b3d..1f8c48f87f7d 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -235,8 +235,7 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
bool use_sample_identifier);
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
-int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *fmt, const char *filter);
+int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
const char *filter);
int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index b14784c765eb..16bf09cc3e8d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1767,7 +1767,7 @@ static int set_filter(struct perf_evsel *evsel, const void *arg)
return -1;
}
- if (perf_evsel__append_filter(evsel, "(%s) && (%s)", str) < 0) {
+ if (perf_evsel__append_tp_filter(evsel, str) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
@@ -1798,7 +1798,7 @@ static int add_exclude_perf_filter(struct perf_evsel *evsel,
snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid());
- if (perf_evsel__append_filter(evsel, "(%s) && (%s)", new_filter) < 0) {
+ if (perf_evsel__append_tp_filter(evsel, new_filter) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
--
2.7.4
^ permalink raw reply related
* [PATCH 06/27] perf tools: Make perf_evsel__append_filter() generic
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159756-21326-1-git-send-email-acme@kernel.org>
From: Mathieu Poirier <mathieu.poirier@linaro.org>
By making function perf_evsel__append_filter() take a format rather than
an operator it is possible to reuse the code for other purposes (ex.
Intel PT and CoreSight) than tracepoints.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel at lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-2-git-send-email-mathieu.poirier at linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 9 +++++++--
tools/perf/util/evsel.c | 4 ++--
tools/perf/util/evsel.h | 2 +-
tools/perf/util/parse-events.c | 4 ++--
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 1a54ce9d101c..e04ba9d852d4 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2143,6 +2143,7 @@ out_delete_sys_enter:
static int trace__set_ev_qualifier_filter(struct trace *trace)
{
int err = -1;
+ struct perf_evsel *sys_exit;
char *filter = asprintf_expr_inout_ints("id", !trace->not_ev_qualifier,
trace->ev_qualifier_ids.nr,
trace->ev_qualifier_ids.entries);
@@ -2150,8 +2151,12 @@ static int trace__set_ev_qualifier_filter(struct trace *trace)
if (filter == NULL)
goto out_enomem;
- if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter, "&&", filter))
- err = perf_evsel__append_filter(trace->syscalls.events.sys_exit, "&&", filter);
+ if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter,
+ "(%s) && (%s)", filter)) {
+ sys_exit = trace->syscalls.events.sys_exit;
+ err = perf_evsel__append_filter(sys_exit,
+ "(%s) && (%s)", filter);
+ }
free(filter);
out:
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f3225a2e6eee..4f327b522e5c 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1046,14 +1046,14 @@ int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
}
int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *op, const char *filter)
+ const char *fmt, const char *filter)
{
char *new_filter;
if (evsel->filter == NULL)
return perf_evsel__set_filter(evsel, filter);
- if (asprintf(&new_filter,"(%s) %s (%s)", evsel->filter, op, filter) > 0) {
+ if (asprintf(&new_filter, fmt, evsel->filter, filter) > 0) {
free(evsel->filter);
evsel->filter = new_filter;
return 0;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 323806082c58..7ef960298b3d 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -236,7 +236,7 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *op, const char *filter);
+ const char *fmt, const char *filter);
int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
const char *filter);
int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2eb8b1ed4cc8..b14784c765eb 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1767,7 +1767,7 @@ static int set_filter(struct perf_evsel *evsel, const void *arg)
return -1;
}
- if (perf_evsel__append_filter(evsel, "&&", str) < 0) {
+ if (perf_evsel__append_filter(evsel, "(%s) && (%s)", str) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
@@ -1798,7 +1798,7 @@ static int add_exclude_perf_filter(struct perf_evsel *evsel,
snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid());
- if (perf_evsel__append_filter(evsel, "&&", new_filter) < 0) {
+ if (perf_evsel__append_filter(evsel, "(%s) && (%s)", new_filter) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
--
2.7.4
^ permalink raw reply related
* [GIT PULL 00/27] perf/core improvements and fixes
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
Hi Ingo,
Please consider pulling, more to come soon,
- Arnaldo
Build and test results at the end of this message.
The following changes since commit 6b652de2b27c0a4020ce0e8f277e782b6af76096:
Merge tag 'perf-core-for-mingo-20160922' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-09-23 07:21:38 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160929
for you to fetch changes up to d18019a53a07e009899ff6b8dc5ec30f249360d9:
perf tests: Add dwarf unwind test for powerpc (2016-09-29 11:18:21 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
-------------
New features:
- Add support for using symbols in address filters with Intel PT and ARM
CoreSight (hardware assisted tracing facilities) (Adrian Hunter, Mathieu Poirier)
Fixes:
- Fix MMAP event synthesis for pre-existing threads when no hugetlbfs
mount is in place (Adrian Hunter)
- Don't ignore kernel idle symbols in 'perf script' (Adrian Hunter)
- Assorted Intel PT fixes (Adrian Hunter)
Improvements:
- Fix handling of C++ symbols in 'perf probe' (Masami Hiramatsu)
- Beautify sched_[gs]et_attr return value in 'perf trace' (Arnaldo Carvalho de Melo)
Infrastructure:
---------------
New features:
- Add dwarf unwind 'perf test' for powerpc (Ravi Bangoria)
Fixes:
- Fix error paths in 'perf record' (Adrian Hunter)
Documentation:
- Update documentation info about quipper, a C++ parser for converting
to/from perf.data/chromium profiling format (Simon Que)
Build Fixes:
Fix building in 32 bit platform with libbabeltrace (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (16):
perf record: Fix documentation 'event_sources' -> 'event_source'
perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
perf script: Fix vanished idle symbols
perf record: Rename label 'out_symbol_exit'
perf record: Fix error paths
perf symbols: Add dso__last_symbol()
perf record: Add support for using symbols in address filters
perf probe: Increase debug level of SDT debug messages
perf intel-pt: Fix snapshot overlap detection decoder errors
perf intel-pt: Add support for recording the max non-turbo ratio
perf intel-pt: Fix missing error codes processing auxtrace_info
perf intel-pt: Add a helper function for processing AUXTRACE_INFO
perf intel-pt: Record address filter in AUXTRACE_INFO event
perf intel-pt: Read address filter from AUXTRACE_INFO event
perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
perf intel-pt: Fix decoding when there are address filters
Arnaldo Carvalho de Melo (1):
perf trace: Beautify sched_[gs]et_attr return value
Masami Hiramatsu (4):
perf probe: Ignore the error of finding inline instance
perf probe: Skip if the function address is 0
perf probe: Fix to cut off incompatible chars from group name
perf probe: Match linkage name with mangled name
Mathieu Poirier (3):
perf tools: Make perf_evsel__append_filter() generic
perf evsel: New tracepoint specific function
perf evsel: Add support for address filters
Ravi Bangoria (1):
perf tests: Add dwarf unwind test for powerpc
Simon Que (1):
perf tools: Update documentation info about quipper
Wang Nan (1):
perf data: Fix building in 32 bit platform with libbabeltrace
tools/perf/Documentation/perf-record.txt | 61 +-
tools/perf/Documentation/perf.data-file-format.txt | 6 +-
tools/perf/arch/powerpc/Build | 1 +
tools/perf/arch/powerpc/include/arch-tests.h | 13 +
tools/perf/arch/powerpc/include/perf_regs.h | 2 +
tools/perf/arch/powerpc/tests/Build | 4 +
tools/perf/arch/powerpc/tests/arch-tests.c | 15 +
tools/perf/arch/powerpc/tests/dwarf-unwind.c | 62 ++
tools/perf/arch/powerpc/tests/regs_load.S | 94 +++
tools/perf/arch/x86/util/intel-pt.c | 57 +-
tools/perf/builtin-record.c | 32 +-
tools/perf/builtin-trace.c | 10 +-
tools/perf/tests/Build | 2 +-
tools/perf/tests/dwarf-unwind.c | 2 +-
tools/perf/util/auxtrace.c | 737 +++++++++++++++++++++
tools/perf/util/auxtrace.h | 54 ++
tools/perf/util/build-id.c | 4 +-
tools/perf/util/data-convert-bt.c | 2 +-
tools/perf/util/dwarf-aux.c | 28 +-
tools/perf/util/dwarf-aux.h | 3 +
tools/perf/util/event.c | 3 +-
tools/perf/util/evsel.c | 16 +-
tools/perf/util/evsel.h | 5 +-
tools/perf/util/evsel_fprintf.c | 7 +-
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 30 +
.../perf/util/intel-pt-decoder/intel-pt-decoder.h | 1 +
tools/perf/util/intel-pt.c | 172 ++++-
tools/perf/util/intel-pt.h | 4 +-
tools/perf/util/parse-events.c | 41 +-
tools/perf/util/probe-event.c | 10 +-
tools/perf/util/probe-file.c | 2 +-
tools/perf/util/probe-finder.c | 17 +-
tools/perf/util/symbol.c | 15 +
tools/perf/util/symbol.h | 1 +
34 files changed, 1451 insertions(+), 62 deletions(-)
create mode 100644 tools/perf/arch/powerpc/include/arch-tests.h
create mode 100644 tools/perf/arch/powerpc/tests/Build
create mode 100644 tools/perf/arch/powerpc/tests/arch-tests.c
create mode 100644 tools/perf/arch/powerpc/tests/dwarf-unwind.c
create mode 100644 tools/perf/arch/powerpc/tests/regs_load.S
# time dm
1 alpine:3.4: Ok
2 android-ndk:r12b-arm: Ok
3 archlinux:latest: Ok
4 centos:5: Ok
5 centos:6: Ok
6 centos:7: Ok
7 debian:7: Ok
8 debian:8: Ok
9 debian:experimental: Ok
10 fedora:20: Ok
11 fedora:21: Ok
12 fedora:22: Ok
13 fedora:23: Ok
14 fedora:24: Ok
15 fedora:24-x-ARC-uClibc: Ok
16 fedora:rawhide: Ok
17 mageia:5: Ok
18 opensuse:13.2: Ok
19 opensuse:42.1: Ok
20 opensuse:tumbleweed: Ok
21 ubuntu:12.04.5: Ok
22 ubuntu:14.04: Ok
23 ubuntu:14.04.4: Ok
24 ubuntu:15.10: Ok
25 ubuntu:16.04: Ok
26 ubuntu:16.04-x-arm: Ok
27 ubuntu:16.04-x-arm64: Ok
28 ubuntu:16.04-x-powerpc: Ok
29 ubuntu:16.04-x-powerpc64: Ok
30 ubuntu:16.04-x-powerpc64el: Ok
31 ubuntu:16.04-x-s390: Ok
32 ubuntu:16.10: Ok
33 2246.21
real 37m26.862s
user 0m2.148s
sys 0m2.256s
#
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: detect openat syscall event : Ok
3: detect openat syscall event on all cpus : Ok
4: read samples using the mmap interface : Ok
5: parse events tests : Ok
6: Validate PERF_RECORD_* events & perf_sample fields : Ok
7: Test perf pmu format parsing : Ok
8: Test dso data read : Ok
9: Test dso data cache : Ok
10: Test dso data reopen : Ok
11: roundtrip evsel->name check : Ok
12: Check parsing of sched tracepoints fields : Ok
13: Generate and check syscalls:sys_enter_openat event fields: Ok
14: struct perf_event_attr setup : Ok
15: Test matching and linking multiple hists : Ok
16: Try 'import perf' in python, checking link problems : Ok
17: Test breakpoint overflow signal handler : Ok
18: Test breakpoint overflow sampling : Ok
19: Test number of exit event of a simple workload : Ok
20: Test software clock events have valid period values : Ok
21: Test object code reading : Ok
22: Test sample parsing : Ok
23: Test using a dummy software event to keep tracking : Ok
24: Test parsing with no sample_id_all bit set : Ok
25: Test filtering hist entries : Ok
26: Test mmap thread lookup : Ok
27: Test thread mg sharing : Ok
28: Test output sorting of hist entries : Ok
29: Test cumulation of child hist entries : Ok
30: Test tracking with sched_switch : Ok
31: Filter fds with revents mask in a fdarray : Ok
32: Add fd to a fdarray, making it autogrow : Ok
33: Test kmod_path__parse function : Ok
34: Test thread map : Ok
35: Test LLVM searching and compiling :
35.1: Basic BPF llvm compiling test : Ok
35.2: Test kbuild searching : Ok
35.3: Compile source for BPF prologue generation test : Ok
35.4: Compile source for BPF relocation test : Ok
36: Test topology in session : Ok
37: Test BPF filter :
37.1: Test basic BPF filtering : Ok
37.2: Test BPF prologue generation : Ok
37.3: Test BPF relocation checker : Ok
38: Test thread map synthesize : Ok
39: Test cpu map synthesize : Ok
40: Test stat config synthesize : Ok
41: Test stat synthesize : Ok
42: Test stat round synthesize : Ok
43: Test attr update synthesize : Ok
44: Test events times : Ok
45: Test backward reading from ring buffer : Ok
46: Test cpu map print : Ok
47: Test SDT event probing : Ok
48: Test is_printable_array function : Ok
49: Test bitmap print : Ok
50: x86 rdpmc test : Ok
51: Test converting perf time to TSC : Ok
52: Test dwarf unwind : Ok
53: Test x86 instruction decoder - new instructions : Ok
54: Test intel cqm nmi context read : Skip
#
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
tarpkg: ./tests/perf-targz-src-pkg .
make_debug_O: make DEBUG=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_no_slang_O: make NO_SLANG=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_no_libbpf_O: make NO_LIBBPF=1
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_tags_O: make tags
make_doc_O: make doc
make_no_libunwind_O: make NO_LIBUNWIND=1
make_install_bin_O: make install-bin
make_no_libbionic_O: make NO_LIBBIONIC=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_demangle_O: make NO_DEMANGLE=1
make_perf_o_O: make perf.o
make_no_auxtrace_O: make NO_AUXTRACE=1
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_pure_O: make
make_util_map_o_O: make util/map.o
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_newt_O: make NO_NEWT=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_help_O: make help
make_install_prefix_O: make install prefix=/tmp/krava
make_static_O: make LDFLAGS=-static
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_clean_all_O: make clean all
make_install_O: make install
make_no_libelf_O: make NO_LIBELF=1
make_no_libperl_O: make NO_LIBPERL=1
make_no_gtk2_O: make NO_GTK2=1
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$
^ permalink raw reply
* [PATCH] Adding Support for Coresight Components on Zynq 7000.
From: Sören Brinkmann @ 2016-09-29 14:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <c6836102-9b7e-a9d9-bad9-34b100d4ae49@supelec.fr>
Hi Muhammad,
On Thu, 2016-09-29 at 12:26:13 +0200, Muhammad Abdul WAHAB wrote:
> The Coresight components are present on the Zynq SoC but the corresponding
> device tree entries are missing. This patch adds device tree entries for
> coresight components while explaining how it was done in order to allow
> porting towards other boards easily.
>
> By adding the entries for Coresight components in the device tree: if no
> files are created in sysfile system, you need to contact the board designer
> to sort out the problem. On some boards, Coresight components are not
> powered on boot.
>
> Signed-off-by: Muhammad Abdul Wahab <muhammadabdul.wahab@centralesupelec.fr>
> ---
> The documentation file was very helpful
> (Documentation/devicetree/bindings/arm/coresight.txt). However, few details
> can be added to make it more clear for beginners.
>
> Things to modify in device tree when changing the board are mainly:
>
> - address
> - `clocks` field
> - some references in other entries may be missing (e.g. for `CPU` field in
> ETM/PTM component, references need to be created)
>
> Furthermore, the `reg` field should be adapted according to
> `#address-cells` and `#size-cells`. It may appear obvious, not for
> beginners.
>
> ## Testing
>
> The trace sink components need to be enabled by accessing through sysfile
> system.
>
> echo 1 > /sys/bus/coresight/devices/@addr.etb/enable\_sink
>
> Then enable the CS source component:
>
> echo 1 > /sys/bus/coresight/devices/@addr.ptm/enable\_source
>
> By default, CS Source components are configured to trace the kernel.
>
> Then the trace can be read by dumping ETB.
>
> dd if=/dev/@addr.etb of=trace_kernel.bin
>
> The trace can be visualized by:
>
> hexdump -C trace_kernel.bin
>
> Or stored using:
>
> hexdump -C trace_kernel.bin > trace_kernel.txt
>
> The trace need to be decoded to be readable. All these above steps can now
> be performed with Perf Library which was not available at the time I was
> playing with DT entries.
I'm curious, did you test that with external debug tools. I have the
feeling the kernel using the debug HW could interfere with JTAG
debuggers, external trace tools, etc.
>
> --- linux-4.7/arch/arm/boot/dts/zynq-7000.dtsi.orig 2016-07-24
> 21:23:50.000000000 +0200
> +++ linux-4.7/arch/arm/boot/dts/zynq-7000.dtsi 2016-09-28
> 19:13:52.651881000 +0200
> @@ -363,5 +363,159 @@
> reg = <0xf8005000 0x1000>;
> timeout-sec = <10>;
> };
> +
> + etb at F8801000 {
> + compatible = "arm,coresight-etb10", "arm,primecell";
> + reg = <0xf8801000 0x1000>;
> + coresight-default-sink;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + port {
> +
> + endpoint at 0 {
> + slave-mode;
> + remote-endpoint = <0x8>;
Use labels please.
> + linux,phandle = <0xd>;
> + phandle = <0xd>;
Do these phandle properties need to be here?
> + };
> + };
> + };
> +
> + tpiu at F8803000 {
> + compatible = "arm,coresight-tpiu", "arm,primecell";
> + reg = <0xf8803000 0x1000>;
> + clocks = <&clkc 47>, <&clkc 16>;
I'm not sure this is correct for every setup. Sorry, that I don't recall
all the details, I haven't used tracing in a long time. But I guess this
clock is configurable as you're referring an fclk here. The other thing
that makes me a little suspicious is, that nothing in here uses the
'dbg_trc' clock that the clock controller provides.
> + clock-names = "apb_pclk", "fclk1";
Those names (at least fclk1) is not a good name for tpiu to identify
it's input. fclk1 is a zynq-specific clock, and as mentioned above, it
seems likely that this could easily become a different one. The
clock-names are meant to identify an input from the consumer's
perspective. The correct names should be documented in the DT binding.
> + clock-frequency=<0xee6b280>;
I cannot find this property in the binding.
> +
> + port {
> +
> + endpoint at 0 {
> + slave-mode;
> + remote-endpoint = <0x9>;
> + linux,phandle = <0xe>;
> + phandle = <0xe>;
> + };
> + };
> + };
> +
> + funnel at F8804000 {
> + compatible = "arm,coresight-funnel", "arm,primecell";
> + reg = <0xf8804000 0x1000>;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + ports {
> + #address-cells = <0x1>;
> + #size-cells = <0x0>;
> +
> + port at 0 {
> + reg = <0x0>;
> +
> + endpoint {
> + remote-endpoint = <0xa>;
> + linux,phandle = <0xf>;
> + phandle = <0xf>;
> + };
> + };
> +
> + port at 1 {
> + reg = <0x0>;
> +
> + endpoint {
> + slave-mode;
> + remote-endpoint = <0xb>;
> + linux,phandle = <0x11>;
> + phandle = <0x11>;
> + };
> + };
> +
> + port at 2 {
> + reg = <0x1>;
> +
> + endpoint {
> + slave-mode;
> + remote-endpoint = <0xc>;
> + linux,phandle = <0x13>;
> + phandle = <0x13>;
> + };
> + };
> + };
> + };
> +
> + replicator {
> + compatible = "arm,coresight-replicator";
> +
> + ports {
> + #address-cells = <0x1>;
> + #size-cells = <0x0>;
> +
> + port at 0 {
> + reg = <0x0>;
> +
> + endpoint {
> + remote-endpoint = <0xd>;
> + linux,phandle = <0x8>;
> + phandle = <0x8>;
> + };
> + };
> +
> + port at 1 {
> + reg = <0x1>;
> +
> + endpoint {
> + remote-endpoint = <0xe>;
> + linux,phandle = <0x9>;
> + phandle = <0x9>;
> + };
> + };
> +
> + port at 2 {
> + reg = <0x0>;
> +
> + endpoint {
> + slave-mode;
> + remote-endpoint = <0xf>;
> + linux,phandle = <0xa>;
> + phandle = <0xa>;
> + };
> + };
> + };
> + };
> +
> + ptm0 at F889C000 {
> + compatible = "arm,coresight-etm3x", "arm,primecell";
> + reg = <0xf889c000 0x1000>;
> + cpu = <0x10>;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + port {
> +
> + endpoint {
> + remote-endpoint = <0x11>;
> + linux,phandle = <0xb>;
> + phandle = <0xb>;
> + };
> + };
> + };
> +
> + ptm1 at F889D000 {
> + compatible = "arm,coresight-etm3x", "arm,primecell";
> + reg = <0xf889d000 0x1000>;
> + cpu = <0x12>;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + port {
> +
> + endpoint {
> + remote-endpoint = <0x13>;
> + linux,phandle = <0xc>;
> + phandle = <0xc>;
> + };
> + };
> + };
> };
> };
I think nodes were ordered alphabetically in our DTs.
S?ren
^ permalink raw reply
* [PATCH] arm64: make rpm failed due to incorrect path to Image.gz
From: Vadim Lomovtsev @ 2016-09-29 14:32 UTC (permalink / raw)
To: linux-arm-kernel
The "make rpm" and "make rpm-pkg" commands for arm64 platform are broken
due to rpmbuild couldn't find Image.gz file at default location (which
is kernel src root):
cp: cannot stat 'Image.gz': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.ocFBmP (%install)
While the correct path to arm64 kernel image file
is "arch/arm64/boot/Image.gz".
The exact file name (Image.gz) is stored at KBUILD_IMAGE variable
and read by rpmbuild with "make image_name" command at
install phase after kernel build is complete.
Accordingly to Michal's Marek comment it is necesary
that the KBUILD_IMAGE variable value has to be set
accordingly to point to actual file and thus fix that issue.
Since the KBUILD_IMAGE variable is used in general cases of
build we need to prevent other build types breakage by changing it.
The solution is to add to arch/arm64/Makefie extra target "image_name"
with dependency "KBUILD_IMAGE:=<proper path to Image.gz file>".
Thus it will allow to set proper path to Image.gz file only for
the "image_name" build target and this exact value will be picked up
while rpm build install phase.
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
arch/arm64/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index ab51aed..09926d3 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -101,6 +101,8 @@ all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
boot := arch/arm64/boot
+image_name: KBUILD_IMAGE :=$(boot)/$(KBUILD_IMAGE)
+
Image: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
--
1.8.3.1
^ permalink raw reply related
* [PATCH] clk: mvebu: armada-37xx-periph: Fix the clock provider registration
From: Gregory CLEMENT @ 2016-09-29 14:28 UTC (permalink / raw)
To: linux-arm-kernel
While trying using a peripheral clock on a driver, I saw that the clock
pointer returned by the provider was NULL.
The problem was a missing indirection. It was the pointer stored in the
hws array which needed to be updated not the value it contains.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
drivers/clk/mvebu/armada-37xx-periph.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c
index 45905fc0d75b..d5dfbad4ceab 100644
--- a/drivers/clk/mvebu/armada-37xx-periph.c
+++ b/drivers/clk/mvebu/armada-37xx-periph.c
@@ -305,7 +305,7 @@ static const struct of_device_id armada_3700_periph_clock_of_match[] = {
};
static int armada_3700_add_composite_clk(const struct clk_periph_data *data,
void __iomem *reg, spinlock_t *lock,
- struct device *dev, struct clk_hw *hw)
+ struct device *dev, struct clk_hw **hw)
{
const struct clk_ops *mux_ops = NULL, *gate_ops = NULL,
*rate_ops = NULL;
@@ -353,13 +353,13 @@ static int armada_3700_add_composite_clk(const struct clk_periph_data *data,
}
}
- hw = clk_hw_register_composite(dev, data->name, data->parent_names,
+ *hw = clk_hw_register_composite(dev, data->name, data->parent_names,
data->num_parents, mux_hw,
mux_ops, rate_hw, rate_ops,
gate_hw, gate_ops, CLK_IGNORE_UNUSED);
- if (IS_ERR(hw))
- return PTR_ERR(hw);
+ if (IS_ERR(*hw))
+ return PTR_ERR(*hw);
return 0;
}
@@ -400,7 +400,7 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev)
spin_lock_init(&driver_data->lock);
for (i = 0; i < num_periph; i++) {
- struct clk_hw *hw = driver_data->hw_data->hws[i];
+ struct clk_hw **hw = &driver_data->hw_data->hws[i];
if (armada_3700_add_composite_clk(&data[i], reg,
&driver_data->lock, dev, hw))
--
2.9.3
^ permalink raw reply related
* [PATCH v5 01/14] drivers: iommu: add FWNODE_IOMMU fwnode type
From: Lorenzo Pieralisi @ 2016-09-29 14:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160909142343.13314-2-lorenzo.pieralisi@arm.com>
Hi Rafael,
On Fri, Sep 09, 2016 at 03:23:30PM +0100, Lorenzo Pieralisi wrote:
> On systems booting with a device tree, every struct device is
> associated with a struct device_node, that represents its DT
> representation. The device node can be used in generic kernel
> contexts (eg IRQ translation, IOMMU streamid mapping), to
> retrieve the properties associated with the device and carry
> out kernel operation accordingly. Owing to the 1:1 relationship
> between the device and its device_node, the device_node can also
> be used as a look-up token for the device (eg looking up a device
> through its device_node), to retrieve the device in kernel paths
> where the device_node is available.
>
> On systems booting with ACPI, the same abstraction provided by
> the device_node is required to provide look-up functionality.
>
> Therefore, mirroring the approach implemented in the IRQ domain
> kernel layer, this patch adds an additional fwnode type FWNODE_IOMMU.
>
> This patch also implements a glue kernel layer that allows to
> allocate/free FWNODE_IOMMU fwnode_handle structures and associate
> them with IOMMU devices.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> ---
> include/linux/fwnode.h | 1 +
> include/linux/iommu.h | 25 +++++++++++++++++++++++++
> 2 files changed, 26 insertions(+)
>
> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
> index 8516717..6e10050 100644
> --- a/include/linux/fwnode.h
> +++ b/include/linux/fwnode.h
> @@ -19,6 +19,7 @@ enum fwnode_type {
> FWNODE_ACPI_DATA,
> FWNODE_PDATA,
> FWNODE_IRQCHIP,
> + FWNODE_IOMMU,
This patch provides groundwork for this series and it is key for
the rest of it, basically the point here is that we need a fwnode
to differentiate platform devices created out of static ACPI tables
entries (ie IORT), that represent IOMMU components.
The corresponding device is not an ACPI device (I could fabricate one as
it is done for other static tables entries eg FADT power button, but I
do not necessarily see the reason for doing that given that all we need
the fwnode for is a token identifier), so FWNODE_ACPI does not apply
here.
Please let me know if it is reasonable how I sorted this out (it
is basically identical to IRQCHIP, just another enum entry), the
remainder of the code depends on this.
Thanks !
Lorenzo
> };
>
> struct fwnode_handle {
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index a35fb8b..6456528 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -38,6 +38,7 @@ struct bus_type;
> struct device;
> struct iommu_domain;
> struct notifier_block;
> +struct fwnode_handle;
>
> /* iommu fault flags */
> #define IOMMU_FAULT_READ 0x0
> @@ -543,4 +544,28 @@ static inline void iommu_device_unlink(struct device *dev, struct device *link)
>
> #endif /* CONFIG_IOMMU_API */
>
> +/* IOMMU fwnode handling */
> +static inline bool is_fwnode_iommu(struct fwnode_handle *fwnode)
> +{
> + return fwnode && fwnode->type == FWNODE_IOMMU;
> +}
> +
> +static inline struct fwnode_handle *iommu_alloc_fwnode(void)
> +{
> + struct fwnode_handle *fwnode;
> +
> + fwnode = kzalloc(sizeof(struct fwnode_handle), GFP_KERNEL);
> + fwnode->type = FWNODE_IOMMU;
> +
> + return fwnode;
> +}
> +
> +static inline void iommu_free_fwnode(struct fwnode_handle *fwnode)
> +{
> + if (WARN_ON(!is_fwnode_iommu(fwnode)))
> + return;
> +
> + kfree(fwnode);
> +}
> +
> #endif /* __LINUX_IOMMU_H */
> --
> 2.10.0
>
^ permalink raw reply
* [PATCH] dmaengine: pxa_dma: remove unused function
From: Baoyou Xie @ 2016-09-29 13:09 UTC (permalink / raw)
To: linux-arm-kernel
We get 1 warning when building kernel with W=1:
drivers/dma/pxa_dma.c:1525:5: warning: no previous prototype for 'pxad_toggle_reserved_channel' [-Wmissing-prototypes]
In fact, this function is called by no one, so this patch removes it.
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
drivers/dma/pxa_dma.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index 3f56f9c..7d9b1cc 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -1522,15 +1522,6 @@ bool pxad_filter_fn(struct dma_chan *chan, void *param)
}
EXPORT_SYMBOL_GPL(pxad_filter_fn);
-int pxad_toggle_reserved_channel(int legacy_channel)
-{
- if (legacy_unavailable & (BIT(legacy_channel)))
- return -EBUSY;
- legacy_reserved ^= BIT(legacy_channel);
- return 0;
-}
-EXPORT_SYMBOL_GPL(pxad_toggle_reserved_channel);
-
module_platform_driver(pxad_driver);
MODULE_DESCRIPTION("Marvell PXA Peripheral DMA Driver");
--
2.7.4
^ permalink raw reply related
* [PATCH 0/4] Add DMA support for ti_am335x_adc driver
From: Mugunthan V N @ 2016-09-29 13:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <22588f2d-d0de-7911-35ed-92094f7dd28d@kernel.org>
On Sunday 25 September 2016 03:11 PM, Jonathan Cameron wrote:
> On 21/09/16 17:11, Mugunthan V N wrote:
>> > The ADC has a 64 work depth fifo length which holds the ADC data
>> > till the CPU reads. So when a user program needs a large ADC data
>> > to operate on, then it has to do multiple reads to get its
>> > buffer. Currently if the application asks for 4 samples per
>> > channel with all 8 channels are enabled, kernel can provide only
>> > 3 samples per channel when all 8 channels are enabled (logs at
>> > [1]). So with DMA support user can request for large number of
>> > samples at a time (logs at [2]).
>> >
>> > Tested the patch on AM437x-gp-evm and AM335x Boneblack with the
>> > patch [3] to enable ADC and pushed a branch for testing [4]
>> >
>> > [1] - http://pastebin.ubuntu.com/23211490/
>> > [2] - http://pastebin.ubuntu.com/23211492/
>> > [3] - http://pastebin.ubuntu.com/23211494/
>> > [4] - git://git.ti.com/~mugunthanvnm/ti-linux-kernel/linux.git iio-dma
> Just curious. How fast is the ADC sampling at in these? Never that
> obvious for this driver!
>
> I'm also curious as to whether you started to hit the limits of the
> kfifo based interface. Might be worth considering adding alternative
> support for the dma buffers interface which is obviously much lower
> overhead.
>
> Good to have this work prior to that as the kfifo stuff is somewhat
> easier to use.
Currently ADC clock is 3MHz, which can produce a data rate of 225KBps
per channel with no open delay and no averaging of samples. So when all
8 Channels are enables the data rate will be 1.75MBps
ADC can be operated at 24MHz, which can generate a data rate of 28MBps
with all 8 channels enabled and no open delay and averaging, but our
target is to get 800K samples per second per channel which has a data
rate of 12.5MBps
I think with this data rate, DMA will be the best option to implement
without any data loss and less cpu overload to read the ADC samples.
Regards
Mugunthan V N
^ permalink raw reply
* Crash seen on ARM Juno r1 with 4.8-rc8 when Coresight is enabled
From: Venkatesh Vivekanandan @ 2016-09-29 12:20 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <5dc4d096-d580-900c-5750-38e0db1ccbce@arm.com>
On Thu, Sep 29, 2016 at 2:47 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>
> On 29/09/16 09:49, Rabin Vincent wrote:
>>
>> On Wed, Sep 28, 2016 at 11:41:41AM -0600, Mathieu Poirier wrote:
>
> [...]
>
>>> Thanks you for reporting this Vankatesh,
>>>
>>> Sudeep and Suzuki, can you guys help me with this - I don't have an R1
>>> to test with.
>>
>>
>> I've seen this too, on other platforms. This should fix it:
>>
>> 8<-----------
>> From a9da7d7b47e67dd6ffcafddadb50e6f97503f296 Mon Sep 17 00:00:00 2001
>> From: Rabin Vincent <rabinv@axis.com>
>> Date: Tue, 30 Aug 2016 08:54:21 +0200
>> Subject: [PATCH] coresight: check for NULL child_name
>>
>> Connection child names associated to ports can sometimes be NULL, which
>> is the case when booting a system on QEMU or when the Coresight power
>> domain isn't switched on. fadf3a44e974 ("coresight: checking for NULL
>> string in coresight_name_match()") fixed one place to handle this but
>> the same check is needed in coresight_orphan_match() to prevent a crash
>> there.
>>
>
> Thanks Rabin, we have exact same fix in linux-next already.
Thanks Rabin/Sudeep for pointing out the patch. It is booting now with
coresight enabled.
>
> --
> Regards,
> Sudeep
^ permalink raw reply
* [PATCH] drm/sun4i: rgb: Enable panel after controller
From: Maxime Ripard @ 2016-09-29 12:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAOw6vbKxJeSZYsCwVWYbVosZUK+FfBq1ytrpRUNpbH+kM6Ow6Q@mail.gmail.com>
Hi,
On Tue, Sep 27, 2016 at 10:42:09AM -0400, Sean Paul wrote:
> As an aside, it seems like (from the diff, I haven't looked at the
> code) the bridge_pre_enable and bridge_post_disable calls are missing,
> and the enable/disable calls are in the wrong place.
Actually, I don't even think that's necessary. The atomic helpers
already call drm_bridge_pre_enable and drm_bridge_enable at the right
time. So I guess the proper fix would be to just remove the driver's
call to drm_bridge_enable.
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160929/7c5646a7/attachment.sig>
^ permalink raw reply
* [PATCH] arm64: KVM: Take S1 walks into account when determining S2 write faults
From: Will Deacon @ 2016-09-29 11:37 UTC (permalink / raw)
To: linux-arm-kernel
The WnR bit in the HSR/ESR_EL2 indicates whether a data abort was
generated by a read or a write instruction. For stage 2 data aborts
generated by a stage 1 translation table walk (i.e. the actual page
table access faults at EL2), the WnR bit therefore reports whether the
instruction generating the walk was a load or a store, *not* whether the
page table walker was reading or writing the entry.
For page tables marked as read-only at stage 2 (e.g. due to KSM merging
them with the tables from another guest), this could result in livelock,
where a page table walk generated by a load instruction attempts to
set the access flag in the stage 1 descriptor, but fails to trigger
CoW in the host since only a read fault is reported.
This patch modifies the arm64 kvm_vcpu_dabt_iswrite function to
take into account stage 2 faults in stage 1 walks. Since DBM cannot be
disabled at EL2 for CPUs that implement it, we assume that these faults
are always causes by writes, avoiding the livelock situation at the
expense of occasional, spurious CoWs.
We could, in theory, do a bit better by checking the guest TCR
configuration and inspecting the page table to see why the PTE faulted.
However, I doubt this is measurable in practice, and the threat of
livelock is real.
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Julien Grall <julien.grall@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm64/include/asm/kvm_emulate.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index 4cdeae3b17c6..948a9a8a9297 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -167,11 +167,6 @@ static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);
}
-static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
-{
- return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR);
-}
-
static inline bool kvm_vcpu_dabt_issext(const struct kvm_vcpu *vcpu)
{
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SSE);
@@ -192,6 +187,12 @@ static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);
}
+static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
+{
+ return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) ||
+ kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */
+}
+
static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu)
{
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);
--
2.1.4
^ permalink raw reply related
* [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency
From: Jisheng Zhang @ 2016-09-29 11:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160929110714.GF28107@nuc-i3427.alporthouse.com>
On Thu, 29 Sep 2016 12:07:14 +0100 Chris Wilson wrote:
> On Thu, Sep 29, 2016 at 04:28:08PM +0800, Jisheng Zhang wrote:
> > On Thu, 29 Sep 2016 09:18:18 +0100 Chris Wilson wrote:
> >
> > > On Thu, Sep 29, 2016 at 03:34:11PM +0800, Jisheng Zhang wrote:
> > > > On Marvell berlin arm64 platforms, I see the preemptoff tracer report
> > > > a max 26543 us latency at __purge_vmap_area_lazy, this latency is an
> > > > awfully bad for STB. And the ftrace log also shows __free_vmap_area
> > > > contributes most latency now. I noticed that Joel mentioned the same
> > > > issue[1] on x86 platform and gave two solutions, but it seems no patch
> > > > is sent out for this purpose.
> > > >
> > > > This patch adopts Joel's first solution, but I use 16MB per core
> > > > rather than 8MB per core for the number of lazy_max_pages. After this
> > > > patch, the preemptoff tracer reports a max 6455us latency, reduced to
> > > > 1/4 of original result.
> > >
> > > My understanding is that
> > >
> > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> > > index 91f44e78c516..3f7c6d6969ac 100644
> > > --- a/mm/vmalloc.c
> > > +++ b/mm/vmalloc.c
> > > @@ -626,7 +626,6 @@ void set_iounmap_nonlazy(void)
> > > static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
> > > int sync, int force_flush)
> > > {
> > > - static DEFINE_SPINLOCK(purge_lock);
> > > struct llist_node *valist;
> > > struct vmap_area *va;
> > > struct vmap_area *n_va;
> > > @@ -637,12 +636,6 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
> > > * should not expect such behaviour. This just simplifies locking for
> > > * the case that isn't actually used at the moment anyway.
> > > */
> > > - if (!sync && !force_flush) {
> > > - if (!spin_trylock(&purge_lock))
> > > - return;
> > > - } else
> > > - spin_lock(&purge_lock);
> > > -
> > > if (sync)
> > > purge_fragmented_blocks_allcpus();
> > >
> > > @@ -667,7 +660,6 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
> > > __free_vmap_area(va);
> > > spin_unlock(&vmap_area_lock);
> >
> > Hi Chris,
> >
> > Per my test, the bottleneck now is __free_vmap_area() over the valist, the
> > iteration is protected with spinlock vmap_area_lock. So the larger lazy max
> > pages, the longer valist, the bigger the latency.
> >
> > So besides above patch, we still need to remove vmap_are_lock or replace with
> > mutex.
>
> Or follow up with
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 3f7c6d6969ac..67b5475f0b0a 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -656,8 +656,10 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
>
> if (nr) {
> spin_lock(&vmap_area_lock);
> - llist_for_each_entry_safe(va, n_va, valist, purge_list)
> + llist_for_each_entry_safe(va, n_va, valist, purge_list) {
> __free_vmap_area(va);
> + cond_resched_lock(&vmap_area_lock);
oh, great! This seems works fine. I'm not sure there's any side effect or
performance regression, but this patch plus previous purge_lock removing do
addressed my problem.
Thanks,
Jisheng
> + }
> spin_unlock(&vmap_area_lock);
> }
> }
>
> ?
> -Chris
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox