Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Browse files Browse the repository at this point in the history
No conflicts.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Dec 9, 2022
2 parents ff36c44 + 010b676 commit 837e8ac
Show file tree
Hide file tree
Showing 222 changed files with 1,991 additions and 809 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ ForEachMacros:
- 'perf_hpp_list__for_each_sort_list_safe'
- 'perf_pmu__for_each_hybrid_pmu'
- 'ping_portaddr_for_each_entry'
- 'ping_portaddr_for_each_entry_rcu'
- 'plist_for_each'
- 'plist_for_each_continue'
- 'plist_for_each_entry'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ allOf:
items:
- const: oscclk
- const: dout_clkcmu_fsys1_bus
- const: dout_clkcmu_fsys1_mmc_card
- const: gout_clkcmu_fsys1_mmc_card
- const: dout_clkcmu_fsys1_usbdrd

- if:
Expand Down
42 changes: 42 additions & 0 deletions Documentation/loongarch/booting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. SPDX-License-Identifier: GPL-2.0
=======================
Booting Linux/LoongArch
=======================

:Author: Yanteng Si <siyanteng@loongson.cn>
:Date: 18 Nov 2022

Information passed from BootLoader to kernel
============================================

LoongArch supports ACPI and FDT. The information that needs to be passed
to the kernel includes the memmap, the initrd, the command line, optionally
the ACPI/FDT tables, and so on.

The kernel is passed the following arguments on `kernel_entry` :

- a0 = efi_boot: `efi_boot` is a flag indicating whether
this boot environment is fully UEFI-compliant.

- a1 = cmdline: `cmdline` is a pointer to the kernel command line.

- a2 = systemtable: `systemtable` points to the EFI system table.
All pointers involved at this stage are in physical addresses.

Header of Linux/LoongArch kernel images
=======================================

Linux/LoongArch kernel images are EFI images. Being PE files, they have
a 64-byte header structured like::

u32 MZ_MAGIC /* "MZ", MS-DOS header */
u32 res0 = 0 /* Reserved */
u64 kernel_entry /* Kernel entry point */
u64 _end - _text /* Kernel image effective size */
u64 load_offset /* Kernel image load offset from start of RAM */
u64 res1 = 0 /* Reserved */
u64 res2 = 0 /* Reserved */
u64 res3 = 0 /* Reserved */
u32 LINUX_PE_MAGIC /* Magic number */
u32 pe_header - _head /* Offset to the PE header */
1 change: 1 addition & 0 deletions Documentation/loongarch/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ LoongArch Architecture
:numbered:

introduction
booting
irq-chip-model

features
Expand Down
48 changes: 48 additions & 0 deletions Documentation/translations/zh_CN/loongarch/booting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../disclaimer-zh_CN.rst

:Original: Documentation/loongarch/booting.rst

:翻译:

司延腾 Yanteng Si <siyanteng@loongson.cn>

====================
启动 Linux/LoongArch
====================

:作者: 司延腾 <siyanteng@loongson.cn>
:日期: 2022年11月18日

BootLoader传递给内核的信息
==========================

LoongArch支持ACPI和FDT启动,需要传递给内核的信息包括memmap、initrd、cmdline、可
选的ACPI/FDT表等。

内核在 `kernel_entry` 入口处被传递以下参数:

- a0 = efi_boot: `efi_boot` 是一个标志,表示这个启动环境是否完全符合UEFI
的要求。

- a1 = cmdline: `cmdline` 是一个指向内核命令行的指针。

- a2 = systemtable: `systemtable` 指向EFI的系统表,在这个阶段涉及的所有
指针都是物理地址。

Linux/LoongArch内核镜像文件头
=============================

内核镜像是EFI镜像。作为PE文件,它们有一个64字节的头部结构体,如下所示::

u32 MZ_MAGIC /* "MZ", MS-DOS 头 */
u32 res0 = 0 /* 保留 */
u64 kernel_entry /* 内核入口点 */
u64 _end - _text /* 内核镜像有效大小 */
u64 load_offset /* 加载内核镜像相对内存起始地址的偏移量 */
u64 res1 = 0 /* 保留 */
u64 res2 = 0 /* 保留 */
u64 res3 = 0 /* 保留 */
u32 LINUX_PE_MAGIC /* 魔术数 */
u32 pe_header - _head /* 到PE头的偏移量 */
1 change: 1 addition & 0 deletions Documentation/translations/zh_CN/loongarch/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LoongArch体系结构
:numbered:

introduction
booting
irq-chip-model

features
Expand Down
15 changes: 7 additions & 8 deletions Documentation/virt/kvm/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7213,14 +7213,13 @@ veto the transition.
:Parameters: args[0] is the maximum poll time in nanoseconds
:Returns: 0 on success; -1 on error

