Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • agd5f/linux
  • ltuikov/linux
  • FireBurn/linux
  • u6/linux
  • nikitalita/linux
  • siqueira/linux
  • magali/linux
  • amos/linux-display
  • isinyaaa/linux
  • somalapuram/linux
  • nirmoy/linux
  • hwentland/linux
  • hakzsam/linux
  • siqueira/linux-kunit
  • xushuotao/linux
  • lixian/linux
  • asheplyakov/linux
  • ap6711451/linux
  • alonsopascacioflores/linux
  • pyuan/linux
  • pepp/linux
  • alex.hung/linux
  • ckborah/linux-colorpipeline
  • lucmann/linux
  • MSkeffington/amdgfx-linux-fork
25 results
Show changes
Commits on Source (353)
Showing
with 162 additions and 68 deletions
...@@ -88,7 +88,6 @@ Antonio Quartulli <antonio@mandelbit.com> <antonio@open-mesh.com> ...@@ -88,7 +88,6 @@ Antonio Quartulli <antonio@mandelbit.com> <antonio@open-mesh.com>
Antonio Quartulli <antonio@mandelbit.com> <antonio.quartulli@open-mesh.com> Antonio Quartulli <antonio@mandelbit.com> <antonio.quartulli@open-mesh.com>
Antonio Quartulli <antonio@mandelbit.com> <ordex@autistici.org> Antonio Quartulli <antonio@mandelbit.com> <ordex@autistici.org>
Antonio Quartulli <antonio@mandelbit.com> <ordex@ritirata.org> Antonio Quartulli <antonio@mandelbit.com> <ordex@ritirata.org>
Antonio Quartulli <antonio@mandelbit.com> <antonio@openvpn.net>
Antonio Quartulli <antonio@mandelbit.com> <a@unstable.cc> Antonio Quartulli <antonio@mandelbit.com> <a@unstable.cc>
Anup Patel <anup@brainfault.org> <anup.patel@wdc.com> Anup Patel <anup@brainfault.org> <anup.patel@wdc.com>
Archit Taneja <archit@ti.com> Archit Taneja <archit@ti.com>
...@@ -692,6 +691,7 @@ Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> <subbaram@codeaurora.org> ...@@ -692,6 +691,7 @@ Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> <subbaram@codeaurora.org>
Subhash Jadavani <subhashj@codeaurora.org> Subhash Jadavani <subhashj@codeaurora.org>
Sudarshan Rajagopalan <quic_sudaraja@quicinc.com> <sudaraja@codeaurora.org> Sudarshan Rajagopalan <quic_sudaraja@quicinc.com> <sudaraja@codeaurora.org>
Sudeep Holla <sudeep.holla@arm.com> Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Sudeep Holla <sudeep.holla@arm.com> Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Sumit Garg <sumit.garg@kernel.org> <sumit.garg@linaro.org>
Sumit Semwal <sumit.semwal@ti.com> Sumit Semwal <sumit.semwal@ti.com>
Surabhi Vishnoi <quic_svishnoi@quicinc.com> <svishnoi@codeaurora.org> Surabhi Vishnoi <quic_svishnoi@quicinc.com> <svishnoi@codeaurora.org>
Sven Eckelmann <sven@narfation.org> <seckelmann@datto.com> Sven Eckelmann <sven@narfation.org> <seckelmann@datto.com>
......
...@@ -176,7 +176,7 @@ Configuring the kernel ...@@ -176,7 +176,7 @@ Configuring the kernel
values without prompting. values without prompting.
"make defconfig" Create a ./.config file by using the default "make defconfig" Create a ./.config file by using the default
symbol values from either arch/$ARCH/defconfig symbol values from either arch/$ARCH/configs/defconfig
or arch/$ARCH/configs/${PLATFORM}_defconfig, or arch/$ARCH/configs/${PLATFORM}_defconfig,
depending on the architecture. depending on the architecture.
......
...@@ -212,6 +212,17 @@ pid>/``). ...@@ -212,6 +212,17 @@ pid>/``).
This value defaults to 0. This value defaults to 0.
core_sort_vma
=============
The default coredump writes VMAs in address order. By setting
``core_sort_vma`` to 1, VMAs will be written from smallest size
to largest size. This is known to break at least elfutils, but
can be handy when dealing with very large (and truncated)
coredumps where the more useful debugging details are included
in the smaller VMAs.
core_uses_pid core_uses_pid
============= =============
......
...@@ -146,6 +146,7 @@ properties: ...@@ -146,6 +146,7 @@ properties:
maxItems: 2 maxItems: 2
pwm-names: pwm-names:
minItems: 1
items: items:
- const: convst1 - const: convst1
- const: convst2 - const: convst2
......
...@@ -63,8 +63,8 @@ what id ``k11000`` corresponds to in the second or third idmapping. The ...@@ -63,8 +63,8 @@ what id ``k11000`` corresponds to in the second or third idmapping. The
straightforward algorithm to use is to apply the inverse of the first idmapping, straightforward algorithm to use is to apply the inverse of the first idmapping,
mapping ``k11000`` up to ``u1000``. Afterwards, we can map ``u1000`` down using mapping ``k11000`` up to ``u1000``. Afterwards, we can map ``u1000`` down using
either the second idmapping mapping or third idmapping mapping. The second either the second idmapping mapping or third idmapping mapping. The second
idmapping would map ``u1000`` down to ``21000``. The third idmapping would map idmapping would map ``u1000`` down to ``k21000``. The third idmapping would map
``u1000`` down to ``u31000``. ``u1000`` down to ``k31000``.
If we were given the same task for the following three idmappings:: If we were given the same task for the following three idmappings::
......
...@@ -102,6 +102,9 @@ The system wide settings are configured under the /proc virtual file system: ...@@ -102,6 +102,9 @@ The system wide settings are configured under the /proc virtual file system:
* sched_rt_period_us takes values from 1 to INT_MAX. * sched_rt_period_us takes values from 1 to INT_MAX.
* sched_rt_runtime_us takes values from -1 to sched_rt_period_us. * sched_rt_runtime_us takes values from -1 to sched_rt_period_us.
* A run time of -1 specifies runtime == period, ie. no limit. * A run time of -1 specifies runtime == period, ie. no limit.
* sched_rt_runtime_us/sched_rt_period_us > 0.05 inorder to preserve
bandwidth for fair dl_server. For accurate value check average of
runtime/period in /sys/kernel/debug/sched/fair_server/cpuX/
2.2 Default behaviour 2.2 Default behaviour
......
...@@ -5775,6 +5775,7 @@ X: drivers/clk/clkdev.c ...@@ -5775,6 +5775,7 @@ X: drivers/clk/clkdev.c
   
