[PATCHv4 07/10] kexec: Switch to __pa_symbol

2016-11-29 Thread Laura Abbott

__pa_symbol is the correct api to get the physical address of kernel
symbols. Switch to it to allow for better debug checking.

Signed-off-by: Laura Abbott 
---
Found during review of the kernel. Untested.
---
 kernel/kexec_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 5616755..e1b625e 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1397,7 +1397,7 @@ void __weak arch_crash_save_vmcoreinfo(void)
 
 phys_addr_t __weak paddr_vmcoreinfo_note(void)
 {
-   return __pa((unsigned long)(char *)&vmcoreinfo_note);
+   return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note);
 }
 
 static int __init crash_save_vmcoreinfo_init(void)
-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCHv4 00/10] CONFIG_DEBUG_VIRTUAL for arm64

2016-11-30 Thread Laura Abbott

Hi,

This is v4 of the series to add CONFIG_DEBUG_VIRTUAL for arm64. This mostly
expanded on __pa_symbol conversion with a few new sites found. There's also
some reworking done to avoid calling __va too early. __va relies on having
memstart_addr set so very early code in early_fixmap_init and early KASAN
initialization can't just call __va(__Ipa_symbol(...)) to get the linear map
alias. I found this while testing with DEBUG_VM.

All of this could use probably use more testing under more configurations.
KVM, Xen, kexec, hibernate should all be tested.

Thanks,
Laura

Laura Abbott (10):
  lib/Kconfig.debug: Add ARCH_HAS_DEBUG_VIRTUAL
  mm/cma: Cleanup highmem check
  arm64: Move some macros under #ifndef __ASSEMBLY__
  arm64: Add cast for virt_to_pfn
  arm64: Use __pa_symbol for kernel symbols
  xen: Switch to using __pa_symbol
  kexec: Switch to __pa_symbol
  mm/kasan: Switch to using __pa_symbol and lm_alias
  mm/usercopy: Switch to using lm_alias
  arm64: Add support for CONFIG_DEBUG_VIRTUAL

 arch/arm64/Kconfig|  1 +
 arch/arm64/include/asm/kvm_mmu.h  |  4 +-
 arch/arm64/include/asm/memory.h   | 67 ++-
 arch/arm64/include/asm/mmu_context.h  |  6 +--
 arch/arm64/include/asm/pgtable.h  |  2 +-
 arch/arm64/kernel/acpi_parking_protocol.c |  2 +-
 arch/arm64/kernel/cpu-reset.h |  2 +-
 arch/arm64/kernel/cpufeature.c|  2 +-
 arch/arm64/kernel/hibernate.c | 13 +++---
 arch/arm64/kernel/insn.c  |  2 +-
 arch/arm64/kernel/psci.c  |  2 +-
 arch/arm64/kernel/setup.c |  8 ++--
 arch/arm64/kernel/smp_spin_table.c|  2 +-
 arch/arm64/kernel/vdso.c  |  4 +-
 arch/arm64/mm/Makefile|  2 +
 arch/arm64/mm/init.c  | 11 ++---
 arch/arm64/mm/kasan_init.c| 21 ++
 arch/arm64/mm/mmu.c   | 32 +--
 arch/arm64/mm/physaddr.c  | 28 +
 arch/x86/Kconfig  |  1 +
 drivers/firmware/psci.c   |  2 +-
 drivers/xen/xenbus/xenbus_dev_backend.c   |  2 +-
 drivers/xen/xenfs/xenstored.c |  2 +-
 include/linux/mm.h|  4 ++
 kernel/kexec_core.c   |  2 +-
 lib/Kconfig.debug |  5 ++-
 mm/cma.c  | 15 +++
 mm/kasan/kasan_init.c | 12 +++---
 mm/usercopy.c |  4 +-
 29 files changed, 167 insertions(+), 93 deletions(-)
 create mode 100644 arch/arm64/mm/physaddr.c

-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCHv5 08/11] kexec: Switch to __pa_symbol

2016-12-06 Thread Laura Abbott

__pa_symbol is the correct api to get the physical address of kernel
symbols. Switch to it to allow for better debug checking.

Acked-by: "Eric W. Biederman" 
Signed-off-by: Laura Abbott 
---
v5: No changes, just acks
---
 kernel/kexec_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 5616755..e1b625e 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1397,7 +1397,7 @@ void __weak arch_crash_save_vmcoreinfo(void)
 
 phys_addr_t __weak paddr_vmcoreinfo_note(void)
 {
-   return __pa((unsigned long)(char *)&vmcoreinfo_note);
+   return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note);
 }
 
 static int __init crash_save_vmcoreinfo_init(void)
