mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-02-01 07:42:18 +00:00
T3Q talks like a slut who got destroyed by a gorilla dick
This commit is contained in:
parent
491da14f5f
commit
52d5978d29
@ -118,7 +118,7 @@ pinctrl_fwspid_default: fwspid_default {
|
||||
};
|
||||
|
||||
pinctrl_fwqspid_default: fwqspid_default {
|
||||
function = "FWQSPID";
|
||||
function = "FWSPID";
|
||||
groups = "FWQSPID";
|
||||
};
|
||||
|
||||
|
@ -15,8 +15,8 @@ __overrides__ {
|
||||
act_led_activelow = <&act_led>,"gpios:8";
|
||||
act_led_trigger = <&act_led>,"linux,default-trigger";
|
||||
cam0_reg = <&cam0_reg>,"status";
|
||||
cam0_reg_gpio = <&cam0_reg>,"gpios:4";
|
||||
cam0_reg_gpio = <&cam0_reg>,"gpio:4";
|
||||
cam1_reg = <&cam1_reg>,"status";
|
||||
cam1_reg_gpio = <&cam1_reg>,"gpios:4";
|
||||
cam1_reg_gpio = <&cam1_reg>,"gpio:4";
|
||||
};
|
||||
};
|
||||
|
@ -211,8 +211,8 @@ __overrides__ {
|
||||
act_led_activelow = <&act_led>,"gpios:8";
|
||||
act_led_trigger = <&act_led>,"linux,default-trigger";
|
||||
cam0_reg = <&cam0_reg>,"status";
|
||||
cam0_reg_gpio = <&cam0_reg>,"gpios:4";
|
||||
cam0_reg_gpio = <&cam0_reg>,"gpio:4";
|
||||
cam1_reg = <&cam1_reg>,"status";
|
||||
cam1_reg_gpio = <&cam1_reg>,"gpios:4";
|
||||
cam1_reg_gpio = <&cam1_reg>,"gpio:4";
|
||||
};
|
||||
};
|
||||
|
@ -1869,6 +1869,7 @@ Params: rotation Mounting rotation of the camera sensor (0 or
|
||||
configuring the sensor (default on)
|
||||
cam0 Adopt the default configuration for CAM0 on a
|
||||
Compute Module (CSI0, i2c_vc, and cam0_reg).
|
||||
vcm Configure a VCM focus drive on the sensor.
|
||||
|
||||
|
||||
Name: imx290
|
||||
@ -2449,6 +2450,7 @@ Params: rotation Mounting rotation of the camera sensor (0 or
|
||||
configuring the sensor (default on)
|
||||
cam0 Adopt the default configuration for CAM0 on a
|
||||
Compute Module (CSI0, i2c_vc, and cam0_reg).
|
||||
vcm Configure a VCM focus drive on the sensor.
|
||||
|
||||
|
||||
Name: ov7251
|
||||
|
@ -63,6 +63,13 @@ imx219_0: endpoint {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vcm: ad5398@0c {
|
||||
compatible = "adi,ad5398";
|
||||
reg = <0x0c>;
|
||||
status = "disabled";
|
||||
VANA-supply = <&cam1_reg>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -91,6 +98,9 @@ __overrides__ {
|
||||
<&csi_frag>, "target:0=",<&csi0>,
|
||||
<&clk_frag>, "target:0=",<&cam0_clk>,
|
||||
<&imx219>, "clocks:0=",<&cam0_clk>,
|
||||
<&imx219>, "VANA-supply:0=",<&cam0_reg>;
|
||||
<&imx219>, "VANA-supply:0=",<&cam0_reg>,
|
||||
<&vcm>, "VANA-supply:0=", <&cam0_reg>;
|
||||
vcm = <&vcm>, "status=okay",
|
||||
<&imx219>,"lens-focus:0=", <&vcm>;
|
||||
};
|
||||
};
|
||||
|
@ -20,6 +20,8 @@ iqs550: iqs550@74 {
|
||||
reg = <0x74>;
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&iqs550_pins>;
|
||||
touchscreen-size-x = <800>;
|
||||
touchscreen-size-y = <480>;
|
||||
};
|
||||
@ -34,8 +36,19 @@ iqs550_reset: __dormant__ {
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
iqs550_pins: iqs550_pins {
|
||||
brcm,pins = <4>;
|
||||
brcm,pull = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
interrupt = <&iqs550>,"interrupts:0";
|
||||
interrupt = <&iqs550>,"interrupts:0",
|
||||
<&iqs550_pins>,"brcm,pins:0";
|
||||
reset = <0>,"+1", <&iqs550_reset>,"reset-gpios:4";
|
||||
sizex = <&iqs550>,"touchscreen-size-x:0";
|
||||
sizey = <&iqs550>,"touchscreen-size-y:0";
|
||||
|
@ -38,6 +38,13 @@ ov5647_0: endpoint {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vcm: ad5398@0c {
|
||||
compatible = "adi,ad5398";
|
||||
reg = <0x0c>;
|
||||
status = "disabled";
|
||||
VANA-supply = <&cam1_reg>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -95,5 +102,7 @@ __overrides__ {
|
||||
<&clk_frag>, "target:0=",<&cam0_clk>,
|
||||
<&ov5647>, "clocks:0=",<&cam0_clk>,
|
||||
<&ov5647>, "avdd-supply:0=",<&cam0_reg>;
|
||||
vcm = <&vcm>, "status=okay",
|
||||
<&ov5647>,"lens-focus:0=", <&vcm>;
|
||||
};
|
||||
};
|
||||
|
@ -102,7 +102,7 @@ stmpe_gpio: stmpe_gpio {
|
||||
fragment@5 {
|
||||
target-path = "/soc";
|
||||
__overlay__ {
|
||||
backlight {
|
||||
backlight: backlight {
|
||||
compatible = "gpio-backlight";
|
||||
gpios = <&stmpe_gpio 2 0>;
|
||||
default-on;
|
||||
@ -115,6 +115,7 @@ __overrides__ {
|
||||
rotate = <&pitft>,"rotate:0";
|
||||
fps = <&pitft>,"fps:0";
|
||||
debug = <&pitft>,"debug:0";
|
||||
drm = <&pitft>,"compatible=adafruit,yx350hv15";
|
||||
drm = <&pitft>,"compatible=adafruit,yx350hv15",
|
||||
<&pitft>,"backlight:0=",<&backlight>;
|
||||
};
|
||||
};
|
||||
|
@ -971,7 +971,7 @@ i2s: i2s@ff890000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
crypto: cypto-controller@ff8a0000 {
|
||||
crypto: crypto@ff8a0000 {
|
||||
compatible = "rockchip,rk3288-crypto";
|
||||
reg = <0x0 0xff8a0000 0x0 0x4000>;
|
||||
interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
@ -880,6 +880,7 @@ CONFIG_VIDEO_OV7640=m
|
||||
CONFIG_VIDEO_OV9281=m
|
||||
CONFIG_VIDEO_IRS1125=m
|
||||
CONFIG_VIDEO_MT9V011=m
|
||||
CONFIG_VIDEO_AD5398=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
CONFIG_DRM_UDL=m
|
||||
|
@ -895,6 +895,7 @@ CONFIG_VIDEO_OV7640=m
|
||||
CONFIG_VIDEO_OV9281=m
|
||||
CONFIG_VIDEO_IRS1125=m
|
||||
CONFIG_VIDEO_MT9V011=m
|
||||
CONFIG_VIDEO_AD5398=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
CONFIG_DRM_UDL=m
|
||||
|
@ -873,6 +873,7 @@ CONFIG_VIDEO_OV7640=m
|
||||
CONFIG_VIDEO_OV9281=m
|
||||
CONFIG_VIDEO_IRS1125=m
|
||||
CONFIG_VIDEO_MT9V011=m
|
||||
CONFIG_VIDEO_AD5398=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
CONFIG_DRM_UDL=m
|
||||
|
@ -25,7 +25,13 @@ enum {
|
||||
SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
|
||||
};
|
||||
|
||||
#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
|
||||
void spectre_v2_update_state(unsigned int state, unsigned int methods);
|
||||
#else
|
||||
static inline void spectre_v2_update_state(unsigned int state,
|
||||
unsigned int methods)
|
||||
{}
|
||||
#endif
|
||||
|
||||
int spectre_bhb_update_vectors(unsigned int method);
|
||||
|
||||
|
@ -1053,9 +1053,6 @@ config HW_PERF_EVENTS
|
||||
def_bool y
|
||||
depends on ARM_PMU
|
||||
|
||||
config ARCH_HAS_FILTER_PGPROT
|
||||
def_bool y
|
||||
|
||||
# Supported by clang >= 7.0
|
||||
config CC_HAVE_SHADOW_CALL_STACK
|
||||
def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18)
|
||||
|
@ -502,7 +502,7 @@ uart1: serial@ffc02100 {
|
||||
};
|
||||
|
||||
usb0: usb@ffb00000 {
|
||||
compatible = "snps,dwc2";
|
||||
compatible = "intel,socfpga-agilex-hsotg", "snps,dwc2";
|
||||
reg = <0xffb00000 0x40000>;
|
||||
interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
|
||||
phys = <&usbphy0>;
|
||||
@ -515,7 +515,7 @@ usb0: usb@ffb00000 {
|
||||
};
|
||||
|
||||
usb1: usb@ffb40000 {
|
||||
compatible = "snps,dwc2";
|
||||
compatible = "intel,socfpga-agilex-hsotg", "snps,dwc2";
|
||||
reg = <0xffb40000 0x40000>;
|
||||
interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
|
||||
phys = <&usbphy0>;
|
||||
|
@ -18,6 +18,7 @@ / {
|
||||
|
||||
aliases {
|
||||
spi0 = &spi0;
|
||||
ethernet0 = ð0;
|
||||
ethernet1 = ð1;
|
||||
mmc0 = &sdhci0;
|
||||
mmc1 = &sdhci1;
|
||||
@ -138,7 +139,9 @@ &pcie0 {
|
||||
/*
|
||||
* U-Boot port for Turris Mox has a bug which always expects that "ranges" DT property
|
||||
* contains exactly 2 ranges with 3 (child) address cells, 2 (parent) address cells and
|
||||
* 2 size cells and also expects that the second range starts at 16 MB offset. If these
|
||||
* 2 size cells and also expects that the second range starts at 16 MB offset. Also it
|
||||
* expects that first range uses same address for PCI (child) and CPU (parent) cells (so
|
||||
* no remapping) and that this address is the lowest from all specified ranges. If these
|
||||
* conditions are not met then U-Boot crashes during loading kernel DTB file. PCIe address
|
||||
* space is 128 MB long, so the best split between MEM and IO is to use fixed 16 MB window
|
||||
* for IO and the rest 112 MB (64+32+16) for MEM, despite that maximal IO size is just 64 kB.
|
||||
@ -147,6 +150,9 @@ &pcie0 {
|
||||
* https://source.denx.de/u-boot/u-boot/-/commit/cb2ddb291ee6fcbddd6d8f4ff49089dfe580f5d7
|
||||
* https://source.denx.de/u-boot/u-boot/-/commit/c64ac3b3185aeb3846297ad7391fc6df8ecd73bf
|
||||
* https://source.denx.de/u-boot/u-boot/-/commit/4a82fca8e330157081fc132a591ebd99ba02ee33
|
||||
* Bug related to requirement of same child and parent addresses for first range is fixed
|
||||
* in U-Boot version 2022.04 by following commit:
|
||||
* https://source.denx.de/u-boot/u-boot/-/commit/1fd54253bca7d43d046bba4853fe5fafd034bc17
|
||||
*/
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
@ -35,6 +35,24 @@ sleep_clk: sleep-clk {
|
||||
clock-frequency = <32000>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
ufs_phy_rx_symbol_0_clk: ufs-phy-rx-symbol-0 {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <1000>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
ufs_phy_rx_symbol_1_clk: ufs-phy-rx-symbol-1 {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <1000>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
ufs_phy_tx_symbol_0_clk: ufs-phy-tx-symbol-0 {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <1000>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
cpus {
|
||||
@ -443,8 +461,30 @@ gcc: clock-controller@100000 {
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
#power-domain-cells = <1>;
|
||||
clock-names = "bi_tcxo", "sleep_clk";
|
||||
clocks = <&rpmhcc RPMH_CXO_CLK>, <&sleep_clk>;
|
||||
clock-names = "bi_tcxo",
|
||||
"sleep_clk",
|
||||
"pcie_0_pipe_clk",
|
||||
"pcie_1_pipe_clk",
|
||||
"ufs_card_rx_symbol_0_clk",
|
||||
"ufs_card_rx_symbol_1_clk",
|
||||
"ufs_card_tx_symbol_0_clk",
|
||||
"ufs_phy_rx_symbol_0_clk",
|
||||
"ufs_phy_rx_symbol_1_clk",
|
||||
"ufs_phy_tx_symbol_0_clk",
|
||||
"usb3_phy_wrapper_gcc_usb30_pipe_clk",
|
||||
"usb3_uni_phy_sec_gcc_usb30_pipe_clk";
|
||||
clocks = <&rpmhcc RPMH_CXO_CLK>,
|
||||
<&sleep_clk>,
|
||||
<0>,
|
||||
<0>,
|
||||
<0>,
|
||||
<0>,
|
||||
<0>,
|
||||
<&ufs_phy_rx_symbol_0_clk>,
|
||||
<&ufs_phy_rx_symbol_1_clk>,
|
||||
<&ufs_phy_tx_symbol_0_clk>,
|
||||
<0>,
|
||||
<0>;
|
||||
};
|
||||
|
||||
ipcc: mailbox@408000 {
|
||||
@ -1060,8 +1100,8 @@ ufs_mem_hc: ufshc@1d84000 {
|
||||
<75000000 300000000>,
|
||||
<0 0>,
|
||||
<0 0>,
|
||||
<75000000 300000000>,
|
||||
<75000000 300000000>;
|
||||
<0 0>,
|
||||
<0 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
@ -711,7 +711,7 @@ rktimer: timer@ff210000 {
|
||||
clock-names = "pclk", "timer";
|
||||
};
|
||||
|
||||
dmac: dmac@ff240000 {
|
||||
dmac: dma-controller@ff240000 {
|
||||
compatible = "arm,pl330", "arm,primecell";
|
||||
reg = <0x0 0xff240000 0x0 0x4000>;
|
||||
interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
|
||||
|
@ -489,7 +489,7 @@ pwm3: pwm@ff1b0030 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
dmac: dmac@ff1f0000 {
|
||||
dmac: dma-controller@ff1f0000 {
|
||||
compatible = "arm,pl330", "arm,primecell";
|
||||
reg = <0x0 0xff1f0000 0x0 0x4000>;
|
||||
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
|
||||
|
@ -232,6 +232,7 @@ &usbdrd3_0 {
|
||||
|
||||
&usbdrd_dwc3_0 {
|
||||
dr_mode = "otg";
|
||||
extcon = <&extcon_usb3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
@ -25,6 +25,13 @@ module_led: led-0 {
|
||||
};
|
||||
};
|
||||
|
||||
extcon_usb3: extcon-usb3 {
|
||||
compatible = "linux,extcon-usb-gpio";
|
||||
id-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&usb3_id>;
|
||||
};
|
||||
|
||||
clkin_gmac: external-gmac-clock {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <125000000>;
|
||||
@ -422,9 +429,22 @@ vcc5v0_host_en: vcc5v0-host-en {
|
||||
<4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
usb3 {
|
||||
usb3_id: usb3-id {
|
||||
rockchip,pins =
|
||||
<1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
/*
|
||||
* Signal integrity isn't great at 200MHz but 100MHz has proven stable
|
||||
* enough.
|
||||
*/
|
||||
max-frequency = <100000000>;
|
||||
|
||||
bus-width = <8>;
|
||||
mmc-hs400-1_8v;
|
||||
mmc-hs400-enhanced-strobe;
|
||||
|
@ -900,6 +900,7 @@ CONFIG_VIDEO_OV7640=m
|
||||
CONFIG_VIDEO_OV9281=m
|
||||
CONFIG_VIDEO_IRS1125=m
|
||||
CONFIG_VIDEO_MT9V011=m
|
||||
CONFIG_VIDEO_AD5398=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
CONFIG_DRM_UDL=m
|
||||
|
@ -821,6 +821,7 @@ CONFIG_VIDEO_OV7640=m
|
||||
CONFIG_VIDEO_OV9281=m
|
||||
CONFIG_VIDEO_IRS1125=m
|
||||
CONFIG_VIDEO_MT9V011=m
|
||||
CONFIG_VIDEO_AD5398=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
CONFIG_DRM_UDL=m
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef __ASM_MTE_KASAN_H
|
||||
#define __ASM_MTE_KASAN_H
|
||||
|
||||
#include <asm/compiler.h>
|
||||
#include <asm/mte-def.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
@ -92,7 +92,7 @@ extern bool arm64_use_ng_mappings;
|
||||
#define __P001 PAGE_READONLY
|
||||
#define __P010 PAGE_READONLY
|
||||
#define __P011 PAGE_READONLY
|
||||
#define __P100 PAGE_EXECONLY
|
||||
#define __P100 PAGE_READONLY_EXEC /* PAGE_EXECONLY if Enhanced PAN */
|
||||
#define __P101 PAGE_READONLY_EXEC
|
||||
#define __P110 PAGE_READONLY_EXEC
|
||||
#define __P111 PAGE_READONLY_EXEC
|
||||
@ -101,7 +101,7 @@ extern bool arm64_use_ng_mappings;
|
||||
#define __S001 PAGE_READONLY
|
||||
#define __S010 PAGE_SHARED
|
||||
#define __S011 PAGE_SHARED
|
||||
#define __S100 PAGE_EXECONLY
|
||||
#define __S100 PAGE_READONLY_EXEC /* PAGE_EXECONLY if Enhanced PAN */
|
||||
#define __S101 PAGE_READONLY_EXEC
|
||||
#define __S110 PAGE_SHARED_EXEC
|
||||
#define __S111 PAGE_SHARED_EXEC
|
||||
|
@ -1017,18 +1017,6 @@ static inline bool arch_wants_old_prefaulted_pte(void)
|
||||
}
|
||||
#define arch_wants_old_prefaulted_pte arch_wants_old_prefaulted_pte
|
||||
|
||||
static inline pgprot_t arch_filter_pgprot(pgprot_t prot)
|
||||
{
|
||||
if (cpus_have_const_cap(ARM64_HAS_EPAN))
|
||||
return prot;
|
||||
|
||||
if (pgprot_val(prot) != pgprot_val(PAGE_EXECONLY))
|
||||
return prot;
|
||||
|
||||
return PAGE_READONLY_EXEC;
|
||||
}
|
||||
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif /* __ASM_PGTABLE_H */
|
||||
|
@ -7,8 +7,10 @@
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/cpufeature.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
/*
|
||||
@ -38,3 +40,18 @@ int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
|
||||
{
|
||||
return !(((pfn << PAGE_SHIFT) + size) & ~PHYS_MASK);
|
||||
}
|
||||
|
||||
static int __init adjust_protection_map(void)
|
||||
{
|
||||
/*
|
||||
* With Enhanced PAN we can honour the execute-only permissions as
|
||||
* there is no PAN override with such mappings.
|
||||
*/
|
||||
if (cpus_have_const_cap(ARM64_HAS_EPAN)) {
|
||||
protection_map[VM_EXEC] = PAGE_EXECONLY;
|
||||
protection_map[VM_EXEC | VM_SHARED] = PAGE_EXECONLY;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(adjust_protection_map);
|
||||
|
@ -2,6 +2,7 @@ menu "CPU errata selection"
|
||||
|
||||
config RISCV_ERRATA_ALTERNATIVE
|
||||
bool "RISC-V alternative scheme"
|
||||
depends on !XIP_KERNEL
|
||||
default y
|
||||
help
|
||||
This Kconfig allows the kernel to automatically patch the
|
||||
|
@ -14,8 +14,8 @@ config SOC_SIFIVE
|
||||
select CLK_SIFIVE
|
||||
select CLK_SIFIVE_PRCI
|
||||
select SIFIVE_PLIC
|
||||
select RISCV_ERRATA_ALTERNATIVE
|
||||
select ERRATA_SIFIVE
|
||||
select RISCV_ERRATA_ALTERNATIVE if !XIP_KERNEL
|
||||
select ERRATA_SIFIVE if !XIP_KERNEL
|
||||
help
|
||||
This enables support for SiFive SoC platform hardware.
|
||||
|
||||
|
@ -113,7 +113,8 @@ plic0: interrupt-controller@c000000 {
|
||||
compatible = "canaan,k210-plic", "sifive,plic-1.0.0";
|
||||
reg = <0xC000000 0x4000000>;
|
||||
interrupt-controller;
|
||||
interrupts-extended = <&cpu0_intc 11 &cpu1_intc 11>;
|
||||
interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>,
|
||||
<&cpu1_intc 11>, <&cpu1_intc 9>;
|
||||
riscv,ndev = <65>;
|
||||
};
|
||||
|
||||
|
@ -13,6 +13,19 @@
|
||||
#include <linux/pgtable.h>
|
||||
#include <asm/sections.h>
|
||||
|
||||
/*
|
||||
* The auipc+jalr instruction pair can reach any PC-relative offset
|
||||
* in the range [-2^31 - 2^11, 2^31 - 2^11)
|
||||
*/
|
||||
static bool riscv_insn_valid_32bit_offset(ptrdiff_t val)
|
||||
{
|
||||
#ifdef CONFIG_32BIT
|
||||
return true;
|
||||
#else
|
||||
return (-(1L << 31) - (1L << 11)) <= val && val < ((1L << 31) - (1L << 11));
|
||||
#endif
|
||||
}
|
||||
|
||||
static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v)
|
||||
{
|
||||
if (v != (u32)v) {
|
||||
@ -95,7 +108,7 @@ static int apply_r_riscv_pcrel_hi20_rela(struct module *me, u32 *location,
|
||||
ptrdiff_t offset = (void *)v - (void *)location;
|
||||
s32 hi20;
|
||||
|
||||
if (offset != (s32)offset) {
|
||||
if (!riscv_insn_valid_32bit_offset(offset)) {
|
||||
pr_err(
|
||||
"%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",
|
||||
me->name, (long long)v, location);
|
||||
@ -197,10 +210,9 @@ static int apply_r_riscv_call_plt_rela(struct module *me, u32 *location,
|
||||
Elf_Addr v)
|
||||
{
|
||||
ptrdiff_t offset = (void *)v - (void *)location;
|
||||
s32 fill_v = offset;
|
||||
u32 hi20, lo12;
|
||||
|
||||
if (offset != fill_v) {
|
||||
if (!riscv_insn_valid_32bit_offset(offset)) {
|
||||
/* Only emit the plt entry if offset over 32-bit range */
|
||||
if (IS_ENABLED(CONFIG_MODULE_SECTIONS)) {
|
||||
offset = module_emit_plt_entry(me, v);
|
||||
@ -224,10 +236,9 @@ static int apply_r_riscv_call_rela(struct module *me, u32 *location,
|
||||
Elf_Addr v)
|
||||
{
|
||||
ptrdiff_t offset = (void *)v - (void *)location;
|
||||
s32 fill_v = offset;
|
||||
u32 hi20, lo12;
|
||||
|
||||
if (offset != fill_v) {
|
||||
if (!riscv_insn_valid_32bit_offset(offset)) {
|
||||
pr_err(
|
||||
"%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",
|
||||
me->name, (long long)v, location);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <linux/blk-mq.h>
|
||||
#include <linux/ata.h>
|
||||
#include <linux/hdreg.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/cdrom.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
@ -12,6 +12,30 @@
|
||||
#include "encls.h"
|
||||
#include "sgx.h"
|
||||
|
||||
/*
|
||||
* Calculate byte offset of a PCMD struct associated with an enclave page. PCMD's
|
||||
* follow right after the EPC data in the backing storage. In addition to the
|
||||
* visible enclave pages, there's one extra page slot for SECS, before PCMD
|
||||
* structs.
|
||||
*/
|
||||
static inline pgoff_t sgx_encl_get_backing_page_pcmd_offset(struct sgx_encl *encl,
|
||||
unsigned long page_index)
|
||||
{
|
||||
pgoff_t epc_end_off = encl->size + sizeof(struct sgx_secs);
|
||||
|
||||
return epc_end_off + page_index * sizeof(struct sgx_pcmd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free a page from the backing storage in the given page index.
|
||||
*/
|
||||
static inline void sgx_encl_truncate_backing_page(struct sgx_encl *encl, unsigned long page_index)
|
||||
{
|
||||
struct inode *inode = file_inode(encl->backing);
|
||||
|
||||
shmem_truncate_range(inode, PFN_PHYS(page_index), PFN_PHYS(page_index) + PAGE_SIZE - 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* ELDU: Load an EPC page as unblocked. For more info, see "OS Management of EPC
|
||||
* Pages" in the SDM.
|
||||
@ -22,9 +46,11 @@ static int __sgx_encl_eldu(struct sgx_encl_page *encl_page,
|
||||
{
|
||||
unsigned long va_offset = encl_page->desc & SGX_ENCL_PAGE_VA_OFFSET_MASK;
|
||||
struct sgx_encl *encl = encl_page->encl;
|
||||
pgoff_t page_index, page_pcmd_off;
|
||||
struct sgx_pageinfo pginfo;
|
||||
struct sgx_backing b;
|
||||
pgoff_t page_index;
|
||||
bool pcmd_page_empty;
|
||||
u8 *pcmd_page;
|
||||
int ret;
|
||||
|
||||
if (secs_page)
|
||||
@ -32,14 +58,16 @@ static int __sgx_encl_eldu(struct sgx_encl_page *encl_page,
|
||||
else
|
||||
page_index = PFN_DOWN(encl->size);
|
||||
|
||||
page_pcmd_off = sgx_encl_get_backing_page_pcmd_offset(encl, page_index);
|
||||
|
||||
ret = sgx_encl_get_backing(encl, page_index, &b);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pginfo.addr = encl_page->desc & PAGE_MASK;
|
||||
pginfo.contents = (unsigned long)kmap_atomic(b.contents);
|
||||
pginfo.metadata = (unsigned long)kmap_atomic(b.pcmd) +
|
||||
b.pcmd_offset;
|
||||
pcmd_page = kmap_atomic(b.pcmd);
|
||||
pginfo.metadata = (unsigned long)pcmd_page + b.pcmd_offset;
|
||||
|
||||
if (secs_page)
|
||||
pginfo.secs = (u64)sgx_get_epc_virt_addr(secs_page);
|
||||
@ -55,11 +83,24 @@ static int __sgx_encl_eldu(struct sgx_encl_page *encl_page,
|
||||
ret = -EFAULT;
|
||||
}
|
||||
|
||||
kunmap_atomic((void *)(unsigned long)(pginfo.metadata - b.pcmd_offset));
|
||||
memset(pcmd_page + b.pcmd_offset, 0, sizeof(struct sgx_pcmd));
|
||||
|
||||
/*
|
||||
* The area for the PCMD in the page was zeroed above. Check if the
|
||||
* whole page is now empty meaning that all PCMD's have been zeroed:
|
||||
*/
|
||||
pcmd_page_empty = !memchr_inv(pcmd_page, 0, PAGE_SIZE);
|
||||
|
||||
kunmap_atomic(pcmd_page);
|
||||
kunmap_atomic((void *)(unsigned long)pginfo.contents);
|
||||
|
||||
sgx_encl_put_backing(&b, false);
|
||||
|
||||
sgx_encl_truncate_backing_page(encl, page_index);
|
||||
|
||||
if (pcmd_page_empty)
|
||||
sgx_encl_truncate_backing_page(encl, PFN_DOWN(page_pcmd_off));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -579,7 +620,7 @@ static struct page *sgx_encl_get_backing_page(struct sgx_encl *encl,
|
||||
int sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index,
|
||||
struct sgx_backing *backing)
|
||||
{
|
||||
pgoff_t pcmd_index = PFN_DOWN(encl->size) + 1 + (page_index >> 5);
|
||||
pgoff_t page_pcmd_off = sgx_encl_get_backing_page_pcmd_offset(encl, page_index);
|
||||
struct page *contents;
|
||||
struct page *pcmd;
|
||||
|
||||
@ -587,7 +628,7 @@ int sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index,
|
||||
if (IS_ERR(contents))
|
||||
return PTR_ERR(contents);
|
||||
|
||||
pcmd = sgx_encl_get_backing_page(encl, pcmd_index);
|
||||
pcmd = sgx_encl_get_backing_page(encl, PFN_DOWN(page_pcmd_off));
|
||||
if (IS_ERR(pcmd)) {
|
||||
put_page(contents);
|
||||
return PTR_ERR(pcmd);
|
||||
@ -596,9 +637,7 @@ int sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index,
|
||||
backing->page_index = page_index;
|
||||
backing->contents = contents;
|
||||
backing->pcmd = pcmd;
|
||||
backing->pcmd_offset =
|
||||
(page_index & (PAGE_SIZE / sizeof(struct sgx_pcmd) - 1)) *
|
||||
sizeof(struct sgx_pcmd);
|
||||
backing->pcmd_offset = page_pcmd_off & (PAGE_SIZE - 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -995,8 +995,10 @@ early_param("memmap", parse_memmap_opt);
|
||||
*/
|
||||
void __init e820__reserve_setup_data(void)
|
||||
{
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data *data;
|
||||
u64 pa_data;
|
||||
u64 pa_data, pa_next;
|
||||
u32 len;
|
||||
|
||||
pa_data = boot_params.hdr.setup_data;
|
||||
if (!pa_data)
|
||||
@ -1004,6 +1006,14 @@ void __init e820__reserve_setup_data(void)
|
||||
|
||||
while (pa_data) {
|
||||
data = early_memremap(pa_data, sizeof(*data));
|
||||
if (!data) {
|
||||
pr_warn("e820: failed to memremap setup_data entry\n");
|
||||
return;
|
||||
}
|
||||
|
||||
len = sizeof(*data);
|
||||
pa_next = data->next;
|
||||
|
||||
e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
|
||||
|
||||
/*
|
||||
@ -1015,18 +1025,27 @@ void __init e820__reserve_setup_data(void)
|
||||
sizeof(*data) + data->len,
|
||||
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
|
||||
|
||||
if (data->type == SETUP_INDIRECT &&
|
||||
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) {
|
||||
e820__range_update(((struct setup_indirect *)data->data)->addr,
|
||||
((struct setup_indirect *)data->data)->len,
|
||||
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
|
||||
e820__range_update_kexec(((struct setup_indirect *)data->data)->addr,
|
||||
((struct setup_indirect *)data->data)->len,
|
||||
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
len += data->len;
|
||||
early_memunmap(data, sizeof(*data));
|
||||
data = early_memremap(pa_data, len);
|
||||
if (!data) {
|
||||
pr_warn("e820: failed to memremap indirect setup_data\n");
|
||||
return;
|
||||
}
|
||||
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
if (indirect->type != SETUP_INDIRECT) {
|
||||
e820__range_update(indirect->addr, indirect->len,
|
||||
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
|
||||
e820__range_update_kexec(indirect->addr, indirect->len,
|
||||
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
|
||||
}
|
||||
}
|
||||
|
||||
pa_data = data->next;
|
||||
early_memunmap(data, sizeof(*data));
|
||||
pa_data = pa_next;
|
||||
early_memunmap(data, len);
|
||||
}
|
||||
|
||||
e820__update_table(e820_table);
|
||||
|
@ -88,11 +88,13 @@ create_setup_data_node(struct dentry *parent, int no,
|
||||
|
||||
static int __init create_setup_data_nodes(struct dentry *parent)
|
||||
{
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data_node *node;
|
||||
struct setup_data *data;
|
||||
int error;
|
||||
u64 pa_data, pa_next;
|
||||
struct dentry *d;
|
||||
u64 pa_data;
|
||||
int error;
|
||||
u32 len;
|
||||
int no = 0;
|
||||
|
||||
d = debugfs_create_dir("setup_data", parent);
|
||||
@ -112,12 +114,29 @@ static int __init create_setup_data_nodes(struct dentry *parent)
|
||||
error = -ENOMEM;
|
||||
goto err_dir;
|
||||
}
|
||||
pa_next = data->next;
|
||||
|
||||
if (data->type == SETUP_INDIRECT &&
|
||||
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) {
|
||||
node->paddr = ((struct setup_indirect *)data->data)->addr;
|
||||
node->type = ((struct setup_indirect *)data->data)->type;
|
||||
node->len = ((struct setup_indirect *)data->data)->len;
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
len = sizeof(*data) + data->len;
|
||||
memunmap(data);
|
||||
data = memremap(pa_data, len, MEMREMAP_WB);
|
||||
if (!data) {
|
||||
kfree(node);
|
||||
error = -ENOMEM;
|
||||
goto err_dir;
|
||||
}
|
||||
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
if (indirect->type != SETUP_INDIRECT) {
|
||||
node->paddr = indirect->addr;
|
||||
node->type = indirect->type;
|
||||
node->len = indirect->len;
|
||||
} else {
|
||||
node->paddr = pa_data;
|
||||
node->type = data->type;
|
||||
node->len = data->len;
|
||||
}
|
||||
} else {
|
||||
node->paddr = pa_data;
|
||||
node->type = data->type;
|
||||
@ -125,7 +144,7 @@ static int __init create_setup_data_nodes(struct dentry *parent)
|
||||
}
|
||||
|
||||
create_setup_data_node(d, no, node);
|
||||
pa_data = data->next;
|
||||
pa_data = pa_next;
|
||||
|
||||
memunmap(data);
|
||||
no++;
|
||||
|
@ -91,26 +91,41 @@ static int get_setup_data_paddr(int nr, u64 *paddr)
|
||||
|
||||
static int __init get_setup_data_size(int nr, size_t *size)
|
||||
{
|
||||
int i = 0;
|
||||
u64 pa_data = boot_params.hdr.setup_data, pa_next;
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data *data;
|
||||
u64 pa_data = boot_params.hdr.setup_data;
|
||||
int i = 0;
|
||||
u32 len;
|
||||
|
||||
while (pa_data) {
|
||||
data = memremap(pa_data, sizeof(*data), MEMREMAP_WB);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
pa_next = data->next;
|
||||
|
||||
if (nr == i) {
|
||||
if (data->type == SETUP_INDIRECT &&
|
||||
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT)
|
||||
*size = ((struct setup_indirect *)data->data)->len;
|
||||
else
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
len = sizeof(*data) + data->len;
|
||||
memunmap(data);
|
||||
data = memremap(pa_data, len, MEMREMAP_WB);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
if (indirect->type != SETUP_INDIRECT)
|
||||
*size = indirect->len;
|
||||
else
|
||||
*size = data->len;
|
||||
} else {
|
||||
*size = data->len;
|
||||
}
|
||||
|
||||
memunmap(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pa_data = data->next;
|
||||
pa_data = pa_next;
|
||||
memunmap(data);
|
||||
i++;
|
||||
}
|
||||
@ -120,9 +135,11 @@ static int __init get_setup_data_size(int nr, size_t *size)
|
||||
static ssize_t type_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data *data;
|
||||
int nr, ret;
|
||||
u64 paddr;
|
||||
struct setup_data *data;
|
||||
u32 len;
|
||||
|
||||
ret = kobj_to_setup_data_nr(kobj, &nr);
|
||||
if (ret)
|
||||
@ -135,10 +152,20 @@ static ssize_t type_show(struct kobject *kobj,
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
if (data->type == SETUP_INDIRECT)
|
||||
ret = sprintf(buf, "0x%x\n", ((struct setup_indirect *)data->data)->type);
|
||||
else
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
len = sizeof(*data) + data->len;
|
||||
memunmap(data);
|
||||
data = memremap(paddr, len, MEMREMAP_WB);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
ret = sprintf(buf, "0x%x\n", indirect->type);
|
||||
} else {
|
||||
ret = sprintf(buf, "0x%x\n", data->type);
|
||||
}
|
||||
|
||||
memunmap(data);
|
||||
return ret;
|
||||
}
|
||||
@ -149,9 +176,10 @@ static ssize_t setup_data_data_read(struct file *fp,
|
||||
char *buf,
|
||||
loff_t off, size_t count)
|
||||
{
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data *data;
|
||||
int nr, ret = 0;
|
||||
u64 paddr, len;
|
||||
struct setup_data *data;
|
||||
void *p;
|
||||
|
||||
ret = kobj_to_setup_data_nr(kobj, &nr);
|
||||
@ -165,10 +193,27 @@ static ssize_t setup_data_data_read(struct file *fp,
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
if (data->type == SETUP_INDIRECT &&
|
||||
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) {
|
||||
paddr = ((struct setup_indirect *)data->data)->addr;
|
||||
len = ((struct setup_indirect *)data->data)->len;
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
len = sizeof(*data) + data->len;
|
||||
memunmap(data);
|
||||
data = memremap(paddr, len, MEMREMAP_WB);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
if (indirect->type != SETUP_INDIRECT) {
|
||||
paddr = indirect->addr;
|
||||
len = indirect->len;
|
||||
} else {
|
||||
/*
|
||||
* Even though this is technically undefined, return
|
||||
* the data as though it is a normal setup_data struct.
|
||||
* This will at least allow it to be inspected.
|
||||
*/
|
||||
paddr += sizeof(*data);
|
||||
len = data->len;
|
||||
}
|
||||
} else {
|
||||
paddr += sizeof(*data);
|
||||
len = data->len;
|
||||
|
@ -457,19 +457,22 @@ static bool pv_tlb_flush_supported(void)
|
||||
{
|
||||
return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
|
||||
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
|
||||
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME));
|
||||
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
|
||||
(num_possible_cpus() != 1));
|
||||
}
|
||||
|
||||
static bool pv_ipi_supported(void)
|
||||
{
|
||||
return kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI);
|
||||
return (kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI) &&
|
||||
(num_possible_cpus() != 1));
|
||||
}
|
||||
|
||||
static bool pv_sched_yield_supported(void)
|
||||
{
|
||||
return (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&
|
||||
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
|
||||
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME));
|
||||
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
|
||||
(num_possible_cpus() != 1));
|
||||
}
|
||||
|
||||
#define KVM_IPI_CLUSTER_SIZE (2 * BITS_PER_LONG)
|
||||
|
@ -270,6 +270,14 @@ int module_finalize(const Elf_Ehdr *hdr,
|
||||
orc_ip = s;
|
||||
}
|
||||
|
||||
/*
|
||||
* See alternative_instructions() for the ordering rules between the
|
||||
* various patching types.
|
||||
*/
|
||||
if (para) {
|
||||
void *pseg = (void *)para->sh_addr;
|
||||
apply_paravirt(pseg, pseg + para->sh_size);
|
||||
}
|
||||
if (alt) {
|
||||
/* patch .altinstructions */
|
||||
void *aseg = (void *)alt->sh_addr;
|
||||
@ -283,11 +291,6 @@ int module_finalize(const Elf_Ehdr *hdr,
|
||||
tseg, tseg + text->sh_size);
|
||||
}
|
||||
|
||||
if (para) {
|
||||
void *pseg = (void *)para->sh_addr;
|
||||
apply_paravirt(pseg, pseg + para->sh_size);
|
||||
}
|
||||
|
||||
/* make jump label nops */
|
||||
jump_label_apply_nops(me);
|
||||
|
||||
|
@ -368,21 +368,41 @@ static void __init parse_setup_data(void)
|
||||
|
||||
static void __init memblock_x86_reserve_range_setup_data(void)
|
||||
{
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data *data;
|
||||
u64 pa_data;
|
||||
u64 pa_data, pa_next;
|
||||
u32 len;
|
||||
|
||||
pa_data = boot_params.hdr.setup_data;
|
||||
while (pa_data) {
|
||||
data = early_memremap(pa_data, sizeof(*data));
|
||||
if (!data) {
|
||||
pr_warn("setup: failed to memremap setup_data entry\n");
|
||||
return;
|
||||
}
|
||||
|
||||
len = sizeof(*data);
|
||||
pa_next = data->next;
|
||||
|
||||
memblock_reserve(pa_data, sizeof(*data) + data->len);
|
||||
|
||||
if (data->type == SETUP_INDIRECT &&
|
||||
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT)
|
||||
memblock_reserve(((struct setup_indirect *)data->data)->addr,
|
||||
((struct setup_indirect *)data->data)->len);
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
len += data->len;
|
||||
early_memunmap(data, sizeof(*data));
|
||||
data = early_memremap(pa_data, len);
|
||||
if (!data) {
|
||||
pr_warn("setup: failed to memremap indirect setup_data\n");
|
||||
return;
|
||||
}
|
||||
|
||||
pa_data = data->next;
|
||||
early_memunmap(data, sizeof(*data));
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
if (indirect->type != SETUP_INDIRECT)
|
||||
memblock_reserve(indirect->addr, indirect->len);
|
||||
}
|
||||
|
||||
pa_data = pa_next;
|
||||
early_memunmap(data, len);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -659,6 +659,7 @@ static bool do_int3(struct pt_regs *regs)
|
||||
|
||||
return res == NOTIFY_STOP;
|
||||
}
|
||||
NOKPROBE_SYMBOL(do_int3);
|
||||
|
||||
static void do_int3_user(struct pt_regs *regs)
|
||||
{
|
||||
|
@ -3967,6 +3967,7 @@ static bool kvm_faultin_pfn(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn,
|
||||
|
||||
*pfn = __gfn_to_pfn_memslot(slot, gfn, false, NULL,
|
||||
write, writable, hva);
|
||||
return false;
|
||||
|
||||
out_retry:
|
||||
*r = RET_PF_RETRY;
|
||||
|
@ -8666,6 +8666,13 @@ static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
|
||||
if (clock_type != KVM_CLOCK_PAIRING_WALLCLOCK)
|
||||
return -KVM_EOPNOTSUPP;
|
||||
|
||||
/*
|
||||
* When tsc is in permanent catchup mode guests won't be able to use
|
||||
* pvclock_read_retry loop to get consistent view of pvclock
|
||||
*/
|
||||
if (vcpu->arch.tsc_always_catchup)
|
||||
return -KVM_EOPNOTSUPP;
|
||||
|
||||
if (!kvm_get_walltime_and_clockread(&ts, &cycle))
|
||||
return -KVM_EOPNOTSUPP;
|
||||
|
||||
|
@ -614,6 +614,7 @@ static bool memremap_is_efi_data(resource_size_t phys_addr,
|
||||
static bool memremap_is_setup_data(resource_size_t phys_addr,
|
||||
unsigned long size)
|
||||
{
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data *data;
|
||||
u64 paddr, paddr_next;
|
||||
|
||||
@ -626,6 +627,10 @@ static bool memremap_is_setup_data(resource_size_t phys_addr,
|
||||
|
||||
data = memremap(paddr, sizeof(*data),
|
||||
MEMREMAP_WB | MEMREMAP_DEC);
|
||||
if (!data) {
|
||||
pr_warn("failed to memremap setup_data entry\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
paddr_next = data->next;
|
||||
len = data->len;
|
||||
@ -635,10 +640,21 @@ static bool memremap_is_setup_data(resource_size_t phys_addr,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (data->type == SETUP_INDIRECT &&
|
||||
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) {
|
||||
paddr = ((struct setup_indirect *)data->data)->addr;
|
||||
len = ((struct setup_indirect *)data->data)->len;
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
memunmap(data);
|
||||
data = memremap(paddr, sizeof(*data) + len,
|
||||
MEMREMAP_WB | MEMREMAP_DEC);
|
||||
if (!data) {
|
||||
pr_warn("failed to memremap indirect setup_data\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
if (indirect->type != SETUP_INDIRECT) {
|
||||
paddr = indirect->addr;
|
||||
len = indirect->len;
|
||||
}
|
||||
}
|
||||
|
||||
memunmap(data);
|
||||
@ -659,22 +675,51 @@ static bool memremap_is_setup_data(resource_size_t phys_addr,
|
||||
static bool __init early_memremap_is_setup_data(resource_size_t phys_addr,
|
||||
unsigned long size)
|
||||
{
|
||||
struct setup_indirect *indirect;
|
||||
struct setup_data *data;
|
||||
u64 paddr, paddr_next;
|
||||
|
||||
paddr = boot_params.hdr.setup_data;
|
||||
while (paddr) {
|
||||
unsigned int len;
|
||||
unsigned int len, size;
|
||||
|
||||
if (phys_addr == paddr)
|
||||
return true;
|
||||
|
||||
data = early_memremap_decrypted(paddr, sizeof(*data));
|
||||
if (!data) {
|
||||
pr_warn("failed to early memremap setup_data entry\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
size = sizeof(*data);
|
||||
|
||||
paddr_next = data->next;
|
||||
len = data->len;
|
||||
|
||||
early_memunmap(data, sizeof(*data));
|
||||
if ((phys_addr > paddr) && (phys_addr < (paddr + len))) {
|
||||
early_memunmap(data, sizeof(*data));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (data->type == SETUP_INDIRECT) {
|
||||
size += len;
|
||||
early_memunmap(data, sizeof(*data));
|
||||
data = early_memremap_decrypted(paddr, size);
|
||||
if (!data) {
|
||||
pr_warn("failed to early memremap indirect setup_data\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
indirect = (struct setup_indirect *)data->data;
|
||||
|
||||
if (indirect->type != SETUP_INDIRECT) {
|
||||
paddr = indirect->addr;
|
||||
len = indirect->len;
|
||||
}
|
||||
}
|
||||
|
||||
early_memunmap(data, size);
|
||||
|
||||
if ((phys_addr > paddr) && (phys_addr < (paddr + len)))
|
||||
return true;
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/log2.h>
|
||||
|
@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <linux/genhd.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
struct bd_holder_disk {
|
||||
struct list_head list;
|
||||
|
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2020 Christoph Hellwig
|
||||
*/
|
||||
#include <linux/fs.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/genhd.h>
|
||||
|
@ -2291,13 +2291,6 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port,
|
||||
if (!mv88e6xxx_max_vid(chip))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* The ATU removal procedure needs the FID to be mapped in the VTU,
|
||||
* but FDB deletion runs concurrently with VLAN deletion. Flush the DSA
|
||||
* switchdev workqueue to ensure that all FDB entries are deleted
|
||||
* before we remove the VLAN.
|
||||
*/
|
||||
dsa_flush_workqueue();
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
|
||||
err = mv88e6xxx_port_get_pvid(chip, port, &pvid);
|
||||
|
@ -30,8 +30,12 @@
|
||||
#define INTSRC_LINK_DOWN BIT(4)
|
||||
#define INTSRC_REMOTE_FAULT BIT(5)
|
||||
#define INTSRC_ANEG_COMPLETE BIT(6)
|
||||
#define INTSRC_ENERGY_DETECT BIT(7)
|
||||
#define INTSRC_MASK 30
|
||||
|
||||
#define INT_SOURCES (INTSRC_LINK_DOWN | INTSRC_ANEG_COMPLETE | \
|
||||
INTSRC_ENERGY_DETECT)
|
||||
|
||||
#define BANK_ANALOG_DSP 0
|
||||
#define BANK_WOL 1
|
||||
#define BANK_BIST 3
|
||||
@ -200,7 +204,6 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev)
|
||||
|
||||
static int meson_gxl_config_intr(struct phy_device *phydev)
|
||||
{
|
||||
u16 val;
|
||||
int ret;
|
||||
|
||||
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
|
||||
@ -209,16 +212,9 @@ static int meson_gxl_config_intr(struct phy_device *phydev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
val = INTSRC_ANEG_PR
|
||||
| INTSRC_PARALLEL_FAULT
|
||||
| INTSRC_ANEG_LP_ACK
|
||||
| INTSRC_LINK_DOWN
|
||||
| INTSRC_REMOTE_FAULT
|
||||
| INTSRC_ANEG_COMPLETE;
|
||||
ret = phy_write(phydev, INTSRC_MASK, val);
|
||||
ret = phy_write(phydev, INTSRC_MASK, INT_SOURCES);
|
||||
} else {
|
||||
val = 0;
|
||||
ret = phy_write(phydev, INTSRC_MASK, val);
|
||||
ret = phy_write(phydev, INTSRC_MASK, 0);
|
||||
|
||||
/* Ack any pending IRQ */
|
||||
ret = meson_gxl_ack_interrupt(phydev);
|
||||
@ -237,10 +233,23 @@ static irqreturn_t meson_gxl_handle_interrupt(struct phy_device *phydev)
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
irq_status &= INT_SOURCES;
|
||||
|
||||
if (irq_status == 0)
|
||||
return IRQ_NONE;
|
||||
|
||||
phy_trigger_machine(phydev);
|
||||
/* Aneg-complete interrupt is used for link-up detection */
|
||||
if (phydev->autoneg == AUTONEG_ENABLE &&
|
||||
irq_status == INTSRC_ENERGY_DETECT)
|
||||
return IRQ_HANDLED;
|
||||
|
||||
/* Give PHY some time before MAC starts sending data. This works
|
||||
* around an issue where network doesn't come up properly.
|
||||
*/
|
||||
if (!(irq_status & INTSRC_LINK_DOWN))
|
||||
phy_queue_state_machine(phydev, msecs_to_jiffies(100));
|
||||
else
|
||||
phy_trigger_machine(phydev);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
@ -97,9 +97,10 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
|
||||
ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
|
||||
| USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0, index, &buf, 4);
|
||||
if (unlikely(ret < 0)) {
|
||||
netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
|
||||
index, ret);
|
||||
if (ret < 0) {
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
|
||||
index, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -129,7 +130,7 @@ static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index,
|
||||
ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
|
||||
| USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0, index, &buf, 4);
|
||||
if (unlikely(ret < 0))
|
||||
if (ret < 0 && ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
|
||||
index, ret);
|
||||
|
||||
@ -172,6 +173,9 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev,
|
||||
do {
|
||||
ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);
|
||||
if (ret < 0) {
|
||||
/* Ignore -ENODEV error during disconnect() */
|
||||
if (ret == -ENODEV)
|
||||
return 0;
|
||||
netdev_warn(dev->net, "Error reading MII_ACCESS\n");
|
||||
return ret;
|
||||
}
|
||||
@ -207,7 +211,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx,
|
||||
addr = mii_address_cmd(phy_id, idx, MII_READ_ | MII_BUSY_);
|
||||
ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -219,7 +224,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx,
|
||||
|
||||
ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error reading MII_DATA\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error reading MII_DATA\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -227,6 +233,10 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx,
|
||||
|
||||
done:
|
||||
mutex_unlock(&dev->phy_mutex);
|
||||
|
||||
/* Ignore -ENODEV error during disconnect() */
|
||||
if (ret == -ENODEV)
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -248,7 +258,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id,
|
||||
val = regval;
|
||||
ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error writing MII_DATA\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error writing MII_DATA\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -256,7 +267,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id,
|
||||
addr = mii_address_cmd(phy_id, idx, MII_WRITE_ | MII_BUSY_);
|
||||
ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -541,8 +541,7 @@ static const struct ieee80211_sband_iftype_data iwl_he_capa[] = {
|
||||
.has_he = true,
|
||||
.he_cap_elem = {
|
||||
.mac_cap_info[0] =
|
||||
IEEE80211_HE_MAC_CAP0_HTC_HE |
|
||||
IEEE80211_HE_MAC_CAP0_TWT_REQ,
|
||||
IEEE80211_HE_MAC_CAP0_HTC_HE,
|
||||
.mac_cap_info[1] =
|
||||
IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US |
|
||||
IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8,
|
||||
|
Loading…
Reference in New Issue
Block a user