COMMON INTERNET FILE SYSTEM CLIENT (CIFS and SMB3) COMMON INTERNET FILE SYSTEM CLIENT (CIFS and SMB3)
M: Steve French <sfrench@samba.org> M: Steve French <sfrench@samba.org>
M: Steve French <smfrench@gmail.com>
R: Paulo Alcantara <pc@manguebit.com> (DFS, global name space) R: Paulo Alcantara <pc@manguebit.com> (DFS, global name space)
R: Ronnie Sahlberg <ronniesahlberg@gmail.com> (directory leases, sparse files) R: Ronnie Sahlberg <ronniesahlberg@gmail.com> (directory leases, sparse files)
R: Shyam Prasad N <sprasad@microsoft.com> (multichannel) R: Shyam Prasad N <sprasad@microsoft.com> (multichannel)
...@@ -9442,14 +9443,11 @@ F: include/linux/fscrypt.h ...@@ -9442,14 +9443,11 @@ F: include/linux/fscrypt.h
F: include/uapi/linux/fscrypt.h F: include/uapi/linux/fscrypt.h
   
FSI SUBSYSTEM FSI SUBSYSTEM
M: Jeremy Kerr <jk@ozlabs.org> M: Eddie James <eajames@linux.ibm.com>
M: Joel Stanley <joel@jms.id.au> R: Ninad Palsule <ninad@linux.ibm.com>
R: Alistar Popple <alistair@popple.id.au>
R: Eddie James <eajames@linux.ibm.com>
L: linux-fsi@lists.ozlabs.org L: linux-fsi@lists.ozlabs.org
S: Supported S: Supported
Q: http://patchwork.ozlabs.org/project/linux-fsi/list/ Q: http://patchwork.ozlabs.org/project/linux-fsi/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi.git
F: drivers/fsi/ F: drivers/fsi/
F: include/linux/fsi*.h F: include/linux/fsi*.h
F: include/trace/events/fsi*.h F: include/trace/events/fsi*.h
...@@ -12655,7 +12653,9 @@ F: tools/testing/selftests/ ...@@ -12655,7 +12653,9 @@ F: tools/testing/selftests/
   
