mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 10:00:03 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.2-rc2
Cross-merge BPF and other fixes after downstream PR. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
1
.mailmap
1
.mailmap
@@ -373,6 +373,7 @@ Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@opinsys.com>
|
||||
Jason Gunthorpe <jgg@ziepe.ca> <jgg@mellanox.com>
|
||||
Jason Gunthorpe <jgg@ziepe.ca> <jgg@nvidia.com>
|
||||
Jason Gunthorpe <jgg@ziepe.ca> <jgunthorpe@obsidianresearch.com>
|
||||
Jason Wang <jasowangio@gmail.com> <jasowang@redhat.com>
|
||||
Jason Xing <kerneljasonxing@gmail.com> <kernelxing@tencent.com>
|
||||
<javier@osg.samsung.com> <javier.martinez@collabora.co.uk>
|
||||
Javi Merino <javi.merino@kernel.org> <javi.merino@arm.com>
|
||||
|
||||
@@ -29,3 +29,29 @@ Date: Oct 2025
|
||||
KernelVersion: 6.18
|
||||
Contact: Cédric Le Goater <clg@redhat.com>
|
||||
Description: Read the migration features of the vfio device.
|
||||
|
||||
What: /sys/kernel/debug/vfio/<device>/pci
|
||||
Date: June 2026
|
||||
KernelVersion: 7.2
|
||||
Contact: Alex Williamson <alex.williamson@nvidia.com>
|
||||
Description: This debugfs file directory is used for debugging
|
||||
VFIO PCI devices.
|
||||
|
||||
What: /sys/kernel/debug/vfio/<device>/pci/nointxmask
|
||||
Date: June 2026
|
||||
KernelVersion: 7.2
|
||||
Contact: Alex Williamson <alex.williamson@nvidia.com>
|
||||
Description: Read the nointxmask policy latched for this device. This
|
||||
policy governs whether the device may use PCI 2.3 style
|
||||
INTx masking when supported, reporting a value of "N", or
|
||||
requires APIC level INTx masking, reporting a value of "Y".
|
||||
|
||||
What: /sys/kernel/debug/vfio/<device>/pci/disable_idle_d3
|
||||
Date: June 2026
|
||||
KernelVersion: 7.2
|
||||
Contact: Alex Williamson <alex.williamson@nvidia.com>
|
||||
Description: Read the disable_idle_d3 policy latched for this device. This
|
||||
policy governs whether the device PM runtime usage count is
|
||||
kept elevated while the device is bound to the driver and
|
||||
unused, reporting a value of "Y", or decremented to allow the
|
||||
device to enter a low power state, reporting a value of "N".
|
||||
|
||||
@@ -60,7 +60,7 @@ examples:
|
||||
clock-output-names = "main", "pll0", "pll1", "pll2",
|
||||
"pll2s", "pll2h", "z", "z2",
|
||||
"i", "m3", "b", "m1", "m2",
|
||||
"zx", "zs", "hp";
|
||||
"zx", "zs", "hp", "ztr", "zt";
|
||||
};
|
||||
|
||||
sdhi2_clk: sdhi2_clk@e615007c {
|
||||
|
||||
@@ -28,7 +28,6 @@ properties:
|
||||
|
||||
fan-supply:
|
||||
description: Phandle to the regulator that powers the fan.
|
||||
$ref: /schemas/types.yaml#/definitions/phandle
|
||||
|
||||
required:
|
||||
- compatible
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/regulator/sprd,sc2730-regulator.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Unisoc SC2730 Power Management IC regulators
|
||||
|
||||
maintainers:
|
||||
- Otto Pflüger <otto.pflueger@abscue.de>
|
||||
|
||||
patternProperties:
|
||||
"^dcdc-(core|cpu|gen[0-1]|gpu|mem|memq|modem|sram)$":
|
||||
type: object
|
||||
$ref: regulator.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
"^ldo-avdd(12|18)$":
|
||||
type: object
|
||||
$ref: regulator.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
"^ldo-vdd(18-dcxo|28)$":
|
||||
type: object
|
||||
$ref: regulator.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
"^ldo-vdd(emmccore|kpled|ldo[0-2]|sd(core|io)|sim[0-2]|usb33|wcn|wifipa)$":
|
||||
type: object
|
||||
$ref: regulator.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
"^ldo-vddcam(a0|a1|d0|d1|io|mot)$":
|
||||
type: object
|
||||
$ref: regulator.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
"^ldo-vddrf(1v25|18)$":
|
||||
type: object
|
||||
$ref: regulator.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
additionalProperties: false
|
||||
...
|
||||
@@ -1,39 +0,0 @@
|
||||
Epson RX6110 Real Time Clock
|
||||
============================
|
||||
|
||||
The Epson RX6110 can be used with SPI or I2C busses. The kind of
|
||||
bus depends on the SPISEL pin and can not be configured via software.
|
||||
|
||||
I2C mode
|
||||
--------
|
||||
|
||||
Required properties:
|
||||
- compatible: should be: "epson,rx6110"
|
||||
- reg : the I2C address of the device for I2C
|
||||
|
||||
Example:
|
||||
|
||||
rtc: rtc@32 {
|
||||
compatible = "epson,rx6110"
|
||||
reg = <0x32>;
|
||||
};
|
||||
|
||||
SPI mode
|
||||
--------
|
||||
|
||||
Required properties:
|
||||
- compatible: should be: "epson,rx6110"
|
||||
- reg: chip select number
|
||||
- spi-cs-high: RX6110 needs chipselect high
|
||||
- spi-cpha: RX6110 works with SPI shifted clock phase
|
||||
- spi-cpol: RX6110 works with SPI inverse clock polarity
|
||||
|
||||
Example:
|
||||
|
||||
rtc: rtc@3 {
|
||||
compatible = "epson,rx6110"
|
||||
reg = <3>
|
||||
spi-cs-high;
|
||||
spi-cpha;
|
||||
spi-cpol;
|
||||
};
|
||||
68
Documentation/devicetree/bindings/rtc/epson,rx6110.yaml
Normal file
68
Documentation/devicetree/bindings/rtc/epson,rx6110.yaml
Normal file
@@ -0,0 +1,68 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/rtc/epson,rx6110.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Epson RX6110 Real Time Clock
|
||||
|
||||
description:
|
||||
The Epson RX6110 can be used with SPI or I2C busses. The kind of bus depends
|
||||
on the SPISEL pin and cannot be configured via software.
|
||||
|
||||
maintainers:
|
||||
- Alexandre Belloni <alexandre.belloni@bootlin.com>
|
||||
|
||||
allOf:
|
||||
- $ref: rtc.yaml#
|
||||
- $ref: /schemas/spi/spi-peripheral-props.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: epson,rx6110
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
spi-cs-high: true
|
||||
spi-cpha: true
|
||||
spi-cpol: true
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
dependencies:
|
||||
spi-cs-high: [ spi-cpha, spi-cpol ]
|
||||
spi-cpha: [ spi-cs-high, spi-cpol ]
|
||||
spi-cpol: [ spi-cs-high, spi-cpha ]
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
# I2C mode
|
||||
- |
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
rtc@32 {
|
||||
compatible = "epson,rx6110";
|
||||
reg = <0x32>;
|
||||
};
|
||||
};
|
||||
|
||||
# SPI mode
|
||||
- |
|
||||
spi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
rtc@3 {
|
||||
compatible = "epson,rx6110";
|
||||
reg = <3>;
|
||||
spi-cs-high;
|
||||
spi-cpha;
|
||||
spi-cpol;
|
||||
};
|
||||
};
|
||||
@@ -31,6 +31,7 @@ properties:
|
||||
- epson,rx8025
|
||||
- isil,isl12057
|
||||
- epson,rx8130
|
||||
- epson,rx8901
|
||||
|
||||
- items:
|
||||
- enum:
|
||||
|
||||
50
Documentation/devicetree/bindings/rtc/st,m41t93.yaml
Normal file
50
Documentation/devicetree/bindings/rtc/st,m41t93.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/rtc/st,m41t93.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: ST M41T93 RTC and compatible
|
||||
|
||||
maintainers:
|
||||
- Akhilesh Patil <akhilesh@ee.iitb.ac.in>
|
||||
|
||||
description:
|
||||
ST M41T93 is spi based Real Time Clock (RTC) with time, date,
|
||||
alarm, watchdog, square wave clock output, 8 bit timer and
|
||||
7 bytes of user SRAM.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- st,m41t93
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
"#clock-cells":
|
||||
const: 0
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
allOf:
|
||||
- $ref: rtc.yaml
|
||||
- $ref: /schemas/spi/spi-peripheral-props.yaml#
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
spi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
rtc@0 {
|
||||
compatible = "st,m41t93";
|
||||
reg = <0>;
|
||||
#clock-cells = <0>;
|
||||
spi-max-frequency = <2000000>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -30,6 +30,8 @@ properties:
|
||||
- aspeed,ast2500-rtc
|
||||
# ASPEED BMC ast2600 Real-time Clock
|
||||
- aspeed,ast2600-rtc
|
||||
# ASPEED BMC ast2700 Real-time Clock
|
||||
- aspeed,ast2700-rtc
|
||||
# Conexant Digicolor Real Time Clock Controller
|
||||
- cnxt,cx92755-rtc
|
||||
# I2C, 32-Bit Binary Counter Watchdog RTC with Trickle Charger and Reset Input/Output
|
||||
|
||||
@@ -54,6 +54,12 @@ properties:
|
||||
- sophgo,sg2042-spi
|
||||
- thead,th1520-spi
|
||||
- const: snps,dw-apb-ssi
|
||||
- description: Vendor controllers which use snps,dwc-ssi-2.00a as fallback
|
||||
items:
|
||||
- enum:
|
||||
- starfive,jhb100-spi
|
||||
- const: snps,dwc-ssi-2.00a
|
||||
- const: snps,dwc-ssi-1.01a
|
||||
- description: Intel Keem Bay SPI Controller
|
||||
const: intel,keembay-ssi
|
||||
- description: Intel Mount Evans Integrated Management Complex SPI Controller
|
||||
|
||||
@@ -87,9 +87,12 @@ examples:
|
||||
amlogic,ao-secure = <&sec_AO>;
|
||||
};
|
||||
- |
|
||||
#include <dt-bindings/clock/amlogic,t7-peripherals-clkc.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
temperature-sensor@20000 {
|
||||
compatible = "amlogic,t7-thermal";
|
||||
reg = <0x0 0x20000 0x0 0x50>;
|
||||
reg = <0x20000 0x50>;
|
||||
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clkc_periphs CLKID_TS>;
|
||||
#thermal-sensor-cells = <0>;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| arm64: | ok |
|
||||
| csky: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| loongarch: | TODO |
|
||||
| loongarch: | ok |
|
||||
| m68k: | TODO |
|
||||
| microblaze: | TODO |
|
||||
| mips: | TODO |
|
||||
|
||||
@@ -256,7 +256,7 @@ these logs can be cleared by writing in the proper reset_history attribute.
|
||||
``/sys/kernel/debug/i2c/i2c-[X]/[X]-addr/``
|
||||
contains the following attributes:
|
||||
|
||||
======================= ==========================================
|
||||
============================== ==========================================================
|
||||
power1_failed_fault_log Set to 1 by a power1 fault occurring.
|
||||
power1_good_input_fault_log Set to 1 by a power1 good input fault occurring at PGIO3.
|
||||
in11_fet_short_fault_log Set to 1 when a FET-short fault occurs.
|
||||
@@ -264,4 +264,4 @@ in11_fet_bad_fault_log Set to 1 when a FET-BAD fault occurs.
|
||||
in0_lcrit_fault_log Set to 1 by a VIN undervoltage fault occurring.
|
||||
in0_crit_fault_log Set to 1 by a VIN overvoltage fault occurring.
|
||||
curr1_crit_fault_log Set to 1 by an overcurrent fault occurring.
|
||||
======================= ==========================================
|
||||
============================== ==========================================================
|
||||
|
||||
20
MAINTAINERS
20
MAINTAINERS
@@ -15738,8 +15738,8 @@ F: drivers/net/ethernet/marvell/octeon_ep_vf
|
||||
MARVELL OCTEONTX2 PHYSICAL FUNCTION DRIVER
|
||||
M: Sunil Goutham <sgoutham@marvell.com>
|
||||
M: Geetha sowjanya <gakula@marvell.com>
|
||||
M: Ratheesh Kannoth <rkannoth@marvell.com>
|
||||
M: Subbaraya Sundeep <sbhatta@marvell.com>
|
||||
M: hariprasad <hkelam@marvell.com>
|
||||
M: Bharat Bhushan <bbhushan2@marvell.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
@@ -15748,9 +15748,8 @@ F: include/linux/soc/marvell/octeontx2/
|
||||
|
||||
MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER
|
||||
M: Sunil Goutham <sgoutham@marvell.com>
|
||||
M: Linu Cherian <lcherian@marvell.com>
|
||||
M: Ratheesh Kannoth <rkannoth@marvell.com>
|
||||
M: Geetha sowjanya <gakula@marvell.com>
|
||||
M: hariprasad <hkelam@marvell.com>
|
||||
M: Subbaraya Sundeep <sbhatta@marvell.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
@@ -15758,8 +15757,8 @@ F: Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst
|
||||
F: drivers/net/ethernet/marvell/octeontx2/af/
|
||||
|
||||
MARVELL PEM PMU DRIVER
|
||||
M: Linu Cherian <lcherian@marvell.com>
|
||||
M: Gowthami Thiagarajan <gthiagarajan@marvell.com>
|
||||
M: Geetha sowjanya <gakula@marvell.com>
|
||||
S: Supported
|
||||
F: drivers/perf/marvell_pem_pmu.c
|
||||
|
||||
@@ -18442,6 +18441,7 @@ F: drivers/net/ethernet/mucse/
|
||||
|
||||
MULTIFUNCTION DEVICES (MFD)
|
||||
M: Lee Jones <lee@kernel.org>
|
||||
L: mfd@lists.linux.dev
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
|
||||
F: Documentation/devicetree/bindings/mfd/
|
||||
@@ -27520,7 +27520,7 @@ F: drivers/net/ethernet/dec/tulip/
|
||||
|
||||
TUN/TAP DRIVER
|
||||
M: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
S: Maintained
|
||||
W: http://vtun.sourceforge.net/tun
|
||||
F: Documentation/networking/tuntap.rst
|
||||
@@ -28512,7 +28512,7 @@ F: include/uapi/linux/virtio_balloon.h
|
||||
|
||||
VIRTIO BLOCK AND SCSI DRIVERS
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
R: Paolo Bonzini <pbonzini@redhat.com>
|
||||
R: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
R: Eugenio Pérez <eperezma@redhat.com>
|
||||
@@ -28541,7 +28541,7 @@ F: include/uapi/linux/virtio_console.h
|
||||
|
||||
VIRTIO CORE
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
R: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
|
||||
R: Eugenio Pérez <eperezma@redhat.com>
|
||||
L: virtualization@lists.linux.dev
|
||||
@@ -28619,7 +28619,7 @@ F: include/uapi/linux/virtio_gpu.h
|
||||
|
||||
VIRTIO HOST (VHOST)
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
R: Eugenio Pérez <eperezma@redhat.com>
|
||||
L: kvm@vger.kernel.org
|
||||
L: virtualization@lists.linux.dev
|
||||
@@ -28634,7 +28634,7 @@ F: kernel/vhost_task.c
|
||||
|
||||
VIRTIO HOST (VHOST-SCSI)
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
M: Mike Christie <michael.christie@oracle.com>
|
||||
R: Paolo Bonzini <pbonzini@redhat.com>
|
||||
R: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
@@ -28674,7 +28674,7 @@ F: include/uapi/linux/virtio_mem.h
|
||||
|
||||
VIRTIO NET DRIVER
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
R: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
|
||||
R: Eugenio Pérez <eperezma@redhat.com>
|
||||
L: netdev@vger.kernel.org
|
||||
|
||||
4
Makefile
4
Makefile
@@ -1,8 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 7
|
||||
PATCHLEVEL = 1
|
||||
PATCHLEVEL = 2
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = -rc1
|
||||
NAME = Baby Opossum Posse
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/clocksource.h>
|
||||
#include <linux/clockchips.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
@@ -559,6 +559,15 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
|
||||
else
|
||||
alignment_mask = 0x7;
|
||||
offset = hw->address & alignment_mask;
|
||||
|
||||
/*
|
||||
* BAS is an 8-bit field in WCR/BCR; the shift below would
|
||||
* silently drop the high bits of ctrl.len when offset + len
|
||||
* exceeds 8, programming hardware to watch fewer bytes than
|
||||
* the user requested.
|
||||
*/
|
||||
if (((u32)hw->ctrl.len << offset) > ARM_BREAKPOINT_LEN_8)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hw->address &= ~alignment_mask;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <linux/static_call.h>
|
||||
#include <linux/memory.h>
|
||||
#include <asm/text-patching.h>
|
||||
#include <asm/insn.h>
|
||||
|
||||
void arch_static_call_transform(void *site, void *tramp, void *func, bool tail)
|
||||
{
|
||||
|
||||
@@ -1198,11 +1198,6 @@ static void __init map_mem(void)
|
||||
__map_memblock(start, end, pgprot_tagged(PAGE_KERNEL),
|
||||
flags);
|
||||
}
|
||||
|
||||
/* Map the kernel data/bss read-only in the linear map */
|
||||
__map_memblock(init_end, kernel_end, PAGE_KERNEL_RO, flags);
|
||||
flush_tlb_kernel_range((unsigned long)lm_alias(__init_end),
|
||||
(unsigned long)lm_alias(__bss_stop));
|
||||
}
|
||||
|
||||
void mark_rodata_ro(void)
|
||||
@@ -1221,6 +1216,12 @@ void mark_rodata_ro(void)
|
||||
update_mapping_prot(__pa_symbol(_text), (unsigned long)_text,
|
||||
(unsigned long)_stext - (unsigned long)_text,
|
||||
PAGE_KERNEL_RO);
|
||||
|
||||
/* Map the kernel data/bss read-only in the linear map */
|
||||
update_mapping_prot(__pa_symbol(__init_end),
|
||||
(unsigned long)lm_alias(__init_end),
|
||||
(unsigned long)__bss_stop - (unsigned long)__init_end,
|
||||
PAGE_KERNEL_RO);
|
||||
}
|
||||
|
||||
static void __init declare_vma(struct vm_struct *vma,
|
||||
|
||||
@@ -2177,7 +2177,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
|
||||
image_size = extable_offset + extable_size;
|
||||
ro_header = bpf_jit_binary_pack_alloc(image_size, &ro_image_ptr,
|
||||
sizeof(u64), &header, &image_ptr,
|
||||
jit_fill_hole);
|
||||
jit_fill_hole, was_classic);
|
||||
if (!ro_header)
|
||||
goto out_off;
|
||||
|
||||
@@ -2870,7 +2870,7 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
|
||||
|
||||
void *arch_alloc_bpf_trampoline(unsigned int size)
|
||||
{
|
||||
return bpf_prog_pack_alloc(size, jit_fill_hole);
|
||||
return bpf_prog_pack_alloc(size, jit_fill_hole, false);
|
||||
}
|
||||
|
||||
void arch_free_bpf_trampoline(void *image, unsigned int size)
|
||||
|
||||
@@ -209,6 +209,7 @@ config LOONGARCH
|
||||
select SYSCTL_ARCH_UNALIGN_NO_WARN
|
||||
select SYSCTL_EXCEPTION_TRACE
|
||||
select SWIOTLB if 64BIT
|
||||
select THREAD_INFO_IN_TASK
|
||||
select TRACE_IRQFLAGS_SUPPORT
|
||||
select USE_PERCPU_NUMA_NODE_ID
|
||||
select USER_STACKTRACE_SUPPORT
|
||||
|
||||
@@ -405,6 +405,8 @@ uart0: serial@1ff40800 {
|
||||
i2c0: i2c@1ff48000 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1ff48000 0x0 0x0800>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&eiointc>;
|
||||
interrupts = <14>;
|
||||
status = "disabled";
|
||||
@@ -413,6 +415,8 @@ i2c0: i2c@1ff48000 {
|
||||
i2c@1ff48800 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1ff48800 0x0 0x0800>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&eiointc>;
|
||||
interrupts = <15>;
|
||||
status = "disabled";
|
||||
@@ -421,6 +425,8 @@ i2c@1ff48800 {
|
||||
i2c@1ff49000 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1ff49000 0x0 0x0800>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&eiointc>;
|
||||
interrupts = <16>;
|
||||
status = "disabled";
|
||||
@@ -429,6 +435,8 @@ i2c@1ff49000 {
|
||||
i2c@1ff49800 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1ff49800 0x0 0x0800>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&eiointc>;
|
||||
interrupts = <17>;
|
||||
status = "disabled";
|
||||
@@ -437,6 +445,8 @@ i2c@1ff49800 {
|
||||
i2c@1ff4a000 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1ff4a000 0x0 0x0800>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&eiointc>;
|
||||
interrupts = <18>;
|
||||
status = "disabled";
|
||||
@@ -445,6 +455,8 @@ i2c@1ff4a000 {
|
||||
i2c@1ff4a800 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1ff4a800 0x0 0x0800>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&eiointc>;
|
||||
interrupts = <19>;
|
||||
status = "disabled";
|
||||
|
||||
@@ -311,6 +311,8 @@ uart0: serial@1fe20000 {
|
||||
i2c2: i2c@1fe21000 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1fe21000 0x0 0x8>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
@@ -319,6 +321,8 @@ i2c2: i2c@1fe21000 {
|
||||
i2c3: i2c@1fe21800 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1fe21800 0x0 0x8>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <23 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
|
||||
@@ -239,6 +239,8 @@ rtc0: rtc@100d0100 {
|
||||
i2c@1fe00120 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1fe00120 0x0 0x8>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
interrupt-parent = <&liointc>;
|
||||
interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
@@ -247,6 +249,8 @@ i2c@1fe00120 {
|
||||
i2c@1fe00130 {
|
||||
compatible = "loongson,ls2k-i2c";
|
||||
reg = <0x0 0x1fe00130 0x0 0x8>;
|
||||
clock-frequency = <100000>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
interrupt-parent = <&liointc>;
|
||||
interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
|
||||
@@ -38,6 +38,8 @@ static inline bool acpi_has_cpu_in_madt(void)
|
||||
extern struct list_head acpi_wakeup_device_list;
|
||||
extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC];
|
||||
|
||||
extern void acpi_add_early_pio(void);
|
||||
extern void acpi_remove_early_pio(void);
|
||||
extern int __init parse_acpi_topology(void);
|
||||
|
||||
#endif /* !CONFIG_ACPI */
|
||||
|
||||
31
arch/loongarch/include/asm/current.h
Normal file
31
arch/loongarch/include/asm/current.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __ASM_LOONGARCH_CURRENT_H
|
||||
#define __ASM_LOONGARCH_CURRENT_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#include <asm/percpu.h>
|
||||
|
||||
struct task_struct;
|
||||
|
||||
DECLARE_PER_CPU(struct task_struct *, cpu_tasks);
|
||||
|
||||
register struct task_struct *current_thread_pointer __asm__("$tp");
|
||||
|
||||
static __always_inline struct task_struct *get_current(void)
|
||||
{
|
||||
return current_thread_pointer;
|
||||
}
|
||||
|
||||
#define current get_current()
|
||||
|
||||
static __always_inline void set_current(struct task_struct *task)
|
||||
{
|
||||
__this_cpu_write(cpu_tasks, task);
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* __ASM_LOONGARCH_CURRENT_H */
|
||||
@@ -41,6 +41,8 @@ struct kimage_arch {
|
||||
unsigned long systable_ptr;
|
||||
};
|
||||
|
||||
struct kimage;
|
||||
|
||||
#ifdef CONFIG_KEXEC_FILE
|
||||
extern const struct kexec_file_ops kexec_efi_ops;
|
||||
extern const struct kexec_file_ops kexec_elf_ops;
|
||||
@@ -59,7 +61,6 @@ typedef void (*do_kexec_t)(unsigned long efi_boot,
|
||||
unsigned long start_addr,
|
||||
unsigned long first_ind_entry);
|
||||
|
||||
struct kimage;
|
||||
extern const unsigned char relocate_new_kernel[];
|
||||
extern const size_t relocate_new_kernel_size;
|
||||
extern void kexec_reboot(void);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#ifndef __ASM_PERCPU_H
|
||||
#define __ASM_PERCPU_H
|
||||
|
||||
#include <asm/cmpxchg.h>
|
||||
#include <asm/loongarch.h>
|
||||
|
||||
/*
|
||||
|
||||
@@ -429,6 +429,8 @@ static inline pte_t pte_mkwrite_novma(pte_t pte)
|
||||
|
||||
static inline pte_t pte_wrprotect(pte_t pte)
|
||||
{
|
||||
if (pte_val(pte) & _PAGE_DIRTY)
|
||||
pte_val(pte) |= _PAGE_MODIFIED;
|
||||
pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_DIRTY);
|
||||
return pte;
|
||||
}
|
||||
@@ -535,6 +537,8 @@ static inline pmd_t pmd_mkwrite_novma(pmd_t pmd)
|
||||
|
||||
static inline pmd_t pmd_wrprotect(pmd_t pmd)
|
||||
{
|
||||
if (pmd_val(pmd) & _PAGE_DIRTY)
|
||||
pmd_val(pmd) |= _PAGE_MODIFIED;
|
||||
pmd_val(pmd) &= ~(_PAGE_WRITE | _PAGE_DIRTY);
|
||||
return pmd;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,9 @@ extern int __cpu_logical_map[NR_CPUS];
|
||||
struct seq_file;
|
||||
|
||||
struct secondary_data {
|
||||
unsigned long task;
|
||||
unsigned long stack;
|
||||
unsigned long thread_info;
|
||||
unsigned long offset;
|
||||
};
|
||||
extern struct secondary_data cpuboot_data;
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
.cfi_rel_offset ra, PT_ERA
|
||||
.endif
|
||||
cfi_st tp, PT_R2, \docfi
|
||||
cfi_st u0, PT_R21, \docfi
|
||||
cfi_st fp, PT_R22, \docfi
|
||||
|
||||
/* Set thread_info if we're coming from user mode */
|
||||
@@ -191,10 +192,13 @@
|
||||
andi t0, t0, 0x3 /* extract pplv bit */
|
||||
beqz t0, 9f
|
||||
|
||||
LONG_LI tp, ~_THREAD_MASK
|
||||
and tp, tp, sp
|
||||
cfi_st u0, PT_R21, \docfi
|
||||
csrrd u0, PERCPU_BASE_KS
|
||||
|
||||
la_abs t1, cpu_tasks
|
||||
#ifdef CONFIG_SMP
|
||||
LONG_ADD t1, t1, u0
|
||||
#endif
|
||||
LONG_L tp, t1, 0
|
||||
9:
|
||||
#ifdef CONFIG_KGDB
|
||||
li.w t0, CSR_CRMD_WE
|
||||
|
||||
@@ -15,7 +15,6 @@ struct task_struct;
|
||||
* __switch_to - switch execution of a task
|
||||
* @prev: The task previously executed.
|
||||
* @next: The task to begin executing.
|
||||
* @next_ti: task_thread_info(next).
|
||||
* @sched_ra: __schedule return address.
|
||||
* @sched_cfa: __schedule call frame address.
|
||||
*
|
||||
@@ -23,8 +22,7 @@ struct task_struct;
|
||||
* the context of next. Returns prev.
|
||||
*/
|
||||
extern asmlinkage struct task_struct *__switch_to(struct task_struct *prev,
|
||||
struct task_struct *next, struct thread_info *next_ti,
|
||||
void *sched_ra, void *sched_cfa);
|
||||
struct task_struct *next, void *sched_ra, void *sched_cfa);
|
||||
|
||||
/*
|
||||
* For newly created kernel threads switch_to() will return to
|
||||
@@ -37,7 +35,8 @@ do { \
|
||||
lose_fpu_inatomic(1, prev); \
|
||||
lose_lbt_inatomic(1, prev); \
|
||||
hw_breakpoint_thread_switch(next); \
|
||||
(last) = __switch_to(prev, next, task_thread_info(next), \
|
||||
set_current(next); \
|
||||
(last) = __switch_to(prev, next, \
|
||||
__builtin_return_address(0), __builtin_frame_address(0)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
* must also be changed
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long tp_value; /* thread pointer */
|
||||
__u32 cpu; /* current CPU */
|
||||
@@ -37,20 +36,11 @@ struct thread_info {
|
||||
*/
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.flags = _TIF_FIXADE, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
}
|
||||
|
||||
/* How to get the thread information struct from C. */
|
||||
register struct thread_info *__current_thread_info __asm__("$tp");
|
||||
|
||||
static inline struct thread_info *current_thread_info(void)
|
||||
{
|
||||
return __current_thread_info;
|
||||
}
|
||||
|
||||
register unsigned long current_stack_pointer __asm__("$sp");
|
||||
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/numa.h>
|
||||
#include <asm/loongson.h>
|
||||
@@ -59,6 +60,33 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
|
||||
return ioremap_cache(phys, size);
|
||||
}
|
||||
|
||||
#define PIO_BASE (unsigned long)PCI_IOBASE
|
||||
#define PIO_SIZE ALIGN(ISA_IOSIZE, PAGE_SIZE)
|
||||
|
||||
static bool acpi_pio;
|
||||
|
||||
/* Add PIO for early access */
|
||||
void acpi_add_early_pio(void)
|
||||
{
|
||||
if (!acpi_disabled) {
|
||||
acpi_pio = true;
|
||||
vmap_page_range(PIO_BASE, PIO_BASE + PIO_SIZE,
|
||||
LOONGSON_LIO_BASE, pgprot_device(PAGE_KERNEL));
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove PIO for PCI register */
|
||||
void acpi_remove_early_pio(void)
|
||||
{
|
||||
if (!acpi_pio)
|
||||
return;
|
||||
|
||||
if (!acpi_disabled) {
|
||||
acpi_pio = false;
|
||||
vunmap_range(PIO_BASE, PIO_BASE + PIO_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
static int set_processor_mask(u32 id, u32 pass)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ static void __used output_task_defines(void)
|
||||
{
|
||||
COMMENT("LoongArch task_struct offsets.");
|
||||
OFFSET(TASK_STATE, task_struct, __state);
|
||||
OFFSET(TASK_THREAD_INFO, task_struct, stack);
|
||||
OFFSET(TASK_STACK, task_struct, stack);
|
||||
OFFSET(TASK_FLAGS, task_struct, flags);
|
||||
OFFSET(TASK_MM, task_struct, mm);
|
||||
OFFSET(TASK_PID, task_struct, pid);
|
||||
@@ -84,7 +84,6 @@ static void __used output_task_defines(void)
|
||||
static void __used output_thread_info_defines(void)
|
||||
{
|
||||
COMMENT("LoongArch thread_info offsets.");
|
||||
OFFSET(TI_TASK, thread_info, task);
|
||||
OFFSET(TI_FLAGS, thread_info, flags);
|
||||
OFFSET(TI_TP_VALUE, thread_info, tp_value);
|
||||
OFFSET(TI_CPU, thread_info, cpu);
|
||||
@@ -266,8 +265,9 @@ static void __used output_signal_defines(void)
|
||||
static void __used output_smpboot_defines(void)
|
||||
{
|
||||
COMMENT("Linux smp cpu boot offsets.");
|
||||
OFFSET(CPU_BOOT_TASK, secondary_data, task);
|
||||
OFFSET(CPU_BOOT_STACK, secondary_data, stack);
|
||||
OFFSET(CPU_BOOT_TINFO, secondary_data, thread_info);
|
||||
OFFSET(CPU_BOOT_OFFSET, secondary_data, offset);
|
||||
BLANK();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -67,8 +67,11 @@ SYM_CODE_START(handle_syscall)
|
||||
#endif
|
||||
|
||||
move u0, t0
|
||||
LONG_LI tp, ~_THREAD_MASK
|
||||
and tp, tp, sp
|
||||
la_abs t1, cpu_tasks
|
||||
#ifdef CONFIG_SMP
|
||||
LONG_ADD t1, t1, u0
|
||||
#endif
|
||||
LONG_L tp, t1, 0
|
||||
|
||||
move a0, sp
|
||||
bl do_syscall
|
||||
|
||||
@@ -74,10 +74,11 @@ SYM_CODE_START(kernel_entry) # kernel entry point
|
||||
/* GPR21 used for percpu base (runtime), initialized as 0 */
|
||||
move u0, zero
|
||||
|
||||
la.pcrel tp, init_thread_union
|
||||
/* Set the SP after an empty pt_regs. */
|
||||
PTR_LI sp, (_THREAD_SIZE - PT_SIZE)
|
||||
PTR_ADD sp, sp, tp
|
||||
la.pcrel tp, init_task
|
||||
la.pcrel t0, init_stack
|
||||
PTR_LI t1, _THREAD_SIZE
|
||||
PTR_ADD t0, t0, t1
|
||||
PTR_ADDI sp, t0, -PT_SIZE
|
||||
set_saved_sp sp, t0, t1
|
||||
|
||||
#ifdef CONFIG_RELOCATABLE
|
||||
@@ -86,8 +87,10 @@ SYM_CODE_START(kernel_entry) # kernel entry point
|
||||
|
||||
#ifdef CONFIG_RANDOMIZE_BASE
|
||||
/* Repoint the sp into the new kernel */
|
||||
PTR_LI sp, (_THREAD_SIZE - PT_SIZE)
|
||||
PTR_ADD sp, sp, tp
|
||||
LONG_LPTR t0, tp, TASK_STACK
|
||||
PTR_LI t1, _THREAD_SIZE
|
||||
PTR_ADD t0, t0, t1
|
||||
PTR_ADDI sp, t0, -PT_SIZE
|
||||
set_saved_sp sp, t0, t1
|
||||
|
||||
/* Jump to the new kernel: new_pc = current_pc + random_offset */
|
||||
@@ -127,8 +130,9 @@ SYM_CODE_START(smpboot_entry)
|
||||
csrxchg t0, t1, LOONGARCH_CSR_IMPCTL1
|
||||
#endif
|
||||
la.pcrel t0, cpuboot_data
|
||||
ld.d tp, t0, CPU_BOOT_TASK
|
||||
ld.d sp, t0, CPU_BOOT_STACK
|
||||
ld.d tp, t0, CPU_BOOT_TINFO
|
||||
ld.d u0, t0, CPU_BOOT_OFFSET
|
||||
|
||||
bl start_secondary
|
||||
ASM_BUG()
|
||||
|
||||
@@ -60,6 +60,8 @@ unsigned long __stack_chk_guard __read_mostly;
|
||||
EXPORT_SYMBOL(__stack_chk_guard);
|
||||
#endif
|
||||
|
||||
DEFINE_PER_CPU(struct task_struct *, cpu_tasks);
|
||||
|
||||
/*
|
||||
* Idle related variables and functions
|
||||
*/
|
||||
|
||||
@@ -313,7 +313,7 @@ unsigned long __init relocate_kernel(void)
|
||||
reloc_offset += random_offset;
|
||||
|
||||
/* The current thread is now within the relocated kernel */
|
||||
__current_thread_info = RELOCATED_KASLR(__current_thread_info);
|
||||
current_thread_pointer = RELOCATED_KASLR(current_thread_pointer);
|
||||
|
||||
update_reloc_offset(&reloc_offset, random_offset);
|
||||
}
|
||||
|
||||
@@ -502,6 +502,8 @@ static __init int arch_reserve_pio_range(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
|
||||
acpi_add_early_pio();
|
||||
|
||||
for_each_node_by_name(np, "isa") {
|
||||
struct of_range range;
|
||||
struct of_range_parser parser;
|
||||
@@ -593,6 +595,7 @@ void __init setup_arch(char **cmdline_p)
|
||||
{
|
||||
cpu_probe();
|
||||
unwind_init();
|
||||
set_current(current);
|
||||
|
||||
init_environ();
|
||||
efi_init();
|
||||
|
||||
@@ -400,8 +400,9 @@ void loongson_boot_secondary(int cpu, struct task_struct *idle)
|
||||
pr_info("Booting CPU#%d...\n", cpu);
|
||||
|
||||
entry = __pa_symbol((unsigned long)&smpboot_entry);
|
||||
cpuboot_data.stack = (unsigned long)__KSTK_TOS(idle);
|
||||
cpuboot_data.thread_info = (unsigned long)task_thread_info(idle);
|
||||
cpuboot_data.task = (unsigned long)idle;
|
||||
cpuboot_data.stack = (unsigned long)task_pt_regs(idle);
|
||||
cpuboot_data.offset = per_cpu_offset(cpu);
|
||||
|
||||
csr_mail_send(entry, cpu_logical_map(cpu), 0);
|
||||
|
||||
@@ -663,6 +664,7 @@ asmlinkage void start_secondary(void)
|
||||
set_my_cpu_offset(per_cpu_offset(cpu));
|
||||
|
||||
cpu_probe();
|
||||
set_current(current);
|
||||
constant_clockevent_init();
|
||||
loongson_init_secondary();
|
||||
|
||||
@@ -705,6 +707,7 @@ static void stop_this_cpu(void *dummy)
|
||||
set_cpu_online(smp_processor_id(), false);
|
||||
calculate_cpu_foreign_map();
|
||||
local_irq_disable();
|
||||
rcutree_report_cpu_dead();
|
||||
while (true);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/*
|
||||
* task_struct *__switch_to(task_struct *prev, task_struct *next,
|
||||
* struct thread_info *next_ti, void *sched_ra, void *sched_cfa)
|
||||
* void *sched_ra, void *sched_cfa)
|
||||
*/
|
||||
.align 5
|
||||
SYM_FUNC_START(__switch_to)
|
||||
@@ -24,8 +24,8 @@ SYM_FUNC_START(__switch_to)
|
||||
LONG_SPTR t1, a0, (THREAD_CSRPRMD - TASK_STRUCT_OFFSET)
|
||||
|
||||
cpu_save_nonscratch a0
|
||||
LONG_SPTR a3, a0, (THREAD_SCHED_RA - TASK_STRUCT_OFFSET)
|
||||
LONG_SPTR a4, a0, (THREAD_SCHED_CFA - TASK_STRUCT_OFFSET)
|
||||
LONG_SPTR a2, a0, (THREAD_SCHED_RA - TASK_STRUCT_OFFSET)
|
||||
LONG_SPTR a3, a0, (THREAD_SCHED_CFA - TASK_STRUCT_OFFSET)
|
||||
|
||||
#if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_SMP)
|
||||
la t7, __stack_chk_guard
|
||||
@@ -33,11 +33,12 @@ SYM_FUNC_START(__switch_to)
|
||||
LONG_SPTR t8, t7, 0
|
||||
#endif
|
||||
|
||||
move tp, a2
|
||||
move tp, a1
|
||||
cpu_restore_nonscratch a1
|
||||
|
||||
li.w t0, _THREAD_SIZE
|
||||
PTR_ADD t0, t0, tp
|
||||
LONG_LPTR t0, a1, (TASK_STACK - TASK_STRUCT_OFFSET)
|
||||
PTR_LI t1, _THREAD_SIZE
|
||||
PTR_ADD t0, t0, t1
|
||||
set_saved_sp t0, t1, t2
|
||||
|
||||
LONG_LPTR t1, a1, (THREAD_CSRPRMD - TASK_STRUCT_OFFSET)
|
||||
@@ -45,6 +46,7 @@ SYM_FUNC_START(__switch_to)
|
||||
|
||||
#ifdef CONFIG_32BIT
|
||||
PTR_ADDI a0, a0, -TASK_STRUCT_OFFSET
|
||||
PTR_ADDI tp, tp, -TASK_STRUCT_OFFSET
|
||||
#endif
|
||||
jr ra
|
||||
SYM_FUNC_END(__switch_to)
|
||||
|
||||
@@ -107,6 +107,12 @@ static void show_stacktrace(struct task_struct *task,
|
||||
unsigned long stackdata;
|
||||
unsigned long *sp = (unsigned long *)regs->regs[3];
|
||||
|
||||
if (!task)
|
||||
task = current;
|
||||
|
||||
if (!try_get_task_stack(task))
|
||||
return;
|
||||
|
||||
printk("%sStack :", loglvl);
|
||||
i = 0;
|
||||
while ((unsigned long) sp & (PAGE_SIZE - 1)) {
|
||||
@@ -129,6 +135,8 @@ static void show_stacktrace(struct task_struct *task,
|
||||
}
|
||||
pr_cont("\n");
|
||||
show_backtrace(task, regs, loglvl, user);
|
||||
|
||||
put_task_stack(task);
|
||||
}
|
||||
|
||||
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/kvm_host.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/cpufeature.h>
|
||||
|
||||
@@ -234,5 +234,5 @@ int set_direct_map_valid_noflush(struct page *page, unsigned nr, bool valid)
|
||||
clear = __pgprot(_PAGE_PRESENT | _PAGE_VALID);
|
||||
}
|
||||
|
||||
return __set_memory(addr, 1, set, clear);
|
||||
return __set_memory(addr, nr, set, clear);
|
||||
}
|
||||
|
||||
@@ -5,11 +5,18 @@
|
||||
* Copyright (C) 2022 Loongson Technology Corporation Limited
|
||||
*/
|
||||
#include <linux/memory.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
#include "bpf_jit.h"
|
||||
|
||||
#define LOONGARCH_MAX_REG_ARGS 8
|
||||
|
||||
#define LOONGARCH_SAVE_RA_NINSNS 1
|
||||
#define LOONGARCH_LONG_JUMP_NINSNS 5
|
||||
#define LOONGARCH_TCC_SLOT_NINSNS 1
|
||||
|
||||
#define LOONGARCH_PROLOGUE_SKIP_INSNS \
|
||||
(LOONGARCH_SAVE_RA_NINSNS + LOONGARCH_LONG_JUMP_NINSNS + LOONGARCH_TCC_SLOT_NINSNS)
|
||||
|
||||
#define LOONGARCH_LONG_JUMP_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
|
||||
|
||||
#define LOONGARCH_FENTRY_NINSNS 2
|
||||
@@ -143,8 +150,13 @@ static void build_prologue(struct jit_ctx *ctx)
|
||||
stack_adjust = round_up(stack_adjust, 16);
|
||||
stack_adjust += bpf_stack_adjust;
|
||||
|
||||
/*
|
||||
* Save the original return address to a temporary register to prevent
|
||||
* it from being overwritten, then reserve space for the long jump and
|
||||
* fentry trampoline slot for dynamically patching by ftrace at runtime.
|
||||
* These instructions are bypassed during a tail call invocation.
|
||||
*/
|
||||
move_reg(ctx, LOONGARCH_GPR_T0, LOONGARCH_GPR_RA);
|
||||
/* Reserve space for the move_imm + jirl instruction */
|
||||
for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++)
|
||||
emit_insn(ctx, nop);
|
||||
|
||||
@@ -253,10 +265,11 @@ static void __build_epilogue(struct jit_ctx *ctx, bool is_tail_call)
|
||||
emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_RA, 0);
|
||||
} else {
|
||||
/*
|
||||
* Call the next bpf prog and skip the first instruction
|
||||
* of TCC initialization.
|
||||
* Tail call to the next BPF program, passing offset in number
|
||||
* of instructions to jirl to bypass the initial setup slots.
|
||||
*/
|
||||
emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T3, 7);
|
||||
emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO,
|
||||
LOONGARCH_GPR_T3, LOONGARCH_PROLOGUE_SKIP_INSNS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,12 +325,12 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx, int insn)
|
||||
*/
|
||||
emit_insn(ctx, ldd, REG_TCC, LOONGARCH_GPR_SP, tcc_ptr_off);
|
||||
emit_insn(ctx, ldd, t3, REG_TCC, 0);
|
||||
emit_insn(ctx, addid, t3, t3, 1);
|
||||
emit_insn(ctx, std, t3, REG_TCC, 0);
|
||||
emit_insn(ctx, addid, t2, LOONGARCH_GPR_ZERO, MAX_TAIL_CALL_CNT);
|
||||
if (emit_tailcall_jmp(ctx, BPF_JSGT, t3, t2, jmp_offset) < 0)
|
||||
if (emit_tailcall_jmp(ctx, BPF_JSGE, t3, t2, jmp_offset) < 0)
|
||||
goto toofar;
|
||||
|
||||
emit_insn(ctx, addid, t3, t3, 1);
|
||||
|
||||
/*
|
||||
* prog = array->ptrs[index];
|
||||
* if (!prog)
|
||||
@@ -330,6 +343,8 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx, int insn)
|
||||
if (emit_tailcall_jmp(ctx, BPF_JEQ, t2, LOONGARCH_GPR_ZERO, jmp_offset) < 0)
|
||||
goto toofar;
|
||||
|
||||
emit_insn(ctx, std, t3, REG_TCC, 0);
|
||||
|
||||
/* goto *(prog->bpf_func + 4); */
|
||||
off = offsetof(struct bpf_prog, bpf_func);
|
||||
emit_insn(ctx, ldd, t3, t2, off);
|
||||
@@ -1147,6 +1162,19 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
||||
|
||||
/* function call */
|
||||
case BPF_JMP | BPF_CALL:
|
||||
/* Implement helper call to bpf_get_current_task/_btf() inline */
|
||||
if (insn->src_reg == 0 && (insn->imm == BPF_FUNC_get_current_task ||
|
||||
insn->imm == BPF_FUNC_get_current_task_btf)) {
|
||||
move_reg(ctx, regmap[BPF_REG_0], LOONGARCH_GPR_TP);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Implement helper call to bpf_get_smp_processor_id() inline */
|
||||
if (insn->src_reg == 0 && insn->imm == BPF_FUNC_get_smp_processor_id) {
|
||||
emit_insn(ctx, ldwu, regmap[BPF_REG_0], LOONGARCH_GPR_TP, TI_CPU);
|
||||
break;
|
||||
}
|
||||
|
||||
ret = bpf_jit_get_func_addr(ctx->prog, insn, extra_pass,
|
||||
&func_addr, &func_addr_fixed);
|
||||
if (ret < 0)
|
||||
@@ -1762,7 +1790,7 @@ static int invoke_bpf(struct jit_ctx *ctx, struct bpf_tramp_nodes *tn,
|
||||
|
||||
void *arch_alloc_bpf_trampoline(unsigned int size)
|
||||
{
|
||||
return bpf_prog_pack_alloc(size, jit_fill_hole);
|
||||
return bpf_prog_pack_alloc(size, jit_fill_hole, false);
|
||||
}
|
||||
|
||||
void arch_free_bpf_trampoline(void *image, unsigned int size)
|
||||
@@ -2228,7 +2256,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
|
||||
image_size = prog_size + extable_size;
|
||||
/* Now we know the size of the structure to make */
|
||||
ro_header = bpf_jit_binary_pack_alloc(image_size, &ro_image_ptr, sizeof(u32),
|
||||
&header, &image_ptr, jit_fill_hole);
|
||||
&header, &image_ptr, jit_fill_hole,
|
||||
bpf_prog_was_classic(prog));
|
||||
if (!ro_header)
|
||||
goto out_offset;
|
||||
|
||||
@@ -2367,3 +2396,15 @@ bool bpf_jit_supports_subprog_tailcalls(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool bpf_jit_inlines_helper_call(s32 imm)
|
||||
{
|
||||
switch (imm) {
|
||||
case BPF_FUNC_get_current_task:
|
||||
case BPF_FUNC_get_current_task_btf:
|
||||
case BPF_FUNC_get_smp_processor_id:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ static int acpi_prepare_root_resources(struct acpi_pci_root_info *ci)
|
||||
struct resource_entry *entry, *tmp;
|
||||
struct acpi_device *device = ci->bridge;
|
||||
|
||||
acpi_remove_early_pio();
|
||||
|
||||
status = acpi_pci_probe_root_resources(ci);
|
||||
if (status > 0) {
|
||||
acpi_evaluate_integer(device->handle, "PCIH", NULL, &pci_h);
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
|
||||
#include <asm/vdso/vdso.h>
|
||||
|
||||
#include <linux/build-salt.h>
|
||||
#include <linux/elfnote.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
ELFNOTE_START(Linux, 0, "a")
|
||||
.long LINUX_VERSION_CODE
|
||||
ELFNOTE_END
|
||||
|
||||
BUILD_SALT
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define __ASM_CDMM_H
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/device-id/mips_cdmm.h>
|
||||
|
||||
/**
|
||||
* struct mips_cdmm_device - Represents a single device on a CDMM bus.
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <lantiq_soc.h>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <linux/pci.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/mach-ralink/rt288x.h>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#ifndef _PARISC_HARDWARE_H
|
||||
#define _PARISC_HARDWARE_H
|
||||
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/device-id/parisc.h>
|
||||
|
||||
#define HWTYPE_ANY_ID PA_HWTYPE_ANY_ID
|
||||
#define HVERSION_ANY_ID PA_HVERSION_ANY_ID
|
||||
@@ -95,8 +95,6 @@ struct bc_module {
|
||||
#define HPHW_MC 15
|
||||
#define HPHW_FAULTY 31
|
||||
|
||||
struct parisc_device_id;
|
||||
|
||||
/* hardware.c: */
|
||||
extern const char *parisc_hardware_description(struct parisc_device_id *id);
|
||||
extern enum cpu_type parisc_get_cpu_type(unsigned long hversion);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#define _ASM_PARISC_PARISC_DEVICE_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/device-id/parisc.h>
|
||||
|
||||
struct parisc_device {
|
||||
struct resource hpa; /* Hard Physical Address */
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <asm/assembly.h>
|
||||
#include <uapi/asm/ptrace.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
|
||||
alloclen = proglen + FUNCTION_DESCR_SIZE + fixup_len + extable_len;
|
||||
|
||||
fhdr = bpf_jit_binary_pack_alloc(alloclen, &fimage, 4, &hdr, &image,
|
||||
bpf_jit_fill_ill_insns);
|
||||
bpf_jit_fill_ill_insns, bpf_prog_was_classic(fp));
|
||||
if (!fhdr)
|
||||
goto out_err;
|
||||
|
||||
@@ -588,7 +588,7 @@ bool bpf_jit_inlines_helper_call(s32 imm)
|
||||
|
||||
void *arch_alloc_bpf_trampoline(unsigned int size)
|
||||
{
|
||||
return bpf_prog_pack_alloc(size, bpf_jit_fill_ill_insns);
|
||||
return bpf_prog_pack_alloc(size, bpf_jit_fill_ill_insns, false);
|
||||
}
|
||||
|
||||
void arch_free_bpf_trampoline(void *image, unsigned int size)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <asm/reg.h>
|
||||
#include <asm/synch.h>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
#include <asm/fsl_lbc.h>
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <linux/export.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
|
||||
@@ -1321,7 +1321,7 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
|
||||
|
||||
void *arch_alloc_bpf_trampoline(unsigned int size)
|
||||
{
|
||||
return bpf_prog_pack_alloc(size, bpf_fill_ill_insns);
|
||||
return bpf_prog_pack_alloc(size, bpf_fill_ill_insns, false);
|
||||
}
|
||||
|
||||
void arch_free_bpf_trampoline(void *image, unsigned int size)
|
||||
|
||||
@@ -109,7 +109,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
|
||||
bpf_jit_binary_pack_alloc(prog_size + extable_size,
|
||||
&jit_data->ro_image, sizeof(u32),
|
||||
&jit_data->header, &jit_data->image,
|
||||
bpf_fill_ill_insns);
|
||||
bpf_fill_ill_insns,
|
||||
bpf_prog_was_classic(prog));
|
||||
if (!jit_data->ro_header)
|
||||
goto out_offset;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define _S390_CCWDEV_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/device-id/ccw.h>
|
||||
#include <asm/chsc.h>
|
||||
#include <asm/fcx.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <asm/platform_early.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/device-id/platform.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
static __initdata LIST_HEAD(sh_early_platform_driver_list);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/device-id/of.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
/* This is a dummy device table linked into all of the crypto
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <linux/string.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
@@ -38,11 +38,8 @@
|
||||
/*
|
||||
* Declare drivers belonging to specific x86 CPUs
|
||||
* Similar in spirit to pci_device_id and related PCI functions
|
||||
*
|
||||
* The wildcard initializers are in mod_devicetable.h because
|
||||
* file2alias needs them. Sigh.
|
||||
*/
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/device-id/x86_cpu.h>
|
||||
/* Get the INTEL_FAM* model defines */
|
||||
#include <asm/intel-family.h>
|
||||
/* And the X86_VENDOR_* ones */
|
||||
|
||||
@@ -388,6 +388,10 @@ extern void srso_alias_return_thunk(void);
|
||||
extern void entry_untrain_ret(void);
|
||||
extern void write_ibpb(void);
|
||||
|
||||
#ifdef CONFIG_BPF_JIT
|
||||
extern void bpf_arch_ibpb(void);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
extern void clear_bhb_loop(void);
|
||||
#endif
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <linux/sched/smt.h>
|
||||
#include <linux/pgtable.h>
|
||||
#include <linux/bpf.h>
|
||||
#include <linux/filter.h>
|
||||
#include <linux/kvm_types.h>
|
||||
|
||||
#include <asm/spec-ctrl.h>
|
||||
@@ -1651,8 +1652,21 @@ static inline const char *spectre_v2_module_string(void)
|
||||
{
|
||||
return spectre_v2_bad_module ? " - vulnerable module loaded" : "";
|
||||
}
|
||||
|
||||
/*
|
||||
* The "retpoline sequence" is the "call;mov;ret" sequence that
|
||||
* replaces normal indirect branch instructions. Differentiate
|
||||
* *the* retpoline sequence from the LFENCE-prefixed indirect
|
||||
* branches that simply use the retpoline infrastructure.
|
||||
*/
|
||||
static inline bool retpoline_seq_enabled(void)
|
||||
{
|
||||
return boot_cpu_has(X86_FEATURE_RETPOLINE) && !boot_cpu_has(X86_FEATURE_RETPOLINE_LFENCE);
|
||||
}
|
||||
|
||||
#else
|
||||
static inline const char *spectre_v2_module_string(void) { return ""; }
|
||||
static inline bool retpoline_seq_enabled(void) { return false; }
|
||||
#endif
|
||||
|
||||
#define SPECTRE_V2_LFENCE_MSG "WARNING: LFENCE mitigation is not recommended for this CPU, data leaks possible!\n"
|
||||
@@ -2095,8 +2109,7 @@ static void __init bhi_apply_mitigation(void)
|
||||
return;
|
||||
|
||||
/* Retpoline mitigates against BHI unless the CPU has RRSBA behavior */
|
||||
if (boot_cpu_has(X86_FEATURE_RETPOLINE) &&
|
||||
!boot_cpu_has(X86_FEATURE_RETPOLINE_LFENCE)) {
|
||||
if (retpoline_seq_enabled()) {
|
||||
spec_ctrl_disable_kernel_rrsba();
|
||||
if (rrsba_disabled)
|
||||
return;
|
||||
@@ -2238,6 +2251,27 @@ static void __init spectre_v2_update_mitigation(void)
|
||||
pr_info("%s\n", spectre_v2_strings[spectre_v2_enabled]);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BPF_JIT
|
||||
static void __bpf_arch_ibpb(void *unused)
|
||||
{
|
||||
write_ibpb();
|
||||
}
|
||||
|
||||
void bpf_arch_ibpb(void)
|
||||
{
|
||||
on_each_cpu(__bpf_arch_ibpb, NULL, 1);
|
||||
}
|
||||
|
||||
static bool __init cpu_wants_ibpb_bpf(void)
|
||||
{
|
||||
/* A genuine retpoline already neutralizes ring0 indirect predictions */
|
||||
if (retpoline_seq_enabled())
|
||||
return false;
|
||||
|
||||
return boot_cpu_has(X86_FEATURE_IBPB);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void __init spectre_v2_apply_mitigation(void)
|
||||
{
|
||||
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled())
|
||||
@@ -2314,6 +2348,14 @@ static void __init spectre_v2_apply_mitigation(void)
|
||||
setup_force_cpu_cap(X86_FEATURE_USE_IBRS_FW);
|
||||
pr_info("Enabling Restricted Speculation for firmware calls\n");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BPF_JIT
|
||||
if (cpu_wants_ibpb_bpf()) {
|
||||
static_call_update(bpf_arch_pred_flush, bpf_arch_ibpb);
|
||||
static_branch_enable(&bpf_pred_flush_enabled);
|
||||
pr_info("Enabling IBPB for BPF\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void update_stibp_msr(void * __unused)
|
||||
@@ -3490,9 +3532,7 @@ static const char *spectre_bhi_state(void)
|
||||
return "; BHI: BHI_DIS_S";
|
||||
else if (boot_cpu_has(X86_FEATURE_CLEAR_BHB_LOOP))
|
||||
return "; BHI: SW loop, KVM: SW loop";
|
||||
else if (boot_cpu_has(X86_FEATURE_RETPOLINE) &&
|
||||
!boot_cpu_has(X86_FEATURE_RETPOLINE_LFENCE) &&
|
||||
rrsba_disabled)
|
||||
else if (retpoline_seq_enabled() && rrsba_disabled)
|
||||
return "; BHI: Retpoline";
|
||||
else if (boot_cpu_has(X86_FEATURE_CLEAR_BHB_VMEXIT))
|
||||
return "; BHI: Vulnerable, KVM: SW loop";
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "pmu.h"
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/highmem.h>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <linux/kvm_host.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/objtool.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
@@ -3653,7 +3653,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
|
||||
|
||||
void *arch_alloc_bpf_trampoline(unsigned int size)
|
||||
{
|
||||
return bpf_prog_pack_alloc(size, jit_fill_hole);
|
||||
return bpf_prog_pack_alloc(size, jit_fill_hole, false);
|
||||
}
|
||||
|
||||
void arch_free_bpf_trampoline(void *image, unsigned int size)
|
||||
@@ -3965,7 +3965,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
|
||||
/* allocate module memory for x86 insns and extable */
|
||||
header = bpf_jit_binary_pack_alloc(roundup(proglen, align) + extable_size,
|
||||
&image, align, &rw_header, &rw_image,
|
||||
jit_fill_hole);
|
||||
jit_fill_hole,
|
||||
bpf_prog_was_classic(prog));
|
||||
if (!header)
|
||||
goto out_addrs;
|
||||
prog->aux->extable = (void *) image + roundup(proglen, align);
|
||||
|
||||
@@ -1300,7 +1300,7 @@ int amdxdna_drm_sync_bo_ioctl(struct drm_device *dev,
|
||||
args->handle, args->offset, args->size);
|
||||
|
||||
if (args->direction == SYNC_DIRECT_FROM_DEVICE)
|
||||
ret = amdxdna_hwctx_sync_debug_bo(abo->client, args->handle);
|
||||
ret = amdxdna_hwctx_sync_debug_bo(client, args->handle);
|
||||
|
||||
put_obj:
|
||||
drm_gem_object_put(gobj);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
|
||||
@@ -208,9 +208,9 @@ static int ivpu_hws_cmdq_init(struct ivpu_file_priv *file_priv, struct ivpu_cmdq
|
||||
ret = ivpu_jsm_hws_set_context_sched_properties(vdev, file_priv->ctx.id, cmdq->id,
|
||||
priority);
|
||||
if (ret)
|
||||
return ret;
|
||||
ivpu_jsm_hws_destroy_cmdq(vdev, file_priv->ctx.id, cmdq->id);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ivpu_register_db(struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq)
|
||||
@@ -281,10 +281,10 @@ static int ivpu_cmdq_register(struct ivpu_file_priv *file_priv, struct ivpu_cmdq
|
||||
}
|
||||
|
||||
ret = ivpu_register_db(file_priv, cmdq);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (ret && vdev->fw->sched_mode == VPU_SCHEDULING_MODE_HW)
|
||||
ivpu_jsm_hws_destroy_cmdq(vdev, file_priv->ctx.id, cmdq->id);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ivpu_cmdq_unregister(struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/math64.h>
|
||||
#include <linux/mhi.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/time64.h>
|
||||
#include <linux/timer.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/limits.h>
|
||||
#include <linux/mhi.h>
|
||||
#include <linux/minmax.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/overflow.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
@@ -490,7 +490,7 @@ static void ipmi_bmc_gone(int iface)
|
||||
mutex_lock(&driver_data.ipmi_lock);
|
||||
list_for_each_entry_safe(iter, temp,
|
||||
&driver_data.ipmi_devices, head) {
|
||||
if (iter->ipmi_ifnum != iface) {
|
||||
if (iter->ipmi_ifnum == iface) {
|
||||
ipmi_device = iter;
|
||||
__ipmi_dev_kill(iter);
|
||||
break;
|
||||
|
||||
@@ -168,7 +168,16 @@ void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size)
|
||||
{
|
||||
/* Always terminate destination string */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
strscpy_pad(dest, source, dest_size);
|
||||
#else
|
||||
/*
|
||||
* strscpy_pad() is not defined in ACPICA tools builds, so use strncpy()
|
||||
* and directly NUL-terminate the destination string in that case.
|
||||
*/
|
||||
strncpy(dest, source, dest_size);
|
||||
dest[dest_size - 1] = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1143,7 +1143,7 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __weak acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi)
|
||||
int __weak __cpuidle acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -1156,7 +1156,7 @@ int __weak acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi)
|
||||
*
|
||||
* Return: 0 for success or negative value for error
|
||||
*/
|
||||
static int acpi_idle_lpi_enter(struct cpuidle_device *dev,
|
||||
static int __cpuidle acpi_idle_lpi_enter(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int index)
|
||||
{
|
||||
struct acpi_processor *pr;
|
||||
|
||||
@@ -871,7 +871,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
|
||||
EXPORT_SYMBOL_GPL(acpi_dev_resource_interrupt);
|
||||
|
||||
/**
|
||||
* acpi_dev_free_resource_list - Free resource from %acpi_dev_get_resources().
|
||||
* acpi_dev_free_resource_list - Free resource from acpi_dev_get_resources().
|
||||
* @list: The head of the resource list to free.
|
||||
*/
|
||||
void acpi_dev_free_resource_list(struct list_head *list)
|
||||
@@ -991,7 +991,7 @@ static int __acpi_dev_get_resources(struct acpi_device *adev,
|
||||
*
|
||||
* The resultant struct resource objects are put on the list pointed to by
|
||||
* @list, that must be empty initially, as members of struct resource_entry
|
||||
* objects. Callers of this routine should use %acpi_dev_free_resource_list() to
|
||||
* objects. Callers of this routine should use acpi_dev_free_resource_list() to
|
||||
* free that list.
|
||||
*
|
||||
* The number of resources in the output list is returned on success, an error
|
||||
@@ -1032,7 +1032,7 @@ static int is_memory(struct acpi_resource *ares, void *not_used)
|
||||
* The resultant struct resource objects are put on the list pointed to
|
||||
* by @list, that must be empty initially, as members of struct
|
||||
* resource_entry objects. Callers of this routine should use
|
||||
* %acpi_dev_free_resource_list() to free that list.
|
||||
* acpi_dev_free_resource_list() to free that list.
|
||||
*
|
||||
* The number of resources in the output list is returned on success,
|
||||
* an error code reflecting the error condition is returned otherwise.
|
||||
|
||||
@@ -66,7 +66,7 @@ int acpi_processor_ffh_lpi_probe(unsigned int cpu)
|
||||
return acpi_cpu_init_idle(cpu);
|
||||
}
|
||||
|
||||
int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi)
|
||||
int __cpuidle acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi)
|
||||
{
|
||||
u32 state = lpi->address;
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
#ifdef CONFIG_ACPI_DEBUG
|
||||
/*
|
||||
* ACPI debug sysfs I/F, including:
|
||||
* /sys/modules/acpi/parameters/debug_layer
|
||||
* /sys/modules/acpi/parameters/debug_level
|
||||
* /sys/modules/acpi/parameters/trace_method_name
|
||||
* /sys/modules/acpi/parameters/trace_state
|
||||
* /sys/modules/acpi/parameters/trace_debug_layer
|
||||
* /sys/modules/acpi/parameters/trace_debug_level
|
||||
* /sys/module/acpi/parameters/debug_layer
|
||||
* /sys/module/acpi/parameters/debug_level
|
||||
* /sys/module/acpi/parameters/trace_method_name
|
||||
* /sys/module/acpi/parameters/trace_state
|
||||
* /sys/module/acpi/parameters/trace_debug_layer
|
||||
* /sys/module/acpi/parameters/trace_debug_level
|
||||
*/
|
||||
|
||||
struct acpi_dlayer {
|
||||
@@ -269,7 +269,7 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
|
||||
#endif /* CONFIG_ACPI_DEBUG */
|
||||
|
||||
|
||||
/* /sys/modules/acpi/parameters/aml_debug_output */
|
||||
/* /sys/module/acpi/parameters/aml_debug_output */
|
||||
|
||||
module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
|
||||
byte, 0644);
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/device.h>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
|
||||
@@ -2847,6 +2847,24 @@ static void ata_dev_config_cpr(struct ata_device *dev)
|
||||
if (!nr_cpr)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* The device reports the number of CPR descriptors independently of the
|
||||
* log size, and that count is also used to emit VPD page B9h into the
|
||||
* fixed-size rbuf. Reject a count larger than what that buffer can hold
|
||||
* (ATA_DEV_MAX_CPR) or larger than the log the device actually returned.
|
||||
*/
|
||||
if (nr_cpr > ATA_DEV_MAX_CPR) {
|
||||
ata_dev_warn(dev,
|
||||
"Too many concurrent positioning ranges\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (buf_len < 64 + (size_t)nr_cpr * 32) {
|
||||
ata_dev_warn(dev,
|
||||
"Invalid number of concurrent positioning ranges\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
cpr_log = kzalloc_flex(*cpr_log, cpr, nr_cpr);
|
||||
if (!cpr_log)
|
||||
goto out;
|
||||
@@ -4295,6 +4313,9 @@ static const struct ata_dev_quirks_entry __ata_dev_quirks[] = {
|
||||
/* Apacer models with LPM issues */
|
||||
{ "Apacer AS340*", NULL, ATA_QUIRK_NOLPM },
|
||||
|
||||
/* PNY CS900 (Phison PS3111-S11, DRAM-less) drops the link on DIPM */
|
||||
{ "PNY CS900 1TB SSD", NULL, ATA_QUIRK_NOLPM },
|
||||
|
||||
/* Silicon Motion models with LPM issues */
|
||||
{ "MD619HXCLDE3TC", "TCVAID", ATA_QUIRK_NOLPM },
|
||||
{ "MD619GXCLDE3TC", "TCV35D", ATA_QUIRK_NOLPM },
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
#include "libata.h"
|
||||
#include "libata-transport.h"
|
||||
|
||||
#define ATA_SCSI_RBUF_SIZE 2048
|
||||
|
||||
static DEFINE_SPINLOCK(ata_scsi_rbuf_lock);
|
||||
static u8 ata_scsi_rbuf[ATA_SCSI_RBUF_SIZE];
|
||||
|
||||
@@ -1933,8 +1931,13 @@ static void ata_scsi_rbuf_fill(struct ata_device *dev, struct scsi_cmnd *cmd,
|
||||
memset(ata_scsi_rbuf, 0, ATA_SCSI_RBUF_SIZE);
|
||||
len = actor(dev, cmd, ata_scsi_rbuf);
|
||||
if (len) {
|
||||
if (WARN_ON(len > ATA_SCSI_RBUF_SIZE)) {
|
||||
ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND, 0, 0);
|
||||
spin_unlock_irqrestore(&ata_scsi_rbuf_lock, flags);
|
||||
return;
|
||||
}
|
||||
sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
|
||||
ata_scsi_rbuf, ATA_SCSI_RBUF_SIZE);
|
||||
ata_scsi_rbuf, len);
|
||||
cmd->result = SAM_STAT_GOOD;
|
||||
if (scsi_bufflen(cmd) > len)
|
||||
scsi_set_resid(cmd, scsi_bufflen(cmd) - len);
|
||||
|
||||
@@ -149,6 +149,15 @@ static inline bool ata_acpi_dev_manage_restart(struct ata_device *dev) { return
|
||||
#endif
|
||||
|
||||
/* libata-scsi.c */
|
||||
#define ATA_SCSI_RBUF_SIZE 2048
|
||||
|
||||
/*
|
||||
* Maximum number of concurrent positioning ranges (CPR) supported. The ACS
|
||||
* specifications allow up to 255, but we limit this to the number of CPR
|
||||
* descriptors that fit in the rbuf buffer used to emit VPD page B9h.
|
||||
*/
|
||||
#define ATA_DEV_MAX_CPR min(255, ((ATA_SCSI_RBUF_SIZE - 64) / 32))
|
||||
|
||||
extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
|
||||
const struct scsi_device *scsidev);
|
||||
extern int ata_scsi_add_hosts(struct ata_host *host,
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/libata.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/zorro.h>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/dmaengine.h>
|
||||
#include <linux/ktime.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#include <linux/soc/cirrus/ep93xx.h>
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/libata.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#define DRV_NAME "pata_imx"
|
||||
|
||||
@@ -286,6 +286,7 @@ static int pxa_ata_probe(struct platform_device *pdev)
|
||||
ret = dmaengine_slave_config(data->dma_chan, &config);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "dma configuration failed: %d\n", ret);
|
||||
dma_release_channel(data->dma_chan);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ static int gemini_sata_probe(struct platform_device *pdev)
|
||||
if (sg->ide_pins) {
|
||||
ret = gemini_setup_ide_pins(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out_unprep_clk;
|
||||
}
|
||||
|
||||
dev_info(dev, "set up the Gemini IDE/SATA nexus\n");
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user