* Re: [v2] powerpc/hash64: Be more careful when generating tlbiel
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
In-Reply-To: <1476856405-4811-1-git-send-email-mpe@ellerman.id.au>
On Wed, 2016-19-10 at 05:53:25 UTC, Michael Ellerman wrote:
> From: Balbir Singh <bsingharora@gmail.com>
>
> In ISA v2.05, the tlbiel instruction takes two arguments, RB and L:
>
> tlbiel RB,L
>
> +---------+---------+----+---------+---------+---------+----+
> | 31 | / | L | / | RB | 274 | / |
> | 31 - 26 | 25 - 22 | 21 | 20 - 16 | 15 - 11 | 10 - 1 | 0 |
> +---------+---------+----+---------+---------+---------+----+
>
> In ISA v2.06 tlbiel takes only one argument, RB:
>
> tlbiel RB
>
> +---------+---------+---------+---------+---------+----+
> | 31 | / | / | RB | 274 | / |
> | 31 - 26 | 25 - 21 | 20 - 16 | 15 - 11 | 10 - 1 | 0 |
> +---------+---------+---------+---------+---------+----+
>
> And in ISA v3.00 tlbiel takes five arguments:
>
> tlbiel RB,RS,RIC,PRS,R
>
> +---------+---------+----+---------+----+----+---------+---------+----+
> | 31 | RS | / | RIC |PRS | R | RB | 274 | / |
> | 31 - 26 | 25 - 21 | 20 | 19 - 18 | 17 | 16 | 15 - 11 | 10 - 1 | 0 |
> +---------+---------+----+---------+----+----+---------+---------+----+
>
> However the assembler also accepts "tlbiel RB", and generates
> "tlbiel RB,r0,0,0,0".
>
> As you can see above the L field from the v2.05 encoding overlaps with the
> reserved field of the v2.06 encoding, and the low bit of the RS field of the
> v3.00 encoding.
>
> Currently in __tlbiel() we generate two tlbiel instructions manually using hex
> constants. In the first case, for MMU_PAGE_4K, we generate "tlbiel RB,0", which
> is safe in all cases, because the L bit is zero.
>
> However in the default case we generate "tlbiel RB,1", therefore setting bit 21
> to 1.
>
> This is not an actual bug on v2.06 processors, because the CPU ignores the value
> of the reserved field. However software is supposed to encode the reserved
> fields as zero to enable forward compatibility.
>
> On v3.00 processors setting bit 21 to 1 and no other bits of RS, means we are
> using r1 for the value of RS.
>
> Although it's not obvious, the code sets the IS field (bits 10-11) to 0 (by
> omission), and L=1, in the va value, which is passed as RB. We also pass R=0 in
> the instruction.
>
> The combination of IS=0, L=1 and R=0 means the value of RS is not used, so even
> on ISA v3.00 there is no actual bug.
>
> We should still fix it, as setting a reserved bit on v2.06 is naughty, and we
> are only avoiding a bug on v3.00 by accident rather than design. Use
> ASM_FTR_IFSET() to generate the single argument form on ISA v2.06 and later, and
> the two argument form on pre v2.06.
>
> Although there may be very old toolchains which don't understand tlbiel, we have
> other code in the tree which has been using tlbiel for over five years, and no
> one has reported any build failures, so just let the assembler generate the
> instructions.
>
> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
> [mpe: Rewrite change log, use IFSET instead of IFCLR]
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/f923efbcfdbaa4391874eeda676b08
cheers
^ permalink raw reply
* ✗ Fi.CI.BAT: warning for dma-buf: Use fence_get_rcu_safe() for retrieving the exclusive fence
From: Patchwork @ 2016-11-14 12:17 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
In-Reply-To: <20161114115540.31155-1-chris@chris-wilson.co.uk>
== Series Details ==
Series: dma-buf: Use fence_get_rcu_safe() for retrieving the exclusive fence
URL : https://patchwork.freedesktop.org/series/15269/
State : warning
== Summary ==
Series 15269v1 dma-buf: Use fence_get_rcu_safe() for retrieving the exclusive fence
https://patchwork.freedesktop.org/api/1.0/series/15269/revisions/1/mbox/
Test kms_force_connector_basic:
Subgroup force-connector-state:
pass -> DMESG-WARN (fi-snb-2520m)
fi-bdw-5557u total:244 pass:229 dwarn:0 dfail:0 fail:0 skip:15
fi-bsw-n3050 total:244 pass:204 dwarn:0 dfail:0 fail:0 skip:40
fi-bxt-t5700 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-j1900 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-n2820 total:244 pass:212 dwarn:0 dfail:0 fail:0 skip:32
fi-hsw-4770 total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-hsw-4770r total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-ilk-650 total:244 pass:191 dwarn:0 dfail:0 fail:0 skip:53
fi-ivb-3520m total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-ivb-3770 total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-kbl-7200u total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-skl-6260u total:244 pass:230 dwarn:0 dfail:0 fail:0 skip:14
fi-skl-6700hq total:244 pass:223 dwarn:0 dfail:0 fail:0 skip:21
fi-skl-6700k total:244 pass:222 dwarn:1 dfail:0 fail:0 skip:21
fi-skl-6770hq total:244 pass:230 dwarn:0 dfail:0 fail:0 skip:14
fi-snb-2520m total:244 pass:211 dwarn:1 dfail:0 fail:0 skip:32
fi-snb-2600 total:244 pass:211 dwarn:0 dfail:0 fail:0 skip:33
020e291d72d4aaf3e0f8f5168a60ac05daa43a77 drm-intel-nightly: 2016y-11m-14d-08h-02m-22s UTC integration manifest
f20a2ac dma-buf: Use fence_get_rcu_safe() for retrieving the exclusive fence
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2981/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: powerpc/book3s64: Always build for power4 or later
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: anton
In-Reply-To: <1477008111-9160-1-git-send-email-mpe@ellerman.id.au>
On Fri, 2016-21-10 at 00:01:51 UTC, Michael Ellerman wrote:
> When we're not compiling for a specific CPU, ie. none of the
> CONFIG_POWERx_CPU options are set, and CONFIG_GENERIC_CPU *is* set, we
> currently don't pass any -mcpu option to the compiler. This means the
> compiler builds for a "generic" Power CPU.
>
> But back in 2014 we dropped support for pre power4 CPUs in commit
> 468a33028edd ("powerpc: Drop support for pre-POWER4 cpus").
>
> Given that, there's no point in building the kernel to run on pre power4
> cpus. So update the flags we pass to the compiler when
> CONFIG_GENERIC_CPU is set, to specify -mcpu=power4.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/3a849815a13695ad0e32f6f01c9054
cheers
^ permalink raw reply
* Re: powerpc/asm: Allow including ppc_asm.h in asm files
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
In-Reply-To: <1478227183-10299-1-git-send-email-mpe@ellerman.id.au>
On Fri, 2016-04-11 at 02:39:43 UTC, Michael Ellerman wrote:
> There's no reason to #error if we include ppc_asm.h in asm files, the
> ifdef already prevents any problems.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/e3f2c6c39371c0e67c7fd6ebcb8b74
cheers
^ permalink raw reply
* Re: powerpc/module: Add support for R_PPC64_REL32 relocations
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: npiggin
In-Reply-To: <1478147957-4766-1-git-send-email-mpe@ellerman.id.au>
On Thu, 2016-03-11 at 04:39:17 UTC, Michael Ellerman wrote:
> We haven't seen these before, but the soon to be merged relative
> exception tables support causes them to be generated.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/9f751b82b491d06c6438066b511d44
cheers
^ permalink raw reply
* Re: [4/4] powerpc/pci: fix device reference leaks
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Johan Hovold, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, Johan Hovold
In-Reply-To: <1478013963-28871-4-git-send-email-johan@kernel.org>
On Tue, 2016-01-11 at 15:26:03 UTC, Johan Hovold wrote:
> Make sure to drop any device reference taken by vio_find_node() when
> adding and removing virtual I/O slots.
>
> Fixes: 5eeb8c63a38f ("[PATCH] PCI Hotplug: rpaphp: Move VIO...")
> Signed-off-by: Johan Hovold <johan@kernel.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/99e5cde5eae78bef95bfe7c16ccda8
cheers
^ permalink raw reply
* Re: [3/4] powerpc/vio: clarify vio_find_node reference counting
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Johan Hovold, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, Johan Hovold
In-Reply-To: <1478013963-28871-3-git-send-email-johan@kernel.org>
On Tue, 2016-01-11 at 15:26:02 UTC, Johan Hovold wrote:
> Add comment clarifying that vio_find_node() takes a reference to the
> embedded struct device which needs to be dropped after use.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/e8cfb7e7c3b2be8a4c2241b5da2ae6
cheers
^ permalink raw reply
* Re: [3/3] powerpc: build-time sort exception table
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20161013054255.7205-4-npiggin@gmail.com>
On Thu, 2016-13-10 at 05:42:55 UTC, Nicholas Piggin wrote:
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/5b9ff027859868efd63cdbbff5d301
cheers
^ permalink raw reply
* Re: [2/4] ibmebus: fix further device reference leaks
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Johan Hovold, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, Johan Hovold
In-Reply-To: <1478013963-28871-2-git-send-email-johan@kernel.org>
On Tue, 2016-01-11 at 15:26:01 UTC, Johan Hovold wrote:
> Make sure to drop any reference taken by bus_find_device() when creating
> devices during init and driver registration.
>
> Fixes: 55347cc9962f ("[POWERPC] ibmebus: Add device creation...)
> Signed-off-by: Johan Hovold <johan@kernel.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/815a7141c4d1b11610dccb7fcbb386
cheers
^ permalink raw reply
* Re: [2/3] powerpc: relative exception tables
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20161013054255.7205-3-npiggin@gmail.com>
On Thu, 2016-13-10 at 05:42:54 UTC, Nicholas Piggin wrote:
> This halves the exception table size on 64-bit builds, and it
> allows build-time sorting of exception tables to work on
> relocated kernels.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/61a92f703120daf7ed25e046275aa8
cheers
^ permalink raw reply
* Re: [2/2] selftests/powerpc: Fail load_unaligned_zeropad on miscompare
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: anton
In-Reply-To: <1478148061-5724-2-git-send-email-mpe@ellerman.id.au>
On Thu, 2016-03-11 at 04:41:01 UTC, Michael Ellerman wrote:
> If the result returned by load_unaligned_zeropad() doesn't match what we
> expect we should fail the test!
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/997e200182347d2cc7e37bc43eaafe
cheers
^ permalink raw reply
* Re: [2/2] Revert "powerpc: Load Monitor Register Support"
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Neuling; +Cc: mikey, linuxppc-dev, Jack Miller
In-Reply-To: <20161031021939.30989-2-mikey@neuling.org>
On Mon, 2016-31-10 at 02:19:39 UTC, Michael Neuling wrote:
> Load monitored is no longer supported on POWER9 so let's remove the
> code.
>
> This reverts commit bd3ea317fddfd0f2044f94bed294b90c4bc8e69e.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/29a969b764817c1dce819c2bc8c00a
cheers
^ permalink raw reply
* Re: [1/4] ibmebus: fix device reference leaks in sysfs interface
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Johan Hovold, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, Johan Hovold
In-Reply-To: <1478013963-28871-1-git-send-email-johan@kernel.org>
On Tue, 2016-01-11 at 15:26:00 UTC, Johan Hovold wrote:
> Make sure to drop any reference taken by bus_find_device() in the sysfs
> callbacks that are used to create and destroy devices based on
> device-tree entries.
>
> Fixes: 6bccf755ff53 ("[POWERPC] ibmebus: dynamic addition/removal...)
> Signed-off-by: Johan Hovold <johan@kernel.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/fe0f3168169f7c34c29b0cf0c489f1
cheers
^ permalink raw reply
* Re: [1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: anton
In-Reply-To: <1478148061-5724-1-git-send-email-mpe@ellerman.id.au>
On Thu, 2016-03-11 at 04:41:00 UTC, Michael Ellerman wrote:
> If the load unaligned zeropad test takes a SEGV which can't be handled,
> we increment segv_error, print the offending NIP and then return without
> taking any further action. In almost all cases this means we'll just
> take the SEGV again, and loop eternally spamming the console.
>
> Instead just abort(), it's a fatal error in the test. The test harness
> will notice that the child died and print a nice message for us.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/06236f4efb926aa433e2cb3e36e846
cheers
^ permalink raw reply
* Re: [1/2] Revert "selftests/powerpc: Load Monitor Register Tests"
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
To: Michael Neuling; +Cc: mikey, linuxppc-dev, Jack Miller
In-Reply-To: <20161031021939.30989-1-mikey@neuling.org>
On Mon, 2016-31-10 at 02:19:38 UTC, Michael Neuling wrote:
> Load monitored won't be supported in POWER9, so PPC_FEATURE2_ARCH_3_00
> (in HWCAP2) will no longer imply Load monitor support.
>
> These Load monitored tests are enabled by PPC_FEATURE2_ARCH_3_00 so
> they are now bogus and need to be removed.
>
> This reverts commit 16c19a2e983346c547501795aadffde1977b058d.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/7c65856b7e0d12f2be2adae7a75a11
cheers
^ permalink raw reply
* TCP as a module
From: Aruna Hewapathirane @ 2016-11-14 12:17 UTC (permalink / raw)
To: kernelnewbies
In-Reply-To: <CAFgPn1DyTvr3SuciOwcitiiOjT50DMxfX=ok_iN69H2pw2fCvQ@mail.gmail.com>
> Currently TCP is statically linked to the kernel.
Correct, so how is this done and where ? Once you figure that part
out you have what you need to do what you want to :)
> How can I make it a loadable module?
Change into your source tree, look for this file:
linux-4.7.2/linux-4.7.2/net/Kconfig
Kconfig is used by the KBuild system that menuconfig uses.
Look for the section:
config INET
bool "TCP/IP networking" <-- change bool to tristate, save and run make
menuconfig.
Now you can ask menuconfig to build TCP as a module.
But... it may be better to if you can use:
https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
One last thing, heed the warnings in Kconfig they are there for a reason.
Good luck and what exactly are you trying to do ? Am curious.
Aruna ( Shrugs and gets ready to duck a flying trout Valdis may send my way
:)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20161114/223b0a43/attachment.html
^ permalink raw reply
* [powerpc v5 3/3] Enable storage keys for radix - user mode execution
From: Balbir Singh @ 2016-11-14 12:16 UTC (permalink / raw)
To: linuxppc-dev, mpe; +Cc: aneesh.kumar, Balbir Singh
In-Reply-To: <1479125778-18496-1-git-send-email-bsingharora@gmail.com>
ISA 3 defines new encoded access authority that allows instruction
access prevention in privileged mode and allows normal access
to problem state. This patch just enables IAMR (Instruction Authority
Mask Register), enabling AMR would require more work.
I've tested this with a buggy driver and a simple payload. The payload
is specific to the build I've tested.
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
arch/powerpc/mm/pgtable-radix.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 7c21a52..ae0d701 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -339,6 +339,24 @@ static void radix_init_amor(void)
mtspr(SPRN_AMOR, amor);
}
+/*
+ * For radix page tables we setup, the IAMR values as follows
+ * IMAR = 0100...00 (key 0 is set to 1)
+ * AMR, UAMR, UAMOR are not affected
+ */
+static void radix_init_iamr(void)
+{
+ unsigned long iamr_mask = 0x4000000000000000;
+ unsigned long iamr = mfspr(SPRN_IAMR);
+
+ if (cpu_has_feature(CPU_FTR_POWER9_DD1))
+ return;
+
+ iamr = iamr_mask;
+
+ mtspr(SPRN_IAMR, iamr);
+}
+
void __init radix__early_init_mmu(void)
{
unsigned long lpcr;
@@ -398,6 +416,7 @@ void __init radix__early_init_mmu(void)
radix_init_amor();
}
+ radix_init_iamr();
radix_init_pgtable();
}
@@ -415,6 +434,7 @@ void radix__early_init_mmu_secondary(void)
__pa(partition_tb) | (PATB_SIZE_SHIFT - 12));
radix_init_amor();
}
+ radix_init_iamr();
}
void radix__mmu_cleanup_all(void)
--
2.5.5
^ permalink raw reply related
* [powerpc v5 2/3] Detect instruction fetch denied and report
From: Balbir Singh @ 2016-11-14 12:16 UTC (permalink / raw)
To: linuxppc-dev, mpe; +Cc: aneesh.kumar, Balbir Singh
In-Reply-To: <1479125778-18496-1-git-send-email-bsingharora@gmail.com>
ISA 3 allows for prevention of instruction fetch and execution
of user mode pages. If such an error occurs, SRR1 bit 35
reports the error. We catch and report the error in do_page_fault()
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
arch/powerpc/mm/fault.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index d0b137d..1e7ff7b 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -404,6 +404,10 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
(cpu_has_feature(CPU_FTR_NOEXECUTE) ||
!(vma->vm_flags & (VM_READ | VM_WRITE))))
goto bad_area;
+
+ if (regs->msr & SRR1_ISI_N_OR_G)
+ goto bad_area;
+
#ifdef CONFIG_PPC_STD_MMU
/*
* protfault should only happen due to us
--
2.5.5
^ permalink raw reply related
* [powerpc v5 1/3] Setup AMOR in HV mode
From: Balbir Singh @ 2016-11-14 12:16 UTC (permalink / raw)
To: linuxppc-dev, mpe; +Cc: aneesh.kumar, Balbir Singh
In-Reply-To: <1479125778-18496-1-git-send-email-bsingharora@gmail.com>
AMOR should be setup in HV mode, we set it up once
and let the generic kernel handle IAMR. This patch is
used to enable storage keys in a following patch as
defined in ISA 3
Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
arch/powerpc/mm/pgtable-radix.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index ed7bddc..7c21a52 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -320,6 +320,25 @@ static void update_hid_for_radix(void)
cpu_relax();
}
+/*
+ * In HV mode, we init AMOR so that the hypervisor
+ * and guest can setup IMAR, enable key 0 and set
+ * it to 1
+ * AMOR = 1100....00 (Mask for key 0 is 11)
+ */
+static void radix_init_amor(void)
+{
+ unsigned long amor_mask = 0xc000000000000000;
+ unsigned long amor = mfspr(SPRN_AMOR);
+
+ if (cpu_has_feature(CPU_FTR_POWER9_DD1))
+ return;
+
+ amor = amor_mask;
+
+ mtspr(SPRN_AMOR, amor);
+}
+
void __init radix__early_init_mmu(void)
{
unsigned long lpcr;
@@ -376,6 +395,7 @@ void __init radix__early_init_mmu(void)
lpcr = mfspr(SPRN_LPCR);
mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR);
radix_init_partition_table();
+ radix_init_amor();
}
radix_init_pgtable();
@@ -393,6 +413,7 @@ void radix__early_init_mmu_secondary(void)
mtspr(SPRN_PTCR,
__pa(partition_tb) | (PATB_SIZE_SHIFT - 12));
+ radix_init_amor();
}
}
--
2.5.5
^ permalink raw reply related
* [powerpc v5 0/3] Enable IAMR storage keys for radix
From: Balbir Singh @ 2016-11-14 12:16 UTC (permalink / raw)
To: linuxppc-dev, mpe; +Cc: aneesh.kumar, Balbir Singh
The first patch sets up AMOR in hypervisor mode. AMOR
needs to be setup before IAMR (details of AMOR/IAMR in
each patch). The second patch enables detection of exceptions
generated due to instruction fetch violations caused
and OOPSs' the task. The third patch enables IAMR for
both hypervisor and guest kernels.
I've tested with patch series with a sample hack and
payload.
Chris Smart helped with the series, reviewing and
providing valuable feedback
Changelog
Remove __init annotation for iamr and amor init
Balbir Singh (3):
Setup AMOR in HV mode
Detect instruction fetch denied and report
Enable storage keys for radix - user mode execution
arch/powerpc/mm/fault.c | 4 ++++
arch/powerpc/mm/pgtable-radix.c | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
--
2.5.5
^ permalink raw reply
* [PATCH v4 2/2] arm64: Wire up iommu_dma_{map, unmap}_resource()
From: Robin Murphy @ 2016-11-14 12:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <d1cbd5ce714ce3c978aa8bfcb31def87d7919198.1479125555.git.robin.murphy@arm.com>
With no coherency to worry about, just plug'em straight in.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/mm/dma-mapping.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 3f74d0d98de6..5cd0a383b14b 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -796,6 +796,8 @@ static struct dma_map_ops iommu_dma_ops = {
.sync_single_for_device = __iommu_sync_single_for_device,
.sync_sg_for_cpu = __iommu_sync_sg_for_cpu,
.sync_sg_for_device = __iommu_sync_sg_for_device,
+ .map_resource = iommu_dma_map_resource,
+ .unmap_resource = iommu_dma_unmap_resource,
.dma_supported = iommu_dma_supported,
.mapping_error = iommu_dma_mapping_error,
};
--
2.10.2.dirty
^ permalink raw reply related
* [PATCH v4 2/2] arm64: Wire up iommu_dma_{map, unmap}_resource()
From: Robin Murphy @ 2016-11-14 12:16 UTC (permalink / raw)
To: will.deacon-5wv7dgnIgG8, joro-zLv9SwRftAIdnm+yROfE0A
Cc: catalin.marinas-5wv7dgnIgG8,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <d1cbd5ce714ce3c978aa8bfcb31def87d7919198.1479125555.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
With no coherency to worry about, just plug'em straight in.
Acked-by: Catalin Marinas <catalin.marinas-5wv7dgnIgG8@public.gmane.org>
Signed-off-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
---
arch/arm64/mm/dma-mapping.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 3f74d0d98de6..5cd0a383b14b 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -796,6 +796,8 @@ static struct dma_map_ops iommu_dma_ops = {
.sync_single_for_device = __iommu_sync_single_for_device,
.sync_sg_for_cpu = __iommu_sync_sg_for_cpu,
.sync_sg_for_device = __iommu_sync_sg_for_device,
+ .map_resource = iommu_dma_map_resource,
+ .unmap_resource = iommu_dma_unmap_resource,
.dma_supported = iommu_dma_supported,
.mapping_error = iommu_dma_mapping_error,
};
--
2.10.2.dirty
^ permalink raw reply related
* [PATCH v4 1/2] iommu/dma: Implement dma_{map,unmap}_resource()
From: Robin Murphy @ 2016-11-14 12:16 UTC (permalink / raw)
To: linux-arm-kernel
With the new dma_{map,unmap}_resource() functions added to the DMA API
for the benefit of cases like slave DMA, add suitable implementations to
the arsenal of our generic layer. Since cache maintenance should not be
a concern, these can both be standalone callback implementations without
the need for arch code wrappers.
CC: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
v4: Add the missed static qualifier (thanks Catalin)
drivers/iommu/dma-iommu.c | 24 +++++++++++++++++++++---
include/linux/dma-iommu.h | 4 ++++
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index c5ab8667e6f2..2db0d641cf45 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -432,13 +432,12 @@ int iommu_dma_mmap(struct page **pages, size_t size, struct vm_area_struct *vma)
return ret;
}
-dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
- unsigned long offset, size_t size, int prot)
+static dma_addr_t __iommu_dma_map(struct device *dev, phys_addr_t phys,
+ size_t size, int prot)
{
dma_addr_t dma_addr;
struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
struct iova_domain *iovad = cookie_iovad(domain);
- phys_addr_t phys = page_to_phys(page) + offset;
size_t iova_off = iova_offset(iovad, phys);
size_t len = iova_align(iovad, size + iova_off);
struct iova *iova = __alloc_iova(domain, len, dma_get_mask(dev));
@@ -454,6 +453,12 @@ dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
return dma_addr + iova_off;
}
+dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
+ unsigned long offset, size_t size, int prot)
+{
+ return __iommu_dma_map(dev, page_to_phys(page) + offset, size, prot);
+}
+
void iommu_dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size,
enum dma_data_direction dir, unsigned long attrs)
{
@@ -624,6 +629,19 @@ void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
__iommu_dma_unmap(iommu_get_domain_for_dev(dev), sg_dma_address(sg));
}
+dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
+ size_t size, enum dma_data_direction dir, unsigned long attrs)
+{
+ return __iommu_dma_map(dev, phys, size,
+ dma_direction_to_prot(dir, false) | IOMMU_MMIO);
+}
+
+void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
+ size_t size, enum dma_data_direction dir, unsigned long attrs)
+{
+ __iommu_dma_unmap(iommu_get_domain_for_dev(dev), handle);
+}
+
int iommu_dma_supported(struct device *dev, u64 mask)
{
/*
diff --git a/include/linux/dma-iommu.h b/include/linux/dma-iommu.h
index 32c589062bd9..7f7e9a7e3839 100644
--- a/include/linux/dma-iommu.h
+++ b/include/linux/dma-iommu.h
@@ -61,6 +61,10 @@ void iommu_dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size,
enum dma_data_direction dir, unsigned long attrs);
void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
enum dma_data_direction dir, unsigned long attrs);
+dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
+ size_t size, enum dma_data_direction dir, unsigned long attrs);
+void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
+ size_t size, enum dma_data_direction dir, unsigned long attrs);
int iommu_dma_supported(struct device *dev, u64 mask);
int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
--
2.10.2.dirty
^ permalink raw reply related
* [PATCH v4 1/2] iommu/dma: Implement dma_{map,unmap}_resource()
From: Robin Murphy @ 2016-11-14 12:16 UTC (permalink / raw)
To: will.deacon-5wv7dgnIgG8, joro-zLv9SwRftAIdnm+yROfE0A
Cc: catalin.marinas-5wv7dgnIgG8,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
With the new dma_{map,unmap}_resource() functions added to the DMA API
for the benefit of cases like slave DMA, add suitable implementations to
the arsenal of our generic layer. Since cache maintenance should not be
a concern, these can both be standalone callback implementations without
the need for arch code wrappers.
CC: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Signed-off-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
---
v4: Add the missed static qualifier (thanks Catalin)
drivers/iommu/dma-iommu.c | 24 +++++++++++++++++++++---
include/linux/dma-iommu.h | 4 ++++
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index c5ab8667e6f2..2db0d641cf45 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -432,13 +432,12 @@ int iommu_dma_mmap(struct page **pages, size_t size, struct vm_area_struct *vma)
return ret;
}
-dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
- unsigned long offset, size_t size, int prot)
+static dma_addr_t __iommu_dma_map(struct device *dev, phys_addr_t phys,
+ size_t size, int prot)
{
dma_addr_t dma_addr;
struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
struct iova_domain *iovad = cookie_iovad(domain);
- phys_addr_t phys = page_to_phys(page) + offset;
size_t iova_off = iova_offset(iovad, phys);
size_t len = iova_align(iovad, size + iova_off);
struct iova *iova = __alloc_iova(domain, len, dma_get_mask(dev));
@@ -454,6 +453,12 @@ dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
return dma_addr + iova_off;
}
+dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
+ unsigned long offset, size_t size, int prot)
+{
+ return __iommu_dma_map(dev, page_to_phys(page) + offset, size, prot);
+}
+
void iommu_dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size,
enum dma_data_direction dir, unsigned long attrs)
{
@@ -624,6 +629,19 @@ void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
__iommu_dma_unmap(iommu_get_domain_for_dev(dev), sg_dma_address(sg));
}
+dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
+ size_t size, enum dma_data_direction dir, unsigned long attrs)
+{
+ return __iommu_dma_map(dev, phys, size,
+ dma_direction_to_prot(dir, false) | IOMMU_MMIO);
+}
+
+void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
+ size_t size, enum dma_data_direction dir, unsigned long attrs)
+{
+ __iommu_dma_unmap(iommu_get_domain_for_dev(dev), handle);
+}
+
int iommu_dma_supported(struct device *dev, u64 mask)
{
/*
diff --git a/include/linux/dma-iommu.h b/include/linux/dma-iommu.h
index 32c589062bd9..7f7e9a7e3839 100644
--- a/include/linux/dma-iommu.h
+++ b/include/linux/dma-iommu.h
@@ -61,6 +61,10 @@ void iommu_dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size,
enum dma_data_direction dir, unsigned long attrs);
void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
enum dma_data_direction dir, unsigned long attrs);
+dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
+ size_t size, enum dma_data_direction dir, unsigned long attrs);
+void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
+ size_t size, enum dma_data_direction dir, unsigned long attrs);
int iommu_dma_supported(struct device *dev, u64 mask);
int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
--
2.10.2.dirty
^ permalink raw reply related
* [PATCH v2 09/10] ARM: rockchip: enable support for RK1108 SoC
From: Andy Yan @ 2016-11-14 12:15 UTC (permalink / raw)
To: heiko; +Cc: linux-rockchip, linux, linux-kernel, Andy Yan
In-Reply-To: <1479124550-24037-1-git-send-email-andy.yan@rock-chips.com>
Add a rockchip,rk1108 compatible.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---
Changes in v2: None
arch/arm/mach-rockchip/rockchip.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index a7ab9ec..e7fdf06 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -76,6 +76,7 @@ static void __init rockchip_dt_init(void)
}
static const char * const rockchip_board_dt_compat[] = {
+ "rockchip,rk1108",
"rockchip,rk2928",
"rockchip,rk3066a",
"rockchip,rk3066b",
--
2.7.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.