KERNEL SMB3 SERVER (KSMBD) KERNEL SMB3 SERVER (KSMBD)
M: Namjae Jeon <linkinjeon@kernel.org> M: Namjae Jeon <linkinjeon@kernel.org>
M: Namjae Jeon <linkinjeon@samba.org>
M: Steve French <sfrench@samba.org> M: Steve French <sfrench@samba.org>
M: Steve French <smfrench@gmail.com>
R: Sergey Senozhatsky <senozhatsky@chromium.org> R: Sergey Senozhatsky <senozhatsky@chromium.org>
R: Tom Talpey <tom@talpey.com> R: Tom Talpey <tom@talpey.com>
L: linux-cifs@vger.kernel.org L: linux-cifs@vger.kernel.org
...@@ -12872,7 +12872,7 @@ F: include/keys/trusted_dcp.h ...@@ -12872,7 +12872,7 @@ F: include/keys/trusted_dcp.h
F: security/keys/trusted-keys/trusted_dcp.c F: security/keys/trusted-keys/trusted_dcp.c
   
KEYS-TRUSTED-TEE KEYS-TRUSTED-TEE
M: Sumit Garg <sumit.garg@linaro.org> M: Sumit Garg <sumit.garg@kernel.org>
L: linux-integrity@vger.kernel.org L: linux-integrity@vger.kernel.org
L: keyrings@vger.kernel.org L: keyrings@vger.kernel.org
S: Supported S: Supported
...@@ -17672,7 +17672,7 @@ F: Documentation/ABI/testing/sysfs-bus-optee-devices ...@@ -17672,7 +17672,7 @@ F: Documentation/ABI/testing/sysfs-bus-optee-devices
F: drivers/tee/optee/ F: drivers/tee/optee/
   
OP-TEE RANDOM NUMBER GENERATOR (RNG) DRIVER OP-TEE RANDOM NUMBER GENERATOR (RNG) DRIVER
M: Sumit Garg <sumit.garg@linaro.org> M: Sumit Garg <sumit.garg@kernel.org>
L: op-tee@lists.trustedfirmware.org L: op-tee@lists.trustedfirmware.org
S: Maintained S: Maintained
F: drivers/char/hw_random/optee-rng.c F: drivers/char/hw_random/optee-rng.c
...@@ -23285,7 +23285,7 @@ F: include/media/i2c/tw9910.h ...@@ -23285,7 +23285,7 @@ F: include/media/i2c/tw9910.h
   