This capability overrides the kvm module parameter halt_poll_ns for the
target VM.

VCPU polling allows a VCPU to poll for wakeup events instead of immediately
scheduling during guest halts. The maximum time a VCPU can spend polling is
controlled by the kvm module parameter halt_poll_ns. This capability allows
the maximum halt time to specified on a per-VM basis, effectively overriding
the module parameter for the target VM.
KVM_CAP_HALT_POLL overrides the kvm.halt_poll_ns module parameter to set the
maximum halt-polling time for all vCPUs in the target VM. This capability can
be invoked at any time and any number of times to dynamically change the
maximum halt-polling time.

See Documentation/virt/kvm/halt-polling.rst for more information on halt
polling.

7.21 KVM_CAP_X86_USER_SPACE_MSR
-------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ These module parameters can be set from the debugfs files in:
Note: that these module parameters are system wide values and are not able to
be tuned on a per vm basis.

Any changes to these parameters will be picked up by new and existing vCPUs the
next time they halt, with the notable exception of VMs using KVM_CAP_HALT_POLL
(see next section).

KVM_CAP_HALT_POLL
=================

KVM_CAP_HALT_POLL is a VM capability that allows userspace to override halt_poll_ns
on a per-VM basis. VMs using KVM_CAP_HALT_POLL ignore halt_poll_ns completely (but
still obey halt_poll_ns_grow, halt_poll_ns_grow_start, and halt_poll_ns_shrink).

See Documentation/virt/kvm/api.rst for more information on this capability.

Further Notes
=============

Expand Down
1 change: 1 addition & 0 deletions Documentation/virt/kvm/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ KVM

locking
vcpu-requests
halt-polling
review-checklist
1 change: 0 additions & 1 deletion Documentation/virt/kvm/x86/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ KVM for x86 systems
amd-memory-encryption
cpuid
errata
halt-polling
hypercalls
mmu
msr
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
VERSION = 6
PATCHLEVEL = 1
SUBLEVEL = 0
EXTRAVERSION = -rc7
EXTRAVERSION = -rc8
NAME = Hurr durr I'ma ninja sloth

# *DOCUMENTATION*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/at91rm9200.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
compatible = "atmel,at91rm9200-udc";
reg = <0xfffb0000 0x4000>;
interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 11>, <&pmc PMC_TYPE_SYSTEM 2>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 11>, <&pmc PMC_TYPE_SYSTEM 1>;
clock-names = "pclk", "hclk";
status = "disabled";
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/sama5.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void sama5_l2c310_write_sec(unsigned long val, unsigned reg)
static void __init sama5_secure_cache_init(void)
{
sam_secure_init();
if (sam_linux_is_optee_available())
if (IS_ENABLED(CONFIG_OUTER_CACHE) && sam_linux_is_optee_available())
outer_cache.write_sec = sama5_l2c310_write_sec;
}

Expand Down
8 changes: 0 additions & 8 deletions arch/arm64/include/asm/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@

#ifdef CONFIG_EFI
extern void efi_init(void);

bool efi_runtime_fixup_exception(struct pt_regs *regs, const char *msg);
#else
#define efi_init()

static inline
bool efi_runtime_fixup_exception(struct pt_regs *regs, const char *msg)
{
return false;
}
#endif

int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
Expand Down
33 changes: 2 additions & 31 deletions arch/arm64/kernel/efi-rt-wrapper.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <linux/linkage.h>

SYM_FUNC_START(__efi_rt_asm_wrapper)
stp x29, x30, [sp, #-112]!
stp x29, x30, [sp, #-32]!
mov x29, sp

/*
Expand All @@ -16,20 +16,6 @@ SYM_FUNC_START(__efi_rt_asm_wrapper)
*/
stp x1, x18, [sp, #16]

/*
* Preserve all callee saved registers and record the stack pointer
* value in a per-CPU variable so we can recover from synchronous
* exceptions occurring while running the firmware routines.
*/
stp x19, x20, [sp, #32]
stp x21, x22, [sp, #48]
stp x23, x24, [sp, #64]
stp x25, x26, [sp, #80]
stp x27, x28, [sp, #96]

adr_this_cpu x8, __efi_rt_asm_recover_sp, x9
str x29, [x8]

/*
* We are lucky enough that no EFI runtime services take more than
* 5 arguments, so all are passed in registers rather than via the
Expand All @@ -45,7 +31,7 @@ SYM_FUNC_START(__efi_rt_asm_wrapper)

ldp x1, x2, [sp, #16]
cmp x2, x18
ldp x29, x30, [sp], #112
ldp x29, x30, [sp], #32
b.ne 0f
ret
0:
Expand All @@ -59,18 +45,3 @@ SYM_FUNC_START(__efi_rt_asm_wrapper)
mov x18, x2
b efi_handle_corrupted_x18 // tail call
SYM_FUNC_END(__efi_rt_asm_wrapper)

SYM_FUNC_START(__efi_rt_asm_recover)
ldr_this_cpu x8, __efi_rt_asm_recover_sp, x9
mov sp, x8

ldp x0, x18, [sp, #16]
ldp x19, x20, [sp, #32]
ldp x21, x22, [sp, #48]
ldp x23, x24, [sp, #64]
ldp x25, x26, [sp, #80]
ldp x27, x28, [sp, #96]
ldp x29, x30, [sp], #112

b efi_handle_runtime_exception
SYM_FUNC_END(__efi_rt_asm_recover)
26 changes: 0 additions & 26 deletions arch/arm64/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <linux/efi.h>
#include <linux/init.h>
#include <linux/percpu.h>

#include <asm/efi.h>

Expand Down Expand Up @@ -145,28 +144,3 @@ asmlinkage efi_status_t efi_handle_corrupted_x18(efi_status_t s, const char *f)
pr_err_ratelimited(FW_BUG "register x18 corrupted by EFI %s\n", f);
return s;
}

asmlinkage DEFINE_PER_CPU(u64, __efi_rt_asm_recover_sp);

asmlinkage efi_status_t __efi_rt_asm_recover(void);

asmlinkage efi_status_t efi_handle_runtime_exception(const char *f)
{
pr_err(FW_BUG "Synchronous exception occurred in EFI runtime service %s()\n", f);
clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
return EFI_ABORTED;
}

bool efi_runtime_fixup_exception(struct pt_regs *regs, const char *msg)
{
/* Check whether the exception occurred while running the firmware */
if (current_work() != &efi_rts_work.work || regs->pc >= TASK_SIZE_64)
return false;

pr_err(FW_BUG "Unable to handle %s in EFI runtime service\n", msg);
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
dump_stack();

regs->pc = (u64)__efi_rt_asm_recover;
return true;
}
17 changes: 16 additions & 1 deletion arch/arm64/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,22 @@ void arch_dma_prep_coherent(struct page *page, size_t size)
{
unsigned long start = (unsigned long)page_address(page);

dcache_clean_poc(start, start + size);
/*
* The architecture only requires a clean to the PoC here in order to
* meet the requirements of the DMA API. However, some vendors (i.e.
* Qualcomm) abuse the DMA API for transferring buffers from the
* non-secure to the secure world, resetting the system if a non-secure
* access shows up after the buffer has been transferred:
*
* https://lore.kernel.org/r/20221114110329.68413-1-manivannan.sadhasivam@linaro.org
*
* Using clean+invalidate appears to make this issue less likely, but
* the drivers themselves still need fixing as the CPU could issue a
* speculative read from the buffer via the linear mapping irrespective
* of the cache maintenance we use. Once the drivers are fixed, we can
* relax this to a clean operation.
*/
dcache_clean_inval_poc(start, start + size);
}

#ifdef CONFIG_IOMMU_DMA
Expand Down
4 changes: 0 additions & 4 deletions arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <asm/bug.h>
#include <asm/cmpxchg.h>
#include <asm/cpufeature.h>
#include <asm/efi.h>
#include <asm/exception.h>
#include <asm/daifflags.h>
#include <asm/debug-monitors.h>
Expand Down Expand Up @@ -392,9 +391,6 @@ static void __do_kernel_fault(unsigned long addr, unsigned long esr,
msg = "paging request";
}

if (efi_runtime_fixup_exception(regs, msg))
return;

die_kernel_fault(msg, addr, esr, regs);
}

Expand Down
1 change: 1 addition & 0 deletions arch/loongarch/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ static inline pmd_t pmd_mkdirty(pmd_t pmd)
return pmd;
}

#define pmd_young pmd_young
static inline int pmd_young(pmd_t pmd)
{
return !!(pmd_val(pmd) & _PAGE_ACCESSED);
Expand Down
10 changes: 0 additions & 10 deletions arch/loongarch/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ extern void calculate_cpu_foreign_map(void);
*/
extern void show_ipi_list(struct seq_file *p, int prec);

/*
* This function sends a 'reschedule' IPI to another CPU.
* it goes straight through and wastes no time serializing
* anything. Worst case is that we lose a reschedule ...
*/
static inline void smp_send_reschedule(int cpu)
{
loongson_send_ipi_single(cpu, SMP_RESCHEDULE);
}

static inline void arch_send_call_function_single_ipi(int cpu)
{
loongson_send_ipi_single(cpu, SMP_CALL_FUNCTION);
Expand Down
Loading

0 comments on commit 837e8ac

Please sign in to comment.