-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCHv5 00/11] CONFIG_DEBUG_VIRTUAL for arm64

2016-12-07 Thread Laura Abbott
Hi,

This is v5 of the series to add CONFIG_DEBUG_VIRTUAL for arm64. This mostly
contains minor fixups including adding a few extra headers around and splitting
things out into a few more sub-patches.

With a few more acks I think this should be ready to go. More testing is
always appreciated though.

Thanks,
Laura

Laura Abbott (11):
  lib/Kconfig.debug: Add ARCH_HAS_DEBUG_VIRTUAL
  mm/cma: Cleanup highmem check
  arm64: Move some macros under #ifndef __ASSEMBLY__
  arm64: Add cast for virt_to_pfn
  mm: Introduce lm_alias
  arm64: Use __pa_symbol for kernel symbols
  drivers: firmware: psci: Use __pa_symbol for kernel symbol
  kexec: Switch to __pa_symbol
  mm/kasan: Switch to using __pa_symbol and lm_alias
  mm/usercopy: Switch to using lm_alias
  arm64: Add support for CONFIG_DEBUG_VIRTUAL

 arch/arm64/Kconfig|  1 +
 arch/arm64/include/asm/kvm_mmu.h  |  4 +-
 arch/arm64/include/asm/memory.h   | 66 +--
 arch/arm64/include/asm/mmu_context.h  |  6 +--
 arch/arm64/include/asm/pgtable.h  |  2 +-
 arch/arm64/kernel/acpi_parking_protocol.c |  3 +-
 arch/arm64/kernel/cpu-reset.h |  2 +-
 arch/arm64/kernel/cpufeature.c|  3 +-
 arch/arm64/kernel/hibernate.c | 20 +++---
 arch/arm64/kernel/insn.c  |  2 +-
 arch/arm64/kernel/psci.c  |  3 +-
 arch/arm64/kernel/setup.c |  9 +++--
 arch/arm64/kernel/smp_spin_table.c|  3 +-
 arch/arm64/kernel/vdso.c  |  8 +++-
 arch/arm64/mm/Makefile|  2 +
 arch/arm64/mm/init.c  | 12 +++---
 arch/arm64/mm/kasan_init.c| 22 +++
 arch/arm64/mm/mmu.c   | 33 ++--
 arch/arm64/mm/physaddr.c  | 30 ++
 arch/x86/Kconfig  |  1 +
 drivers/firmware/psci.c   |  2 +-
 include/linux/mm.h|  4 ++
 kernel/kexec_core.c   |  2 +-
 lib/Kconfig.debug |  5 ++-
 mm/cma.c  | 15 +++
 mm/kasan/kasan_init.c | 15 +++
 mm/usercopy.c |  4 +-
 27 files changed, 180 insertions(+), 99 deletions(-)
 create mode 100644 arch/arm64/mm/physaddr.c

-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCHv6 08/11] kexec: Switch to __pa_symbol

2017-01-03 Thread Laura Abbott
__pa_symbol is the correct api to get the physical address of kernel
symbols. Switch to it to allow for better debug checking.

Reviewed-by: Mark Rutland 
Tested-by: Mark Rutland 
Acked-by: "Eric W. Biederman" 
Signed-off-by: Laura Abbott 
---
 kernel/kexec_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 5617cc4..a01974e 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1399,7 +1399,7 @@ void __weak arch_crash_save_vmcoreinfo(void)
 
 phys_addr_t __weak paddr_vmcoreinfo_note(void)
 {
-   return __pa((unsigned long)(char *)&vmcoreinfo_note);
+   return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note);
 }
 
 static int __init crash_save_vmcoreinfo_init(void)
-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCHv6 00/11] CONFIG_DEBUG_VIRTUAL for arm64

2017-01-04 Thread Laura Abbott
Happy New Year!

This is a very minor rebase from v5. It only moves a few headers around.
I think this series should be ready to be queued up for 4.11.

Thanks,
Laura

