* Re: [PATCH v3 3/6] drivers: clk-qoriq: increase array size of cmux_to_group
From: Stephen Boyd @ 2018-10-01 22:04 UTC (permalink / raw)
To: Vabhav Sharma, arnd, catalin.marinas, devicetree, gregkh,
kstewart, linux-arm-kernel, linux-clk, linux-kernel-owner,
linux-kernel, linux-pm, linuxppc-dev, mark.rutland, mturquette,
oss, rjw, robh+dt, sudeep.holla, viresh.kumar, will.deacon,
yamada.masahiro
Cc: udit.kumar, Yogesh Gaur, linux, Vabhav Sharma, V.Sethi
In-Reply-To: <1537747741-6245-4-git-send-email-vabhav.sharma@nxp.com>
Subject should be "clk: qoriq: increase array size ..."
^ permalink raw reply
* Re: [PATCH v2 5/5] soc/fsl_qbman: export coalesce change API
From: Li Yang @ 2018-10-01 21:50 UTC (permalink / raw)
To: madalin.bucur
Cc: Catalin Marinas, Roy Pledge, lkml, Scott Wood, claudiu.manoil,
linuxppc-dev,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <1538124204-31406-6-git-send-email-madalin.bucur@nxp.com>
On Fri, Sep 28, 2018 at 3:45 AM Madalin Bucur <madalin.bucur@nxp.com> wrote:
>
> Export the API required to control the QMan portal interrupt coalescing
> settings.
These are new APIs not just old APIs being exported. What is the user
of these APIs? Is the user being submitted? We cannot have APIs in
kernel that has no users.
>
> Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
> ---
> drivers/soc/fsl/qbman/qman.c | 31 +++++++++++++++++++++++++++++++
> include/soc/fsl/qman.h | 27 +++++++++++++++++++++++++++
> 2 files changed, 58 insertions(+)
>
> diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
> index 99d0f87889b8..8ab75bb44c4d 100644
> --- a/drivers/soc/fsl/qbman/qman.c
> +++ b/drivers/soc/fsl/qbman/qman.c
> @@ -1012,6 +1012,37 @@ static inline void put_affine_portal(void)
>
> static struct workqueue_struct *qm_portal_wq;
>
> +void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh)
> +{
> + if (!portal)
> + return;
> +
> + qm_dqrr_set_ithresh(&portal->p, ithresh);
> + portal->p.dqrr.ithresh = ithresh;
> +}
> +EXPORT_SYMBOL(qman_dqrr_set_ithresh);
> +
> +void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh)
> +{
> + if (portal && ithresh)
> + *ithresh = portal->p.dqrr.ithresh;
> +}
> +EXPORT_SYMBOL(qman_dqrr_get_ithresh);
> +
> +void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod)
> +{
> + if (portal && iperiod)
> + *iperiod = qm_in(&portal->p, QM_REG_ITPR);
> +}
> +EXPORT_SYMBOL(qman_portal_get_iperiod);
> +
> +void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod)
> +{
> + if (portal)
> + qm_out(&portal->p, QM_REG_ITPR, iperiod);
> +}
> +EXPORT_SYMBOL(qman_portal_set_iperiod);
> +
> int qman_wq_alloc(void)
> {
> qm_portal_wq = alloc_workqueue("qman_portal_wq", 0, 1);
> diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h
> index d4dfefdee6c1..42f50eb51529 100644
> --- a/include/soc/fsl/qman.h
> +++ b/include/soc/fsl/qman.h
> @@ -1186,4 +1186,31 @@ int qman_alloc_cgrid_range(u32 *result, u32 count);
> */
> int qman_release_cgrid(u32 id);
>
> +/**
> + * qman_dqrr_get_ithresh - Get coalesce interrupt threshold
> + * @portal: portal to get the value for
> + * @ithresh: threshold pointer
> + */
> +void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh);
> +
> +/**
> + * qman_dqrr_set_ithresh - Set coalesce interrupt threshold
> + * @portal: portal to set the new value on
> + * @ithresh: new threshold value
> + */
> +void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh);
> +
> +/**
> + * qman_dqrr_get_iperiod - Get coalesce interrupt period
> + * @portal: portal to get the value for
> + * @iperiod: period pointer
> + */
> +void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod);
> +/*
> + * qman_dqrr_set_iperiod - Set coalesce interrupt period
> + * @portal: portal to set the new value on
> + * @ithresh: new period value
> + */
> +void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod);
> +
> #endif /* __FSL_QMAN_H */
> --
> 2.1.0
>
^ permalink raw reply
* Re: dma mask related fixups (including full bus_dma_mask support) v2
From: Benjamin Herrenschmidt @ 2018-10-01 20:51 UTC (permalink / raw)
To: Christoph Hellwig, iommu
Cc: Greg Kroah-Hartman, linuxppc-dev, Robin Murphy, linux-kernel
In-Reply-To: <20181001143259.GA5655@lst.de>
On Mon, 2018-10-01 at 16:32 +0200, Christoph Hellwig wrote:
> FYI, I've pulled this into the dma-mapping tree to make forward
> progress. All but oatch 4 had formal ACKs, and for that one Robin
> was fine even without and explicit ack. I'll also send a patch to
> better document the zone selection as it confuses even well versed
> people like Ben.
Thanks. I"ll try to dig out some older systems to test.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH v4 6/9] kbuild: consolidate Devicetree dtb build rules
From: Masahiro Yamada @ 2018-10-01 20:34 UTC (permalink / raw)
To: Rob Herring
Cc: Linux-MIPS, linux-xtensa, Will Deacon, Max Filippov,
Paul Mackerras, Frank Rowand, Yoshinori Sato, Russell King,
Ley Foon Tan, Catalin Marinas, James Hogan, arcml,
moderated list:H8/300 ARCHITECTURE, DTML,
Linux Kbuild mailing list, linux-arm-kernel, Chris Zankel,
Michal Simek, Michal Marek, Vineet Gupta,
Linux Kernel Mailing List, Ralf Baechle, Paul Burton, nios2-dev,
linuxppc-dev
In-Reply-To: <20181001152531.3385-7-robh@kernel.org>
2018年10月2日(火) 0:26 Rob Herring <robh@kernel.org>:
>
> There is nothing arch specific about building dtb files other than their
> location under /arch/*/boot/dts/. Keeping each arch aligned is a pain.
> The dependencies and supported targets are all slightly different.
> Also, a cross-compiler for each arch is needed, but really the host
> compiler preprocessor is perfectly fine for building dtbs. Move the
> build rules to a common location and remove the arch specific ones. This
> is done in a single step to avoid warnings about overriding rules.
>
> The build dependencies had been a mixture of 'scripts' and/or 'prepare'.
> These pull in several dependencies some of which need a target compiler
> (specifically devicetable-offsets.h) and aren't needed to build dtbs.
> All that is really needed is dtc, so adjust the dependencies to only be
> dtc.
>
> This change enables support 'dtbs_install' on some arches which were
> missing the target.
>
> Acked-by: Will Deacon <will.deacon@arm.com>
> Acked-by: Paul Burton <paul.burton@mips.com>
> Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Please change this to
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Thanks.
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: James Hogan <jhogan@kernel.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-mips@linux-mips.org
> Cc: nios2-dev@lists.rocketboards.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-xtensa@linux-xtensa.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> v4:
> - Make dtbs and %.dtb rules depend on arch/$ARCH/boot/dts path rather than
> CONFIG_OF_EARLY_FLATTREE
> - Fix install path missing kernel version for dtbs_install
> - Fix "make CONFIG_OF_ALL_DTBS=y" for arches like ARM which selectively
> enable CONFIG_OF (and therefore dtc)
--
Best Regards
Masahiro Yamada
^ permalink raw reply
* Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node
From: Michal Hocko @ 2018-10-01 20:27 UTC (permalink / raw)
To: Michael Bringmann
Cc: Thomas Falcon, Kees Cook, Mathieu Malaterre, linux-kernel,
Nicholas Piggin, Pavel Tatashin, linux-mm,
Mauricio Faria de Oliveira, Juliet Kim, Tyrel Datwyler,
Thiago Jung Bauermann, Nathan Fontenot, Andrew Morton,
YASUAKI ISHIMATSU, linuxppc-dev, Dan Williams, Oscar Salvador
In-Reply-To: <20181001185616.11427.35521.stgit@ltcalpine2-lp9.aus.stglabs.ibm.com>
On Mon 01-10-18 13:56:25, Michael Bringmann wrote:
> In some LPAR migration scenarios, device-tree modifications are
> made to the affinity of the memory in the system. For instance,
> it may occur that memory is installed to nodes 0,3 on a source
> system, and to nodes 0,2 on a target system. Node 2 may not
> have been initialized/allocated on the target system.
>
> After migration, if a RTAS PRRN memory remove is made to a
> memory block that was in node 3 on the source system, then
> try_offline_node tries to remove it from node 2 on the target.
> The NODE_DATA(2) block would not be initialized on the target,
> and there is no validation check in the current code to prevent
> the use of a NULL pointer.
I am not familiar with ppc and the above doesn't really help me
much. Sorry about that. But from the above it is not clear to me whether
it is the caller which does something unexpected or the hotplug code
being not robust enough. From your changelog I would suggest the later
but why don't we see the same problem for other archs? Is this a problem
of unrolling a partial failure?
dlpar_remove_lmb does the following
nid = memory_add_physaddr_to_nid(lmb->base_addr);
remove_memory(nid, lmb->base_addr, block_sz);
/* Update memory regions for memory remove */
memblock_remove(lmb->base_addr, block_sz);
dlpar_remove_device_tree_lmb(lmb);
Is the whole operation correct when remove_memory simply backs off
silently. Why don't we have to care about memblock resp
dlpar_remove_device_tree_lmb parts? In other words how come the physical
memory range is valid while the node association is not?
--
Michal Hocko
SUSE Labs
^ permalink raw reply
* Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node
From: Kees Cook @ 2018-10-01 20:02 UTC (permalink / raw)
To: Michael Bringmann
Cc: Michal Hocko, Thomas Falcon, Mathieu Malaterre, LKML,
Nicholas Piggin, Pavel Tatashin, Linux-MM,
Mauricio Faria de Oliveira, Juliet Kim, Tyrel Datwyler,
Thiago Jung Bauermann, Nathan Fontenot, Andrew Morton,
YASUAKI ISHIMATSU, PowerPC, Dan Williams, Oscar Salvador
In-Reply-To: <20181001185616.11427.35521.stgit@ltcalpine2-lp9.aus.stglabs.ibm.com>
On Mon, Oct 1, 2018 at 11:56 AM, Michael Bringmann
<mwb@linux.vnet.ibm.com> wrote:
> In some LPAR migration scenarios, device-tree modifications are
> made to the affinity of the memory in the system. For instance,
> it may occur that memory is installed to nodes 0,3 on a source
> system, and to nodes 0,2 on a target system. Node 2 may not
> have been initialized/allocated on the target system.
>
> After migration, if a RTAS PRRN memory remove is made to a
> memory block that was in node 3 on the source system, then
> try_offline_node tries to remove it from node 2 on the target.
> The NODE_DATA(2) block would not be initialized on the target,
> and there is no validation check in the current code to prevent
> the use of a NULL pointer. Call traces such as the following
> may be observed:
>
> A similar problem of moving memory to an unitialized node has
> also been observed on systems where multiple PRRN events occur
> prior to a complete update of the device-tree.
>
> pseries-hotplug-mem: Attempting to update LMB, drc index 80000002
> Offlined Pages 4096
> ...
> Oops: Kernel access of bad area, sig: 11 [#1]
> ...
> Workqueue: pseries hotplug workque pseries_hp_work_fn
> ...
> NIP [c0000000002bc088] try_offline_node+0x48/0x1e0
> LR [c0000000002e0b84] remove_memory+0xb4/0xf0
> Call Trace:
> [c0000002bbee7a30] [c0000002bbee7a70] 0xc0000002bbee7a70 (unreliable)
> [c0000002bbee7a70] [c0000000002e0b84] remove_memory+0xb4/0xf0
> [c0000002bbee7ab0] [c000000000097784] dlpar_remove_lmb+0xb4/0x160
> [c0000002bbee7af0] [c000000000097f38] dlpar_memory+0x328/0xcb0
> [c0000002bbee7ba0] [c0000000000906d0] handle_dlpar_errorlog+0xc0/0x130
> [c0000002bbee7c10] [c0000000000907d4] pseries_hp_work_fn+0x94/0xa0
> [c0000002bbee7c40] [c0000000000e1cd0] process_one_work+0x1a0/0x4e0
> [c0000002bbee7cd0] [c0000000000e21b0] worker_thread+0x1a0/0x610
> [c0000002bbee7d80] [c0000000000ea458] kthread+0x128/0x150
> [c0000002bbee7e30] [c00000000000982c] ret_from_kernel_thread+0x5c/0xb0
>
> This patch adds a check for an incorrectly initialized to the
> beginning of try_offline_node, and exits the routine.
>
> Another patch is being developed for powerpc to track the
> node Id to which an LMB belongs, so that we can remove the
> LMB from there instead of the nid as currently interpreted
> from the device tree.
>
> Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> mm/memory_hotplug.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 38d94b7..e48a4d0 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1831,10 +1831,16 @@ static int check_and_unmap_cpu_on_node(pg_data_t *pgdat)
> void try_offline_node(int nid)
> {
> pg_data_t *pgdat = NODE_DATA(nid);
> - unsigned long start_pfn = pgdat->node_start_pfn;
> - unsigned long end_pfn = start_pfn + pgdat->node_spanned_pages;
> + unsigned long start_pfn;
> + unsigned long end_pfn;
> unsigned long pfn;
>
> + if (WARN_ON(pgdat == NULL))
> + return;
> +
> + start_pfn = pgdat->node_start_pfn;
> + end_pfn = start_pfn + pgdat->node_spanned_pages;
> +
> for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
> unsigned long section_nr = pfn_to_section_nr(pfn);
>
>
--
Kees Cook
Pixel Security
^ permalink raw reply
* [PATCH 2/2] powerpc/tm: Avoid SPR flush if TM is disabled
From: Breno Leitao @ 2018-10-01 19:47 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao, mikey, gromero
In-Reply-To: <1538423270-17527-1-git-send-email-leitao@debian.org>
There is a bug in the flush_tmregs_to_thread() function, where it forces
TM SPRs to be saved to the thread even if the TM facility is disabled.
This bug could be reproduced using a simple test case:
mtspr(SPRN_TEXASR, XX);
sleep until load_tm == 0
cause a coredump
read SPRN_TEXASR in the coredump
In this case, the coredump may contain an invalid SPR, because the
current code is flushing live SPRs (Used by the last thread with TM
active) into the current thread, overwriting the latest SPRs (which were
valid).
This patch checks if TM is enabled for current task before
saving the SPRs, otherwise, the TM is lazily disabled and the thread
value is already up-to-date and could be used directly, and saving is
not required.
Fixes: cd63f3cf1d5 ("powerpc/tm: Fix saving of TM SPRs in core dump")
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/kernel/ptrace.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 9667666eb18e..e0a2ee865032 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -138,7 +138,12 @@ static void flush_tmregs_to_thread(struct task_struct *tsk)
if (MSR_TM_SUSPENDED(mfmsr())) {
tm_reclaim_current(TM_CAUSE_SIGNAL);
- } else {
+ } else if (tm_enabled(tsk)) {
+ /*
+ * Only flush TM SPRs to the thread if TM was enabled,
+ * otherwise (TM lazily disabled), the thread already
+ * contains the latest SPR value
+ */
tm_enable();
tm_save_sprs(&(tsk->thread));
}
--
2.19.0
^ permalink raw reply related
* [PATCH 1/2] powerpc/tm: Move tm_enable definition
From: Breno Leitao @ 2018-10-01 19:47 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao, mikey, gromero
The goal of this patch is to move function tm_enabled() to tm.h in order
to allow this function to be used by other files as an inline function.
This patch also removes the double inclusion of tm.h in the traps.c
source code. One inclusion is inside a CONFIG_PPC64 ifdef block, and
another one is in the generic part. This double inclusion causes a
redefinition of tm_enable(), that is why it is being fixed here.
There is generic code (non CONFIG_PPC64, thus, non
CONFIG_PPC_TRANSACTIONAL_MEM also) using some TM definitions, which
explains why tm.h is being imported in the generic code. This is
not correct, and this code is now surrounded by a
CONFIG_PPC_TRANSACTIONAL_MEM ifdef block.
These ifdef inclusion will avoid calling tm_abort_check() completely,
but it is not a problem since this function is just returning 'false' if
CONFIG_PPC_TRANSACTIONAL_MEM is not defined.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/include/asm/tm.h | 5 +++++
arch/powerpc/kernel/process.c | 5 -----
arch/powerpc/kernel/traps.c | 5 ++++-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/tm.h b/arch/powerpc/include/asm/tm.h
index e94f6db5e367..646d45a2aaae 100644
--- a/arch/powerpc/include/asm/tm.h
+++ b/arch/powerpc/include/asm/tm.h
@@ -19,4 +19,9 @@ extern void tm_restore_sprs(struct thread_struct *thread);
extern bool tm_suspend_disabled;
+static inline bool tm_enabled(struct task_struct *tsk)
+{
+ return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM);
+}
+
#endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 913c5725cdb2..c1ca2451fa3b 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -862,11 +862,6 @@ static inline bool hw_brk_match(struct arch_hw_breakpoint *a,
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
-static inline bool tm_enabled(struct task_struct *tsk)
-{
- return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM);
-}
-
static void tm_reclaim_thread(struct thread_struct *thr, uint8_t cause)
{
/*
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index c85adb858271..a3d6298b8074 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -64,7 +64,6 @@
#include <asm/rio.h>
#include <asm/fadump.h>
#include <asm/switch_to.h>
-#include <asm/tm.h>
#include <asm/debug.h>
#include <asm/asm-prototypes.h>
#include <asm/hmi.h>
@@ -1276,9 +1275,11 @@ static int emulate_instruction(struct pt_regs *regs)
/* Emulate load/store string insn. */
if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) {
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
if (tm_abort_check(regs,
TM_CAUSE_EMULATE | TM_CAUSE_PERSISTENT))
return -EINVAL;
+#endif
PPC_WARN_EMULATED(string, regs);
return emulate_string_inst(regs, instword);
}
@@ -1508,8 +1509,10 @@ void alignment_exception(struct pt_regs *regs)
if (!arch_irq_disabled_regs(regs))
local_irq_enable();
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
if (tm_abort_check(regs, TM_CAUSE_ALIGNMENT | TM_CAUSE_PERSISTENT))
goto bail;
+#endif
/* we don't implement logging of alignment exceptions */
if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
--
2.19.0
^ permalink raw reply related
* Re: [PATCH] powerpc: signedness bug in update_flash_db()
From: Dan Carpenter @ 2018-10-01 19:06 UTC (permalink / raw)
To: christophe leroy
Cc: Geoff Levand, Geert Uytterhoeven, kernel-janitors, linuxppc-dev,
Paul Mackerras
In-Reply-To: <20181001190254.vtuop3jqh5vrvwtq@mwanda>
On Mon, Oct 01, 2018 at 10:02:54PM +0300, Dan Carpenter wrote:
> On Mon, Oct 01, 2018 at 08:22:01PM +0200, christophe leroy wrote:
> >
> >
> > Le 01/10/2018 à 18:44, Dan Carpenter a écrit :
> > > The "count < sizeof(struct os_area_db)" comparison is type promoted to
> > > size_t so negative values of "count" are treated as very high values and
> > > we accidentally return success instead of a negative error code.
> > >
> > > This doesn't really change runtime much but it fixes a static checker
> > > warning.
> > >
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > >
> > > diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
> > > index cdbfc5cfd6f3..f5387ad82279 100644
> > > --- a/arch/powerpc/platforms/ps3/os-area.c
> > > +++ b/arch/powerpc/platforms/ps3/os-area.c
> > > @@ -664,7 +664,7 @@ static int update_flash_db(void)
> > > db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff);
> > > count = os_area_flash_write(db, sizeof(struct os_area_db), pos);
> > > - if (count < sizeof(struct os_area_db)) {
> > > + if (count < 0 || count < sizeof(struct os_area_db)) {
> >
> > Why not simply add a cast ? :
> >
> > if (count < (ssize_t)sizeof(struct os_area_db)) {
> >
>
> There are so many ways to solve these and no accounting for taste. Do
> you need me to resend or can you redo it yourself?
>
Btw, I just went on vacation, and I'm not going to be back until next
week.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] powerpc: signedness bug in update_flash_db()
From: Dan Carpenter @ 2018-10-01 19:02 UTC (permalink / raw)
To: christophe leroy
Cc: Geoff Levand, Geert Uytterhoeven, kernel-janitors, linuxppc-dev,
Paul Mackerras
In-Reply-To: <6fa5827e-3346-4057-ca44-c6d9758f5837@c-s.fr>
On Mon, Oct 01, 2018 at 08:22:01PM +0200, christophe leroy wrote:
>
>
> Le 01/10/2018 à 18:44, Dan Carpenter a écrit :
> > The "count < sizeof(struct os_area_db)" comparison is type promoted to
> > size_t so negative values of "count" are treated as very high values and
> > we accidentally return success instead of a negative error code.
> >
> > This doesn't really change runtime much but it fixes a static checker
> > warning.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
> > index cdbfc5cfd6f3..f5387ad82279 100644
> > --- a/arch/powerpc/platforms/ps3/os-area.c
> > +++ b/arch/powerpc/platforms/ps3/os-area.c
> > @@ -664,7 +664,7 @@ static int update_flash_db(void)
> > db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff);
> > count = os_area_flash_write(db, sizeof(struct os_area_db), pos);
> > - if (count < sizeof(struct os_area_db)) {
> > + if (count < 0 || count < sizeof(struct os_area_db)) {
>
> Why not simply add a cast ? :
>
> if (count < (ssize_t)sizeof(struct os_area_db)) {
>
There are so many ways to solve these and no accounting for taste. Do
you need me to resend or can you redo it yourself?
regards,
dan carpenter
^ permalink raw reply
* [PATCH] migration/mm: Add WARN_ON to try_offline_node
From: Michael Bringmann @ 2018-10-01 18:56 UTC (permalink / raw)
To: linuxppc-dev, linux-kernel, linux-mm, mwb
Cc: Michal Hocko, Thomas Falcon, Kees Cook, Mathieu Malaterre,
Pavel Tatashin, Nicholas Piggin, YASUAKI ISHIMATSU,
Mauricio Faria de Oliveira, Juliet Kim, Tyrel Datwyler,
Thiago Jung Bauermann, Nathan Fontenot, Andrew Morton,
Dan Williams, Oscar Salvador
In some LPAR migration scenarios, device-tree modifications are
made to the affinity of the memory in the system. For instance,
it may occur that memory is installed to nodes 0,3 on a source
system, and to nodes 0,2 on a target system. Node 2 may not
have been initialized/allocated on the target system.
After migration, if a RTAS PRRN memory remove is made to a
memory block that was in node 3 on the source system, then
try_offline_node tries to remove it from node 2 on the target.
The NODE_DATA(2) block would not be initialized on the target,
and there is no validation check in the current code to prevent
the use of a NULL pointer. Call traces such as the following
may be observed:
A similar problem of moving memory to an unitialized node has
also been observed on systems where multiple PRRN events occur
prior to a complete update of the device-tree.
pseries-hotplug-mem: Attempting to update LMB, drc index 80000002
Offlined Pages 4096
...
Oops: Kernel access of bad area, sig: 11 [#1]
...
Workqueue: pseries hotplug workque pseries_hp_work_fn
...
NIP [c0000000002bc088] try_offline_node+0x48/0x1e0
LR [c0000000002e0b84] remove_memory+0xb4/0xf0
Call Trace:
[c0000002bbee7a30] [c0000002bbee7a70] 0xc0000002bbee7a70 (unreliable)
[c0000002bbee7a70] [c0000000002e0b84] remove_memory+0xb4/0xf0
[c0000002bbee7ab0] [c000000000097784] dlpar_remove_lmb+0xb4/0x160
[c0000002bbee7af0] [c000000000097f38] dlpar_memory+0x328/0xcb0
[c0000002bbee7ba0] [c0000000000906d0] handle_dlpar_errorlog+0xc0/0x130
[c0000002bbee7c10] [c0000000000907d4] pseries_hp_work_fn+0x94/0xa0
[c0000002bbee7c40] [c0000000000e1cd0] process_one_work+0x1a0/0x4e0
[c0000002bbee7cd0] [c0000000000e21b0] worker_thread+0x1a0/0x610
[c0000002bbee7d80] [c0000000000ea458] kthread+0x128/0x150
[c0000002bbee7e30] [c00000000000982c] ret_from_kernel_thread+0x5c/0xb0
This patch adds a check for an incorrectly initialized to the
beginning of try_offline_node, and exits the routine.
Another patch is being developed for powerpc to track the
node Id to which an LMB belongs, so that we can remove the
LMB from there instead of the nid as currently interpreted
from the device tree.
Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
mm/memory_hotplug.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 38d94b7..e48a4d0 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1831,10 +1831,16 @@ static int check_and_unmap_cpu_on_node(pg_data_t *pgdat)
void try_offline_node(int nid)
{
pg_data_t *pgdat = NODE_DATA(nid);
- unsigned long start_pfn = pgdat->node_start_pfn;
- unsigned long end_pfn = start_pfn + pgdat->node_spanned_pages;
+ unsigned long start_pfn;
+ unsigned long end_pfn;
unsigned long pfn;
+ if (WARN_ON(pgdat == NULL))
+ return;
+
+ start_pfn = pgdat->node_start_pfn;
+ end_pfn = start_pfn + pgdat->node_spanned_pages;
+
for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
unsigned long section_nr = pfn_to_section_nr(pfn);
^ permalink raw reply related
* [PATCH] powerpc/mobility: Extend start/stop topology update scope
From: Michael Bringmann @ 2018-10-01 18:56 UTC (permalink / raw)
To: linuxppc-dev, mwb
Cc: Nathan Fontenot, Juliet Kim, Thomas Falcon, Tyrel Datwyler
The PPC mobility code may receive RTAS requests to perform PRRN
topology changes at any time, including during LPAR migration
operations. In some configurations where the affinity of CPUs
or memory is being changed on that platform, the PRRN requests
may apply or refer to outdated information prior to the complete
update of the device-tree. This patch changes the duration for
which topology updates are suppressed during LPAR migrations from
just the rtas_ibm_suspend_me / 'ibm,suspend-me' call(s) to cover
the entire 'migration_store' operation to allow all changes to
the device-tree to be applied prior to accepting and applying any
PRRN requests.
For tracking purposes, pr_info notices are added to the functions
start_topology_update() and stop_topology_update() of 'numa.c'.
Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
arch/powerpc/kernel/rtas.c | 4 ----
arch/powerpc/mm/numa.c | 6 ++++++
arch/powerpc/platforms/pseries/mobility.c | 5 +++++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 8afd146..28d8b57 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -981,8 +981,6 @@ int rtas_ibm_suspend_me(u64 handle)
goto out;
}
- stop_topology_update();
-
/* Call function on all CPUs. One of us will make the
* rtas call
*/
@@ -994,8 +992,6 @@ int rtas_ibm_suspend_me(u64 handle)
if (atomic_read(&data.error) != 0)
printk(KERN_ERR "Error doing global join\n");
- start_topology_update();
-
/* Take down CPUs not online prior to suspend */
cpuret = rtas_offline_cpus_mask(offline_mask);
if (cpuret)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b5a71ba..0ade0a1 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1518,6 +1518,10 @@ int start_topology_update(void)
}
}
+ pr_info("Starting topology update%s%s\n",
+ (prrn_enabled ? " prrn_enabled" : ""),
+ (vphn_enabled ? " vphn_enabled" : ""));
+
return rc;
}
@@ -1539,6 +1543,8 @@ int stop_topology_update(void)
rc = del_timer_sync(&topology_timer);
}
+ pr_info("Stopping topology update\n");
+
return rc;
}
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 23fb9ac..49ebefd 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -373,6 +373,8 @@ static ssize_t migration_store(struct class *class,
if (rc)
return rc;
+ stop_topology_update();
+
do {
rc = rtas_ibm_suspend_me(streamid);
if (rc == -EAGAIN)
@@ -383,6 +385,9 @@ static ssize_t migration_store(struct class *class,
return rc;
post_mobility_fixup();
+
+ start_topology_update();
+
return count;
}
^ permalink raw reply related
* Re: [PATCH] powerpc: signedness bug in update_flash_db()
From: christophe leroy @ 2018-10-01 18:22 UTC (permalink / raw)
To: Dan Carpenter, Geoff Levand, Geert Uytterhoeven
Cc: Paul Mackerras, kernel-janitors, linuxppc-dev
In-Reply-To: <20181001164458.GB29197@mwanda>
Le 01/10/2018 à 18:44, Dan Carpenter a écrit :
> The "count < sizeof(struct os_area_db)" comparison is type promoted to
> size_t so negative values of "count" are treated as very high values and
> we accidentally return success instead of a negative error code.
>
> This doesn't really change runtime much but it fixes a static checker
> warning.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
> index cdbfc5cfd6f3..f5387ad82279 100644
> --- a/arch/powerpc/platforms/ps3/os-area.c
> +++ b/arch/powerpc/platforms/ps3/os-area.c
> @@ -664,7 +664,7 @@ static int update_flash_db(void)
> db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff);
>
> count = os_area_flash_write(db, sizeof(struct os_area_db), pos);
> - if (count < sizeof(struct os_area_db)) {
> + if (count < 0 || count < sizeof(struct os_area_db)) {
Why not simply add a cast ? :
if (count < (ssize_t)sizeof(struct os_area_db)) {
Christophe
> pr_debug("%s: os_area_flash_write failed %zd\n", __func__,
> count);
> error = count < 0 ? count : -EIO;
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* [PATCH] driver core: device: add BUS_ATTR_WO macro
From: Ioana Ciornei @ 2018-10-01 15:32 UTC (permalink / raw)
To: gregkh, idryomov, sage, elder, jth, benh
Cc: linux-scsi, linux-kernel, linux-block, Ioana Ciornei, ceph-devel,
linuxppc-dev
Add BUS_ATTR_WO macro to make it easier to add attributes without
auditing the mode settings. Also, use the newly added macro where
appropriate.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
arch/powerpc/platforms/pseries/ibmebus.c | 12 ++++----
drivers/block/rbd.c | 48 ++++++++++++++++----------------
drivers/scsi/fcoe/fcoe_sysfs.c | 4 +--
drivers/scsi/fcoe/fcoe_transport.c | 10 +++----
include/linux/device.h | 2 ++
include/scsi/libfcoe.h | 8 +++---
6 files changed, 43 insertions(+), 41 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c
index c7c1140..c75006c 100644
--- a/arch/powerpc/platforms/pseries/ibmebus.c
+++ b/arch/powerpc/platforms/pseries/ibmebus.c
@@ -261,8 +261,8 @@ static char *ibmebus_chomp(const char *in, size_t count)
return out;
}
-static ssize_t ibmebus_store_probe(struct bus_type *bus,
- const char *buf, size_t count)
+static ssize_t probe_store(struct bus_type *bus,
+ const char *buf, size_t count)
{
struct device_node *dn = NULL;
struct device *dev;
@@ -298,10 +298,10 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus,
return rc;
return count;
}
-static BUS_ATTR(probe, 0200, NULL, ibmebus_store_probe);
+static BUS_ATTR_WO(probe);
-static ssize_t ibmebus_store_remove(struct bus_type *bus,
- const char *buf, size_t count)
+static ssize_t remove_store(struct bus_type *bus,
+ const char *buf, size_t count)
{
struct device *dev;
char *path;
@@ -325,7 +325,7 @@ static ssize_t ibmebus_store_remove(struct bus_type *bus,
return -ENODEV;
}
}
-static BUS_ATTR(remove, 0200, NULL, ibmebus_store_remove);
+static BUS_ATTR_WO(remove);
static struct attribute *ibmbus_bus_attrs[] = {
&bus_attr_probe.attr,
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 73ed5f3..703d875 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -428,14 +428,14 @@ enum rbd_dev_flags {
module_param(single_major, bool, 0444);
MODULE_PARM_DESC(single_major, "Use a single major number for all rbd devices (default: true)");
-static ssize_t rbd_add(struct bus_type *bus, const char *buf,
- size_t count);
-static ssize_t rbd_remove(struct bus_type *bus, const char *buf,
- size_t count);
-static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf,
- size_t count);
-static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf,
- size_t count);
+static ssize_t add_store(struct bus_type *bus, const char *buf,
+ size_t count);
+static ssize_t remove_store(struct bus_type *bus, const char *buf,
+ size_t count);
+static ssize_t add_single_major_store(struct bus_type *bus, const char *buf,
+ size_t count);
+static ssize_t remove_single_major_store(struct bus_type *bus, const char *buf,
+ size_t count);
static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth);
static int rbd_dev_id_to_minor(int dev_id)
@@ -469,10 +469,10 @@ static ssize_t rbd_supported_features_show(struct bus_type *bus, char *buf)
return sprintf(buf, "0x%llx\n", RBD_FEATURES_SUPPORTED);
}
-static BUS_ATTR(add, 0200, NULL, rbd_add);
-static BUS_ATTR(remove, 0200, NULL, rbd_remove);
-static BUS_ATTR(add_single_major, 0200, NULL, rbd_add_single_major);
-static BUS_ATTR(remove_single_major, 0200, NULL, rbd_remove_single_major);
+static BUS_ATTR_WO(add);
+static BUS_ATTR_WO(remove);
+static BUS_ATTR_WO(add_single_major);
+static BUS_ATTR_WO(remove_single_major);
static BUS_ATTR(supported_features, 0444, rbd_supported_features_show, NULL);
static struct attribute *rbd_bus_attrs[] = {
@@ -5930,9 +5930,9 @@ static ssize_t do_rbd_add(struct bus_type *bus,
goto out;
}
-static ssize_t rbd_add(struct bus_type *bus,
- const char *buf,
- size_t count)
+static ssize_t add_store(struct bus_type *bus,
+ const char *buf,
+ size_t count)
{
if (single_major)
return -EINVAL;
@@ -5940,9 +5940,9 @@ static ssize_t rbd_add(struct bus_type *bus,
return do_rbd_add(bus, buf, count);
}
-static ssize_t rbd_add_single_major(struct bus_type *bus,
- const char *buf,
- size_t count)
+static ssize_t add_single_major_store(struct bus_type *bus,
+ const char *buf,
+ size_t count)
{
return do_rbd_add(bus, buf, count);
}
@@ -6046,9 +6046,9 @@ static ssize_t do_rbd_remove(struct bus_type *bus,
return count;
}
-static ssize_t rbd_remove(struct bus_type *bus,
- const char *buf,
- size_t count)
+static ssize_t remove_store(struct bus_type *bus,
+ const char *buf,
+ size_t count)
{
if (single_major)
return -EINVAL;
@@ -6056,9 +6056,9 @@ static ssize_t rbd_remove(struct bus_type *bus,
return do_rbd_remove(bus, buf, count);
}
-static ssize_t rbd_remove_single_major(struct bus_type *bus,
- const char *buf,
- size_t count)
+static ssize_t remove_single_major_store(struct bus_type *bus,
+ const char *buf,
+ size_t count)
{
return do_rbd_remove(bus, buf, count);
}
diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 5c8310b..3c23b26 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -671,8 +671,8 @@ static void fcoe_fcf_device_release(struct device *dev)
.release = fcoe_fcf_device_release,
};
-static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store);
-static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store);
+static BUS_ATTR_WO(ctlr_create);
+static BUS_ATTR_WO(ctlr_destroy);
static struct attribute *fcoe_bus_attrs[] = {
&bus_attr_ctlr_create.attr,
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index f4909cd..7789141 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -754,8 +754,8 @@ static int libfcoe_device_notification(struct notifier_block *notifier,
return NOTIFY_OK;
}
-ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
- const char *buf, size_t count)
+ssize_t ctlr_create_store(struct bus_type *bus,
+ const char *buf, size_t count)
{
struct net_device *netdev = NULL;
struct fcoe_transport *ft = NULL;
@@ -817,8 +817,8 @@ ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
return count;
}
-ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus,
- const char *buf, size_t count)
+ssize_t ctlr_destroy_store(struct bus_type *bus,
+ const char *buf, size_t count)
{
int rc = -ENODEV;
struct net_device *netdev = NULL;
@@ -855,7 +855,7 @@ ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus,
mutex_unlock(&ft_mutex);
return rc;
}
-EXPORT_SYMBOL(fcoe_ctlr_destroy_store);
+EXPORT_SYMBOL(ctlr_destroy_store);
/**
* fcoe_transport_create() - Create a fcoe interface
diff --git a/include/linux/device.h b/include/linux/device.h
index 8f88254..767cf19 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -55,6 +55,8 @@ struct bus_attribute {
struct bus_attribute bus_attr_##_name = __ATTR_RW(_name)
#define BUS_ATTR_RO(_name) \
struct bus_attribute bus_attr_##_name = __ATTR_RO(_name)
+#define BUS_ATTR_WO(_name) \
+ struct bus_attribute bus_attr_##_name = __ATTR_WO(_name)
extern int __must_check bus_create_file(struct bus_type *,
struct bus_attribute *);
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index cb8a273..f58388c 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -405,10 +405,10 @@ struct fcoe_netdev_mapping {
int fcoe_transport_detach(struct fcoe_transport *ft);
/* sysfs store handler for ctrl_control interface */
-ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
- const char *buf, size_t count);
-ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus,
- const char *buf, size_t count);
+ssize_t ctlr_create_store(struct bus_type *bus,
+ const char *buf, size_t count);
+ssize_t ctlr_destroy_store(struct bus_type *bus,
+ const char *buf, size_t count);
#endif /* _LIBFCOE_H */
--
1.9.1
^ permalink raw reply related
* Re: [RFC PATCH 11/11] selftests/powerpc: Adapt the test
From: Breno Leitao @ 2018-10-01 17:50 UTC (permalink / raw)
To: Michael Neuling, linuxppc-dev; +Cc: ldufour, gromero
In-Reply-To: <e852ee2d7f960efc7d28c5fb7c9ea782b2f87856.camel@neuling.org>
Hi Mikey,
On 09/28/2018 02:25 AM, Michael Neuling wrote:
>> Perfect, and if the transaction fail, the CPU will rollback the changes and
>> restore the checkpoint registers (replacing the r3 that contains the pid
>> value), thus, it will be like "getpid" system call didn't execute.
>
> No. If we are suspended, then we go back right after the sc. We don't get
> rolled back till the tresume.
Yes, but the test code (below) just run tresume after 'sc'. i.e, the syscall
will execute, but there is a tresume just after the syscall, which will cause
the transaction to rollback and jump to "1:" label, which will replace r3.
with -1.
So, the difference now (with this patchset) is that we are calling
treclaim/trecheckpoint in kernel space, which will doom the transaction. It
was not being done before, thus, the test was passing and it is not anymore.
Anyway, the other way to check for it is calling 'blr' just after 'sc' (
before 'tresume.'), and then tresume after checking if pid == getpid().
If you prefer this method, I can implement it.
>> For this test specifically, it assumes the syscall didn't execute if the
>> transaction failed. Take a look:
>>
>> FUNC_START(getppid_tm_suspended)
>> tbegin.
>> beq 1f
>> li r0, __NR_getppid
>> tsuspend.
>> sc
>> tresume.
>> tend.
>> blr
>> 1:
>> li r3, -1
>> blr
>>
Thank you!
^ permalink raw reply
* [PATCH] powerpc: signedness bug in update_flash_db()
From: Dan Carpenter @ 2018-10-01 16:44 UTC (permalink / raw)
To: Geoff Levand, Geert Uytterhoeven
Cc: kernel-janitors, Paul Mackerras, linuxppc-dev
The "count < sizeof(struct os_area_db)" comparison is type promoted to
size_t so negative values of "count" are treated as very high values and
we accidentally return success instead of a negative error code.
This doesn't really change runtime much but it fixes a static checker
warning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index cdbfc5cfd6f3..f5387ad82279 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -664,7 +664,7 @@ static int update_flash_db(void)
db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff);
count = os_area_flash_write(db, sizeof(struct os_area_db), pos);
- if (count < sizeof(struct os_area_db)) {
+ if (count < 0 || count < sizeof(struct os_area_db)) {
pr_debug("%s: os_area_flash_write failed %zd\n", __func__,
count);
error = count < 0 ? count : -EIO;
^ permalink raw reply related
* Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types
From: Dave Hansen @ 2018-10-01 16:24 UTC (permalink / raw)
To: David Hildenbrand, linux-mm
Cc: Kate Stewart, Rich Felker, linux-ia64, linux-sh, Peter Zijlstra,
Heiko Carstens, Pavel Tatashin, Michal Hocko, Paul Mackerras,
H. Peter Anvin, Rashmica Gupta, K. Y. Srinivasan, Boris Ostrovsky,
linux-s390, Michael Neuling, Stephen Hemminger, Yoshinori Sato,
linux-acpi, Ingo Molnar, xen-devel, Rob Herring, Len Brown,
Fenghua Yu, Stephen Rothwell, mike.travis@hpe.com, Haiyang Zhang,
Dan Williams, Jonathan Neuschäfer, Nicholas Piggin,
Joe Perches, Jérôme Glisse, Mike Rapoport,
Borislav Petkov, Andy Lutomirski, Thomas Gleixner, Joonsoo Kim,
Oscar Salvador, Juergen Gross, Tony Luck, Mathieu Malaterre,
Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel,
Mauricio Faria de Oliveira, Philippe Ombredanne,
Martin Schwidefsky, devel, Andrew Morton, linuxppc-dev,
Kirill A. Shutemov
In-Reply-To: <147d20c7-2a07-2305-9b44-76fdb735173b@redhat.com>
> How should a policy in user space look like when new memory gets added
> - on s390x? Not onlining paravirtualized memory is very wrong.
Because we're going to balloon it away in a moment anyway?
We have auto-onlining. Why isn't that being used on s390?
> So the type of memory is very important here to have in user space.
> Relying on checks like "isS390()", "isKVMGuest()" or "isHyperVGuest()"
> to decide whether to online memory and how to online memory is wrong.
> Only some specific memory types (which I call "normal") are to be
> handled by user space.
>
> For the other ones, we exactly know what to do:
> - standby? don't online
I think you're horribly conflating the software desire for what the stae
should be and the hardware itself.
>> As for the OOM issues, that sounds like something we need to fix by
>> refusing to do (or delaying) hot-add operations once we consume too much
>> ZONE_NORMAL from memmap[]s rather than trying to indirectly tell
>> userspace to hurry thing along.
>
> That is a moving target and doing that automatically is basically
> impossible.
Nah. We know how much metadata we've allocated. We know how much
ZONE_NORMAL we are eating. We can *easily* add something to
add_memory() that just sleeps until the ratio is not out-of-whack.
> You can add a lot of memory to the movable zone and
> everything is fine. Suddenly a lot of processes are started - boom.
> MOVABLE should only every be used if you expect an unplug. And for
> paravirtualized devices, a "typical" unplug does not exist.
No, it's more complicated than that. People use MOVABLE, for instance,
to allow more consistent huge page allocations. It's certainly not just
hot-remove.
^ permalink raw reply
* [PATCH v4 7/9] powerpc: enable building all dtbs
From: Rob Herring @ 2018-10-01 15:25 UTC (permalink / raw)
To: devicetree, linux-kernel, Masahiro Yamada, Frank Rowand
Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <20181001152531.3385-1-robh@kernel.org>
Enable the 'dtbs' target for powerpc. This allows building all the dts
files in arch/powerpc/boot/dts/ when COMPILE_TEST and OF_ALL_DTBS are
enabled.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
arch/powerpc/boot/dts/Makefile | 5 +++++
arch/powerpc/boot/dts/fsl/Makefile | 4 ++++
2 files changed, 9 insertions(+)
create mode 100644 arch/powerpc/boot/dts/fsl/Makefile
diff --git a/arch/powerpc/boot/dts/Makefile b/arch/powerpc/boot/dts/Makefile
index f66554cd5c45..fb335d05aae8 100644
--- a/arch/powerpc/boot/dts/Makefile
+++ b/arch/powerpc/boot/dts/Makefile
@@ -1 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
+
+subdir-y += fsl
+
+dtstree := $(srctree)/$(src)
+dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
diff --git a/arch/powerpc/boot/dts/fsl/Makefile b/arch/powerpc/boot/dts/fsl/Makefile
new file mode 100644
index 000000000000..3bae982641e9
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
+dtstree := $(srctree)/$(src)
+dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
--
2.17.1
^ permalink raw reply related
* [PATCH v4 6/9] kbuild: consolidate Devicetree dtb build rules
From: Rob Herring @ 2018-10-01 15:25 UTC (permalink / raw)
To: devicetree, linux-kernel, Masahiro Yamada, Frank Rowand
Cc: linux-mips, Will Deacon, Max Filippov, Paul Mackerras,
Yoshinori Sato, Russell King, Ley Foon Tan, Catalin Marinas,
James Hogan, linux-snps-arc, uclinux-h8-devel, linux-xtensa,
linux-kbuild, linux-arm-kernel, Chris Zankel, Michal Simek,
Michal Marek, Vineet Gupta, Ralf Baechle, Paul Burton, nios2-dev,
linuxppc-dev
In-Reply-To: <20181001152531.3385-1-robh@kernel.org>
There is nothing arch specific about building dtb files other than their
location under /arch/*/boot/dts/. Keeping each arch aligned is a pain.
The dependencies and supported targets are all slightly different.
Also, a cross-compiler for each arch is needed, but really the host
compiler preprocessor is perfectly fine for building dtbs. Move the
build rules to a common location and remove the arch specific ones. This
is done in a single step to avoid warnings about overriding rules.
The build dependencies had been a mixture of 'scripts' and/or 'prepare'.
These pull in several dependencies some of which need a target compiler
(specifically devicetable-offsets.h) and aren't needed to build dtbs.
All that is really needed is dtc, so adjust the dependencies to only be
dtc.
This change enables support 'dtbs_install' on some arches which were
missing the target.
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Paul Burton <paul.burton@mips.com>
Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-mips@linux-mips.org
Cc: nios2-dev@lists.rocketboards.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-xtensa@linux-xtensa.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
v4:
- Make dtbs and %.dtb rules depend on arch/$ARCH/boot/dts path rather than
CONFIG_OF_EARLY_FLATTREE
- Fix install path missing kernel version for dtbs_install
- Fix "make CONFIG_OF_ALL_DTBS=y" for arches like ARM which selectively
enable CONFIG_OF (and therefore dtc)
Makefile | 37 ++++++++++++++++++++++++++++++-
arch/arc/Makefile | 6 -----
arch/arm/Makefile | 20 +----------------
arch/arm64/Makefile | 17 +-------------
arch/c6x/Makefile | 2 --
arch/h8300/Makefile | 11 +--------
arch/microblaze/Makefile | 4 +---
arch/microblaze/boot/dts/Makefile | 2 ++
arch/mips/Makefile | 15 +------------
arch/nds32/Makefile | 2 +-
arch/nios2/Makefile | 7 ------
arch/nios2/boot/Makefile | 4 ----
arch/powerpc/Makefile | 3 ---
arch/xtensa/Makefile | 12 +---------
scripts/Makefile | 3 +--
scripts/Makefile.lib | 2 +-
scripts/dtc/Makefile | 2 +-
17 files changed, 48 insertions(+), 101 deletions(-)
diff --git a/Makefile b/Makefile
index 6c3da3e10f07..251875470c5b 100644
--- a/Makefile
+++ b/Makefile
@@ -1061,7 +1061,7 @@ include/config/kernel.release: $(srctree)/Makefile FORCE
# Carefully list dependencies so we do not try to build scripts twice
# in parallel
PHONY += scripts
-scripts: scripts_basic asm-generic gcc-plugins $(autoksyms_h)
+scripts: scripts_basic scripts_dtc asm-generic gcc-plugins $(autoksyms_h)
$(Q)$(MAKE) $(build)=$(@)
# Things we need to do before we recursively start building the kernel
@@ -1205,6 +1205,35 @@ kselftest-merge:
$(srctree)/tools/testing/selftests/*/config
+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
+# ---------------------------------------------------------------------------
+# Devicetree files
+
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
+dtstree := arch/$(SRCARCH)/boot/dts
+endif
+
+ifneq ($(dtstree),)
+
+%.dtb: prepare3 scripts_dtc
+ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+
+PHONY += dtbs dtbs_install
+dtbs: prepare3 scripts_dtc
+ $(Q)$(MAKE) $(build)=$(dtstree)
+
+dtbs_install:
+ $(Q)$(MAKE) $(dtbinst)=$(dtstree)
+
+ifdef CONFIG_OF_EARLY_FLATTREE
+all: dtbs
+endif
+
+endif
+
+PHONY += scripts_dtc
+scripts_dtc: scripts_basic
+ $(Q)$(MAKE) $(build)=scripts/dtc
+
# ---------------------------------------------------------------------------
# Modules
@@ -1414,6 +1443,12 @@ help:
@echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing'
@echo ' .config.'
@echo ''
+ @$(if $(dtstree), \
+ echo 'Devicetree:'; \
+ echo '* dtbs - Build device tree blobs for enabled boards'; \
+ echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
+ echo '')
+
@echo 'Userspace tools targets:'
@echo ' use "make tools/help"'
@echo ' or "cd tools; make help"'
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 99cce77ab98f..caece8866080 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -124,11 +124,5 @@ boot_targets += uImage uImage.bin uImage.gz
$(boot_targets): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
-%.dtb %.dtb.S %.dtb.o: scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
-
-dtbs: scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts
-
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d1516f85f25d..161c2df6567e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -307,12 +307,7 @@ else
KBUILD_IMAGE := $(boot)/zImage
endif
-# Build the DT binary blobs if we have OF configured
-ifeq ($(CONFIG_USE_OF),y)
-KBUILD_DTBS := dtbs
-endif
-
-all: $(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS)
+all: $(notdir $(KBUILD_IMAGE))
archheaders:
@@ -339,17 +334,6 @@ $(BOOT_TARGETS): vmlinux
$(INSTALL_TARGETS):
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
-%.dtb: | scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
-
-PHONY += dtbs dtbs_install
-
-dtbs: prepare scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts
-
-dtbs_install:
- $(Q)$(MAKE) $(dtbinst)=$(boot)/dts
-
PHONY += vdso_install
vdso_install:
ifeq ($(CONFIG_VDSO),y)
@@ -371,8 +355,6 @@ define archhelp
echo ' uImage - U-Boot wrapped zImage'
echo ' bootpImage - Combined zImage and initial RAM disk'
echo ' (supply initrd image via make variable INITRD=<path>)'
- echo '* dtbs - Build device tree blobs for enabled boards'
- echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
echo ' install - Install uncompressed kernel'
echo ' zinstall - Install compressed kernel'
echo ' uinstall - Install U-Boot wrapped compressed kernel'
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 106039d25e2f..b4e994cd3a42 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -113,9 +113,8 @@ core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
# Default target when executing plain make
boot := arch/arm64/boot
KBUILD_IMAGE := $(boot)/Image.gz
-KBUILD_DTBS := dtbs
-all: Image.gz $(KBUILD_DTBS)
+all: Image.gz
Image: vmlinux
@@ -127,17 +126,6 @@ Image.%: Image
zinstall install:
$(Q)$(MAKE) $(build)=$(boot) $@
-%.dtb: scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
-
-PHONY += dtbs dtbs_install
-
-dtbs: prepare scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts
-
-dtbs_install:
- $(Q)$(MAKE) $(dtbinst)=$(boot)/dts
-
PHONY += vdso_install
vdso_install:
$(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@
@@ -145,7 +133,6 @@ vdso_install:
# We use MRPROPER_FILES and CLEAN_FILES now
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
- $(Q)$(MAKE) $(clean)=$(boot)/dts
# We need to generate vdso-offsets.h before compiling certain files in kernel/.
# In order to do that, we should use the archprepare target, but we can't since
@@ -160,8 +147,6 @@ vdso_prepare: prepare0
define archhelp
echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
- echo '* dtbs - Build device tree blobs for enabled boards'
- echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
echo ' install - Install uncompressed kernel'
echo ' zinstall - Install compressed kernel'
echo ' Install using (your) ~/bin/installkernel or'
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile
index 3fe8a948e94c..b7aa854f7008 100644
--- a/arch/c6x/Makefile
+++ b/arch/c6x/Makefile
@@ -40,9 +40,7 @@ boot := arch/$(ARCH)/boot
DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS)))
export DTB
-ifneq ($(DTB),)
core-y += $(boot)/dts/
-endif
# With make 3.82 we cannot mix normal and wildcard targets
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index 58634e6bae92..4003ddc616e1 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -31,21 +31,12 @@ CROSS_COMPILE := h8300-unknown-linux-
endif
core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
-ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
-core-y += arch/h8300/boot/dts/
-endif
+core-y += arch/$(ARCH)/boot/dts/
libs-y += arch/$(ARCH)/lib/
boot := arch/h8300/boot
-%.dtb %.dtb.S %.dtb.o: | scripts
- $(Q)$(MAKE) $(build)=arch/h8300/boot/dts arch/h8300/boot/dts/$@
-
-PHONY += dtbs
-dtbs: scripts
- $(Q)$(MAKE) $(build)=arch/h8300/boot/dts
-
archmrproper:
archclean:
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index 4f3ab5707265..0823d291fbeb 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -65,9 +65,7 @@ boot := arch/microblaze/boot
# Are we making a simpleImage.<boardname> target? If so, crack out the boardname
DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS)))
-ifneq ($(DTB),)
- core-y += $(boot)/dts/
-endif
+core-y += $(boot)/dts/
# defines filename extension depending memory management type
ifeq ($(CONFIG_MMU),)
diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile
index 1f77913d404d..fe9af267f598 100644
--- a/arch/microblaze/boot/dts/Makefile
+++ b/arch/microblaze/boot/dts/Makefile
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
#
+ifneq ($(DTB),)
obj-y += linked_dtb.o
# Ensure system.dtb exists
@@ -11,6 +12,7 @@ ifneq ($(DTB),system)
$(obj)/system.dtb: $(obj)/$(DTB).dtb
$(call if_changed,cp)
endif
+endif
quiet_cmd_cp = CP $< $@$2
cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index d74b3742fa5d..d43eeaa6d75b 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -407,18 +407,7 @@ endif
CLEAN_FILES += vmlinux.32 vmlinux.64
# device-trees
-core-$(CONFIG_BUILTIN_DTB) += arch/mips/boot/dts/
-
-%.dtb %.dtb.S %.dtb.o: | scripts
- $(Q)$(MAKE) $(build)=arch/mips/boot/dts arch/mips/boot/dts/$@
-
-PHONY += dtbs
-dtbs: scripts
- $(Q)$(MAKE) $(build)=arch/mips/boot/dts
-
-PHONY += dtbs_install
-dtbs_install:
- $(Q)$(MAKE) $(dtbinst)=arch/mips/boot/dts
+core-y += arch/mips/boot/dts/
archprepare:
ifdef CONFIG_MIPS32_N32
@@ -461,8 +450,6 @@ define archhelp
echo ' uImage.lzma - U-Boot image (lzma)'
echo ' uImage.lzo - U-Boot image (lzo)'
echo ' uzImage.bin - U-Boot image (self-extracting)'
- echo ' dtbs - Device-tree blobs for enabled boards'
- echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
echo
echo ' These will be default as appropriate for a configured platform.'
echo
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile
index 3509fac10491..9f525ed70049 100644
--- a/arch/nds32/Makefile
+++ b/arch/nds32/Makefile
@@ -47,7 +47,7 @@ CHECKFLAGS += -D__NDS32_EB__
endif
boot := arch/nds32/boot
-core-$(BUILTIN_DTB) += $(boot)/dts/
+core-y += $(boot)/dts/
.PHONY: FORCE
diff --git a/arch/nios2/Makefile b/arch/nios2/Makefile
index db2e78fe65c7..52c03e60b114 100644
--- a/arch/nios2/Makefile
+++ b/arch/nios2/Makefile
@@ -56,12 +56,6 @@ all: vmImage
archclean:
$(Q)$(MAKE) $(clean)=$(nios2-boot)
-%.dtb %.dtb.S %.dtb.o: | scripts
- $(Q)$(MAKE) $(build)=$(nios2-boot)/dts $(nios2-boot)/dts/$@
-
-dtbs:
- $(Q)$(MAKE) $(build)=$(nios2-boot)/dts
-
$(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
@@ -74,5 +68,4 @@ define archhelp
echo ' (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
echo ' install to $$(INSTALL_PATH)'
- echo ' dtbs - Build device tree blobs for enabled boards'
endef
diff --git a/arch/nios2/boot/Makefile b/arch/nios2/boot/Makefile
index 0b48f1bf086d..37dfc7e584bc 100644
--- a/arch/nios2/boot/Makefile
+++ b/arch/nios2/boot/Makefile
@@ -31,9 +31,5 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
-targets += $(dtb-y)
-
-$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
-
install:
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 53ea887eb34e..42f225f6ec93 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -293,9 +293,6 @@ $(BOOT_TARGETS2): vmlinux
bootwrapper_install:
$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
-%.dtb: scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts $(patsubst %,$(boot)/dts/%,$@)
-
# Used to create 'merged defconfigs'
# To use it $(call) it with the first argument as the base defconfig
# and the second argument as a space separated list of .config files to merge,
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index d67e30faff9c..be060dfb1cc3 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -80,28 +80,18 @@ LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
head-y := arch/xtensa/kernel/head.o
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
core-y += $(buildvar) $(buildplf)
+core-y += arch/xtensa/boot/dts/
libs-y += arch/xtensa/lib/ $(LIBGCC)
drivers-$(CONFIG_OPROFILE) += arch/xtensa/oprofile/
-ifneq ($(CONFIG_BUILTIN_DTB),"")
-core-$(CONFIG_OF) += arch/xtensa/boot/dts/
-endif
-
boot := arch/xtensa/boot
all Image zImage uImage: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $@
-%.dtb:
- $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
-
-dtbs: scripts
- $(Q)$(MAKE) $(build)=$(boot)/dts
-
define archhelp
@echo '* Image - Kernel ELF image with reset vector'
@echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
@echo '* uImage - U-Boot wrapped image'
- @echo ' dtbs - Build device tree blobs for enabled boards'
endef
diff --git a/scripts/Makefile b/scripts/Makefile
index 61affa300d25..ece52ff20171 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -39,8 +39,7 @@ build_unifdef: $(obj)/unifdef
subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-y += mod
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
-subdir-$(CONFIG_DTC) += dtc
subdir-$(CONFIG_GDB_SCRIPTS) += gdb
# Let clean descend into subdirs
-subdir- += basic kconfig package gcc-plugins
+subdir- += basic dtc kconfig package gcc-plugins
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 61e596650ed3..8fe4468f9bda 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -283,7 +283,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
quiet_cmd_dtc = DTC $@
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
- $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+ $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
$(DTC) -O dtb -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 1c943e03eaf2..e535b457babb 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# scripts/dtc makefile
-hostprogs-y := dtc
+hostprogs-$(CONFIG_DTC) := dtc
always := $(hostprogs-y)
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
--
2.17.1
^ permalink raw reply related
* [PATCH v4 1/9] powerpc: build .dtb files in dts directory
From: Rob Herring @ 2018-10-01 15:25 UTC (permalink / raw)
To: devicetree, linux-kernel, Masahiro Yamada, Frank Rowand
Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <20181001152531.3385-1-robh@kernel.org>
Align powerpc with other architectures which build the dtb files in the
same directory as the dts files. This is also in line with most other
build targets which are located in the same directory as the source.
This move will help enable the 'dtbs' target which builds all the dtbs
regardless of kernel config.
This transition could break some scripts if they expect dtb files in the
old location.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
PPC maintainers, really need you review/ack on this.
arch/powerpc/Makefile | 2 +-
arch/powerpc/boot/Makefile | 55 ++++++++++++++++------------------
arch/powerpc/boot/dts/Makefile | 1 +
3 files changed, 28 insertions(+), 30 deletions(-)
create mode 100644 arch/powerpc/boot/dts/Makefile
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 11a1acba164a..53ea887eb34e 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -294,7 +294,7 @@ bootwrapper_install:
$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
%.dtb: scripts
- $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+ $(Q)$(MAKE) $(build)=$(boot)/dts $(patsubst %,$(boot)/dts/%,$@)
# Used to create 'merged defconfigs'
# To use it $(call) it with the first argument as the base defconfig
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 0fb96c26136f..bca5c23767df 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -304,9 +304,9 @@ image-$(CONFIG_PPC_ADDER875) += cuImage.adder875-uboot \
dtbImage.adder875-redboot
# Board ports in arch/powerpc/platform/52xx/Kconfig
-image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200 lite5200.dtb
-image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200b lite5200b.dtb
-image-$(CONFIG_PPC_MEDIA5200) += cuImage.media5200 media5200.dtb
+image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200
+image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200b
+image-$(CONFIG_PPC_MEDIA5200) += cuImage.media5200
# Board ports in arch/powerpc/platform/82xx/Kconfig
image-$(CONFIG_MPC8272_ADS) += cuImage.mpc8272ads
@@ -381,11 +381,11 @@ $(addprefix $(obj)/, $(sort $(filter zImage.%, $(image-y)))): vmlinux $(wrapperb
$(call if_changed,wrap,$(subst $(obj)/zImage.,,$@))
# dtbImage% - a dtbImage is a zImage with an embedded device tree blob
-$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb FORCE
- $(call if_changed,wrap,$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
+ $(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
-$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/%.dtb FORCE
- $(call if_changed,wrap,$*,,$(obj)/$*.dtb)
+$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
+ $(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb)
# This cannot be in the root of $(src) as the zImage rule always adds a $(obj)
# prefix
@@ -395,36 +395,33 @@ $(obj)/vmlinux.strip: vmlinux
$(obj)/uImage: vmlinux $(wrapperbits) FORCE
$(call if_changed,wrap,uboot)
-$(obj)/uImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+$(obj)/uImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
-$(obj)/uImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb)
+$(obj)/uImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb)
-$(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+$(obj)/cuImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
-$(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb)
+$(obj)/cuImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb)
-$(obj)/simpleImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,simpleboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+$(obj)/simpleImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
-$(obj)/simpleImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,simpleboot-$*,,$(obj)/$*.dtb)
+$(obj)/simpleImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb)
-$(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+$(obj)/treeImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
-$(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
- $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)
+$(obj)/treeImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
+ $(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb)
-# Rule to build device tree blobs
-$(obj)/%.dtb: $(src)/dts/%.dts FORCE
- $(call if_changed_dep,dtc)
-
-$(obj)/%.dtb: $(src)/dts/fsl/%.dts FORCE
- $(call if_changed_dep,dtc)
+# Needed for the above targets to work with dts/fsl/ files
+$(obj)/dts/%.dtb: $(obj)/dts/fsl/%.dtb
+ @cp $< $@
# If there isn't a platform selected then just strip the vmlinux.
ifeq (,$(image-y))
diff --git a/arch/powerpc/boot/dts/Makefile b/arch/powerpc/boot/dts/Makefile
new file mode 100644
index 000000000000..f66554cd5c45
--- /dev/null
+++ b/arch/powerpc/boot/dts/Makefile
@@ -0,0 +1 @@
+# SPDX-License-Identifier: GPL-2.0
--
2.17.1
^ permalink raw reply related
* [PATCH v4 0/9] Devicetree build consolidation
From: Rob Herring @ 2018-10-01 15:25 UTC (permalink / raw)
To: devicetree, linux-kernel, Masahiro Yamada, Frank Rowand
Cc: linux-mips, Will Deacon, Max Filippov, Paul Mackerras,
Yoshinori Sato, Russell King, Ley Foon Tan, Catalin Marinas,
James Hogan, linux-snps-arc, uclinux-h8-devel, linux-xtensa,
linux-kbuild, linux-arm-kernel, Chris Zankel, Michal Simek,
Michal Marek, Vineet Gupta, Ralf Baechle, Paul Burton, nios2-dev,
linuxppc-dev
This series addresses a couple of issues I have with building dts files.
First, the ability to build all the dts files in the tree. This has been
supported on most arches for some time with powerpc being the main
exception. The reason powerpc wasn't supported was it needed a change
in the location built dtb files are put.
Secondly, it's a pain to acquire all the cross-compilers needed to build
dtbs for each arch. There's no reason to build with the cross compiler and
the host compiler is perfectly fine as we only need the pre-processor.
I started addressing just those 2 problems, but kept finding small
differences such as target dependencies and dtbs_install support across
architectures. Instead of trying to align all these, I've consolidated the
build targets moving them out of the arch makefiles.
I'd like to take the series via the DT tree.
PPC maintainers, really need you review/ack on this especially patch 1.
Rob
v4:
- Make dtbs and %.dtb rules depend on arch/$ARCH/boot/dts path rather than
CONFIG_OF_EARLY_FLATTREE
- Fix install path missing kernel version for dtbs_install
- Fix "make CONFIG_OF_ALL_DTBS=y" for arches like ARM which selectively
enable CONFIG_OF (and therefore dtc)
v3:
- Rework dtc dependency to avoid 2 entry paths to scripts/dtc/. Essentially,
I copied 'scripts_basic'.
- Add missing scripts_basic dependency for dtc and missing PHONY tag.
- Drop the '|' order only from dependencies
- Drop %.dtb.S and %.dtb.o as top-level targets
- PPC: remove duplicate mpc5200 dtbs from image-y targets
v2:
- Fix $arch/boot/dts path check for out of tree builds
- Fix dtc dependency for building built-in dtbs
- Fix microblaze built-in dtb building
- Add dtbs target for microblaze
Rob Herring (9):
powerpc: build .dtb files in dts directory
nios2: build .dtb files in dts directory
nios2: use common rules to build built-in dtb
nios2: fix building all dtbs
c6x: use common built-in dtb support
kbuild: consolidate Devicetree dtb build rules
powerpc: enable building all dtbs
c6x: enable building all dtbs
microblaze: enable building all dtbs
Makefile | 37 +++++++++++++++++++-
arch/arc/Makefile | 6 ----
arch/arm/Makefile | 20 +----------
arch/arm64/Makefile | 17 +--------
arch/c6x/Makefile | 2 --
arch/c6x/boot/dts/Makefile | 17 ++++-----
arch/c6x/boot/dts/linked_dtb.S | 2 --
arch/c6x/include/asm/sections.h | 1 -
arch/c6x/kernel/setup.c | 4 +--
arch/c6x/kernel/vmlinux.lds.S | 10 ------
arch/h8300/Makefile | 11 +-----
arch/microblaze/Makefile | 4 +--
arch/microblaze/boot/dts/Makefile | 4 +++
arch/mips/Makefile | 15 +-------
arch/nds32/Makefile | 2 +-
arch/nios2/Makefile | 11 +-----
arch/nios2/boot/Makefile | 22 ------------
arch/nios2/boot/dts/Makefile | 6 ++++
arch/nios2/boot/linked_dtb.S | 19 -----------
arch/powerpc/Makefile | 3 --
arch/powerpc/boot/Makefile | 55 ++++++++++++++----------------
arch/powerpc/boot/dts/Makefile | 6 ++++
arch/powerpc/boot/dts/fsl/Makefile | 4 +++
arch/xtensa/Makefile | 12 +------
scripts/Makefile | 3 +-
scripts/Makefile.lib | 2 +-
scripts/dtc/Makefile | 2 +-
27 files changed, 102 insertions(+), 195 deletions(-)
delete mode 100644 arch/c6x/boot/dts/linked_dtb.S
create mode 100644 arch/nios2/boot/dts/Makefile
delete mode 100644 arch/nios2/boot/linked_dtb.S
create mode 100644 arch/powerpc/boot/dts/Makefile
create mode 100644 arch/powerpc/boot/dts/fsl/Makefile
--
2.17.1
^ permalink raw reply
* Re: [PATCH v2] powerpc/rtas: Fix a potential race between CPU-Offline & Migration
From: Nathan Fontenot @ 2018-10-01 15:19 UTC (permalink / raw)
To: Gautham R. Shenoy, Michael Ellerman, Tyrel Datwyler; +Cc: linuxppc-dev
In-Reply-To: <1538390439-17072-1-git-send-email-ego@linux.vnet.ibm.com>
On 10/01/2018 05:40 AM, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
>
> Live Partition Migrations require all the present CPUs to execute the
> H_JOIN call, and hence rtas_ibm_suspend_me() onlines any offline CPUs
> before initiating the migration for this purpose.
>
> The commit 85a88cabad57
> ("powerpc/pseries: Disable CPU hotplug across migrations")
> disables any CPU-hotplug operations once all the offline CPUs are
> brought online to prevent any further state change. Once the
> CPU-Hotplug operation is disabled, the code assumes that all the CPUs
> are online.
>
> However, there is a minor window in rtas_ibm_suspend_me() between
> onlining the offline CPUs and disabling CPU-Hotplug when a concurrent
> CPU-offline operations initiated by the userspace can succeed thereby
> nullifying the the aformentioned assumption. In this unlikely case
> these offlined CPUs will not call H_JOIN, resulting in a system hang.
>
> Fix this by verifying that all the present CPUs are actually online
> after CPU-Hotplug has been disabled, failing which we restore the
> state of the offline CPUs in rtas_ibm_suspend_me() and return an
> -EBUSY.
>
> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> Cc: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
> Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> ---
> v2: Restore the state of the offline CPUs if all CPUs aren't onlined.
>
> arch/powerpc/kernel/rtas.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 2c7ed31..d4468cb 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -982,6 +982,15 @@ int rtas_ibm_suspend_me(u64 handle)
> }
>
> cpu_hotplug_disable();
> +
> + /* Check if we raced with a CPU-Offline Operation */
> + if (unlikely(!cpumask_equal(cpu_present_mask, cpu_online_mask))) {
> + pr_err("%s: Raced against a concurrent CPU-Offline\n",
> + __func__);
> + atomic_set(&data.error, -EBUSY);
> + goto out_hotplug_enable;
> + }
> +
> stop_topology_update();
>
> /* Call function on all CPUs. One of us will make the
> @@ -996,6 +1005,8 @@ int rtas_ibm_suspend_me(u64 handle)
> printk(KERN_ERR "Error doing global join\n");
>
> start_topology_update();
> +
> +out_hotplug_enable:
> cpu_hotplug_enable();
>
> /* Take down CPUs not online prior to suspend */
>
^ permalink raw reply
* Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules
From: Masahiro Yamada @ 2018-10-01 14:48 UTC (permalink / raw)
To: Rob Herring
Cc: Linux-MIPS, linux-xtensa, Will Deacon, Max Filippov,
Paul Mackerras, Frank Rowand, Yoshinori Sato, Russell King,
Ley Foon Tan, Geert Uytterhoeven, Catalin Marinas, James Hogan,
arcml, moderated list:H8/300 ARCHITECTURE, DTML,
Linux Kbuild mailing list, linux-arm-kernel, Chris Zankel,
Michal Simek, Michal Marek, Vineet Gupta,
Linux Kernel Mailing List, Ralf Baechle, Paul Burton, nios2-dev,
linuxppc-dev
In-Reply-To: <CAL_JsqLPaX3GB1Esw3DhkQ+2fQLVG8=_UbyJC5RJ-6_s=v288g@mail.gmail.com>
Hi Rob,
2018年10月1日(月) 22:26 Rob Herring <robh@kernel.org>:
>
> On Mon, Oct 1, 2018 at 12:49 AM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > Hi Rob,
> >
> >
> > 2018年9月29日(土) 0:43 Rob Herring <robh@kernel.org>:
> >
> > > +#
> > > ---------------------------------------------------------------------------
> > > +# Devicetree files
> > > +
> > > +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
> > > +dtstree := arch/$(SRCARCH)/boot/dts
> > > +endif
> > > +
> > > +ifneq ($(dtstree),)
> > > +
> > > +%.dtb : scripts_dtc
> >
> > %.dtb: prepare3 prepare
>
> I assume you didn't mean to drop scripts_dtc as that doesn't work.
>
> Why "prepare" here and not on dtbs?
Sorry, my mistake.
%.dtb: prepare3 scripts_dtc
is the correct one.
> > because we need to make sure KERNELRELEASE
> > is correctly defined before dtbs_install happens.
>
> Yes, indeed. With prepare3 added I get:
>
> cp: cannot create regular file
> '/boot/dtbs/4.19.0-rc3-00009-g0afba9b7b2ea-dirty': No such file or
> directory
>
> vs. with it:
>
> cp: cannot create regular file '/boot/dtbs/': Not a directory
>
> >
> >
> > > + $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
> > > +
> > > +PHONY += dtbs dtbs_install
> > > +dtbs: scripts_dtc
> >
> >
> > dtbs: prepare3 scripts_dtc
> >
> >
> >
> > > + $(Q)$(MAKE) $(build)=$(dtstree)
> > > +
> > > +dtbs_install: dtbs
> >
> >
> > Please do not have dtbs_install to depend on dtbs.
> >
> > No install targets should ever trigger building anything
> > in the source tree.
> >
> >
> > For the background, see the commit log of
> > 19514fc665ffbce624785f76ee7ad0ea6378a527
>
> Okay, thanks.
>
> Rob
--
Best Regards
Masahiro Yamada
^ permalink raw reply
* Re: dma mask related fixups (including full bus_dma_mask support) v2
From: Christoph Hellwig @ 2018-10-01 14:32 UTC (permalink / raw)
To: iommu; +Cc: linuxppc-dev, Robin Murphy, linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20180927223539.28449-1-hch@lst.de>
FYI, I've pulled this into the dma-mapping tree to make forward
progress. All but oatch 4 had formal ACKs, and for that one Robin
was fine even without and explicit ack. I'll also send a patch to
better document the zone selection as it confuses even well versed
people like Ben.
^ permalink raw reply
* Re: [PATCH ppc-next] powerpc/fsl-booke: don't load early TLB at once
From: David Lamparter @ 2018-10-01 14:26 UTC (permalink / raw)
To: Scott Wood; +Cc: York Sun, linuxppc-dev, Scott Wood, David Lamparter
In-Reply-To: <20180922054516.GA19015@home.buserror.net>
On Sat, Sep 22, 2018 at 12:45:16AM -0500, Scott Wood wrote:
> I don't suppose you're running a relocatable kernel at a non-zero
# CONFIG_RELOCATABLE is not set
> address, and/or are running in an environment that sets
> HID0[EN_L2MMU_MHD] (neither standard U-boot nor Linux sets this bit,
It's u-boot v2018.09-rc3; bit "33" / 30 isn't even defined as a
constant, much less touched anywhere. HID0 in u-boot seems to be
0x80000080 aka EMCP | EN_MAS7_UPDATE.
> though they probably should)? On 32-bit, we're already running in an AS1
> trampoline when loadcam_multi() is called, but loadcam_multi() sets up
> its own. This happens to not be catastrophic in standard scenarios, but
> it does add a duplicate TLB entry, and we return to AS0 sooner than
> expected. I think your patch, plus ifdefs to make the change 32-bit
> only, is the appropriate fix.
I'll resend it with ifdefs inserted. Meanwhile, still trying the
default config as mentioned in my previous mail.
> I also got an earlier udbg for e500 working (and happened to decide to
> test it with a relocatable kernel); I'll send that out once I've cleaned
> it up (or sooner with the extra TLB dumping included if the above doesn't
> explain why you're hitting this bug).
Thanks & Cheers,
-David
^ 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