All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] manually add Error Synchronization Barrier at exception handler entry and exit
@ 2017-11-01 19:14 ` Dongjiu Geng
  0 siblings, 0 replies; 40+ messages in thread
From: Dongjiu Geng @ 2017-11-01 19:14 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, marc.zyngier, christoffer.dall,
	james.morse, mark.rutland, ard.biesheuvel, robin.murphy, cov,
	Dave.Martin, gengdongjiu, suzuki.poulose, linux-arm-kernel,
	linux-kernel, kvmarm

Some hardware platform can support RAS Extension, but not support IESB,
such as Huawei's platform, so software need to insert Synchronization Barrier
operations at exception handler entry.

This series patches are based on  James's series patches "SError rework +
RAS&IESB for firmware first support". In Huawei's platform, we do not
support IESB, so software needs to insert that.


Dongjiu Geng (3):
  arm64: add a macro for SError synchronization
  arm64: add error synchronization barrier in kernel_entry/kernel_exit
  KVM: arm64: add ESB in exception handler entry and exit.

James Morse (18):
  arm64: explicitly mask all exceptions
  arm64: introduce an order for exceptions
  arm64: Move the async/fiq helpers to explicitly set process context
    flags
  arm64: Mask all exceptions during kernel_exit
  arm64: entry.S: Remove disable_dbg
  arm64: entry.S: convert el1_sync
  arm64: entry.S convert el0_sync
  arm64: entry.S: convert elX_irq
  KVM: arm/arm64: mask/unmask daif around VHE guests
  arm64: kernel: Survive corrected RAS errors notified by SError
  arm64: cpufeature: Enable IESB on exception entry/return for
    firmware-first
  arm64: kernel: Prepare for a DISR user
  KVM: arm64: Set an impdef ESR for Virtual-SError using VSESR_EL2.
  KVM: arm64: Save/Restore guest DISR_EL1
  KVM: arm64: Save ESR_EL2 on guest SError
  KVM: arm64: Handle RAS SErrors from EL1 on guest exit
  KVM: arm64: Handle RAS SErrors from EL2 on guest exit
  KVM: arm64: Take any host SError before entering the guest

Xie XiuQi (2):
  arm64: entry.S: move SError handling into a C function for future
    expansion
  arm64: cpufeature: Detect CPU RAS Extentions

 arch/arm64/Kconfig                   | 33 +++++++++++++-
 arch/arm64/include/asm/assembler.h   | 59 +++++++++++++++++-------
 arch/arm64/include/asm/barrier.h     |  1 +
 arch/arm64/include/asm/cpucaps.h     |  4 +-
 arch/arm64/include/asm/daifflags.h   | 61 +++++++++++++++++++++++++
 arch/arm64/include/asm/esr.h         | 17 +++++++
 arch/arm64/include/asm/exception.h   | 14 ++++++
 arch/arm64/include/asm/irqflags.h    | 40 ++++++----------
 arch/arm64/include/asm/kvm_emulate.h | 10 ++++
 arch/arm64/include/asm/kvm_host.h    | 16 +++++++
 arch/arm64/include/asm/processor.h   |  2 +
 arch/arm64/include/asm/sysreg.h      |  6 +++
 arch/arm64/include/asm/traps.h       | 36 +++++++++++++++
 arch/arm64/kernel/asm-offsets.c      |  1 +
 arch/arm64/kernel/cpufeature.c       | 43 ++++++++++++++++++
 arch/arm64/kernel/debug-monitors.c   |  5 +-
 arch/arm64/kernel/entry.S            | 88 +++++++++++++++++++++---------------
 arch/arm64/kernel/hibernate.c        |  5 +-
 arch/arm64/kernel/machine_kexec.c    |  4 +-
 arch/arm64/kernel/process.c          |  3 ++
 arch/arm64/kernel/setup.c            |  8 ++--
 arch/arm64/kernel/signal.c           |  8 +++-
 arch/arm64/kernel/smp.c              | 12 ++---
 arch/arm64/kernel/suspend.c          |  7 +--
 arch/arm64/kernel/traps.c            | 64 +++++++++++++++++++++++++-
 arch/arm64/kvm/handle_exit.c         | 19 +++++++-
 arch/arm64/kvm/hyp-init.S            |  3 ++
 arch/arm64/kvm/hyp/entry.S           | 15 ++++++
 arch/arm64/kvm/hyp/hyp-entry.S       |  1 +
 arch/arm64/kvm/hyp/switch.c          | 19 ++++++--
 arch/arm64/kvm/hyp/sysreg-sr.c       |  6 +++
 arch/arm64/kvm/inject_fault.c        | 13 +++++-
 arch/arm64/kvm/sys_regs.c            |  1 +
 arch/arm64/mm/proc.S                 | 14 ++++--
 virt/kvm/arm/arm.c                   |  4 ++
 35 files changed, 527 insertions(+), 115 deletions(-)
 create mode 100644 arch/arm64/include/asm/daifflags.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 40+ messages in thread
* Re: [PATCH v1 1/3] arm64: add a macro for SError synchronization
@ 2017-11-01 14:13 ` gengdongjiu
  0 siblings, 0 replies; 40+ messages in thread