Laura Abbott (11):
  lib/Kconfig.debug: Add ARCH_HAS_DEBUG_VIRTUAL
  mm/cma: Cleanup highmem check
  arm64: Move some macros under #ifndef __ASSEMBLY__
  arm64: Add cast for virt_to_pfn
  mm: Introduce lm_alias
  arm64: Use __pa_symbol for kernel symbols
  drivers: firmware: psci: Use __pa_symbol for kernel symbol
  kexec: Switch to __pa_symbol
  mm/kasan: Switch to using __pa_symbol and lm_alias
  mm/usercopy: Switch to using lm_alias
  arm64: Add support for CONFIG_DEBUG_VIRTUAL

 arch/arm64/Kconfig|  1 +
 arch/arm64/include/asm/kvm_mmu.h  |  4 +-
 arch/arm64/include/asm/memory.h   | 66 +--
 arch/arm64/include/asm/mmu_context.h  |  6 +--
 arch/arm64/include/asm/pgtable.h  |  2 +-
 arch/arm64/kernel/acpi_parking_protocol.c |  3 +-
 arch/arm64/kernel/cpu-reset.h |  2 +-
 arch/arm64/kernel/cpufeature.c|  3 +-
 arch/arm64/kernel/hibernate.c | 20 +++---
 arch/arm64/kernel/insn.c  |  2 +-
 arch/arm64/kernel/psci.c  |  3 +-
 arch/arm64/kernel/setup.c |  9 +++--
 arch/arm64/kernel/smp_spin_table.c|  3 +-
 arch/arm64/kernel/vdso.c  |  8 +++-
 arch/arm64/mm/Makefile|  2 +
 arch/arm64/mm/init.c  | 12 +++---
 arch/arm64/mm/kasan_init.c| 22 +++
 arch/arm64/mm/mmu.c   | 33 ++--
 arch/arm64/mm/physaddr.c  | 30 ++
 arch/x86/Kconfig  |  1 +
 drivers/firmware/psci.c   |  2 +-
 include/linux/mm.h|  4 ++
 kernel/kexec_core.c   |  2 +-
 lib/Kconfig.debug |  5 ++-
 mm/cma.c  | 15 +++
 mm/kasan/kasan_init.c | 15 +++
 mm/usercopy.c |  4 +-
 27 files changed, 180 insertions(+), 99 deletions(-)
 create mode 100644 arch/arm64/mm/physaddr.c

-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCHv6 00/11] CONFIG_DEBUG_VIRTUAL for arm64

2017-01-04 Thread Laura Abbott
On 01/03/2017 02:56 PM, Florian Fainelli wrote:
> On 01/03/2017 09:21 AM, Laura Abbott wrote:
>> Happy New Year!
>>
>> This is a very minor rebase from v5. It only moves a few headers around.
>> I think this series should be ready to be queued up for 4.11.
> 
> FWIW:
> 
> Tested-by: Florian Fainelli 
> 

Thanks!

> How do we get this series included? I would like to get the ARM 32-bit
> counterpart included as well (will resubmit rebased shortly), but I have
> no clue which tree this should be going through.
> 

I was assuming this would go through the arm64 tree unless Catalin/Will
have an objection to that.

> Thanks!
> 
>>
>> Thanks,
>> Laura
>>
>> Laura Abbott (11):
>>   lib/Kconfig.debug: Add ARCH_HAS_DEBUG_VIRTUAL
>>   mm/cma: Cleanup highmem check
>>   arm64: Move some macros under #ifndef __ASSEMBLY__
>>   arm64: Add cast for virt_to_pfn
>>   mm: Introduce lm_alias
>>   arm64: Use __pa_symbol for kernel symbols
>>   drivers: firmware: psci: Use __pa_symbol for kernel symbol
>>   kexec: Switch to __pa_symbol
>>   mm/kasan: Switch to using __pa_symbol and lm_alias
>>   mm/usercopy: Switch to using lm_alias
>>   arm64: Add support for CONFIG_DEBUG_VIRTUAL
>>
>>  arch/arm64/Kconfig|  1 +
>>  arch/arm64/include/asm/kvm_mmu.h  |  4 +-
>>  arch/arm64/include/asm/memory.h   | 66 
>> +--
>>  arch/arm64/include/asm/mmu_context.h  |  6 +--
>>  arch/arm64/include/asm/pgtable.h  |  2 +-
>>  arch/arm64/kernel/acpi_parking_protocol.c |  3 +-
>>  arch/arm64/kernel/cpu-reset.h |  2 +-
>>  arch/arm64/kernel/cpufeature.c|  3 +-
>>  arch/arm64/kernel/hibernate.c | 20 +++---
>>  arch/arm64/kernel/insn.c  |  2 +-
>>  arch/arm64/kernel/psci.c  |  3 +-
>>  arch/arm64/kernel/setup.c |  9 +++--
>>  arch/arm64/kernel/smp_spin_table.c|  3 +-
>>  arch/arm64/kernel/vdso.c  |  8 +++-
>>  arch/arm64/mm/Makefile|  2 +
>>  arch/arm64/mm/init.c  | 12 +++---
>>  arch/arm64/mm/kasan_init.c| 22 +++
>>  arch/arm64/mm/mmu.c   | 33 ++--
>>  arch/arm64/mm/physaddr.c  | 30 ++
>>  arch/x86/Kconfig  |  1 +
>>  drivers/firmware/psci.c   |  2 +-
>>  include/linux/mm.h|  4 ++
>>  kernel/kexec_core.c   |  2 +-
>>  lib/Kconfig.debug |  5 ++-
>>  mm/cma.c  | 15 +++
>>  mm/kasan/kasan_init.c | 15 +++
>>  mm/usercopy.c |  4 +-
>>  27 files changed, 180 insertions(+), 99 deletions(-)
>>  create mode 100644 arch/arm64/mm/physaddr.c
>>
> 
> 


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCHv7 04/11] kexec: Switch to __pa_symbol