TEE SUBSYSTEM TEE SUBSYSTEM
M: Jens Wiklander <jens.wiklander@linaro.org> M: Jens Wiklander <jens.wiklander@linaro.org>
R: Sumit Garg <sumit.garg@linaro.org> R: Sumit Garg <sumit.garg@kernel.org>
L: op-tee@lists.trustedfirmware.org L: op-tee@lists.trustedfirmware.org
S: Maintained S: Maintained
F: Documentation/ABI/testing/sysfs-class-tee F: Documentation/ABI/testing/sysfs-class-tee
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
VERSION = 6 VERSION = 6
PATCHLEVEL = 14 PATCHLEVEL = 14
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc5 EXTRAVERSION = -rc6
NAME = Baby Opossum Posse NAME = Baby Opossum Posse
# *DOCUMENTATION* # *DOCUMENTATION*
...@@ -1123,6 +1123,11 @@ endif ...@@ -1123,6 +1123,11 @@ endif
KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
# userspace programs are linked via the compiler, use the correct linker
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_LD_IS_LLD),yy)
KBUILD_USERLDFLAGS += --ld-path=$(LD)
endif
# make the checker run with the right architecture # make the checker run with the right architecture
CHECKFLAGS += --arch=$(ARCH) CHECKFLAGS += --arch=$(ARCH)
......
...@@ -62,7 +62,7 @@ static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address, ...@@ -62,7 +62,7 @@ static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address,
} }
static int adjust_pte(struct vm_area_struct *vma, unsigned long address, static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
unsigned long pfn, struct vm_fault *vmf) unsigned long pfn, bool need_lock)
{ {
spinlock_t *ptl; spinlock_t *ptl;
pgd_t *pgd; pgd_t *pgd;
...@@ -99,12 +99,11 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address, ...@@ -99,12 +99,11 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
if (!pte) if (!pte)
return 0; return 0;
/* if (need_lock) {
* If we are using split PTE locks, then we need to take the page /*
* lock here. Otherwise we are using shared mm->page_table_lock * Use nested version here to indicate that we are already
* which is already locked, thus cannot take it. * holding one similar spinlock.
*/ */
if (ptl != vmf->ptl) {
spin_lock_nested(ptl, SINGLE_DEPTH_NESTING); spin_lock_nested(ptl, SINGLE_DEPTH_NESTING);
if (unlikely(!pmd_same(pmdval, pmdp_get_lockless(pmd)))) { if (unlikely(!pmd_same(pmdval, pmdp_get_lockless(pmd)))) {
pte_unmap_unlock(pte, ptl); pte_unmap_unlock(pte, ptl);
...@@ -114,7 +113,7 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address, ...@@ -114,7 +113,7 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
ret = do_adjust_pte(vma, address, pfn, pte); ret = do_adjust_pte(vma, address, pfn, pte);
if (ptl != vmf->ptl) if (need_lock)
spin_unlock(ptl); spin_unlock(ptl);
pte_unmap(pte); pte_unmap(pte);
...@@ -123,9 +122,10 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address, ...@@ -123,9 +122,10 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
static void static void
make_coherent(struct address_space *mapping, struct vm_area_struct *vma, make_coherent(struct address_space *mapping, struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep, unsigned long pfn, unsigned long addr, pte_t *ptep, unsigned long pfn)
struct vm_fault *vmf)
{ {
const unsigned long pmd_start_addr = ALIGN_DOWN(addr, PMD_SIZE);
const unsigned long pmd_end_addr = pmd_start_addr + PMD_SIZE;
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
struct vm_area_struct *mpnt; struct vm_area_struct *mpnt;
unsigned long offset; unsigned long offset;
...@@ -141,6 +141,14 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, ...@@ -141,6 +141,14 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma,
*/ */
flush_dcache_mmap_lock(mapping); flush_dcache_mmap_lock(mapping);
vma_interval_tree_foreach(mpnt, &mapping->i_mmap, pgoff, pgoff) { vma_interval_tree_foreach(mpnt, &mapping->i_mmap, pgoff, pgoff) {
/*
* If we are using split PTE locks, then we need to take the pte
* lock. Otherwise we are using shared mm->page_table_lock which
* is already locked, thus cannot take it.
*/
bool need_lock = IS_ENABLED(CONFIG_SPLIT_PTE_PTLOCKS);
unsigned long mpnt_addr;
/* /*
* If this VMA is not in our MM, we can ignore it. * If this VMA is not in our MM, we can ignore it.
* Note that we intentionally mask out the VMA * Note that we intentionally mask out the VMA
...@@ -151,7 +159,12 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, ...@@ -151,7 +159,12 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma,
if (!(mpnt->vm_flags & VM_MAYSHARE)) if (!(mpnt->vm_flags & VM_MAYSHARE))
continue; continue;
offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT; offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
aliases += adjust_pte(mpnt, mpnt->vm_start + offset, pfn, vmf); mpnt_addr = mpnt->vm_start + offset;
/* Avoid deadlocks by not grabbing the same PTE lock again. */
if (mpnt_addr >= pmd_start_addr && mpnt_addr < pmd_end_addr)
need_lock = false;
aliases += adjust_pte(mpnt, mpnt_addr, pfn, need_lock);
} }
flush_dcache_mmap_unlock(mapping); flush_dcache_mmap_unlock(mapping);
if (aliases) if (aliases)
...@@ -194,7 +207,7 @@ void update_mmu_cache_range(struct vm_fault *vmf, struct vm_area_struct *vma, ...@@ -194,7 +207,7 @@ void update_mmu_cache_range(struct vm_fault *vmf, struct vm_area_struct *vma,
__flush_dcache_folio(mapping, folio); __flush_dcache_folio(mapping, folio);
if (mapping) { if (mapping) {
if (cache_is_vivt()) if (cache_is_vivt())
make_coherent(mapping, vma, addr, ptep, pfn, vmf); make_coherent(mapping, vma, addr, ptep, pfn);
else if (vma->vm_flags & VM_EXEC) else if (vma->vm_flags & VM_EXEC)
__flush_icache_all(); __flush_icache_all();
} }
......
...@@ -16,6 +16,32 @@ ...@@ -16,6 +16,32 @@
#include <asm/sysreg.h> #include <asm/sysreg.h>
#include <linux/irqchip/arm-gic-v3.h> #include <linux/irqchip/arm-gic-v3.h>
.macro init_el2_hcr val
mov_q x0, \val
/*
* Compliant CPUs advertise their VHE-onlyness with
* ID_AA64MMFR4_EL1.E2H0 < 0. On such CPUs HCR_EL2.E2H is RES1, but it
* can reset into an UNKNOWN state and might not read as 1 until it has
* been initialized explicitly.
*
* Fruity CPUs seem to have HCR_EL2.E2H set to RAO/WI, but
* don't advertise it (they predate this relaxation).
*
* Initalize HCR_EL2.E2H so that later code can rely upon HCR_EL2.E2H
* indicating whether the CPU is running in E2H mode.
*/
mrs_s x1, SYS_ID_AA64MMFR4_EL1
sbfx x1, x1, #ID_AA64MMFR4_EL1_E2H0_SHIFT, #ID_AA64MMFR4_EL1_E2H0_WIDTH
cmp x1, #0
b.ge .LnVHE_\@
orr x0, x0, #HCR_E2H
.LnVHE_\@:
msr hcr_el2, x0
isb
.endm
.macro __init_el2_sctlr .macro __init_el2_sctlr
mov_q x0, INIT_SCTLR_EL2_MMU_OFF mov_q x0, INIT_SCTLR_EL2_MMU_OFF
msr sctlr_el2, x0 msr sctlr_el2, x0
...@@ -244,11 +270,6 @@ ...@@ -244,11 +270,6 @@
.Lskip_gcs_\@: .Lskip_gcs_\@:
.endm .endm
.macro __init_el2_nvhe_prepare_eret
mov x0, #INIT_PSTATE_EL1
msr spsr_el2, x0
.endm
.macro __init_el2_mpam .macro __init_el2_mpam
/* Memory Partitioning And Monitoring: disable EL2 traps */ /* Memory Partitioning And Monitoring: disable EL2 traps */
mrs x1, id_aa64pfr0_el1 mrs x1, id_aa64pfr0_el1
......
...@@ -298,25 +298,8 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) ...@@ -298,25 +298,8 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL)
msr sctlr_el2, x0 msr sctlr_el2, x0
isb isb
0: 0:
mov_q x0, HCR_HOST_NVHE_FLAGS
/*
* Compliant CPUs advertise their VHE-onlyness with
* ID_AA64MMFR4_EL1.E2H0 < 0. HCR_EL2.E2H can be
* RES1 in that case. Publish the E2H bit early so that
* it can be picked up by the init_el2_state macro.
*
* Fruity CPUs seem to have HCR_EL2.E2H set to RAO/WI, but
* don't advertise it (they predate this relaxation).
*/
mrs_s x1, SYS_ID_AA64MMFR4_EL1
tbz x1, #(ID_AA64MMFR4_EL1_E2H0_SHIFT + ID_AA64MMFR4_EL1_E2H0_WIDTH - 1), 1f
orr x0, x0, #HCR_E2H
1:
msr hcr_el2, x0
isb
init_el2_hcr HCR_HOST_NVHE_FLAGS
init_el2_state init_el2_state
/* Hypervisor stub */ /* Hypervisor stub */
...@@ -339,7 +322,8 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) ...@@ -339,7 +322,8 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL)
msr sctlr_el1, x1 msr sctlr_el1, x1
mov x2, xzr mov x2, xzr
3: 3:
__init_el2_nvhe_prepare_eret mov x0, #INIT_PSTATE_EL1
msr spsr_el2, x0
mov w0, #BOOT_CPU_MODE_EL2 mov w0, #BOOT_CPU_MODE_EL2
orr x0, x0, x2 orr x0, x0, x2
......
...@@ -73,8 +73,12 @@ __do_hyp_init: ...@@ -73,8 +73,12 @@ __do_hyp_init:
eret eret
SYM_CODE_END(__kvm_hyp_init) SYM_CODE_END(__kvm_hyp_init)
/*
* Initialize EL2 CPU state to sane values.
*
* HCR_EL2.E2H must have been initialized already.
*/
SYM_CODE_START_LOCAL(__kvm_init_el2_state) SYM_CODE_START_LOCAL(__kvm_init_el2_state)
/* Initialize EL2 CPU state to sane values. */
init_el2_state // Clobbers x0..x2 init_el2_state // Clobbers x0..x2
finalise_el2_state finalise_el2_state
ret ret
...@@ -206,9 +210,9 @@ SYM_CODE_START_LOCAL(__kvm_hyp_init_cpu) ...@@ -206,9 +210,9 @@ SYM_CODE_START_LOCAL(__kvm_hyp_init_cpu)
2: msr SPsel, #1 // We want to use SP_EL{1,2} 2: msr SPsel, #1 // We want to use SP_EL{1,2}
bl __kvm_init_el2_state init_el2_hcr 0
__init_el2_nvhe_prepare_eret bl __kvm_init_el2_state
/* Enable MMU, set vectors and stack. */ /* Enable MMU, set vectors and stack. */
mov x0, x28 mov x0, x28
......
...@@ -218,6 +218,9 @@ asmlinkage void __noreturn __kvm_host_psci_cpu_entry(bool is_cpu_on) ...@@ -218,6 +218,9 @@ asmlinkage void __noreturn __kvm_host_psci_cpu_entry(bool is_cpu_on)
if (is_cpu_on) if (is_cpu_on)
release_boot_args(boot_args); release_boot_args(boot_args);
write_sysreg_el1(INIT_SCTLR_EL1_MMU_OFF, SYS_SCTLR);
write_sysreg(INIT_PSTATE_EL1, SPSR_EL2);
__host_enter(host_ctxt); __host_enter(host_ctxt);
} }
......
...@@ -249,18 +249,6 @@ static __init int setup_node(int pxm) ...@@ -249,18 +249,6 @@ static __init int setup_node(int pxm)
return acpi_map_pxm_to_node(pxm); return acpi_map_pxm_to_node(pxm);
} }
/*
* Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for
* I/O localities since SRAT does not list them. I/O localities are
* not supported at this point.
*/
unsigned int numa_distance_cnt;
static inline unsigned int get_numa_distances_cnt(struct acpi_table_slit *slit)
{
return slit->locality_count;
}
void __init numa_set_distance(int from, int to, int distance) void __init numa_set_distance(int from, int to, int distance)
{ {
if ((u8)distance != distance || (from == to && distance != LOCAL_DISTANCE)) { if ((u8)distance != distance || (from == to && distance != LOCAL_DISTANCE)) {
......
...@@ -126,14 +126,14 @@ void kexec_reboot(void) ...@@ -126,14 +126,14 @@ void kexec_reboot(void)
/* All secondary cpus go to kexec_smp_wait */ /* All secondary cpus go to kexec_smp_wait */
if (smp_processor_id() > 0) { if (smp_processor_id() > 0) {
relocated_kexec_smp_wait(NULL); relocated_kexec_smp_wait(NULL);
unreachable(); BUG();
} }
#endif #endif
do_kexec = (void *)reboot_code_buffer; do_kexec = (void *)reboot_code_buffer;
do_kexec(efi_boot, cmdline_ptr, systable_ptr, start_addr, first_ind_entry); do_kexec(efi_boot, cmdline_ptr, systable_ptr, start_addr, first_ind_entry);
unreachable(); BUG();
} }
......
...@@ -387,6 +387,9 @@ static void __init check_kernel_sections_mem(void) ...@@ -387,6 +387,9 @@ static void __init check_kernel_sections_mem(void)
*/ */
static void __init arch_mem_init(char **cmdline_p) static void __init arch_mem_init(char **cmdline_p)
{ {
/* Recalculate max_low_pfn for "mem=xxx" */
max_pfn = max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());
if (usermem) if (usermem)
pr_info("User-defined physical RAM map overwrite\n"); pr_info("User-defined physical RAM map overwrite\n");
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/suspend.h>
#include <linux/syscore_ops.h> #include <linux/syscore_ops.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
...@@ -423,7 +424,7 @@ void loongson_cpu_die(unsigned int cpu) ...@@ -423,7 +424,7 @@ void loongson_cpu_die(unsigned int cpu)
mb(); mb();
} }
void __noreturn arch_cpu_idle_dead(void) static void __noreturn idle_play_dead(void)
{ {
register uint64_t addr; register uint64_t addr;
register void (*init_fn)(void); register void (*init_fn)(void);
...@@ -447,6 +448,50 @@ void __noreturn arch_cpu_idle_dead(void) ...@@ -447,6 +448,50 @@ void __noreturn arch_cpu_idle_dead(void)
BUG(); BUG();
} }
#ifdef CONFIG_HIBERNATION
static void __noreturn poll_play_dead(void)
{
register uint64_t addr;
register void (*init_fn)(void);
idle_task_exit();
__this_cpu_write(cpu_state, CPU_DEAD);
__smp_mb();
do {
__asm__ __volatile__("nop\n\t");
addr = iocsr_read64(LOONGARCH_IOCSR_MBUF0);
} while (addr == 0);
init_fn = (void *)TO_CACHE(addr);
iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_CLEAR);
init_fn();
BUG();
}
#endif
static void (*play_dead)(void) = idle_play_dead;
void __noreturn arch_cpu_idle_dead(void)
{
play_dead();
BUG(); /* play_dead() doesn't return */
}
#ifdef CONFIG_HIBERNATION
int hibernate_resume_nonboot_cpu_disable(void)
{
int ret;
play_dead = poll_play_dead;
ret = suspend_disable_secondary_cpus();
play_dead = idle_play_dead;
return ret;
}
#endif
#endif #endif
/* /*
......
...@@ -669,6 +669,12 @@ static int kvm_handle_rdwr_fault(struct kvm_vcpu *vcpu, bool write) ...@@ -669,6 +669,12 @@ static int kvm_handle_rdwr_fault(struct kvm_vcpu *vcpu, bool write)
struct kvm_run *run = vcpu->run; struct kvm_run *run = vcpu->run;
unsigned long badv = vcpu->arch.badv; unsigned long badv = vcpu->arch.badv;
/* Inject ADE exception if exceed max GPA size */
if (unlikely(badv >= vcpu->kvm->arch.gpa_size)) {
kvm_queue_exception(vcpu, EXCCODE_ADE, EXSUBCODE_ADEM);
return RESUME_GUEST;
}
ret = kvm_handle_mm_fault(vcpu, badv, write); ret = kvm_handle_mm_fault(vcpu, badv, write);
if (ret) { if (ret) {
/* Treat as MMIO */ /* Treat as MMIO */
......
...@@ -317,6 +317,13 @@ int kvm_arch_enable_virtualization_cpu(void) ...@@ -317,6 +317,13 @@ int kvm_arch_enable_virtualization_cpu(void)
kvm_debug("GCFG:%lx GSTAT:%lx GINTC:%lx GTLBC:%lx", kvm_debug("GCFG:%lx GSTAT:%lx GINTC:%lx GTLBC:%lx",
read_csr_gcfg(), read_csr_gstat(), read_csr_gintc(), read_csr_gtlbc()); read_csr_gcfg(), read_csr_gstat(), read_csr_gintc(), read_csr_gtlbc());
/*
* HW Guest CSR registers are lost after CPU suspend and resume.
* Clear last_vcpu so that Guest CSR registers forced to reload
* from vCPU SW state.
*/
this_cpu_ptr(vmcs)->last_vcpu = NULL;
return 0; return 0;
} }
......
...@@ -311,7 +311,7 @@ static int kvm_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu) ...@@ -311,7 +311,7 @@ static int kvm_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu)
{ {
int ret = RESUME_GUEST; int ret = RESUME_GUEST;
unsigned long estat = vcpu->arch.host_estat; unsigned long estat = vcpu->arch.host_estat;
u32 intr = estat & 0x1fff; /* Ignore NMI */ u32 intr = estat & CSR_ESTAT_IS;
u32 ecode = (estat & CSR_ESTAT_EXC) >> CSR_ESTAT_EXC_SHIFT; u32 ecode = (estat & CSR_ESTAT_EXC) >> CSR_ESTAT_EXC_SHIFT;
vcpu->mode = OUTSIDE_GUEST_MODE; vcpu->mode = OUTSIDE_GUEST_MODE;
......