From: gengdongjiu @ 2017-11-01 14:13 UTC (permalink / raw)
  To: Robin Murphy, catalin.marinas, will.deacon, marc.zyngier,
	christoffer.dall, james.morse, mark.rutland, ard.biesheuvel, cov,
	Dave.Martin, suzuki.poulose, linux-arm-kernel, linux-kernel,
	kvmarm

> 
> On 01/11/17 12:54, gengdongjiu wrote:
> > Hi Robin,
> >
> > On 2017/11/1 19:24, Robin Murphy wrote:
> >>> +	esb
> >>> +alternative_else_nop_endif
> >>> +1:
> >>> +	.endm
> >> Having a branch in here is pretty horrible, and furthermore using
> >> label number 1 has a pretty high chance of subtly breaking code where
> >> this macro is inserted.
> >>
> >> Can we not somehow nest or combine the alternative conditions here?
> >
> > I found it will report error if combine the alternative conditions here.
> >
> > For example:
> >
> > +	.macro	error_synchronize
> > +alternative_if ARM64_HAS_IESB
> > +alternative_if ARM64_HAS_RAS_EXTN
> > +	esb
> > +alternative_else_nop_endif
> > +alternative_else_nop_endif
> > +	.endm
> >
> > And even using b.eq/cbz instruction in the alternative instruction in
> > arch/arm64/kernel/entry.S, it will report Error.
> >
> > For example below
> >
> > alternative_if ARM64_HAS_PAN
> > 	xxxxxxxxxxxxxxxxxxxx
> >         b.eq    xxxxx
> > alternative_else_nop_endif
> >
> > I do not dig it deeply, do you know the reason about it or good suggestion about that?
> > Thanks a lot in advance.
> 
> Actually, on second look ARM64_HAS_RAS_EXTN doesn't even matter - ESB is a hint, so if the CPU doesn't have RAS it should behave as a
> NOP anyway.


Yes, you are right. It is "HINT #16"

So in fact it can be written below:

+       .macro  error_synchronize
+alternative_if_not ARM64_HAS_IESB
+       esb
+alternative_else_nop_endif
+       .endm

If written to that, whether it will be strange? although ESB should behave as a
NOP anyway if the CPU doesn't have RAS. 

> 
> On which note, since I don't see one here - are any of those other patches defining an "esb" assembly macro similar to the inline asm case?
> If not then this isn't going to build with older toolchains - perhaps we should just use the raw hint syntax directly.


Sorry for that I do not push the dependent patch[1].
The "ESB" is defined as a macro 

/*
+ * RAS Error Synchronization barrier
+ */
+	.macro  esb
+	hint    #16
+	.endm
+
+/*

[1]
https://www.spinics.net/lists/arm-kernel/msg612884.html

> 
> Robin.

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2017-11-04 18:49 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01 19:14 [PATCH v1 0/3] manually add Error Synchronization Barrier at exception handler entry and exit Dongjiu Geng
2017-11-01 19:14 ` Dongjiu Geng
2017-11-01 19:14 ` Dongjiu Geng
2017-11-01 11:21 ` Robin Murphy
2017-11-01 11:21   ` Robin Murphy
2017-11-01 11:32 ` James Morse
2017-11-01 11:32   ` James Morse
2017-11-01 12:44   ` gengdongjiu
2017-11-01 12:44     ` gengdongjiu
2017-11-01 12:44     ` gengdongjiu
2017-11-01 19:14 ` [PATCH v1 1/3] arm64: add a macro for SError synchronization Dongjiu Geng
2017-11-01 19:14   ` Dongjiu Geng
2017-11-01 19:14   ` Dongjiu Geng
2017-11-01 11:24   ` Robin Murphy
2017-11-01 11:24     ` Robin Murphy
2017-11-01 12:54     ` gengdongjiu
2017-11-01 12:54       ` gengdongjiu
2017-11-01 12:54       ` gengdongjiu
2017-11-01 13:31       ` Robin Murphy
2017-11-01 13:31         ` Robin Murphy
2017-11-01 14:16       ` Mark Rutland
2017-11-01 14:16         ` Mark Rutland
2017-11-01 14:16         ` Mark Rutland
2017-11-02  8:52         ` gengdongjiu
2017-11-02  8:52           ` gengdongjiu
2017-11-02  8:52           ` gengdongjiu
2017-11-01 19:14 ` [PATCH v1 2/3] arm64: add error synchronization barrier in kernel_entry/kernel_exit Dongjiu Geng
2017-11-01 19:14   ` Dongjiu Geng
2017-11-01 19:14   ` Dongjiu Geng
2017-11-04 17:34   ` kbuild test robot
2017-11-04 17:34     ` kbuild test robot
2017-11-04 17:34     ` kbuild test robot
2017-11-01 19:14 ` [PATCH v1 3/3] KVM: arm64: add ESB in exception handler entry and exit Dongjiu Geng
2017-11-01 19:14   ` Dongjiu Geng
2017-11-01 19:14   ` Dongjiu Geng
2017-11-04 18:49   ` kbuild test robot
2017-11-04 18:49     ` kbuild test robot
2017-11-04 18:49     ` kbuild test robot
  -- strict thread matches above, loose matches on Subject: below --
2017-11-01 14:13 [PATCH v1 1/3] arm64: add a macro for SError synchronization gengdongjiu
2017-11-01 14:13 ` gengdongjiu

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.