2017-01-10 Thread Laura Abbott
__pa_symbol is the correct api to get the physical address of kernel
symbols. Switch to it to allow for better debug checking.

Reviewed-by: Mark Rutland 
Tested-by: Mark Rutland 
Acked-by: "Eric W. Biederman" 
Signed-off-by: Laura Abbott 
---
 kernel/kexec_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 5617cc4..a01974e 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1399,7 +1399,7 @@ void __weak arch_crash_save_vmcoreinfo(void)
 
 phys_addr_t __weak paddr_vmcoreinfo_note(void)
 {
-   return __pa((unsigned long)(char *)&vmcoreinfo_note);
+   return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note);
 }
 
 static int __init crash_save_vmcoreinfo_init(void)
-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCHv7 00/11] CONFIG_DEBUG_VIRTUAL for arm64

2017-01-11 Thread Laura Abbott
Hi,

This is v7 of the patches to add CONFIG_DEBUG_VIRTUAL for arm64. This is
a simple reordering of patches from v6 per request of Will Deacon for ease
of merging support for arm which depends on this series.

Laura Abbott (11):
  lib/Kconfig.debug: Add ARCH_HAS_DEBUG_VIRTUAL
  mm/cma: Cleanup highmem check
  mm: Introduce lm_alias
  kexec: Switch to __pa_symbol
  mm/kasan: Switch to using __pa_symbol and lm_alias
  mm/usercopy: Switch to using lm_alias
  drivers: firmware: psci: Use __pa_symbol for kernel symbol
  arm64: Move some macros under #ifndef __ASSEMBLY__
  arm64: Add cast for virt_to_pfn
  arm64: Use __pa_symbol for kernel symbols
  arm64: Add support for CONFIG_DEBUG_VIRTUAL

 arch/arm64/Kconfig|  1 +
 arch/arm64/include/asm/kvm_mmu.h  |  4 +-
 arch/arm64/include/asm/memory.h   | 66 +--
 arch/arm64/include/asm/mmu_context.h  |  6 +--
 arch/arm64/include/asm/pgtable.h  |  2 +-
 arch/arm64/kernel/acpi_parking_protocol.c |  3 +-
 arch/arm64/kernel/cpu-reset.h |  2 +-
 arch/arm64/kernel/cpufeature.c|  3 +-
 arch/arm64/kernel/hibernate.c | 20 +++---
 arch/arm64/kernel/insn.c  |  2 +-
 arch/arm64/kernel/psci.c  |  3 +-
 arch/arm64/kernel/setup.c |  9 +++--
 arch/arm64/kernel/smp_spin_table.c|  3 +-
 arch/arm64/kernel/vdso.c  |  8 +++-
 arch/arm64/mm/Makefile|  2 +
 arch/arm64/mm/init.c  | 12 +++---
 arch/arm64/mm/kasan_init.c| 22 +++
 arch/arm64/mm/mmu.c   | 33 ++--
 arch/arm64/mm/physaddr.c  | 30 ++
 arch/x86/Kconfig  |  1 +
 drivers/firmware/psci.c   |  2 +-
 include/linux/mm.h|  4 ++
 kernel/kexec_core.c   |  2 +-
 lib/Kconfig.debug |  5 ++-
 mm/cma.c  | 15 +++
 mm/kasan/kasan_init.c | 15 +++
 mm/usercopy.c |  4 +-
 27 files changed, 180 insertions(+), 99 deletions(-)
 create mode 100644 arch/arm64/mm/physaddr.c

-- 
2.7.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec