···11-Hi6220 SoC ION22-===================================================================33-Required properties:44-- compatible : "hisilicon,hi6220-ion"55-- list of the ION heaps66- - heap name : maybe heap_sys_user@077- - heap id : id should be unique in the system.88- - heap base : base ddr address of the heap,0 means that99- it is dynamic.1010- - heap size : memory size and 0 means it is dynamic.1111- - heap type : the heap type of the heap, please also1212- see the define in ion.h(drivers/staging/android/uapi/ion.h)1313--------------------------------------------------------------------1414-Example:1515- hi6220-ion {1616- compatible = "hisilicon,hi6220-ion";1717- heap_sys_user@0 {1818- heap-name = "sys_user";1919- heap-id = <0x0>;2020- heap-base = <0x0>;2121- heap-size = <0x0>;2222- heap-type = "ion_system";2323- };2424- heap_sys_contig@0 {2525- heap-name = "sys_contig";2626- heap-id = <0x1>;2727- heap-base = <0x0>;2828- heap-size = <0x0>;2929- heap-type = "ion_system_contig";3030- };3131- };
+2-4
Documentation/usb/typec.rst
···114114registering/unregistering cables and their plugs:115115116116.. kernel-doc:: drivers/usb/typec/typec.c117117- :functions: typec_register_cable typec_unregister_cable typec_register_plug118118- typec_unregister_plug117117+ :functions: typec_register_cable typec_unregister_cable typec_register_plug typec_unregister_plug119118120119The class will provide a handle to struct typec_cable and struct typec_plug if121120the registration is successful, or NULL if it isn't.···136137APIs to report it to the class:137138138139.. kernel-doc:: drivers/usb/typec/typec.c139139- :functions: typec_set_data_role typec_set_pwr_role typec_set_vconn_role140140- typec_set_pwr_opmode140140+ :functions: typec_set_data_role typec_set_pwr_role typec_set_vconn_role typec_set_pwr_opmode141141142142Alternate Modes143143~~~~~~~~~~~~~~~
+1-1
Documentation/watchdog/watchdog-parameters.txt
···117117-------------------------------------------------118118iTCO_wdt:119119heartbeat: Watchdog heartbeat in seconds.120120- (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=30)120120+ (5<=heartbeat<=74 (TCO v1) or 1226 (TCO v2), default=30)121121nowayout: Watchdog cannot be stopped once started122122 (default=kernel config parameter)123123-------------------------------------------------
···11+# CONFIG_LOCALVERSION_AUTO is not set22+CONFIG_SYSVIPC=y33+CONFIG_NO_HZ_IDLE=y44+CONFIG_BSD_PROCESS_ACCT=y55+CONFIG_USER_NS=y66+CONFIG_RELAY=y77+CONFIG_BLK_DEV_INITRD=y88+CONFIG_PARTITION_ADVANCED=y99+CONFIG_ARCH_MULTI_V4=y1010+# CONFIG_ARCH_MULTI_V7 is not set1111+CONFIG_ARCH_GEMINI=y1212+CONFIG_PCI=y1313+CONFIG_PREEMPT=y1414+CONFIG_AEABI=y1515+CONFIG_CMDLINE="console=ttyS0,115200n8"1616+CONFIG_KEXEC=y1717+CONFIG_BINFMT_MISC=y1818+CONFIG_PM=y1919+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"2020+CONFIG_DEVTMPFS=y2121+CONFIG_MTD=y2222+CONFIG_MTD_BLOCK=y2323+CONFIG_MTD_CFI=y2424+CONFIG_MTD_CFI_INTELEXT=y2525+CONFIG_MTD_CFI_AMDSTD=y2626+CONFIG_MTD_CFI_STAA=y2727+CONFIG_MTD_PHYSMAP=y2828+CONFIG_MTD_PHYSMAP_OF=y2929+CONFIG_BLK_DEV_RAM=y3030+CONFIG_BLK_DEV_RAM_SIZE=163843131+# CONFIG_SCSI_PROC_FS is not set3232+CONFIG_BLK_DEV_SD=y3333+# CONFIG_SCSI_LOWLEVEL is not set3434+CONFIG_ATA=y3535+CONFIG_INPUT_EVDEV=y3636+CONFIG_KEYBOARD_GPIO=y3737+# CONFIG_INPUT_MOUSE is not set3838+# CONFIG_LEGACY_PTYS is not set3939+CONFIG_SERIAL_8250=y4040+CONFIG_SERIAL_8250_CONSOLE=y4141+CONFIG_SERIAL_8250_NR_UARTS=14242+CONFIG_SERIAL_8250_RUNTIME_UARTS=14343+CONFIG_SERIAL_OF_PLATFORM=y4444+# CONFIG_HW_RANDOM is not set4545+# CONFIG_HWMON is not set4646+CONFIG_WATCHDOG=y4747+CONFIG_GEMINI_WATCHDOG=y4848+CONFIG_USB=y4949+CONFIG_USB_MON=y5050+CONFIG_USB_FOTG210_HCD=y5151+CONFIG_USB_STORAGE=y5252+CONFIG_NEW_LEDS=y5353+CONFIG_LEDS_CLASS=y5454+CONFIG_LEDS_GPIO=y5555+CONFIG_LEDS_TRIGGERS=y5656+CONFIG_LEDS_TRIGGER_HEARTBEAT=y5757+CONFIG_RTC_CLASS=y5858+CONFIG_RTC_DRV_GEMINI=y5959+CONFIG_DMADEVICES=y6060+# CONFIG_DNOTIFY is not set6161+CONFIG_TMPFS=y6262+CONFIG_TMPFS_POSIX_ACL=y6363+CONFIG_ROMFS_FS=y6464+CONFIG_NLS_CODEPAGE_437=y6565+CONFIG_NLS_ISO8859_1=y6666+# CONFIG_ENABLE_WARN_DEPRECATED is not set6767+# CONFIG_ENABLE_MUST_CHECK is not set6868+CONFIG_DEBUG_FS=y
···266266extern const struct smp_operations omap4_smp_ops;267267#endif268268269269+extern u32 omap4_get_cpu1_ns_pa_addr(void);270270+269271#if defined(CONFIG_SMP) && defined(CONFIG_PM)270272extern int omap4_mpuss_init(void);271273extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);272274extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);273273-extern u32 omap4_get_cpu1_ns_pa_addr(void);274275#else275276static inline int omap4_enter_lowpower(unsigned int cpu,276277 unsigned int power_state)
+5-5
arch/arm/mach-omap2/omap-mpuss-lowpower.c
···213213{}214214#endif215215216216-u32 omap4_get_cpu1_ns_pa_addr(void)217217-{218218- return old_cpu1_ns_pa_addr;219219-}220220-221216/**222217 * omap4_enter_lowpower: OMAP4 MPUSS Low Power Entry Function223218 * The purpose of this function is to manage low power programming···451456}452457453458#endif459459+460460+u32 omap4_get_cpu1_ns_pa_addr(void)461461+{462462+ return old_cpu1_ns_pa_addr;463463+}454464455465/*456466 * For kexec, we must set CPU1_WAKEUP_NS_PA_ADDR to point to
+7-4
arch/arm/mach-omap2/omap-smp.c
···306306307307 cpu1_startup_pa = readl_relaxed(cfg.wakeupgen_base +308308 OMAP_AUX_CORE_BOOT_1);309309- cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr();310309311310 /* Did the configured secondary_startup() get overwritten? */312311 if (!omap4_smp_cpu1_startup_valid(cpu1_startup_pa))···315316 * If omap4 or 5 has NS_PA_ADDR configured, CPU1 may be in a316317 * deeper idle state in WFI and will wake to an invalid address.317318 */318318- if ((soc_is_omap44xx() || soc_is_omap54xx()) &&319319- !omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr))320320- needs_reset = true;319319+ if ((soc_is_omap44xx() || soc_is_omap54xx())) {320320+ cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr();321321+ if (!omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr))322322+ needs_reset = true;323323+ } else {324324+ cpu1_ns_pa_addr = 0;325325+ }321326322327 if (!needs_reset || !c->cpu1_rstctrl_va)323328 return;
···44444545/dts-v1/;4646#include "rk3399-gru.dtsi"4747-#include <include/dt-bindings/input/linux-event-codes.h>4747+#include <dt-bindings/input/linux-event-codes.h>48484949/*5050 * Kevin-specific things
+50-62
arch/arm64/configs/defconfig
···3030CONFIG_JUMP_LABEL=y3131CONFIG_MODULES=y3232CONFIG_MODULE_UNLOAD=y3333-# CONFIG_BLK_DEV_BSG is not set3433# CONFIG_IOSCHED_DEADLINE is not set3534CONFIG_ARCH_SUNXI=y3635CONFIG_ARCH_ALPINE=y···6162CONFIG_ARCH_ZX=y6263CONFIG_ARCH_ZYNQMP=y6364CONFIG_PCI=y6464-CONFIG_PCI_MSI=y6565CONFIG_PCI_IOV=y6666-CONFIG_PCI_AARDVARK=y6767-CONFIG_PCIE_RCAR=y6868-CONFIG_PCI_HOST_GENERIC=y6969-CONFIG_PCI_XGENE=y7066CONFIG_PCI_LAYERSCAPE=y7167CONFIG_PCI_HISI=y7268CONFIG_PCIE_QCOM=y7369CONFIG_PCIE_ARMADA_8K=y7070+CONFIG_PCI_AARDVARK=y7171+CONFIG_PCIE_RCAR=y7272+CONFIG_PCI_HOST_GENERIC=y7373+CONFIG_PCI_XGENE=y7474CONFIG_ARM64_VA_BITS_48=y7575CONFIG_SCHED_MC=y7676CONFIG_NUMA=y···7880CONFIG_TRANSPARENT_HUGEPAGE=y7981CONFIG_CMA=y8082CONFIG_SECCOMP=y8181-CONFIG_XEN=y8283CONFIG_KEXEC=y8384CONFIG_CRASH_DUMP=y8585+CONFIG_XEN=y8486# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set8587CONFIG_COMPAT=y8686-CONFIG_CPU_IDLE=y8788CONFIG_HIBERNATION=y8889CONFIG_ARM_CPUIDLE=y8990CONFIG_CPU_FREQ=y···152155CONFIG_BLK_DEV_LOOP=y153156CONFIG_BLK_DEV_NBD=m154157CONFIG_VIRTIO_BLK=y155155-CONFIG_EEPROM_AT25=m156158CONFIG_SRAM=y159159+CONFIG_EEPROM_AT25=m157160# CONFIG_SCSI_PROC_FS is not set158161CONFIG_BLK_DEV_SD=y159162CONFIG_SCSI_SAS_ATA=y···165168CONFIG_AHCI_MVEBU=y166169CONFIG_AHCI_XGENE=y167170CONFIG_AHCI_QORIQ=y168168-CONFIG_SATA_RCAR=y169171CONFIG_SATA_SIL24=y172172+CONFIG_SATA_RCAR=y170173CONFIG_PATA_PLATFORM=y171174CONFIG_PATA_OF_PLATFORM=y172175CONFIG_NETDEVICES=y···183186CONFIG_E1000E=y184187CONFIG_IGB=y185188CONFIG_IGBVF=y186186-CONFIG_MVPP2=y187189CONFIG_MVNETA=y190190+CONFIG_MVPP2=y188191CONFIG_SKY2=y189192CONFIG_RAVB=y190193CONFIG_SMC91X=y191194CONFIG_SMSC911X=y192195CONFIG_STMMAC_ETH=m193193-CONFIG_REALTEK_PHY=m196196+CONFIG_MDIO_BUS_MUX_MMIOREG=y194197CONFIG_MESON_GXL_PHY=m195198CONFIG_MICREL_PHY=y196196-CONFIG_MDIO_BUS_MUX=y197197-CONFIG_MDIO_BUS_MUX_MMIOREG=y199199+CONFIG_REALTEK_PHY=m198200CONFIG_USB_PEGASUS=m199201CONFIG_USB_RTL8150=m200202CONFIG_USB_RTL8152=m···226230CONFIG_SERIAL_OF_PLATFORM=y227231CONFIG_SERIAL_AMBA_PL011=y228232CONFIG_SERIAL_AMBA_PL011_CONSOLE=y233233+CONFIG_SERIAL_MESON=y234234+CONFIG_SERIAL_MESON_CONSOLE=y229235CONFIG_SERIAL_SAMSUNG=y230236CONFIG_SERIAL_SAMSUNG_CONSOLE=y231237CONFIG_SERIAL_TEGRA=y232238CONFIG_SERIAL_SH_SCI=y233239CONFIG_SERIAL_SH_SCI_NR_UARTS=11234240CONFIG_SERIAL_SH_SCI_CONSOLE=y235235-CONFIG_SERIAL_MESON=y236236-CONFIG_SERIAL_MESON_CONSOLE=y237241CONFIG_SERIAL_MSM=y238242CONFIG_SERIAL_MSM_CONSOLE=y239243CONFIG_SERIAL_XILINX_PS_UART=y···257261CONFIG_I2C_RCAR=y258262CONFIG_I2C_CROS_EC_TUNNEL=y259263CONFIG_SPI=y260260-CONFIG_SPI_MESON_SPIFC=m261264CONFIG_SPI_BCM2835=m262265CONFIG_SPI_BCM2835AUX=m266266+CONFIG_SPI_MESON_SPIFC=m263267CONFIG_SPI_ORION=y264268CONFIG_SPI_PL022=y265269CONFIG_SPI_QUP=y266266-CONFIG_SPI_SPIDEV=m267270CONFIG_SPI_S3C64XX=y271271+CONFIG_SPI_SPIDEV=m268272CONFIG_SPMI=y269273CONFIG_PINCTRL_SINGLE=y270274CONFIG_PINCTRL_MAX77620=y···282286CONFIG_GPIO_PCA953X_IRQ=y283287CONFIG_GPIO_MAX77620=y284288CONFIG_POWER_RESET_MSM=y285285-CONFIG_BATTERY_BQ27XXX=y286289CONFIG_POWER_RESET_XGENE=y287290CONFIG_POWER_RESET_SYSCON=y291291+CONFIG_BATTERY_BQ27XXX=y292292+CONFIG_SENSORS_ARM_SCPI=y288293CONFIG_SENSORS_LM90=m289294CONFIG_SENSORS_INA2XX=m290290-CONFIG_SENSORS_ARM_SCPI=y291291-CONFIG_THERMAL=y292292-CONFIG_THERMAL_EMULATION=y293295CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y294296CONFIG_CPU_THERMAL=y295295-CONFIG_BCM2835_THERMAL=y297297+CONFIG_THERMAL_EMULATION=y296298CONFIG_EXYNOS_THERMAL=y297299CONFIG_WATCHDOG=y298298-CONFIG_BCM2835_WDT=y299299-CONFIG_RENESAS_WDT=y300300CONFIG_S3C2410_WATCHDOG=y301301CONFIG_MESON_GXBB_WATCHDOG=m302302CONFIG_MESON_WATCHDOG=m303303-CONFIG_MFD_EXYNOS_LPASS=m304304-CONFIG_MFD_MAX77620=y305305-CONFIG_MFD_RK808=y306306-CONFIG_MFD_SPMI_PMIC=y307307-CONFIG_MFD_SEC_CORE=y308308-CONFIG_MFD_HI655X_PMIC=y309309-CONFIG_REGULATOR=y303303+CONFIG_RENESAS_WDT=y304304+CONFIG_BCM2835_WDT=y310305CONFIG_MFD_CROS_EC=y311306CONFIG_MFD_CROS_EC_I2C=y307307+CONFIG_MFD_EXYNOS_LPASS=m308308+CONFIG_MFD_HI655X_PMIC=y309309+CONFIG_MFD_MAX77620=y310310+CONFIG_MFD_SPMI_PMIC=y311311+CONFIG_MFD_RK808=y312312+CONFIG_MFD_SEC_CORE=y312313CONFIG_REGULATOR_FIXED_VOLTAGE=y313314CONFIG_REGULATOR_GPIO=y314315CONFIG_REGULATOR_HI655X=y···338345CONFIG_DRM_EXYNOS_HDMI=y339346CONFIG_DRM_EXYNOS_MIC=y340347CONFIG_DRM_RCAR_DU=m341341-CONFIG_DRM_RCAR_HDMI=y342348CONFIG_DRM_RCAR_LVDS=y343349CONFIG_DRM_RCAR_VSP=y344350CONFIG_DRM_TEGRA=m345345-CONFIG_DRM_VC4=m346351CONFIG_DRM_PANEL_SIMPLE=m347352CONFIG_DRM_I2C_ADV7511=m353353+CONFIG_DRM_VC4=m348354CONFIG_DRM_HISI_KIRIN=m349355CONFIG_DRM_MESON=m350356CONFIG_FB=y···358366CONFIG_SND=y359367CONFIG_SND_SOC=y360368CONFIG_SND_BCM2835_SOC_I2S=m361361-CONFIG_SND_SOC_RCAR=y362369CONFIG_SND_SOC_SAMSUNG=y370370+CONFIG_SND_SOC_RCAR=y363371CONFIG_SND_SOC_AK4613=y364372CONFIG_USB=y365373CONFIG_USB_OTG=y366374CONFIG_USB_XHCI_HCD=y367367-CONFIG_USB_XHCI_PLATFORM=y368368-CONFIG_USB_XHCI_RCAR=y369369-CONFIG_USB_EHCI_EXYNOS=y370375CONFIG_USB_XHCI_TEGRA=y371376CONFIG_USB_EHCI_HCD=y372377CONFIG_USB_EHCI_MSM=y378378+CONFIG_USB_EHCI_EXYNOS=y373379CONFIG_USB_EHCI_HCD_PLATFORM=y374374-CONFIG_USB_OHCI_EXYNOS=y375380CONFIG_USB_OHCI_HCD=y381381+CONFIG_USB_OHCI_EXYNOS=y376382CONFIG_USB_OHCI_HCD_PLATFORM=y377383CONFIG_USB_RENESAS_USBHS=m378384CONFIG_USB_STORAGE=y379379-CONFIG_USB_DWC2=y380385CONFIG_USB_DWC3=y386386+CONFIG_USB_DWC2=y381387CONFIG_USB_CHIPIDEA=y382388CONFIG_USB_CHIPIDEA_UDC=y383389CONFIG_USB_CHIPIDEA_HOST=y384390CONFIG_USB_ISP1760=y385391CONFIG_USB_HSIC_USB3503=y386392CONFIG_USB_MSM_OTG=y393393+CONFIG_USB_QCOM_8X16_PHY=y387394CONFIG_USB_ULPI=y388395CONFIG_USB_GADGET=y389396CONFIG_USB_RENESAS_USBHS_UDC=m390397CONFIG_MMC=y391398CONFIG_MMC_BLOCK_MINORS=32392399CONFIG_MMC_ARMMMCI=y393393-CONFIG_MMC_MESON_GX=y394400CONFIG_MMC_SDHCI=y395401CONFIG_MMC_SDHCI_ACPI=y396402CONFIG_MMC_SDHCI_PLTFM=y···396406CONFIG_MMC_SDHCI_OF_ESDHC=y397407CONFIG_MMC_SDHCI_CADENCE=y398408CONFIG_MMC_SDHCI_TEGRA=y409409+CONFIG_MMC_MESON_GX=y399410CONFIG_MMC_SDHCI_MSM=y400411CONFIG_MMC_SPI=y401412CONFIG_MMC_SDHI=y···405414CONFIG_MMC_DW_K3=y406415CONFIG_MMC_DW_ROCKCHIP=y407416CONFIG_MMC_SUNXI=y408408-CONFIG_MMC_SDHCI_XENON=y409417CONFIG_MMC_BCM2835=y418418+CONFIG_MMC_SDHCI_XENON=y410419CONFIG_NEW_LEDS=y411420CONFIG_LEDS_CLASS=y412421CONFIG_LEDS_GPIO=y413422CONFIG_LEDS_PWM=y414423CONFIG_LEDS_SYSCON=y415415-CONFIG_LEDS_TRIGGERS=y416416-CONFIG_LEDS_TRIGGER_DEFAULT_ON=y417424CONFIG_LEDS_TRIGGER_HEARTBEAT=y418425CONFIG_LEDS_TRIGGER_CPU=y426426+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y419427CONFIG_RTC_CLASS=y420428CONFIG_RTC_DRV_MAX77686=y429429+CONFIG_RTC_DRV_RK808=m421430CONFIG_RTC_DRV_S5M=y422431CONFIG_RTC_DRV_DS3232=y423432CONFIG_RTC_DRV_EFI=y433433+CONFIG_RTC_DRV_S3C=y424434CONFIG_RTC_DRV_PL031=y425435CONFIG_RTC_DRV_SUN6I=y426426-CONFIG_RTC_DRV_RK808=m427436CONFIG_RTC_DRV_TEGRA=y428437CONFIG_RTC_DRV_XGENE=y429429-CONFIG_RTC_DRV_S3C=y430438CONFIG_DMADEVICES=y439439+CONFIG_DMA_BCM2835=m431440CONFIG_MV_XOR_V2=y432441CONFIG_PL330_DMA=y433433-CONFIG_DMA_BCM2835=m434442CONFIG_TEGRA20_APB_DMA=y435443CONFIG_QCOM_BAM_DMA=y436444CONFIG_QCOM_HIDMA_MGMT=y···442452CONFIG_VIRTIO_MMIO=y443453CONFIG_XEN_GNTDEV=y444454CONFIG_XEN_GRANT_DEV_ALLOC=y455455+CONFIG_COMMON_CLK_RK808=y445456CONFIG_COMMON_CLK_SCPI=y446457CONFIG_COMMON_CLK_CS2000_CP=y447458CONFIG_COMMON_CLK_S2MPS11=y448448-CONFIG_COMMON_CLK_PWM=y449449-CONFIG_COMMON_CLK_RK808=y450459CONFIG_CLK_QORIQ=y460460+CONFIG_COMMON_CLK_PWM=y451461CONFIG_COMMON_CLK_QCOM=y462462+CONFIG_QCOM_CLK_SMD_RPM=y452463CONFIG_MSM_GCC_8916=y453464CONFIG_MSM_GCC_8994=y454465CONFIG_MSM_MMCC_8996=y455466CONFIG_HWSPINLOCK_QCOM=y456456-CONFIG_MAILBOX=y457467CONFIG_ARM_MHU=y458468CONFIG_PLATFORM_MHU=y459469CONFIG_BCM2835_MBOX=y460470CONFIG_HI6220_MBOX=y461471CONFIG_ARM_SMMU=y462472CONFIG_ARM_SMMU_V3=y473473+CONFIG_RPMSG_QCOM_SMD=y463474CONFIG_RASPBERRYPI_POWER=y464475CONFIG_QCOM_SMEM=y465465-CONFIG_QCOM_SMD=y466476CONFIG_QCOM_SMD_RPM=y477477+CONFIG_QCOM_SMP2P=y478478+CONFIG_QCOM_SMSM=y467479CONFIG_ROCKCHIP_PM_DOMAINS=y468480CONFIG_ARCH_TEGRA_132_SOC=y469481CONFIG_ARCH_TEGRA_210_SOC=y470482CONFIG_ARCH_TEGRA_186_SOC=y471483CONFIG_EXTCON_USB_GPIO=y484484+CONFIG_IIO=y485485+CONFIG_EXYNOS_ADC=y472486CONFIG_PWM=y473487CONFIG_PWM_BCM2835=m474474-CONFIG_PWM_ROCKCHIP=y475475-CONFIG_PWM_TEGRA=m476488CONFIG_PWM_MESON=m477477-CONFIG_COMMON_RESET_HI6220=y489489+CONFIG_PWM_ROCKCHIP=y490490+CONFIG_PWM_SAMSUNG=y491491+CONFIG_PWM_TEGRA=m478492CONFIG_PHY_RCAR_GEN3_USB2=y479493CONFIG_PHY_HI6220_USB=y494494+CONFIG_PHY_SUN4I_USB=y480495CONFIG_PHY_ROCKCHIP_INNO_USB2=y481496CONFIG_PHY_ROCKCHIP_EMMC=y482482-CONFIG_PHY_SUN4I_USB=y483497CONFIG_PHY_XGENE=y484498CONFIG_PHY_TEGRA_XUSB=y485499CONFIG_ARM_SCPI_PROTOCOL=y486486-CONFIG_ACPI=y487487-CONFIG_IIO=y488488-CONFIG_EXYNOS_ADC=y489489-CONFIG_PWM_SAMSUNG=y490500CONFIG_RASPBERRYPI_FIRMWARE=y501501+CONFIG_ACPI=y491502CONFIG_EXT2_FS=y492503CONFIG_EXT3_FS=y493504CONFIG_EXT4_FS_POSIX_ACL=y···502511CONFIG_CUSE=m503512CONFIG_OVERLAY_FS=m504513CONFIG_VFAT_FS=y505505-CONFIG_TMPFS=y506514CONFIG_HUGETLBFS=y507515CONFIG_CONFIGFS_FS=y508516CONFIG_EFIVAR_FS=y···529539CONFIG_SECURITY=y530540CONFIG_CRYPTO_ECHAINIV=y531541CONFIG_CRYPTO_ANSI_CPRNG=y532532-CONFIG_CRYPTO_DEV_SAFEXCEL=m533542CONFIG_ARM64_CRYPTO=y534543CONFIG_CRYPTO_SHA1_ARM64_CE=y535544CONFIG_CRYPTO_SHA2_ARM64_CE=y536545CONFIG_CRYPTO_GHASH_ARM64_CE=y537546CONFIG_CRYPTO_AES_ARM64_CE_CCM=y538547CONFIG_CRYPTO_AES_ARM64_CE_BLK=y539539-# CONFIG_CRYPTO_AES_ARM64_NEON_BLK is not set
···115115116116extern DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS);117117extern struct static_key_false cpu_hwcap_keys[ARM64_NCAPS];118118+extern struct static_key_false arm64_const_caps_ready;118119119120bool this_cpu_has_cap(unsigned int cap);120121···125124}126125127126/* System capability check for constant caps */128128-static inline bool cpus_have_const_cap(int num)127127+static inline bool __cpus_have_const_cap(int num)129128{130129 if (num >= ARM64_NCAPS)131130 return false;···139138 return test_bit(num, cpu_hwcaps);140139}141140141141+static inline bool cpus_have_const_cap(int num)142142+{143143+ if (static_branch_likely(&arm64_const_caps_ready))144144+ return __cpus_have_const_cap(num);145145+ else146146+ return cpus_have_cap(num);147147+}148148+142149static inline void cpus_set_cap(unsigned int num)143150{144151 if (num >= ARM64_NCAPS) {···154145 num, ARM64_NCAPS);155146 } else {156147 __set_bit(num, cpu_hwcaps);157157- static_branch_enable(&cpu_hwcap_keys[num]);158148 }159149}160150
+6-2
arch/arm64/include/asm/kvm_host.h
···24242525#include <linux/types.h>2626#include <linux/kvm_types.h>2727+#include <asm/cpufeature.h>2728#include <asm/kvm.h>2829#include <asm/kvm_asm.h>2930#include <asm/kvm_mmio.h>···356355 unsigned long vector_ptr)357356{358357 /*359359- * Call initialization code, and switch to the full blown360360- * HYP code.358358+ * Call initialization code, and switch to the full blown HYP code.359359+ * If the cpucaps haven't been finalized yet, something has gone very360360+ * wrong, and hyp will crash and burn when it uses any361361+ * cpus_have_const_cap() wrapper.361362 */363363+ BUG_ON(!static_branch_likely(&arm64_const_caps_ready));362364 __kvm_call_hyp((void *)pgd_ptr, hyp_stack_ptr, vector_ptr);363365}364366
+21-2
arch/arm64/kernel/cpufeature.c
···985985 */986986void __init enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)987987{988988- for (; caps->matches; caps++)989989- if (caps->enable && cpus_have_cap(caps->capability))988988+ for (; caps->matches; caps++) {989989+ unsigned int num = caps->capability;990990+991991+ if (!cpus_have_cap(num))992992+ continue;993993+994994+ /* Ensure cpus_have_const_cap(num) works */995995+ static_branch_enable(&cpu_hwcap_keys[num]);996996+997997+ if (caps->enable) {990998 /*991999 * Use stop_machine() as it schedules the work allowing9921000 * us to modify PSTATE, instead of on_each_cpu() which···1002994 * we return.1003995 */1004996 stop_machine(caps->enable, NULL, cpu_online_mask);997997+ }998998+ }1005999}1006100010071001/*···11061096 enable_cpu_capabilities(arm64_features);11071097}1108109810991099+DEFINE_STATIC_KEY_FALSE(arm64_const_caps_ready);11001100+EXPORT_SYMBOL(arm64_const_caps_ready);11011101+11021102+static void __init mark_const_caps_ready(void)11031103+{11041104+ static_branch_enable(&arm64_const_caps_ready);11051105+}11061106+11091107/*11101108 * Check if the current CPU has a given feature capability.11111109 * Should be called from non-preemptible context.···11491131 /* Set the CPU feature capabilies */11501132 setup_feature_capabilities();11511133 enable_errata_workarounds();11341134+ mark_const_caps_ready();11521135 setup_elf_hwcaps(arm64_elf_hwcaps);1153113611541137 if (system_supports_32bit_el0())
+16-7
arch/arm64/kernel/perf_event.c
···877877878878 if (attr->exclude_idle)879879 return -EPERM;880880- if (is_kernel_in_hyp_mode() &&881881- attr->exclude_kernel != attr->exclude_hv)882882- return -EINVAL;880880+881881+ /*882882+ * If we're running in hyp mode, then we *are* the hypervisor.883883+ * Therefore we ignore exclude_hv in this configuration, since884884+ * there's no hypervisor to sample anyway. This is consistent885885+ * with other architectures (x86 and Power).886886+ */887887+ if (is_kernel_in_hyp_mode()) {888888+ if (!attr->exclude_kernel)889889+ config_base |= ARMV8_PMU_INCLUDE_EL2;890890+ } else {891891+ if (attr->exclude_kernel)892892+ config_base |= ARMV8_PMU_EXCLUDE_EL1;893893+ if (!attr->exclude_hv)894894+ config_base |= ARMV8_PMU_INCLUDE_EL2;895895+ }883896 if (attr->exclude_user)884897 config_base |= ARMV8_PMU_EXCLUDE_EL0;885885- if (!is_kernel_in_hyp_mode() && attr->exclude_kernel)886886- config_base |= ARMV8_PMU_EXCLUDE_EL1;887887- if (!attr->exclude_hv)888888- config_base |= ARMV8_PMU_INCLUDE_EL2;889898890899 /*891900 * Install the filter into config_base as this is used to
···1414#include <asm-generic/module.h>151516161717+#ifdef CC_USING_MPROFILE_KERNEL1818+#define MODULE_ARCH_VERMAGIC "mprofile-kernel"1919+#endif2020+1721#ifndef __powerpc64__1822/*1923 * Thanks to Paul M for explaining this.
+12
arch/powerpc/include/asm/page.h
···132132#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)133133#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))134134#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)135135+136136+#ifdef CONFIG_PPC_BOOK3S_64137137+/*138138+ * On hash the vmalloc and other regions alias to the kernel region when passed139139+ * through __pa(), which virt_to_pfn() uses. That means virt_addr_valid() can140140+ * return true for some vmalloc addresses, which is incorrect. So explicitly141141+ * check that the address is in the kernel region.142142+ */143143+#define virt_addr_valid(kaddr) (REGION_ID(kaddr) == KERNEL_REGION_ID && \144144+ pfn_valid(virt_to_pfn(kaddr)))145145+#else135146#define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr))147147+#endif136148137149/*138150 * On Book-E parts we need __va to parse the device tree and we can't
+1-1
arch/powerpc/kernel/idle_book3s.S
···416416 * which needs to be restored from the stack.417417 */418418 li r3, 1419419- stb r0,PACA_NAPSTATELOST(r13)419419+ stb r3,PACA_NAPSTATELOST(r13)420420 blr421421422422/*
···864864 if (!MSR_TM_SUSPENDED(mfmsr()))865865 return;866866867867+ /*868868+ * If we are in a transaction and FP is off then we can't have869869+ * used FP inside that transaction. Hence the checkpointed870870+ * state is the same as the live state. We need to copy the871871+ * live state to the checkpointed state so that when the872872+ * transaction is restored, the checkpointed state is correct873873+ * and the aborted transaction sees the correct state. We use874874+ * ckpt_regs.msr here as that's what tm_reclaim will use to875875+ * determine if it's going to write the checkpointed state or876876+ * not. So either this will write the checkpointed registers,877877+ * or reclaim will. Similarly for VMX.878878+ */879879+ if ((thr->ckpt_regs.msr & MSR_FP) == 0)880880+ memcpy(&thr->ckfp_state, &thr->fp_state,881881+ sizeof(struct thread_fp_state));882882+ if ((thr->ckpt_regs.msr & MSR_VEC) == 0)883883+ memcpy(&thr->ckvr_state, &thr->vr_state,884884+ sizeof(struct thread_vr_state));885885+867886 giveup_all(container_of(thr, struct task_struct, thread));868887869888 tm_reclaim(thr, thr->ckpt_regs.msr, cause);
+1-1
arch/powerpc/kvm/Kconfig
···6767 select KVM_BOOK3S_64_HANDLER6868 select KVM6969 select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE7070- select SPAPR_TCE_IOMMU if IOMMU_SUPPORT7070+ select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_SERIES || PPC_POWERNV)7171 ---help---7272 Support running unmodified book3s_64 and book3s_32 guest kernels7373 in virtual machines on book3s_64 host processors.
···301301 /* udbg_printf("H_PUT_TCE(): liobn=0x%lx ioba=0x%lx, tce=0x%lx\n", */302302 /* liobn, ioba, tce); */303303304304+ /* For radix, we might be in virtual mode, so punt */305305+ if (kvm_is_radix(vcpu->kvm))306306+ return H_TOO_HARD;307307+304308 stt = kvmppc_find_table(vcpu->kvm, liobn);305309 if (!stt)306310 return H_TOO_HARD;···384380 unsigned long *rmap = NULL;385381 bool prereg = false;386382 struct kvmppc_spapr_tce_iommu_table *stit;383383+384384+ /* For radix, we might be in virtual mode, so punt */385385+ if (kvm_is_radix(vcpu->kvm))386386+ return H_TOO_HARD;387387388388 stt = kvmppc_find_table(vcpu->kvm, liobn);389389 if (!stt)···499491 long i, ret;500492 struct kvmppc_spapr_tce_iommu_table *stit;501493494494+ /* For radix, we might be in virtual mode, so punt */495495+ if (kvm_is_radix(vcpu->kvm))496496+ return H_TOO_HARD;497497+502498 stt = kvmppc_find_table(vcpu->kvm, liobn);503499 if (!stt)504500 return H_TOO_HARD;···539527 return H_SUCCESS;540528}541529530530+/* This can be called in either virtual mode or real mode */542531long kvmppc_h_get_tce(struct kvm_vcpu *vcpu, unsigned long liobn,543532 unsigned long ioba)544533{
+8-1
arch/powerpc/kvm/book3s_hv_builtin.c
···207207208208long kvmppc_h_random(struct kvm_vcpu *vcpu)209209{210210- if (powernv_get_random_real_mode(&vcpu->arch.gpr[4]))210210+ int r;211211+212212+ /* Only need to do the expensive mfmsr() on radix */213213+ if (kvm_is_radix(vcpu->kvm) && (mfmsr() & MSR_IR))214214+ r = powernv_get_random_long(&vcpu->arch.gpr[4]);215215+ else216216+ r = powernv_get_random_real_mode(&vcpu->arch.gpr[4]);217217+ if (r)211218 return H_SUCCESS;212219213220 return H_HARDWARE;
···2727 * 2005-Dec Used as a template for s390 by Mike Grundy2828 * <grundym@us.ibm.com>2929 */3030+#include <linux/types.h>3031#include <asm-generic/kprobes.h>31323233#define BREAKPOINT_INSTRUCTION 0x000233343535+#define FIXUP_PSW_NORMAL 0x083636+#define FIXUP_BRANCH_NOT_TAKEN 0x043737+#define FIXUP_RETURN_REGISTER 0x023838+#define FIXUP_NOT_REQUIRED 0x013939+4040+int probe_is_prohibited_opcode(u16 *insn);4141+int probe_get_fixup_type(u16 *insn);4242+int probe_is_insn_relative_long(u16 *insn);4343+3444#ifdef CONFIG_KPROBES3535-#include <linux/types.h>3645#include <linux/ptrace.h>3746#include <linux/percpu.h>3847#include <linux/sched/task_stack.h>···6455#define kretprobe_blacklist_size 065566657#define KPROBE_SWAP_INST 0x106767-6868-#define FIXUP_PSW_NORMAL 0x086969-#define FIXUP_BRANCH_NOT_TAKEN 0x047070-#define FIXUP_RETURN_REGISTER 0x027171-#define FIXUP_NOT_REQUIRED 0x0172587359/* Architecture specific copy of original instruction */7460struct arch_specific_insn {···9389int kprobe_fault_handler(struct pt_regs *regs, int trapnr);9490int kprobe_exceptions_notify(struct notifier_block *self,9591 unsigned long val, void *data);9696-9797-int probe_is_prohibited_opcode(u16 *insn);9898-int probe_get_fixup_type(u16 *insn);9999-int probe_is_insn_relative_long(u16 *insn);1009210193#define flush_insn_slot(p) do { } while (0)10294
+1-1
arch/s390/include/asm/sysinfo.h
···146146 * Returns the maximum nesting level supported by the cpu topology code.147147 * The current maximum level is 4 which is the drawer level.148148 */149149-static inline int topology_mnest_limit(void)149149+static inline unsigned char topology_mnest_limit(void)150150{151151 return min(topology_max_mnest, 4);152152}
+4-4
arch/s390/kernel/debug.c
···277277 memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *));278278 memset(rc->debugfs_entries, 0 ,DEBUG_MAX_VIEWS *279279 sizeof(struct dentry*));280280- atomic_set(&(rc->ref_count), 0);280280+ refcount_set(&(rc->ref_count), 0);281281282282 return rc;283283···361361 debug_area_last = rc;362362 rc->next = NULL;363363364364- debug_info_get(rc);364364+ refcount_set(&rc->ref_count, 1);365365out:366366 return rc;367367}···416416debug_info_get(debug_info_t * db_info)417417{418418 if (db_info)419419- atomic_inc(&db_info->ref_count);419419+ refcount_inc(&db_info->ref_count);420420}421421422422/*···431431432432 if (!db_info)433433 return;434434- if (atomic_dec_and_test(&db_info->ref_count)) {434434+ if (refcount_dec_and_test(&db_info->ref_count)) {435435 for (i = 0; i < DEBUG_MAX_VIEWS; i++) {436436 if (!db_info->views[i])437437 continue;
+18-3
arch/s390/kernel/entry.S
···312312 lg %r14,__LC_VDSO_PER_CPU313313 lmg %r0,%r10,__PT_R0(%r11)314314 mvc __LC_RETURN_PSW(16),__PT_PSW(%r11)315315+.Lsysc_exit_timer:315316 stpt __LC_EXIT_TIMER316317 mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER317318 lmg %r11,%r15,__PT_R11(%r11)···624623 lg %r14,__LC_VDSO_PER_CPU625624 lmg %r0,%r10,__PT_R0(%r11)626625 mvc __LC_RETURN_PSW(16),__PT_PSW(%r11)626626+.Lio_exit_timer:627627 stpt __LC_EXIT_TIMER628628 mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER629629 lmg %r11,%r15,__PT_R11(%r11)···11761174 br %r141177117511781176.Lcleanup_sysc_restore:11771177+ # check if stpt has been executed11791178 clg %r9,BASED(.Lcleanup_sysc_restore_insn)11791179+ jh 0f11801180+ mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER11811181+ cghi %r11,__LC_SAVE_AREA_ASYNC11801182 je 0f11831183+ mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER11841184+0: clg %r9,BASED(.Lcleanup_sysc_restore_insn+8)11851185+ je 1f11811186 lg %r9,24(%r11) # get saved pointer to pt_regs11821187 mvc __LC_RETURN_PSW(16),__PT_PSW(%r9)11831188 mvc 0(64,%r11),__PT_R8(%r9)11841189 lmg %r0,%r7,__PT_R0(%r9)11851185-0: lmg %r8,%r9,__LC_RETURN_PSW11901190+1: lmg %r8,%r9,__LC_RETURN_PSW11861191 br %r1411871192.Lcleanup_sysc_restore_insn:11931193+ .quad .Lsysc_exit_timer11881194 .quad .Lsysc_done - 41189119511901196.Lcleanup_io_tif:···12001190 br %r141201119112021192.Lcleanup_io_restore:11931193+ # check if stpt has been executed12031194 clg %r9,BASED(.Lcleanup_io_restore_insn)12041204- je 0f11951195+ jh 0f11961196+ mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER11971197+0: clg %r9,BASED(.Lcleanup_io_restore_insn+8)11981198+ je 1f12051199 lg %r9,24(%r11) # get saved r11 pointer to pt_regs12061200 mvc __LC_RETURN_PSW(16),__PT_PSW(%r9)12071201 mvc 0(64,%r11),__PT_R8(%r9)12081202 lmg %r0,%r7,__PT_R0(%r9)12091209-0: lmg %r8,%r9,__LC_RETURN_PSW12031203+1: lmg %r8,%r9,__LC_RETURN_PSW12101204 br %r1412111205.Lcleanup_io_restore_insn:12061206+ .quad .Lio_exit_timer12121207 .quad .Lio_done - 41213120812141209.Lcleanup_idle:
···3131{3232 . = 0x00000000;3333 .text : {3434- _text = .; /* Text and read-only data */3434+ /* Text and read-only data */3535 HEAD_TEXT3636+ /*3737+ * E.g. perf doesn't like symbols starting at address zero,3838+ * therefore skip the initial PSW and channel program located3939+ * at address zero and let _text start at 0x200.4040+ */4141+ _text = 0x200;3642 TEXT_TEXT3743 SCHED_TEXT3844 CPUIDLE_TEXT
+1
arch/s390/lib/probes.c
···44 * Copyright IBM Corp. 201455 */6677+#include <linux/errno.h>78#include <asm/kprobes.h>89#include <asm/dis.h>910
···2424static inline int prepare_hugepage_range(struct file *file,2525 unsigned long addr, unsigned long len)2626{2727- if (len & ~HPAGE_MASK)2727+ struct hstate *h = hstate_file(file);2828+2929+ if (len & ~huge_page_mask(h))2830 return -EINVAL;2929- if (addr & ~HPAGE_MASK)3131+ if (addr & ~huge_page_mask(h))3032 return -EINVAL;3133 return 0;3234}
+2-2
arch/sparc/include/asm/pgtable_32.h
···9191 * ZERO_PAGE is a global shared page that is always zero: used9292 * for zero-mapped memory areas etc..9393 */9494-extern unsigned long empty_zero_page;9494+extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];95959696-#define ZERO_PAGE(vaddr) (virt_to_page(&empty_zero_page))9696+#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))97979898/*9999 * In general all page table modifications should use the V8 atomic
+1-1
arch/sparc/include/asm/setup.h
···1616 */1717extern unsigned char boot_cpu_id;18181919-extern unsigned long empty_zero_page;1919+extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];20202121extern int serial_console;2222static inline int con_is_present(void)
+7-8
arch/sparc/kernel/ftrace.c
···130130 if (unlikely(atomic_read(¤t->tracing_graph_pause)))131131 return parent + 8UL;132132133133+ trace.func = self_addr;134134+ trace.depth = current->curr_ret_stack + 1;135135+136136+ /* Only trace if the calling function expects to */137137+ if (!ftrace_graph_entry(&trace))138138+ return parent + 8UL;139139+133140 if (ftrace_push_return_trace(parent, self_addr, &trace.depth,134141 frame_pointer, NULL) == -EBUSY)135142 return parent + 8UL;136136-137137- trace.func = self_addr;138138-139139- /* Only trace if the calling function expects to */140140- if (!ftrace_graph_entry(&trace)) {141141- current->curr_ret_stack--;142142- return parent + 8UL;143143- }144143145144 return return_hooker;146145}
+1-1
arch/sparc/mm/init_32.c
···290290291291292292 /* Saves us work later. */293293- memset((void *)&empty_zero_page, 0, PAGE_SIZE);293293+ memset((void *)empty_zero_page, 0, PAGE_SIZE);294294295295 i = last_valid_pfn >> ((20 - PAGE_SHIFT) + 5);296296 i += 1;
···17631763{17641764 struct kvm_arch *ka = &kvm->arch;17651765 struct pvclock_vcpu_time_info hv_clock;17661766+ u64 ret;1766176717671768 spin_lock(&ka->pvclock_gtod_sync_lock);17681769 if (!ka->use_master_clock) {···17751774 hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;17761775 spin_unlock(&ka->pvclock_gtod_sync_lock);1777177617771777+ /* both __this_cpu_read() and rdtsc() should be on the same cpu */17781778+ get_cpu();17791779+17781780 kvm_get_time_scale(NSEC_PER_SEC, __this_cpu_read(cpu_tsc_khz) * 1000LL,17791781 &hv_clock.tsc_shift,17801782 &hv_clock.tsc_to_system_mul);17811781- return __pvclock_read_cycles(&hv_clock, rdtsc());17831783+ ret = __pvclock_read_cycles(&hv_clock, rdtsc());17841784+17851785+ put_cpu();17861786+17871787+ return ret;17821788}1783178917841790static void kvm_setup_pvclock_page(struct kvm_vcpu *v)···32963288 }32973289}3298329032913291+#define XSAVE_MXCSR_OFFSET 2432923292+32993293static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,33003294 struct kvm_xsave *guest_xsave)33013295{33023296 u64 xstate_bv =33033297 *(u64 *)&guest_xsave->region[XSAVE_HDR_OFFSET / sizeof(u32)];32983298+ u32 mxcsr = *(u32 *)&guest_xsave->region[XSAVE_MXCSR_OFFSET / sizeof(u32)];3304329933053300 if (boot_cpu_has(X86_FEATURE_XSAVE)) {33063301 /*···33113300 * CPUID leaf 0xD, index 0, EDX:EAX. This is for compatibility33123301 * with old userspace.33133302 */33143314- if (xstate_bv & ~kvm_supported_xcr0())33033303+ if (xstate_bv & ~kvm_supported_xcr0() ||33043304+ mxcsr & ~mxcsr_feature_mask)33153305 return -EINVAL;33163306 load_xsave(vcpu, (u8 *)guest_xsave->region);33173307 } else {33183318- if (xstate_bv & ~XFEATURE_MASK_FPSSE)33083308+ if (xstate_bv & ~XFEATURE_MASK_FPSSE ||33093309+ mxcsr & ~mxcsr_feature_mask)33193310 return -EINVAL;33203311 memcpy(&vcpu->arch.guest_fpu.state.fxsave,33213312 guest_xsave->region, sizeof(struct fxregs_state));···4831481848324819static int kernel_pio(struct kvm_vcpu *vcpu, void *pd)48334820{48344834- /* TODO: String I/O for in kernel device */48354835- int r;48214821+ int r = 0, i;4836482248374837- if (vcpu->arch.pio.in)48384838- r = kvm_io_bus_read(vcpu, KVM_PIO_BUS, vcpu->arch.pio.port,48394839- vcpu->arch.pio.size, pd);48404840- else48414841- r = kvm_io_bus_write(vcpu, KVM_PIO_BUS,48424842- vcpu->arch.pio.port, vcpu->arch.pio.size,48434843- pd);48234823+ for (i = 0; i < vcpu->arch.pio.count; i++) {48244824+ if (vcpu->arch.pio.in)48254825+ r = kvm_io_bus_read(vcpu, KVM_PIO_BUS, vcpu->arch.pio.port,48264826+ vcpu->arch.pio.size, pd);48274827+ else48284828+ r = kvm_io_bus_write(vcpu, KVM_PIO_BUS,48294829+ vcpu->arch.pio.port, vcpu->arch.pio.size,48304830+ pd);48314831+ if (r)48324832+ break;48334833+ pd += vcpu->arch.pio.size;48344834+ }48444835 return r;48454836}48464837···4881486448824865 if (vcpu->arch.pio.count)48834866 goto data_avail;48674867+48684868+ memset(vcpu->arch.pio_data, 0, size * count);4884486948854870 ret = emulator_pio_in_out(vcpu, size, port, val, count, true);48864871 if (ret) {···5067504850685049 if (var.unusable) {50695050 memset(desc, 0, sizeof(*desc));50515051+ if (base3)50525052+ *base3 = 0;50705053 return false;50715054 }50725055
+4-11
arch/x86/xen/enlighten_pv.c
···142142 struct xen_extraversion extra;143143 HYPERVISOR_xen_version(XENVER_extraversion, &extra);144144145145- pr_info("Booting paravirtualized kernel %son %s\n",146146- xen_feature(XENFEAT_auto_translated_physmap) ?147147- "with PVH extensions " : "", pv_info.name);145145+ pr_info("Booting paravirtualized kernel on %s\n", pv_info.name);148146 printk(KERN_INFO "Xen version: %d.%d%s%s\n",149147 version >> 16, version & 0xffff, extra.extraversion,150148 xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : "");···955957956958void xen_setup_shared_info(void)957959{958958- if (!xen_feature(XENFEAT_auto_translated_physmap)) {959959- set_fixmap(FIX_PARAVIRT_BOOTMAP,960960- xen_start_info->shared_info);960960+ set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_start_info->shared_info);961961962962- HYPERVISOR_shared_info =963963- (struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP);964964- } else965965- HYPERVISOR_shared_info =966966- (struct shared_info *)__va(xen_start_info->shared_info);962962+ HYPERVISOR_shared_info =963963+ (struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP);967964968965#ifndef CONFIG_SMP969966 /* In UP this is as good a place as any to set up shared info */
···355355 pteval_t flags = val & PTE_FLAGS_MASK;356356 unsigned long mfn;357357358358- if (!xen_feature(XENFEAT_auto_translated_physmap))359359- mfn = __pfn_to_mfn(pfn);360360- else361361- mfn = pfn;358358+ mfn = __pfn_to_mfn(pfn);359359+362360 /*363361 * If there's no mfn for the pfn, then just create an364362 * empty non-present pte. Unfortunately this loses···644646 /* The limit is the last byte to be touched */645647 limit--;646648 BUG_ON(limit >= FIXADDR_TOP);647647-648648- if (xen_feature(XENFEAT_auto_translated_physmap))649649- return 0;650649651650 /*652651 * 64-bit has a great big hole in the middle of the address···1284128912851290static void __init xen_pagetable_p2m_setup(void)12861291{12871287- if (xen_feature(XENFEAT_auto_translated_physmap))12881288- return;12891289-12901292 xen_vmalloc_p2m_tree();1291129312921294#ifdef CONFIG_X86_64···13061314 xen_build_mfn_list_list();1307131513081316 /* Remap memory freed due to conflicts with E820 map */13091309- if (!xen_feature(XENFEAT_auto_translated_physmap))13101310- xen_remap_memory();13171317+ xen_remap_memory();1311131813121319 xen_setup_shared_info();13131320}···19161925 /* Zap identity mapping */19171926 init_level4_pgt[0] = __pgd(0);1918192719191919- if (!xen_feature(XENFEAT_auto_translated_physmap)) {19201920- /* Pre-constructed entries are in pfn, so convert to mfn */19211921- /* L4[272] -> level3_ident_pgt19221922- * L4[511] -> level3_kernel_pgt */19231923- convert_pfn_mfn(init_level4_pgt);19281928+ /* Pre-constructed entries are in pfn, so convert to mfn */19291929+ /* L4[272] -> level3_ident_pgt */19301930+ /* L4[511] -> level3_kernel_pgt */19311931+ convert_pfn_mfn(init_level4_pgt);1924193219251925- /* L3_i[0] -> level2_ident_pgt */19261926- convert_pfn_mfn(level3_ident_pgt);19271927- /* L3_k[510] -> level2_kernel_pgt19281928- * L3_k[511] -> level2_fixmap_pgt */19291929- convert_pfn_mfn(level3_kernel_pgt);19331933+ /* L3_i[0] -> level2_ident_pgt */19341934+ convert_pfn_mfn(level3_ident_pgt);19351935+ /* L3_k[510] -> level2_kernel_pgt */19361936+ /* L3_k[511] -> level2_fixmap_pgt */19371937+ convert_pfn_mfn(level3_kernel_pgt);1930193819311931- /* L3_k[511][506] -> level1_fixmap_pgt */19321932- convert_pfn_mfn(level2_fixmap_pgt);19331933- }19391939+ /* L3_k[511][506] -> level1_fixmap_pgt */19401940+ convert_pfn_mfn(level2_fixmap_pgt);19411941+19341942 /* We get [511][511] and have Xen's version of level2_kernel_pgt */19351943 l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd);19361944 l2 = m2v(l3[pud_index(__START_KERNEL_map)].pud);···19521962 if (i && i < pgd_index(__START_KERNEL_map))19531963 init_level4_pgt[i] = ((pgd_t *)xen_start_info->pt_base)[i];1954196419551955- if (!xen_feature(XENFEAT_auto_translated_physmap)) {19561956- /* Make pagetable pieces RO */19571957- set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);19581958- set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);19591959- set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);19601960- set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);19611961- set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO);19621962- set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);19631963- set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);19641964- set_page_prot(level1_fixmap_pgt, PAGE_KERNEL_RO);19651965+ /* Make pagetable pieces RO */19661966+ set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);19671967+ set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);19681968+ set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);19691969+ set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);19701970+ set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO);19711971+ set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);19721972+ set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);19731973+ set_page_prot(level1_fixmap_pgt, PAGE_KERNEL_RO);1965197419661966- /* Pin down new L4 */19671967- pin_pagetable_pfn(MMUEXT_PIN_L4_TABLE,19681968- PFN_DOWN(__pa_symbol(init_level4_pgt)));19751975+ /* Pin down new L4 */19761976+ pin_pagetable_pfn(MMUEXT_PIN_L4_TABLE,19771977+ PFN_DOWN(__pa_symbol(init_level4_pgt)));1969197819701970- /* Unpin Xen-provided one */19711971- pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));19791979+ /* Unpin Xen-provided one */19801980+ pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));1972198119731973- /*19741974- * At this stage there can be no user pgd, and no page19751975- * structure to attach it to, so make sure we just set kernel19761976- * pgd.19771977- */19781978- xen_mc_batch();19791979- __xen_write_cr3(true, __pa(init_level4_pgt));19801980- xen_mc_issue(PARAVIRT_LAZY_CPU);19811981- } else19821982- native_write_cr3(__pa(init_level4_pgt));19821982+ /*19831983+ * At this stage there can be no user pgd, and no page structure to19841984+ * attach it to, so make sure we just set kernel pgd.19851985+ */19861986+ xen_mc_batch();19871987+ __xen_write_cr3(true, __pa(init_level4_pgt));19881988+ xen_mc_issue(PARAVIRT_LAZY_CPU);1983198919841990 /* We can't that easily rip out L3 and L2, as the Xen pagetables are19851991 * set out this way: [L4], [L1], [L2], [L3], [L1], [L1] ... for···2389240323902404static void __init xen_post_allocator_init(void)23912405{23922392- if (xen_feature(XENFEAT_auto_translated_physmap))23932393- return;23942394-23952406 pv_mmu_ops.set_pte = xen_set_pte;23962407 pv_mmu_ops.set_pmd = xen_set_pmd;23972408 pv_mmu_ops.set_pud = xen_set_pud;···24932510void __init xen_init_mmu_ops(void)24942511{24952512 x86_init.paging.pagetable_init = xen_pagetable_init;24962496-24972497- if (xen_feature(XENFEAT_auto_translated_physmap))24982498- return;2499251325002514 pv_mmu_ops = xen_mmu_ops;25012515···26302650 * this function are redundant and can be ignored.26312651 */2632265226332633- if (xen_feature(XENFEAT_auto_translated_physmap))26342634- return 0;26352635-26362653 if (unlikely(order > MAX_CONTIG_ORDER))26372654 return -ENOMEM;26382655···26652688 unsigned long flags;26662689 int success;26672690 unsigned long vstart;26682668-26692669- if (xen_feature(XENFEAT_auto_translated_physmap))26702670- return;2671269126722692 if (unlikely(order > MAX_CONTIG_ORDER))26732693 return;
+15-12
drivers/block/drbd/drbd_req.c
···315315}316316317317/* still holds resource->req_lock */318318-static int drbd_req_put_completion_ref(struct drbd_request *req, struct bio_and_error *m, int put)318318+static void drbd_req_put_completion_ref(struct drbd_request *req, struct bio_and_error *m, int put)319319{320320 struct drbd_device *device = req->device;321321 D_ASSERT(device, m || (req->rq_state & RQ_POSTPONED));322322323323+ if (!put)324324+ return;325325+323326 if (!atomic_sub_and_test(put, &req->completion_ref))324324- return 0;327327+ return;325328326329 drbd_req_complete(req, m);330330+331331+ /* local completion may still come in later,332332+ * we need to keep the req object around. */333333+ if (req->rq_state & RQ_LOCAL_ABORTED)334334+ return;327335328336 if (req->rq_state & RQ_POSTPONED) {329337 /* don't destroy the req object just yet,330338 * but queue it for retry */331339 drbd_restart_request(req);332332- return 0;340340+ return;333341 }334342335335- return 1;343343+ kref_put(&req->kref, drbd_req_destroy);336344}337345338346static void set_if_null_req_next(struct drbd_peer_device *peer_device, struct drbd_request *req)···527519 if (req->i.waiting)528520 wake_up(&device->misc_wait);529521530530- if (c_put) {531531- if (drbd_req_put_completion_ref(req, m, c_put))532532- kref_put(&req->kref, drbd_req_destroy);533533- } else {534534- kref_put(&req->kref, drbd_req_destroy);535535- }522522+ drbd_req_put_completion_ref(req, m, c_put);523523+ kref_put(&req->kref, drbd_req_destroy);536524}537525538526static void drbd_report_io_error(struct drbd_device *device, struct drbd_request *req)···13701366 }1371136713721368out:13731373- if (drbd_req_put_completion_ref(req, &m, 1))13741374- kref_put(&req->kref, drbd_req_destroy);13691369+ drbd_req_put_completion_ref(req, &m, 1);13751370 spin_unlock_irq(&resource->req_lock);1376137113771372 /* Even though above is a kref_put(), this is safe.
+5-3
drivers/block/xen-blkback/xenbus.c
···504504505505 dev_set_drvdata(&dev->dev, NULL);506506507507- if (be->blkif)507507+ if (be->blkif) {508508 xen_blkif_disconnect(be->blkif);509509510510- /* Put the reference we set in xen_blkif_alloc(). */511511- xen_blkif_put(be->blkif);510510+ /* Put the reference we set in xen_blkif_alloc(). */511511+ xen_blkif_put(be->blkif);512512+ }513513+512514 kfree(be->mode);513515 kfree(be);514516 return 0;
+5-1
drivers/char/lp.c
···859859 } else if (!strcmp(str, "auto")) {860860 parport_nr[0] = LP_PARPORT_AUTO;861861 } else if (!strcmp(str, "none")) {862862- parport_nr[parport_ptr++] = LP_PARPORT_NONE;862862+ if (parport_ptr < LP_NO)863863+ parport_nr[parport_ptr++] = LP_PARPORT_NONE;864864+ else865865+ printk(KERN_INFO "lp: too many ports, %s ignored.\n",866866+ str);863867 } else if (!strcmp(str, "reset")) {864868 reset = 1;865869 }
+5
drivers/char/mem.c
···340340static int mmap_mem(struct file *file, struct vm_area_struct *vma)341341{342342 size_t size = vma->vm_end - vma->vm_start;343343+ phys_addr_t offset = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;344344+345345+ /* It's illegal to wrap around the end of the physical address space. */346346+ if (offset + (phys_addr_t)size < offset)347347+ return -EINVAL;343348344349 if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))345350 return -EINVAL;
···782782783783static void debug_display_dimm_sizes_df(struct amd64_pvt *pvt, u8 ctrl)784784{785785- u32 *dcsb = ctrl ? pvt->csels[1].csbases : pvt->csels[0].csbases;786786- int dimm, size0, size1;785785+ int dimm, size0, size1, cs0, cs1;787786788787 edac_printk(KERN_DEBUG, EDAC_MC, "UMC%d chip selects:\n", ctrl);789788790789 for (dimm = 0; dimm < 4; dimm++) {791790 size0 = 0;791791+ cs0 = dimm * 2;792792793793- if (dcsb[dimm*2] & DCSB_CS_ENABLE)794794- size0 = pvt->ops->dbam_to_cs(pvt, ctrl, 0, dimm);793793+ if (csrow_enabled(cs0, ctrl, pvt))794794+ size0 = pvt->ops->dbam_to_cs(pvt, ctrl, 0, cs0);795795796796 size1 = 0;797797- if (dcsb[dimm*2 + 1] & DCSB_CS_ENABLE)798798- size1 = pvt->ops->dbam_to_cs(pvt, ctrl, 0, dimm);797797+ cs1 = dimm * 2 + 1;798798+799799+ if (csrow_enabled(cs1, ctrl, pvt))800800+ size1 = pvt->ops->dbam_to_cs(pvt, ctrl, 0, cs1);799801800802 amd64_info(EDAC_MC ": %d: %5dMB %d: %5dMB\n",801801- dimm * 2, size0,802802- dimm * 2 + 1, size1);803803+ cs0, size0,804804+ cs1, size1);803805 }804806}805807···27582756 * encompasses27592757 *27602758 */27612761-static u32 get_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr)27592759+static u32 get_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr_orig)27622760{27632763- u32 cs_mode, nr_pages;27642761 u32 dbam = dct ? pvt->dbam1 : pvt->dbam0;27622762+ int csrow_nr = csrow_nr_orig;27632763+ u32 cs_mode, nr_pages;2765276427652765+ if (!pvt->umc)27662766+ csrow_nr >>= 1;2766276727672767- /*27682768- * The math on this doesn't look right on the surface because x/2*4 can27692769- * be simplified to x*2 but this expression makes use of the fact that27702770- * it is integral math where 1/2=0. This intermediate value becomes the27712771- * number of bits to shift the DBAM register to extract the proper CSROW27722772- * field.27732773- */27742774- cs_mode = DBAM_DIMM(csrow_nr / 2, dbam);27682768+ cs_mode = DBAM_DIMM(csrow_nr, dbam);2775276927762776- nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode, (csrow_nr / 2))27772777- << (20 - PAGE_SHIFT);27702770+ nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode, csrow_nr);27712771+ nr_pages <<= 20 - PAGE_SHIFT;2778277227792773 edac_dbg(0, "csrow: %d, channel: %d, DBAM idx: %d\n",27802780- csrow_nr, dct, cs_mode);27742774+ csrow_nr_orig, dct, cs_mode);27812775 edac_dbg(0, "nr_pages/channel: %u\n", nr_pages);2782277627832777 return nr_pages;
+3-9
drivers/firmware/efi/efi-pstore.c
···155155 * efi_pstore_sysfs_entry_iter156156 *157157 * @record: pstore record to pass to callback158158- * @pos: entry to begin iterating from159158 *160159 * You MUST call efivar_enter_iter_begin() before this function, and161160 * efivar_entry_iter_end() afterwards.162161 *163163- * It is possible to begin iteration from an arbitrary entry within164164- * the list by passing @pos. @pos is updated on return to point to165165- * the next entry of the last one passed to efi_pstore_read_func().166166- * To begin iterating from the beginning of the list @pos must be %NULL.167162 */168168-static int efi_pstore_sysfs_entry_iter(struct pstore_record *record,169169- struct efivar_entry **pos)163163+static int efi_pstore_sysfs_entry_iter(struct pstore_record *record)170164{165165+ struct efivar_entry **pos = (struct efivar_entry **)&record->psi->data;171166 struct efivar_entry *entry, *n;172167 struct list_head *head = &efivar_sysfs_list;173168 int size = 0;···213218 */214219static ssize_t efi_pstore_read(struct pstore_record *record)215220{216216- struct efivar_entry *entry = (struct efivar_entry *)record->psi->data;217221 ssize_t size;218222219223 record->buf = kzalloc(EFIVARS_DATA_SIZE_MAX, GFP_KERNEL);···223229 size = -EINTR;224230 goto out;225231 }226226- size = efi_pstore_sysfs_entry_iter(record, &entry);232232+ size = efi_pstore_sysfs_entry_iter(record);227233 efivar_entry_iter_end();228234229235out:
+15-6
drivers/firmware/google/vpd.c
···116116 return VPD_OK;117117118118 info = kzalloc(sizeof(*info), GFP_KERNEL);119119- info->key = kzalloc(key_len + 1, GFP_KERNEL);120120- if (!info->key)119119+ if (!info)121120 return -ENOMEM;121121+ info->key = kzalloc(key_len + 1, GFP_KERNEL);122122+ if (!info->key) {123123+ ret = -ENOMEM;124124+ goto free_info;125125+ }122126123127 memcpy(info->key, key, key_len);124128···139135 list_add_tail(&info->list, &sec->attribs);140136141137 ret = sysfs_create_bin_file(sec->kobj, &info->bin_attr);142142- if (ret) {143143- kfree(info->key);144144- return ret;145145- }138138+ if (ret)139139+ goto free_info_key;146140147141 return 0;142142+143143+free_info_key:144144+ kfree(info->key);145145+free_info:146146+ kfree(info);147147+148148+ return ret;148149}149150150151static void vpd_section_attrib_destroy(struct vpd_section *sec)
···129129 struct vgpu_sched_data *vgpu_data;130130 ktime_t cur_time;131131132132- /* no target to schedule */133133- if (!scheduler->next_vgpu)132132+ /* no need to schedule if next_vgpu is the same with current_vgpu,133133+ * let scheduler chose next_vgpu again by setting it to NULL.134134+ */135135+ if (scheduler->next_vgpu == scheduler->current_vgpu) {136136+ scheduler->next_vgpu = NULL;134137 return;138138+ }135139136140 /*137141 * after the flag is set, workload dispatch thread will
+8-4
drivers/gpu/drm/i915/i915_gem_gtt.c
···195195 u32 pte_flags;196196 int ret;197197198198- ret = vma->vm->allocate_va_range(vma->vm, vma->node.start, vma->size);199199- if (ret)200200- return ret;198198+ if (!(vma->flags & I915_VMA_LOCAL_BIND)) {199199+ ret = vma->vm->allocate_va_range(vma->vm, vma->node.start,200200+ vma->size);201201+ if (ret)202202+ return ret;203203+ }201204202205 vma->pages = vma->obj->mm.pages;203206···23092306 if (flags & I915_VMA_LOCAL_BIND) {23102307 struct i915_hw_ppgtt *appgtt = i915->mm.aliasing_ppgtt;2311230823122312- if (appgtt->base.allocate_va_range) {23092309+ if (!(vma->flags & I915_VMA_LOCAL_BIND) &&23102310+ appgtt->base.allocate_va_range) {23132311 ret = appgtt->base.allocate_va_range(&appgtt->base,23142312 vma->node.start,23152313 vma->node.size);
+7-3
drivers/gpu/drm/i915/i915_reg.h
···30513051#define CLKCFG_FSB_667 (3 << 0) /* hrawclk 166 */30523052#define CLKCFG_FSB_800 (2 << 0) /* hrawclk 200 */30533053#define CLKCFG_FSB_1067 (6 << 0) /* hrawclk 266 */30543054+#define CLKCFG_FSB_1067_ALT (0 << 0) /* hrawclk 266 */30543055#define CLKCFG_FSB_1333 (7 << 0) /* hrawclk 333 */30553055-/* Note, below two are guess */30563056-#define CLKCFG_FSB_1600 (4 << 0) /* hrawclk 400 */30573057-#define CLKCFG_FSB_1600_ALT (0 << 0) /* hrawclk 400 */30563056+/*30573057+ * Note that on at least on ELK the below value is reported for both30583058+ * 333 and 400 MHz BIOS FSB setting, but given that the gmch datasheet30593059+ * lists only 200/266/333 MHz FSB as supported let's decode it as 333 MHz.30603060+ */30613061+#define CLKCFG_FSB_1333_ALT (4 << 0) /* hrawclk 333 */30583062#define CLKCFG_FSB_MASK (7 << 0)30593063#define CLKCFG_MEM_533 (1 << 4)30603064#define CLKCFG_MEM_667 (2 << 4)
+2-4
drivers/gpu/drm/i915/intel_cdclk.c
···17981798 case CLKCFG_FSB_800:17991799 return 200000;18001800 case CLKCFG_FSB_1067:18011801+ case CLKCFG_FSB_1067_ALT:18011802 return 266667;18021803 case CLKCFG_FSB_1333:18041804+ case CLKCFG_FSB_1333_ALT:18031805 return 333333;18041804- /* these two are just a guess; one of them might be right */18051805- case CLKCFG_FSB_1600:18061806- case CLKCFG_FSB_1600_ALT:18071807- return 400000;18081806 default:18091807 return 133333;18101808 }
+3-4
drivers/gpu/drm/i915/intel_dsi.c
···410410 val |= (ULPS_STATE_ENTER | DEVICE_READY);411411 I915_WRITE(MIPI_DEVICE_READY(port), val);412412413413- /* Wait for ULPS Not active */413413+ /* Wait for ULPS active */414414 if (intel_wait_for_register(dev_priv,415415- MIPI_CTRL(port), GLK_ULPS_NOT_ACTIVE,416416- GLK_ULPS_NOT_ACTIVE, 20))417417- DRM_ERROR("ULPS is still active\n");415415+ MIPI_CTRL(port), GLK_ULPS_NOT_ACTIVE, 0, 20))416416+ DRM_ERROR("ULPS not active\n");418417419418 /* Exit ULPS */420419 val = I915_READ(MIPI_DEVICE_READY(port));
···116116 ret = nvkm_firmware_get(subdev->device, f, &sig);117117 if (ret)118118 goto free_data;119119+119120 img->sig = kmemdup(sig->data, sig->size, GFP_KERNEL);120121 if (!img->sig) {121122 ret = -ENOMEM;···127126 img->ucode_data = ls_ucode_img_build(bl, code, data,128127 &img->ucode_desc);129128 if (IS_ERR(img->ucode_data)) {129129+ kfree(img->sig);130130 ret = PTR_ERR(img->ucode_data);131131- goto free_data;131131+ goto free_sig;132132 }133133 img->ucode_size = img->ucode_desc.image_size;134134
+1
drivers/gpu/host1x/Kconfig
···11config TEGRA_HOST1X22 tristate "NVIDIA Tegra host1x driver"33 depends on ARCH_TEGRA || (ARM && COMPILE_TEST)44+ select IOMMU_IOVA if IOMMU_SUPPORT45 help56 Driver for the NVIDIA Tegra host1x hardware.67
+14
drivers/hwmon/coretemp.c
···605605 struct platform_data *pdata;606606607607 /*608608+ * Don't execute this on resume as the offline callback did609609+ * not get executed on suspend.610610+ */611611+ if (cpuhp_tasks_frozen)612612+ return 0;613613+614614+ /*608615 * CPUID.06H.EAX[0] indicates whether the CPU has thermal609616 * sensors. We check this bit only, all the early CPUs610617 * without thermal sensors will be filtered out.···660653 struct platform_data *pd;661654 struct temp_data *tdata;662655 int indx, target;656656+657657+ /*658658+ * Don't execute this on suspend as the device remove locks659659+ * up the machine.660660+ */661661+ if (cpuhp_tasks_frozen)662662+ return 0;663663664664 /* If the physical CPU device does not exist, just return */665665 if (!pdev)
···11201120 * Cache entries may not be populated. So we cannot rely on the11211121 * size of the clean queue.11221122 */11231123- unsigned nr_clean;11241124-11251123 if (idle) {11261124 /*11271125 * We'd like to clean everything.···11271129 return q_size(&mq->dirty) == 0u;11281130 }1129113111301130- nr_clean = from_cblock(mq->cache_size) - q_size(&mq->dirty);11311131- return (nr_clean + btracker_nr_writebacks_queued(mq->bg_work)) >=11321132- percent_to_target(mq, CLEAN_TARGET);11321132+ /*11331133+ * If we're busy we don't worry about cleaning at all.11341134+ */11351135+ return true;11331136}1134113711351135-static bool free_target_met(struct smq_policy *mq, bool idle)11381138+static bool free_target_met(struct smq_policy *mq)11361139{11371140 unsigned nr_free;11381138-11391139- if (!idle)11401140- return true;1141114111421142 nr_free = from_cblock(mq->cache_size) - mq->cache_alloc.nr_allocated;11431143 return (nr_free + btracker_nr_demotions_queued(mq->bg_work)) >=···11861190 if (unlikely(WARN_ON_ONCE(!mq->migrations_allowed)))11871191 return;1188119211891189- e = q_peek(&mq->clean, mq->clean.nr_levels, true);11931193+ e = q_peek(&mq->clean, mq->clean.nr_levels / 2, true);11901194 if (!e) {11911191- if (!clean_target_met(mq, false))11951195+ if (!clean_target_met(mq, true))11921196 queue_writeback(mq);11931197 return;11941198 }···12161220 * We always claim to be 'idle' to ensure some demotions happen12171221 * with continuous loads.12181222 */12191219- if (!free_target_met(mq, true))12231223+ if (!free_target_met(mq))12201224 queue_demotion(mq);12211225 return;12221226 }···14171421 spin_lock_irqsave(&mq->lock, flags);14181422 r = btracker_issue(mq->bg_work, result);14191423 if (r == -ENODATA) {14201420- /* find some writeback work to do */14211421- if (mq->migrations_allowed && !free_target_met(mq, idle))14221422- queue_demotion(mq);14231423-14241424- else if (!clean_target_met(mq, idle))14241424+ if (!clean_target_met(mq, idle)) {14251425 queue_writeback(mq);14261426-14271427- r = btracker_issue(mq->bg_work, result);14261426+ r = btracker_issue(mq->bg_work, result);14271427+ }14281428 }14291429 spin_unlock_irqrestore(&mq->lock, flags);14301430···14441452 clear_pending(mq, e);14451453 if (success) {14461454 e->oblock = work->oblock;14551455+ e->level = NR_CACHE_LEVELS - 1;14471456 push(mq, e);14481457 // h, q, a14491458 } else {
+13-14
drivers/md/dm-cache-target.c
···94949595static void __iot_io_end(struct io_tracker *iot, sector_t len)9696{9797+ if (!len)9898+ return;9999+97100 iot->in_flight -= len;98101 if (!iot->in_flight)99102 iot->idle_time = jiffies;···477474 spinlock_t invalidation_lock;478475 struct list_head invalidation_requests;479476480480- struct io_tracker origin_tracker;477477+ struct io_tracker tracker;481478482479 struct work_struct commit_ws;483480 struct batcher committer;···904901905902static bool accountable_bio(struct cache *cache, struct bio *bio)906903{907907- return ((bio->bi_bdev == cache->origin_dev->bdev) &&908908- bio_op(bio) != REQ_OP_DISCARD);904904+ return bio_op(bio) != REQ_OP_DISCARD;909905}910906911907static void accounted_begin(struct cache *cache, struct bio *bio)···914912915913 if (accountable_bio(cache, bio)) {916914 pb->len = bio_sectors(bio);917917- iot_io_begin(&cache->origin_tracker, pb->len);915915+ iot_io_begin(&cache->tracker, pb->len);918916 }919917}920918···923921 size_t pb_data_size = get_per_bio_data_size(cache);924922 struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);925923926926- iot_io_end(&cache->origin_tracker, pb->len);924924+ iot_io_end(&cache->tracker, pb->len);927925}928926929927static void accounted_request(struct cache *cache, struct bio *bio)···1718171617191717enum busy {17201718 IDLE,17211721- MODERATE,17221719 BUSY17231720};1724172117251722static enum busy spare_migration_bandwidth(struct cache *cache)17261723{17271727- bool idle = iot_idle_for(&cache->origin_tracker, HZ);17241724+ bool idle = iot_idle_for(&cache->tracker, HZ);17281725 sector_t current_volume = (atomic_read(&cache->nr_io_migrations) + 1) *17291726 cache->sectors_per_block;1730172717311731- if (current_volume <= cache->migration_threshold)17321732- return idle ? IDLE : MODERATE;17281728+ if (idle && current_volume <= cache->migration_threshold)17291729+ return IDLE;17331730 else17341734- return idle ? MODERATE : BUSY;17311731+ return BUSY;17351732}1736173317371734static void inc_hit_counter(struct cache *cache, struct bio *bio)···2046204520472046 for (;;) {20482047 b = spare_migration_bandwidth(cache);20492049- if (b == BUSY)20502050- break;2051204820522049 r = policy_get_background_work(cache->policy, b == IDLE, &op);20532050 if (r == -ENODATA)···2716271727172718 batcher_init(&cache->committer, commit_op, cache,27182719 issue_op, cache, cache->wq);27192719- iot_init(&cache->origin_tracker);27202720+ iot_init(&cache->tracker);2720272127212722 init_rwsem(&cache->background_work_lock);27222723 prevent_background_work(cache);···2940294129412942 cancel_delayed_work(&cache->waker);29422943 flush_workqueue(cache->wq);29432943- WARN_ON(cache->origin_tracker.in_flight);29442944+ WARN_ON(cache->tracker.in_flight);2944294529452946 /*29462947 * If it's a flush suspend there won't be any deferred bios, so this
+11-8
drivers/md/dm-mpath.c
···447447 * it has been invoked.448448 */449449#define dm_report_EIO(m) \450450-({ \450450+do { \451451 struct mapped_device *md = dm_table_get_md((m)->ti->table); \452452 \453453 pr_debug("%s: returning EIO; QIFNP = %d; SQIFNP = %d; DNFS = %d\n", \···455455 test_bit(MPATHF_QUEUE_IF_NO_PATH, &(m)->flags), \456456 test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &(m)->flags), \457457 dm_noflush_suspending((m)->ti)); \458458- -EIO; \459459-})458458+} while (0)460459461460/*462461 * Map cloned requests (request-based multipath)···480481 if (!pgpath) {481482 if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))482483 return DM_MAPIO_DELAY_REQUEUE;483483- return dm_report_EIO(m); /* Failed */484484+ dm_report_EIO(m); /* Failed */485485+ return DM_MAPIO_KILL;484486 } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) ||485487 test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) {486488 if (pg_init_all_paths(m))···558558 if (!pgpath) {559559 if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))560560 return DM_MAPIO_REQUEUE;561561- return dm_report_EIO(m);561561+ dm_report_EIO(m);562562+ return -EIO;562563 }563564564565 mpio->pgpath = pgpath;···14941493 if (atomic_read(&m->nr_valid_paths) == 0 &&14951494 !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) {14961495 if (error == -EIO)14971497- error = dm_report_EIO(m);14961496+ dm_report_EIO(m);14981497 /* complete with the original error */14991498 r = DM_ENDIO_DONE;15001499 }···15251524 fail_path(mpio->pgpath);1526152515271526 if (atomic_read(&m->nr_valid_paths) == 0 &&15281528- !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))15291529- return dm_report_EIO(m);15271527+ !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) {15281528+ dm_report_EIO(m);15291529+ return -EIO;15301530+ }1530153115311532 /* Queue for the daemon to resubmit */15321533 dm_bio_restore(get_bio_details_from_bio(clone), clone);
+1
drivers/md/dm-rq.c
···507507 case DM_MAPIO_KILL:508508 /* The target wants to complete the I/O */509509 dm_kill_unmapped_request(rq, -EIO);510510+ break;510511 default:511512 DMWARN("unimplemented target map return value: %d", r);512513 BUG();
···80228022 * may proceed without blocking. It is important to call this before80238023 * attempting a GFP_KERNEL allocation while holding the mddev lock.80248024 * Must be called with mddev_lock held.80258025- *80268026- * In the ->external case MD_SB_CHANGE_PENDING can not be cleared until mddev->lock80278027- * is dropped, so return -EAGAIN after notifying userspace.80288025 */80298029-int md_allow_write(struct mddev *mddev)80268026+void md_allow_write(struct mddev *mddev)80308027{80318028 if (!mddev->pers)80328032- return 0;80298029+ return;80338030 if (mddev->ro)80348034- return 0;80318031+ return;80358032 if (!mddev->pers->sync_request)80368036- return 0;80338033+ return;8037803480388035 spin_lock(&mddev->lock);80398036 if (mddev->in_sync) {···80438046 spin_unlock(&mddev->lock);80448047 md_update_sb(mddev, 0);80458048 sysfs_notify_dirent_safe(mddev->sysfs_state);80498049+ /* wait for the dirty state to be recorded in the metadata */80508050+ wait_event(mddev->sb_wait,80518051+ !test_bit(MD_SB_CHANGE_CLEAN, &mddev->sb_flags) &&80528052+ !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags));80468053 } else80478054 spin_unlock(&mddev->lock);80488048-80498049- if (test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags))80508050- return -EAGAIN;80518051- else80528052- return 0;80538055}80548056EXPORT_SYMBOL_GPL(md_allow_write);80558057
···2424#include "md.h"2525#include "raid5.h"2626#include "bitmap.h"2727+#include "raid5-log.h"27282829/*2930 * metadata/data stored in disk with 4k size unit (a block) regardless···623622 __r5l_set_io_unit_state(io, IO_UNIT_IO_START);624623 spin_unlock_irqrestore(&log->io_list_lock, flags);625624625625+ /*626626+ * In case of journal device failures, submit_bio will get error627627+ * and calls endio, then active stripes will continue write628628+ * process. Therefore, it is not necessary to check Faulty bit629629+ * of journal device here.630630+ *631631+ * We can't check split_bio after current_bio is submitted. If632632+ * io->split_bio is null, after current_bio is submitted, current_bio633633+ * might already be completed and the io_unit is freed. We submit634634+ * split_bio first to avoid the issue.635635+ */636636+ if (io->split_bio) {637637+ if (io->has_flush)638638+ io->split_bio->bi_opf |= REQ_PREFLUSH;639639+ if (io->has_fua)640640+ io->split_bio->bi_opf |= REQ_FUA;641641+ submit_bio(io->split_bio);642642+ }643643+626644 if (io->has_flush)627645 io->current_bio->bi_opf |= REQ_PREFLUSH;628646 if (io->has_fua)629647 io->current_bio->bi_opf |= REQ_FUA;630648 submit_bio(io->current_bio);631631-632632- if (!io->split_bio)633633- return;634634-635635- if (io->has_flush)636636- io->split_bio->bi_opf |= REQ_PREFLUSH;637637- if (io->has_fua)638638- io->split_bio->bi_opf |= REQ_FUA;639639- submit_bio(io->split_bio);640649}641650642651/* deferred io_unit will be dispatched here */···681670 return;682671 pr_info("md/raid:%s: Disabling writeback cache for degraded array.\n",683672 mdname(mddev));673673+674674+ /* wait superblock change before suspend */675675+ wait_event(mddev->sb_wait,676676+ !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags));677677+684678 mddev_suspend(mddev);685679 log->r5c_journal_mode = R5C_JOURNAL_MODE_WRITE_THROUGH;686680 mddev_resume(mddev);···26372621 * When run in degraded mode, array is set to write-through mode.26382622 * This check helps drain pending write safely in the transition to26392623 * write-through mode.26242624+ *26252625+ * When a stripe is syncing, the write is also handled in write26262626+ * through mode.26402627 */26412641- if (s->failed) {26282628+ if (s->failed || test_bit(STRIPE_SYNCING, &sh->state)) {26422629 r5c_make_stripe_write_out(sh);26432630 return -EAGAIN;26442631 }···28442825 }2845282628462827 r5l_append_flush_payload(log, sh->sector);28282828+ /* stripe is flused to raid disks, we can do resync now */28292829+ if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state))28302830+ set_bit(STRIPE_HANDLE, &sh->state);28472831}2848283228492833int r5c_cache_data(struct r5l_log *log, struct stripe_head *sh)···29952973 return ret;29962974}2997297529982998-void r5c_update_on_rdev_error(struct mddev *mddev)29762976+void r5c_update_on_rdev_error(struct mddev *mddev, struct md_rdev *rdev)29992977{30002978 struct r5conf *conf = mddev->private;30012979 struct r5l_log *log = conf->log;···30032981 if (!log)30042982 return;3005298330063006- if (raid5_calc_degraded(conf) > 0 &&29842984+ if ((raid5_calc_degraded(conf) > 0 ||29852985+ test_bit(Journal, &rdev->flags)) &&30072986 conf->log->r5c_journal_mode == R5C_JOURNAL_MODE_WRITE_BACK)30082987 schedule_work(&log->disable_writeback_work);30092988}
···103103static inline void lock_all_device_hash_locks_irq(struct r5conf *conf)104104{105105 int i;106106- local_irq_disable();107107- spin_lock(conf->hash_locks);106106+ spin_lock_irq(conf->hash_locks);108107 for (i = 1; i < NR_STRIPE_HASH_LOCKS; i++)109108 spin_lock_nest_lock(conf->hash_locks + i, conf->hash_locks);110109 spin_lock(&conf->device_lock);···113114{114115 int i;115116 spin_unlock(&conf->device_lock);116116- for (i = NR_STRIPE_HASH_LOCKS; i; i--)117117- spin_unlock(conf->hash_locks + i - 1);118118- local_irq_enable();117117+ for (i = NR_STRIPE_HASH_LOCKS - 1; i; i--)118118+ spin_unlock(conf->hash_locks + i);119119+ spin_unlock_irq(conf->hash_locks);119120}120121121122/* Find first data disk in a raid6 stripe */···233234 if (test_bit(R5_InJournal, &sh->dev[i].flags))234235 injournal++;235236 /*236236- * When quiesce in r5c write back, set STRIPE_HANDLE for stripes with237237- * data in journal, so they are not released to cached lists237237+ * In the following cases, the stripe cannot be released to cached238238+ * lists. Therefore, we make the stripe write out and set239239+ * STRIPE_HANDLE:240240+ * 1. when quiesce in r5c write back;241241+ * 2. when resync is requested fot the stripe.238242 */239239- if (conf->quiesce && r5c_is_writeback(conf->log) &&240240- !test_bit(STRIPE_HANDLE, &sh->state) && injournal != 0) {243243+ if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state) ||244244+ (conf->quiesce && r5c_is_writeback(conf->log) &&245245+ !test_bit(STRIPE_HANDLE, &sh->state) && injournal != 0)) {241246 if (test_bit(STRIPE_R5C_CACHING, &sh->state))242247 r5c_make_stripe_write_out(sh);243248 set_bit(STRIPE_HANDLE, &sh->state);···717714718715static void lock_two_stripes(struct stripe_head *sh1, struct stripe_head *sh2)719716{720720- local_irq_disable();721717 if (sh1 > sh2) {722722- spin_lock(&sh2->stripe_lock);718718+ spin_lock_irq(&sh2->stripe_lock);723719 spin_lock_nested(&sh1->stripe_lock, 1);724720 } else {725725- spin_lock(&sh1->stripe_lock);721721+ spin_lock_irq(&sh1->stripe_lock);726722 spin_lock_nested(&sh2->stripe_lock, 1);727723 }728724}···729727static void unlock_two_stripes(struct stripe_head *sh1, struct stripe_head *sh2)730728{731729 spin_unlock(&sh1->stripe_lock);732732- spin_unlock(&sh2->stripe_lock);733733- local_irq_enable();730730+ spin_unlock_irq(&sh2->stripe_lock);734731}735732736733/* Only freshly new full stripe normal write stripe can be added to a batch list */···23132312 struct stripe_head *osh, *nsh;23142313 LIST_HEAD(newstripes);23152314 struct disk_info *ndisks;23162316- int err;23152315+ int err = 0;23172316 struct kmem_cache *sc;23182317 int i;23192318 int hash, cnt;2320231923212321- err = md_allow_write(conf->mddev);23222322- if (err)23232323- return err;23202320+ md_allow_write(conf->mddev);2324232123252322 /* Step 1 */23262323 sc = kmem_cache_create(conf->cache_name[1-conf->active_name],···26932694 bdevname(rdev->bdev, b),26942695 mdname(mddev),26952696 conf->raid_disks - mddev->degraded);26962696- r5c_update_on_rdev_error(mddev);26972697+ r5c_update_on_rdev_error(mddev, rdev);26972698}2698269926992700/*···30543055 * When LOG_CRITICAL, stripes with injournal == 0 will be sent to30553056 * no_space_stripes list.30563057 *30583058+ * 3. during journal failure30593059+ * In journal failure, we try to flush all cached data to raid disks30603060+ * based on data in stripe cache. The array is read-only to upper30613061+ * layers, so we would skip all pending writes.30623062+ *30573063 */30583064static inline bool delay_towrite(struct r5conf *conf,30593065 struct r5dev *dev,···30713067 /* case 2 above */30723068 if (test_bit(R5C_LOG_CRITICAL, &conf->cache_state) &&30733069 s->injournal > 0)30703070+ return true;30713071+ /* case 3 above */30723072+ if (s->log_failed && s->injournal)30743073 return true;30753074 return false;30763075}···4660465346614654 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state) && !sh->batch_head) {46624655 spin_lock(&sh->stripe_lock);46634663- /* Cannot process 'sync' concurrently with 'discard' */46644664- if (!test_bit(STRIPE_DISCARD, &sh->state) &&46564656+ /*46574657+ * Cannot process 'sync' concurrently with 'discard'.46584658+ * Flush data in r5cache before 'sync'.46594659+ */46604660+ if (!test_bit(STRIPE_R5C_PARTIAL_STRIPE, &sh->state) &&46614661+ !test_bit(STRIPE_R5C_FULL_STRIPE, &sh->state) &&46624662+ !test_bit(STRIPE_DISCARD, &sh->state) &&46654663 test_and_clear_bit(STRIPE_SYNC_REQUESTED, &sh->state)) {46664664 set_bit(STRIPE_SYNCING, &sh->state);46674665 clear_bit(STRIPE_INSYNC, &sh->state);···47134701 " to_write=%d failed=%d failed_num=%d,%d\n",47144702 s.locked, s.uptodate, s.to_read, s.to_write, s.failed,47154703 s.failed_num[0], s.failed_num[1]);47164716- /* check if the array has lost more than max_degraded devices and,47044704+ /*47054705+ * check if the array has lost more than max_degraded devices and,47174706 * if so, some requests might need to be failed.47074707+ *47084708+ * When journal device failed (log_failed), we will only process47094709+ * the stripe if there is data need write to raid disks47184710 */47194719- if (s.failed > conf->max_degraded || s.log_failed) {47114711+ if (s.failed > conf->max_degraded ||47124712+ (s.log_failed && s.injournal == 0)) {47204713 sh->check_state = 0;47214714 sh->reconstruct_state = 0;47224715 break_stripe_batch_list(sh, 0);···52945277 struct stripe_head *sh, *tmp;52955278 struct list_head *handle_list = NULL;52965279 struct r5worker_group *wg;52975297- bool second_try = !r5c_is_writeback(conf->log);52985298- bool try_loprio = test_bit(R5C_LOG_TIGHT, &conf->cache_state);52805280+ bool second_try = !r5c_is_writeback(conf->log) &&52815281+ !r5l_log_disk_error(conf);52825282+ bool try_loprio = test_bit(R5C_LOG_TIGHT, &conf->cache_state) ||52835283+ r5l_log_disk_error(conf);5299528453005285again:53015286 wg = NULL;···63326313raid5_set_cache_size(struct mddev *mddev, int size)63336314{63346315 struct r5conf *conf = mddev->private;63356335- int err;6336631663376317 if (size <= 16 || size > 32768)63386318 return -EINVAL;···63436325 ;63446326 mutex_unlock(&conf->cache_size_mutex);6345632763466346-63476347- err = md_allow_write(mddev);63486348- if (err)63496349- return err;63286328+ md_allow_write(mddev);6350632963516330 mutex_lock(&conf->cache_size_mutex);63526331 while (size > conf->max_nr_stripes)···75457530 * neilb: there is no locking about new writes here,75467531 * so this cannot be safe.75477532 */75487548- if (atomic_read(&conf->active_stripes)) {75337533+ if (atomic_read(&conf->active_stripes) ||75347534+ atomic_read(&conf->r5c_cached_full_stripes) ||75357535+ atomic_read(&conf->r5c_cached_partial_stripes)) {75497536 return -EBUSY;75507537 }75517538 log_exit(conf);
···492492493493config PCI_ENDPOINT_TEST494494 depends on PCI495495+ select CRC32495496 tristate "PCI Endpoint Test driver"496497 ---help---497498 Enable this configuration option to enable the host side test driver
···118118 /* FWD rules that point on this flow table */119119 struct list_head fwd_rules;120120 u32 flags;121121- u32 underlay_qpn;122121};123122124123struct mlx5_fc_cache {···194195 struct mlx5_flow_table *root_ft;195196 /* Should be held when chaining flow tables */196197 struct mutex chain_lock;198198+ u32 underlay_qpn;197199};198200199201int mlx5_init_fc_stats(struct mlx5_core_dev *dev);
+9-2
drivers/net/ethernet/mellanox/mlx5/core/ipoib.c
···66666767 mlx5e_build_nic_params(mdev, &priv->channels.params, profile->max_nch(mdev));68686969+ /* Override RQ params as IPoIB supports only LINKED LIST RQ for now */7070+ mlx5e_set_rq_type_params(mdev, &priv->channels.params, MLX5_WQ_TYPE_LINKED_LIST);7171+ priv->channels.params.lro_en = false;7272+6973 mutex_init(&priv->state_lock);70747175 netdev->hw_features |= NETIF_F_SG;···160156161157static void mlx5i_destroy_underlay_qp(struct mlx5_core_dev *mdev, struct mlx5_core_qp *qp)162158{159159+ mlx5_fs_remove_rx_underlay_qpn(mdev, qp->qpn);160160+163161 mlx5_core_destroy_qp(mdev, qp);164162}165163···175169 mlx5_core_warn(priv->mdev, "create underlay QP failed, %d\n", err);176170 return err;177171 }172172+173173+ mlx5_fs_add_rx_underlay_qpn(priv->mdev, ipriv->qp.qpn);178174179175 err = mlx5e_create_tis(priv->mdev, 0 /* tc */, ipriv->qp.qpn, &priv->tisn[0]);180176 if (err) {···197189198190static int mlx5i_create_flow_steering(struct mlx5e_priv *priv)199191{200200- struct mlx5i_priv *ipriv = priv->ppriv;201192 int err;202193203194 priv->fs.ns = mlx5_get_flow_namespace(priv->mdev,···212205 priv->netdev->hw_features &= ~NETIF_F_NTUPLE;213206 }214207215215- err = mlx5e_create_ttc_table(priv, ipriv->qp.qpn);208208+ err = mlx5e_create_ttc_table(priv);216209 if (err) {217210 netdev_err(priv->netdev, "Failed to create ttc table, err=%d\n",218211 err);
···206206{207207 unsigned int *p_counter_index;208208209209+ if (!mlxsw_sp_rif_counter_valid_get(rif, dir))210210+ return;211211+209212 p_counter_index = mlxsw_sp_rif_p_counter_get(rif, dir);210213 if (WARN_ON(!p_counter_index))211214 return;
···14971497 err = mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid,14981498 adding, true);14991499 if (err) {15001500- if (net_ratelimit())15011501- netdev_err(mlxsw_sp_port->dev, "Failed to set FDB entry\n");15001500+ dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to set FDB entry\n");15021501 return;15031502 }15041503···15571558 err = mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp, lag_id, mac, fid, lag_vid,15581559 adding, true);15591560 if (err) {15601560- if (net_ratelimit())15611561- netdev_err(mlxsw_sp_port->dev, "Failed to set FDB entry\n");15611561+ dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to set FDB entry\n");15621562 return;15631563 }15641564
···486486 u32 ret = 0;487487 struct qlcnic_adapter *adapter = netdev_priv(dev);488488489489+ if (qlcnic_83xx_check(adapter))490490+ qlcnic_83xx_get_port_type(adapter);491491+489492 if (adapter->ahw->port_type != QLCNIC_GBE)490493 return -EOPNOTSUPP;491494
+6-4
drivers/net/ethernet/qualcomm/qca_spi.c
···296296297297 /* Allocate rx SKB if we don't have one available. */298298 if (!qca->rx_skb) {299299- qca->rx_skb = netdev_alloc_skb(net_dev,300300- net_dev->mtu + VLAN_ETH_HLEN);299299+ qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,300300+ net_dev->mtu +301301+ VLAN_ETH_HLEN);301302 if (!qca->rx_skb) {302303 netdev_dbg(net_dev, "out of RX resources\n");303304 qca->stats.out_of_mem++;···378377 qca->rx_skb, qca->rx_skb->dev);379378 qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;380379 netif_rx_ni(qca->rx_skb);381381- qca->rx_skb = netdev_alloc_skb(net_dev,380380+ qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,382381 net_dev->mtu + VLAN_ETH_HLEN);383382 if (!qca->rx_skb) {384383 netdev_dbg(net_dev, "out of RX resources\n");···760759 if (!qca->rx_buffer)761760 return -ENOBUFS;762761763763- qca->rx_skb = netdev_alloc_skb(dev, qca->net_dev->mtu + VLAN_ETH_HLEN);762762+ qca->rx_skb = netdev_alloc_skb_ip_align(dev, qca->net_dev->mtu +763763+ VLAN_ETH_HLEN);764764 if (!qca->rx_skb) {765765 kfree(qca->rx_buffer);766766 netdev_info(qca->net_dev, "Failed to allocate RX sk_buff.\n");
+2-1
drivers/net/ethernet/renesas/sh_eth.c
···32203220 /* MDIO bus init */32213221 ret = sh_mdio_init(mdp, pd);32223222 if (ret) {32233223- dev_err(&ndev->dev, "failed to initialise MDIO\n");32233223+ if (ret != -EPROBE_DEFER)32243224+ dev_err(&pdev->dev, "MDIO init failed: %d\n", ret);32243225 goto out_release;32253226 }32263227
+6-2
drivers/net/ethernet/sfc/nic.h
···1818#include "mcdi.h"19192020enum {2121- EFX_REV_SIENA_A0 = 0,2222- EFX_REV_HUNT_A0 = 1,2121+ /* Revisions 0-2 were Falcon A0, A1 and B0 respectively.2222+ * They are not supported by this driver but these revision numbers2323+ * form part of the ethtool API for register dumping.2424+ */2525+ EFX_REV_SIENA_A0 = 3,2626+ EFX_REV_HUNT_A0 = 4,2327};24282529static inline int efx_nic_rev(struct efx_nic *efx)
···1353135313541354 tx_pipe->dma_channel = knav_dma_open_channel(dev,13551355 tx_pipe->dma_chan_name, &config);13561356- if (IS_ERR_OR_NULL(tx_pipe->dma_channel)) {13561356+ if (IS_ERR(tx_pipe->dma_channel)) {13571357 dev_err(dev, "failed opening tx chan(%s)\n",13581358 tx_pipe->dma_chan_name);13591359+ ret = PTR_ERR(tx_pipe->dma_channel);13591360 goto err;13601361 }13611362···1674167316751674 netcp->rx_channel = knav_dma_open_channel(netcp->netcp_device->device,16761675 netcp->dma_chan_name, &config);16771677- if (IS_ERR_OR_NULL(netcp->rx_channel)) {16761676+ if (IS_ERR(netcp->rx_channel)) {16781677 dev_err(netcp->ndev_dev, "failed opening rx chan(%s\n",16791678 netcp->dma_chan_name);16791679+ ret = PTR_ERR(netcp->rx_channel);16801680 goto fail;16811681 }16821682
-1
drivers/net/ethernet/ti/netcp_ethss.c
···26512651 case HWTSTAMP_FILTER_NONE:26522652 cpts_rx_enable(cpts, 0);26532653 break;26542654- case HWTSTAMP_FILTER_ALL:26552654 case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:26562655 case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:26572656 case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
+1-1
drivers/net/irda/irda-usb.c
···10771077 * are "42101001.sb" or "42101002.sb"10781078 */10791079 sprintf(stir421x_fw_name, "4210%4X.sb",10801080- self->usbdev->descriptor.bcdDevice);10801080+ le16_to_cpu(self->usbdev->descriptor.bcdDevice));10811081 ret = request_firmware(&fw, stir421x_fw_name, &self->usbdev->dev);10821082 if (ret < 0)10831083 return ret;
···29622962 /* we need to enable NAPI, otherwise dev_close will deadlock */29632963 for (i = 0; i < adapter->num_rx_queues; i++)29642964 napi_enable(&adapter->rx_queue[i].napi);29652965+ /*29662966+ * Need to clear the quiesce bit to ensure that vmxnet3_close29672967+ * can quiesce the device properly29682968+ */29692969+ clear_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state);29652970 dev_close(adapter->netdev);29662971}29672972
+2-1
drivers/net/vrf.c
···989989990990static int vrf_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)991991{992992+ kfree_skb(skb);992993 return 0;993994}994995···999998{1000999 struct net *net = dev_net(dev);1001100010021002- if (NF_HOOK(pf, hook, net, NULL, skb, dev, NULL, vrf_rcv_finish) < 0)10011001+ if (nf_hook(pf, hook, net, NULL, skb, dev, NULL, vrf_rcv_finish) != 1)10031002 skb = NULL; /* kfree_skb(skb) handled by nf code */1004100310051004 return skb;
···517517{518518 int cpu, idx, cnt;519519520520- if (!(tgtport->ops->target_features &521521- NVMET_FCTGTFEAT_NEEDS_CMD_CPUSCHED) ||522522- tgtport->ops->max_hw_queues == 1)520520+ if (tgtport->ops->max_hw_queues == 1)523521 return WORK_CPU_UNBOUND;524522525523 /* Simple cpu selection based on qid modulo active cpu count */
-1
drivers/nvme/target/fcloop.c
···698698 .dma_boundary = FCLOOP_DMABOUND_4G,699699 /* optional features */700700 .target_features = NVMET_FCTGTFEAT_CMD_IN_ISR |701701- NVMET_FCTGTFEAT_NEEDS_CMD_CPUSCHED |702701 NVMET_FCTGTFEAT_OPDONE_IN_ISR,703702 /* sizes of additional private data for data structures */704703 .target_priv_sz = sizeof(struct fcloop_tport),
···567567 rsp->n_rdma = 0;568568569569 if (unlikely(wc->status != IB_WC_SUCCESS)) {570570+ nvmet_req_uninit(&rsp->req);570571 nvmet_rdma_release_rsp(rsp);571572 if (wc->status != IB_WC_WR_FLUSH_ERR) {572573 pr_info("RDMA READ for CQE 0x%p failed with status %s (%d).\n",
+3
drivers/of/fdt.c
···507507508508 /* Allocate memory for the expanded device tree */509509 mem = dt_alloc(size + 4, __alignof__(struct device_node));510510+ if (!mem)511511+ return NULL;512512+510513 memset(mem, 0, size);511514512515 *(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef);
+1-1
drivers/of/of_reserved_mem.c
···197197 const struct of_device_id *i;198198199199 for (i = __reservedmem_of_table; i < &__rmem_of_table_sentinel; i++) {200200- int const (*initfn)(struct reserved_mem *rmem) = i->data;200200+ reservedmem_of_init_fn initfn = i->data;201201 const char *compat = i->compatible;202202203203 if (!of_flat_dt_is_compatible(rmem->fdt_node, compat))
+2-2
drivers/s390/cio/ccwgroup.c
···3535static void __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev)3636{3737 int i;3838- char str[8];3838+ char str[16];39394040 for (i = 0; i < gdev->count; i++) {4141 sprintf(str, "cdev%d", i);···238238239239static int __ccwgroup_create_symlinks(struct ccwgroup_device *gdev)240240{241241- char str[8];241241+ char str[16];242242 int i, rc;243243244244 for (i = 0; i < gdev->count; i++) {
+1-1
drivers/s390/cio/qdio_debug.h
···1111#include "qdio.h"12121313/* that gives us 15 characters in the text event views */1414-#define QDIO_DBF_LEN 161414+#define QDIO_DBF_LEN 3215151616extern debug_info_t *qdio_dbf_setup;1717extern debug_info_t *qdio_dbf_error;
···42044204 /* Reset HBA */42054205 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,42064206 "0325 Reset HBA Data: x%x x%x\n",42074207- phba->pport->port_state, psli->sli_flag);42074207+ (phba->pport) ? phba->pport->port_state : 0,42084208+ psli->sli_flag);4208420942094210 /* perform board reset */42104211 phba->fc_eventTag = 0;42114212 phba->link_events = 0;42124212- phba->pport->fc_myDID = 0;42134213- phba->pport->fc_prevDID = 0;42134213+ if (phba->pport) {42144214+ phba->pport->fc_myDID = 0;42154215+ phba->pport->fc_prevDID = 0;42164216+ }4214421742154218 /* Turn off parity checking and serr during the physical reset */42164219 pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value);···43394336 /* Restart HBA */43404337 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,43414338 "0337 Restart HBA Data: x%x x%x\n",43424342- phba->pport->port_state, psli->sli_flag);43394339+ (phba->pport) ? phba->pport->port_state : 0,43404340+ psli->sli_flag);4343434143444342 word0 = 0;43454343 mb = (MAILBOX_t *) &word0;···43544350 readl(to_slim); /* flush */4355435143564352 /* Only skip post after fc_ffinit is completed */43574357- if (phba->pport->port_state)43534353+ if (phba->pport && phba->pport->port_state)43584354 word0 = 1; /* This is really setting up word1 */43594355 else43604356 word0 = 0; /* This is really setting up word1 */···43634359 readl(to_slim); /* flush */4364436043654361 lpfc_sli_brdreset(phba);43664366- phba->pport->stopped = 0;43624362+ if (phba->pport)43634363+ phba->pport->stopped = 0;43674364 phba->link_state = LPFC_INIT_START;43684365 phba->hba_flag = 0;43694366 spin_unlock_irq(&phba->hbalock);···44514446 * iteration, the function will restart the HBA again. The function returns44524447 * zero if HBA successfully restarted else returns negative error code.44534448 **/44544454-static int44494449+int44554450lpfc_sli_chipset_init(struct lpfc_hba *phba)44564451{44574452 uint32_t status, i = 0;
-3
drivers/scsi/pmcraid.c
···37703770 pmcraid_err("couldn't build passthrough ioadls\n");37713771 goto out_free_cmd;37723772 }37733773- } else if (request_size < 0) {37743774- rc = -EINVAL;37753775- goto out_free_cmd;37763773 }3777377437783775 /* If data is being written into the device, copy the data from user
+1-1
drivers/scsi/qedf/qedf.h
···259259 uint16_t task_id;260260 uint32_t port_id; /* Remote port fabric ID */261261 int lun;262262- char op; /* SCSI CDB */262262+ unsigned char op; /* SCSI CDB */263263 uint8_t lba[4];264264 unsigned int bufflen; /* SCSI buffer length */265265 unsigned int sg_count; /* Number of SG elements */
···2233config IMX7_PM_DOMAINS44 bool "i.MX7 PM domains"55- select PM_GENERIC_DOMAINS65 depends on SOC_IMX7D || (COMPILE_TEST && OF)66+ depends on PM77+ select PM_GENERIC_DOMAINS78 default y if SOC_IMX7D89910endmenu
+1-1
drivers/soc/ti/knav_dma.c
···413413 * @name: slave channel name414414 * @config: dma configuration parameters415415 *416416- * Returns pointer to appropriate DMA channel on success or NULL.416416+ * Returns pointer to appropriate DMA channel on success or error.417417 */418418void *knav_dma_open_channel(struct device *dev, const char *name,419419 struct knav_dma_cfg *config)
-51
drivers/staging/android/ion/devicetree.txt
···11-Ion Memory Manager22-33-Ion is a memory manager that allows for sharing of buffers via dma-buf.44-Ion allows for different types of allocation via an abstraction called55-a 'heap'. A heap represents a specific type of memory. Each heap has66-a different type. There can be multiple instances of the same heap77-type.88-99-Specific heap instances are tied to heap IDs. Heap IDs are not to be specified1010-in the devicetree.1111-1212-Required properties for Ion1313-1414-- compatible: "linux,ion" PLUS a compatible property for the device1515-1616-All child nodes of a linux,ion node are interpreted as heaps1717-1818-required properties for heaps1919-2020-- compatible: compatible string for a heap type PLUS a compatible property2121-for the specific instance of the heap. Current heap types2222--- linux,ion-heap-system2323--- linux,ion-heap-system-contig2424--- linux,ion-heap-carveout2525--- linux,ion-heap-chunk2626--- linux,ion-heap-dma2727--- linux,ion-heap-custom2828-2929-Optional properties3030-- memory-region: A phandle to a memory region. Required for DMA heap type3131-(see reserved-memory.txt for details on the reservation)3232-3333-Example:3434-3535- ion {3636- compatbile = "hisilicon,ion", "linux,ion";3737-3838- ion-system-heap {3939- compatbile = "hisilicon,system-heap", "linux,ion-heap-system"4040- };4141-4242- ion-camera-region {4343- compatible = "hisilicon,camera-heap", "linux,ion-heap-dma"4444- memory-region = <&camera_region>;4545- };4646-4747- ion-fb-region {4848- compatbile = "hisilicon,fb-heap", "linux,ion-heap-dma"4949- memory-region = <&fb_region>;5050- };5151- }
-1
drivers/staging/ccree/ssi_request_mgr.c
···376376 rc = ssi_power_mgr_runtime_get(&drvdata->plat_dev->dev);377377 if (rc != 0) {378378 SSI_LOG_ERR("ssi_power_mgr_runtime_get returned %x\n",rc);379379- spin_unlock_bh(&req_mgr_h->hw_lock);380379 return rc;381380 }382381#endif
+1
drivers/staging/fsl-dpaa2/Kconfig
···1212config FSL_DPAA2_ETH1313 tristate "Freescale DPAA2 Ethernet"1414 depends on FSL_DPAA2 && FSL_MC_DPIO1515+ depends on NETDEVICES && ETHERNET1516 ---help---1617 Ethernet driver for Freescale DPAA2 SoCs, using the1718 Freescale MC bus driver
···238238 unsigned int hard_reset_count;239239 bool pd_capable;240240 bool explicit_contract;241241+ unsigned int rx_msgid;241242242243 /* Partner capabilities/requests */243244 u32 sink_request;···252251 unsigned int nr_src_pdo;253252 u32 snk_pdo[PDO_MAX_OBJECTS];254253 unsigned int nr_snk_pdo;254254+ u32 snk_vdo[VDO_MAX_OBJECTS];255255+ unsigned int nr_snk_vdo;255256256257 unsigned int max_snk_mv;257258 unsigned int max_snk_ma;···1000997 struct pd_mode_data *modep;1001998 int rlen = 0;1002999 u16 svid;10001000+ int i;1003100110041002 tcpm_log(port, "Rx VDM cmd 0x%x type %d cmd %d len %d",10051003 p0, cmd_type, cmd, cnt);···10111007 case CMDT_INIT:10121008 switch (cmd) {10131009 case CMD_DISCOVER_IDENT:10101010+ /* 6.4.4.3.1: Only respond as UFP (device) */10111011+ if (port->data_role == TYPEC_DEVICE &&10121012+ port->nr_snk_vdo) {10131013+ for (i = 0; i < port->nr_snk_vdo; i++)10141014+ response[i + 1]10151015+ = cpu_to_le32(port->snk_vdo[i]);10161016+ rlen = port->nr_snk_vdo + 1;10171017+ }10141018 break;10151019 case CMD_DISCOVER_SVID:10161020 break;···14271415 break;14281416 case SOFT_RESET_SEND:14291417 port->message_id = 0;14181418+ port->rx_msgid = -1;14301419 if (port->pwr_role == TYPEC_SOURCE)14311420 next_state = SRC_SEND_CAPABILITIES;14321421 else···15161503 port->attached);1517150415181505 if (port->attached) {15061506+ enum pd_ctrl_msg_type type = pd_header_type_le(msg->header);15071507+ unsigned int msgid = pd_header_msgid_le(msg->header);15081508+15091509+ /*15101510+ * USB PD standard, 6.6.1.2:15111511+ * "... if MessageID value in a received Message is the15121512+ * same as the stored value, the receiver shall return a15131513+ * GoodCRC Message with that MessageID value and drop15141514+ * the Message (this is a retry of an already received15151515+ * Message). Note: this shall not apply to the Soft_Reset15161516+ * Message which always has a MessageID value of zero."15171517+ */15181518+ if (msgid == port->rx_msgid && type != PD_CTRL_SOFT_RESET)15191519+ goto done;15201520+ port->rx_msgid = msgid;15211521+15191522 /*15201523 * If both ends believe to be DFP/host, we have a data role15211524 * mismatch.···15491520 }15501521 }1551152215231523+done:15521524 mutex_unlock(&port->lock);15531525 kfree(event);15541526}···17491719 }17501720 ma = min(ma, port->max_snk_ma);1751172117521752- /* XXX: Any other flags need to be set? */17531753- flags = 0;17221722+ flags = RDO_USB_COMM | RDO_NO_SUSPEND;1754172317551724 /* Set mismatch bit if offered power is less than operating power */17561725 mw = ma * mv / 1000;···19861957 port->attached = false;19871958 port->pd_capable = false;1988195919601960+ /*19611961+ * First Rx ID should be 0; set this to a sentinel of -1 so that19621962+ * we can check tcpm_pd_rx_handler() if we had seen it before.19631963+ */19641964+ port->rx_msgid = -1;19651965+19891966 port->tcpc->set_pd_rx(port->tcpc, false);19901967 tcpm_init_vbus(port); /* also disables charging */19911968 tcpm_init_vconn(port);···22052170 port->pwr_opmode = TYPEC_PWR_MODE_USB;22062171 port->caps_count = 0;22072172 port->message_id = 0;21732173+ port->rx_msgid = -1;22082174 port->explicit_contract = false;22092175 tcpm_set_state(port, SRC_SEND_CAPABILITIES, 0);22102176 break;···23652329 typec_set_pwr_opmode(port->typec_port, TYPEC_PWR_MODE_USB);23662330 port->pwr_opmode = TYPEC_PWR_MODE_USB;23672331 port->message_id = 0;23322332+ port->rx_msgid = -1;23682333 port->explicit_contract = false;23692334 tcpm_set_state(port, SNK_DISCOVERY, 0);23702335 break;···25332496 /* Soft_Reset states */25342497 case SOFT_RESET:25352498 port->message_id = 0;24992499+ port->rx_msgid = -1;25362500 tcpm_pd_send_control(port, PD_CTRL_ACCEPT);25372501 if (port->pwr_role == TYPEC_SOURCE)25382502 tcpm_set_state(port, SRC_SEND_CAPABILITIES, 0);···25422504 break;25432505 case SOFT_RESET_SEND:25442506 port->message_id = 0;25072507+ port->rx_msgid = -1;25452508 if (tcpm_pd_send_control(port, PD_CTRL_SOFT_RESET))25462509 tcpm_set_state_cond(port, hard_reset_state(port), 0);25472510 else···26072568 break;26082569 case PR_SWAP_SRC_SNK_SOURCE_OFF:26092570 tcpm_set_cc(port, TYPEC_CC_RD);25712571+ /*25722572+ * USB-PD standard, 6.2.1.4, Port Power Role:25732573+ * "During the Power Role Swap Sequence, for the initial Source25742574+ * Port, the Port Power Role field shall be set to Sink in the25752575+ * PS_RDY Message indicating that the initial Source’s power25762576+ * supply is turned off"25772577+ */25782578+ tcpm_set_pwr_role(port, TYPEC_SINK);26102579 if (tcpm_pd_send_control(port, PD_CTRL_PS_RDY)) {26112580 tcpm_set_state(port, ERROR_RECOVERY, 0);26122581 break;···26222575 tcpm_set_state_cond(port, SNK_UNATTACHED, PD_T_PS_SOURCE_ON);26232576 break;26242577 case PR_SWAP_SRC_SNK_SINK_ON:26252625- tcpm_set_pwr_role(port, TYPEC_SINK);26262578 tcpm_swap_complete(port, 0);26272579 tcpm_set_state(port, SNK_STARTUP, 0);26282580 break;···26332587 case PR_SWAP_SNK_SRC_SOURCE_ON:26342588 tcpm_set_cc(port, tcpm_rp_cc(port));26352589 tcpm_set_vbus(port, true);26362636- tcpm_pd_send_control(port, PD_CTRL_PS_RDY);25902590+ /*25912591+ * USB PD standard, 6.2.1.4:25922592+ * "Subsequent Messages initiated by the Policy Engine,25932593+ * such as the PS_RDY Message sent to indicate that Vbus25942594+ * is ready, will have the Port Power Role field set to25952595+ * Source."25962596+ */26372597 tcpm_set_pwr_role(port, TYPEC_SOURCE);25982598+ tcpm_pd_send_control(port, PD_CTRL_PS_RDY);26382599 tcpm_swap_complete(port, 0);26392600 tcpm_set_state(port, SRC_STARTUP, 0);26402601 break;···33453292 return nr_pdo;33463293}3347329432953295+static int tcpm_copy_vdos(u32 *dest_vdo, const u32 *src_vdo,32963296+ unsigned int nr_vdo)32973297+{32983298+ unsigned int i;32993299+33003300+ if (nr_vdo > VDO_MAX_OBJECTS)33013301+ nr_vdo = VDO_MAX_OBJECTS;33023302+33033303+ for (i = 0; i < nr_vdo; i++)33043304+ dest_vdo[i] = src_vdo[i];33053305+33063306+ return nr_vdo;33073307+}33083308+33483309void tcpm_update_source_capabilities(struct tcpm_port *port, const u32 *pdo,33493310 unsigned int nr_pdo)33503311{···34493382 tcpc->config->nr_src_pdo);34503383 port->nr_snk_pdo = tcpm_copy_pdos(port->snk_pdo, tcpc->config->snk_pdo,34513384 tcpc->config->nr_snk_pdo);33853385+ port->nr_snk_vdo = tcpm_copy_vdos(port->snk_vdo, tcpc->config->snk_vdo,33863386+ tcpc->config->nr_snk_vdo);3452338734533388 port->max_snk_mv = tcpc->config->max_snk_mv;34543389 port->max_snk_ma = tcpc->config->max_snk_ma;
+3
drivers/staging/typec/tcpm.h
···6060 const u32 *snk_pdo;6161 unsigned int nr_snk_pdo;62626363+ const u32 *snk_vdo;6464+ unsigned int nr_snk_vdo;6565+6366 unsigned int max_snk_mv;6467 unsigned int max_snk_ma;6568 unsigned int max_snk_mw;
···362362}363363364364/* USB 2.0 spec Section 11.24.4.5 */365365-static int get_hub_descriptor(struct usb_device *hdev, void *data)365365+static int get_hub_descriptor(struct usb_device *hdev,366366+ struct usb_hub_descriptor *desc)366367{367368 int i, ret, size;368369 unsigned dtype;···379378 for (i = 0; i < 3; i++) {380379 ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),381380 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB,382382- dtype << 8, 0, data, size,381381+ dtype << 8, 0, desc, size,383382 USB_CTRL_GET_TIMEOUT);384384- if (ret >= (USB_DT_HUB_NONVAR_SIZE + 2))383383+ if (hub_is_superspeed(hdev)) {384384+ if (ret == size)385385+ return ret;386386+ } else if (ret >= USB_DT_HUB_NONVAR_SIZE + 2) {387387+ /* Make sure we have the DeviceRemovable field. */388388+ size = USB_DT_HUB_NONVAR_SIZE + desc->bNbrPorts / 8 + 1;389389+ if (ret < size)390390+ return -EMSGSIZE;385391 return ret;392392+ }386393 }387394 return -EINVAL;388395}···13221313 }13231314 mutex_init(&hub->status_mutex);1324131513251325- hub->descriptor = kmalloc(sizeof(*hub->descriptor), GFP_KERNEL);13161316+ hub->descriptor = kzalloc(sizeof(*hub->descriptor), GFP_KERNEL);13261317 if (!hub->descriptor) {13271318 ret = -ENOMEM;13281319 goto fail;···1330132113311322 /* Request the entire hub descriptor.13321323 * hub->descriptor can handle USB_MAXCHILDREN ports,13331333- * but the hub can/will return fewer bytes here.13241324+ * but a (non-SS) hub can/will return fewer bytes here.13341325 */13351326 ret = get_hub_descriptor(hdev, hub->descriptor);13361327 if (ret < 0) {13371328 message = "can't read hub descriptor";13381329 goto fail;13391339- } else if (hub->descriptor->bNbrPorts > USB_MAXCHILDREN) {13301330+ }13311331+13321332+ maxchild = USB_MAXCHILDREN;13331333+ if (hub_is_superspeed(hdev))13341334+ maxchild = min_t(unsigned, maxchild, USB_SS_MAXPORTS);13351335+13361336+ if (hub->descriptor->bNbrPorts > maxchild) {13401337 message = "hub has too many ports!";13411338 ret = -ENODEV;13421339 goto fail;
+3
drivers/usb/core/of.c
···5353 *5454 * Find the companion device from platform bus.5555 *5656+ * Takes a reference to the returned struct device which needs to be dropped5757+ * after use.5858+ *5659 * Return: On success, a pointer to the companion device, %NULL on failure.5760 */5861struct device *usb_of_get_companion_dev(struct device *dev)
+1-1
drivers/usb/core/urb.c
···338338 if (!urb || !urb->complete)339339 return -EINVAL;340340 if (urb->hcpriv) {341341- WARN_ONCE(1, "URB %p submitted while active\n", urb);341341+ WARN_ONCE(1, "URB %pK submitted while active\n", urb);342342 return -EBUSY;343343 }344344
+4
drivers/usb/dwc3/dwc3-keystone.c
···107107 return PTR_ERR(kdwc->usbss);108108109109 kdwc->clk = devm_clk_get(kdwc->dev, "usb");110110+ if (IS_ERR(kdwc->clk)) {111111+ dev_err(kdwc->dev, "unable to get usb clock\n");112112+ return PTR_ERR(kdwc->clk);113113+ }110114111115 error = clk_prepare_enable(kdwc->clk);112116 if (error < 0) {
···419419 wait_for_completion(cmd->completion);420420421421 if (cmd->status == COMP_COMMAND_ABORTED ||422422- cmd->status == COMP_STOPPED) {422422+ cmd->status == COMP_COMMAND_RING_STOPPED) {423423 xhci_warn(xhci, "Timeout while waiting for stop endpoint command\n");424424 ret = -ETIME;425425 }
+6-5
drivers/usb/host/xhci-mem.c
···5656 }57575858 if (max_packet) {5959- seg->bounce_buf = kzalloc(max_packet, flags | GFP_DMA);5959+ seg->bounce_buf = kzalloc(max_packet, flags);6060 if (!seg->bounce_buf) {6161 dma_pool_free(xhci->segment_pool, seg->trbs, dma);6262 kfree(seg);···17241724 xhci->dcbaa->dev_context_ptrs[0] = cpu_to_le64(xhci->scratchpad->sp_dma);17251725 for (i = 0; i < num_sp; i++) {17261726 dma_addr_t dma;17271727- void *buf = dma_alloc_coherent(dev, xhci->page_size, &dma,17271727+ void *buf = dma_zalloc_coherent(dev, xhci->page_size, &dma,17281728 flags);17291729 if (!buf)17301730 goto fail_sp4;···23072307 /* Place limits on the number of roothub ports so that the hub23082308 * descriptors aren't longer than the USB core will allocate.23092309 */23102310- if (xhci->num_usb3_ports > 15) {23102310+ if (xhci->num_usb3_ports > USB_SS_MAXPORTS) {23112311 xhci_dbg_trace(xhci, trace_xhci_dbg_init,23122312- "Limiting USB 3.0 roothub ports to 15.");23132313- xhci->num_usb3_ports = 15;23122312+ "Limiting USB 3.0 roothub ports to %u.",23132313+ USB_SS_MAXPORTS);23142314+ xhci->num_usb3_ports = USB_SS_MAXPORTS;23142315 }23152316 if (xhci->num_usb2_ports > USB_MAXCHILDREN) {23162317 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
···177177178178 irq = platform_get_irq(pdev, 0);179179 if (irq < 0)180180- return -ENODEV;180180+ return irq;181181182182 /*183183 * sysdev must point to a device that is known to the system firmware
+9-11
drivers/usb/host/xhci-ring.c
···323323 if (i_cmd->status != COMP_COMMAND_ABORTED)324324 continue;325325326326- i_cmd->status = COMP_STOPPED;326326+ i_cmd->status = COMP_COMMAND_RING_STOPPED;327327328328 xhci_dbg(xhci, "Turn aborted command %p to no-op\n",329329 i_cmd->command_trb);···641641 xhci_urb_free_priv(urb_priv);642642 usb_hcd_unlink_urb_from_ep(hcd, urb);643643 spin_unlock(&xhci->lock);644644- usb_hcd_giveback_urb(hcd, urb, status);645644 trace_xhci_urb_giveback(urb);645645+ usb_hcd_giveback_urb(hcd, urb, status);646646 spin_lock(&xhci->lock);647647}648648···13801380 cmd_comp_code = GET_COMP_CODE(le32_to_cpu(event->status));1381138113821382 /* If CMD ring stopped we own the trbs between enqueue and dequeue */13831383- if (cmd_comp_code == COMP_STOPPED) {13831383+ if (cmd_comp_code == COMP_COMMAND_RING_STOPPED) {13841384 complete_all(&xhci->cmd_ring_stop_completion);13851385 return;13861386 }···14361436 break;14371437 case TRB_CMD_NOOP:14381438 /* Is this an aborted command turned to NO-OP? */14391439- if (cmd->status == COMP_STOPPED)14401440- cmd_comp_code = COMP_STOPPED;14391439+ if (cmd->status == COMP_COMMAND_RING_STOPPED)14401440+ cmd_comp_code = COMP_COMMAND_RING_STOPPED;14411441 break;14421442 case TRB_RESET_EP:14431443 WARN_ON(slot_id != TRB_TO_SLOT_ID(···26772677 struct xhci_hcd *xhci = hcd_to_xhci(hcd);26782678 union xhci_trb *event_ring_deq;26792679 irqreturn_t ret = IRQ_NONE;26802680+ unsigned long flags;26802681 dma_addr_t deq;26812682 u64 temp_64;26822683 u32 status;2683268426842684- spin_lock(&xhci->lock);26852685+ spin_lock_irqsave(&xhci->lock, flags);26852686 /* Check if the xHC generated the interrupt, or the irq is shared */26862687 status = readl(&xhci->op_regs->status);26872688 if (status == ~(u32)0) {···27082707 */27092708 status |= STS_EINT;27102709 writel(status, &xhci->op_regs->status);27112711- /* FIXME when MSI-X is supported and there are multiple vectors */27122712- /* Clear the MSI-X event interrupt status */2713271027142714- if (hcd->irq) {27112711+ if (!hcd->msi_enabled) {27152712 u32 irq_pending;27162716- /* Acknowledge the PCI interrupt */27172713 irq_pending = readl(&xhci->ir_set->irq_pending);27182714 irq_pending |= IMAN_IP;27192715 writel(irq_pending, &xhci->ir_set->irq_pending);···27552757 ret = IRQ_HANDLED;2756275827572759out:27582758- spin_unlock(&xhci->lock);27602760+ spin_unlock_irqrestore(&xhci->lock, flags);2759276127602762 return ret;27612763}
+7-6
drivers/usb/host/xhci.c
···359359 /* fall back to msi*/360360 ret = xhci_setup_msi(xhci);361361362362- if (!ret)363363- /* hcd->irq is 0, we have MSI */362362+ if (!ret) {363363+ hcd->msi_enabled = 1;364364 return 0;365365+ }365366366367 if (!pdev->irq) {367368 xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n");···1764176317651764 switch (*cmd_status) {17661765 case COMP_COMMAND_ABORTED:17671767- case COMP_STOPPED:17661766+ case COMP_COMMAND_RING_STOPPED:17681767 xhci_warn(xhci, "Timeout while waiting for configure endpoint command\n");17691768 ret = -ETIME;17701769 break;···1814181318151814 switch (*cmd_status) {18161815 case COMP_COMMAND_ABORTED:18171817- case COMP_STOPPED:18161816+ case COMP_COMMAND_RING_STOPPED:18181817 xhci_warn(xhci, "Timeout while waiting for evaluate context command\n");18191818 ret = -ETIME;18201819 break;···34333432 ret = reset_device_cmd->status;34343433 switch (ret) {34353434 case COMP_COMMAND_ABORTED:34363436- case COMP_STOPPED:34353435+ case COMP_COMMAND_RING_STOPPED:34373436 xhci_warn(xhci, "Timeout waiting for reset device command\n");34383437 ret = -ETIME;34393438 goto command_cleanup;···38183817 */38193818 switch (command->status) {38203819 case COMP_COMMAND_ABORTED:38213821- case COMP_STOPPED:38203820+ case COMP_COMMAND_RING_STOPPED:38223821 xhci_warn(xhci, "Timeout while waiting for setup device command\n");38233822 ret = -ETIME;38243823 break;
+1-1
drivers/usb/misc/chaoskey.c
···192192193193 dev->in_ep = in_ep;194194195195- if (udev->descriptor.idVendor != ALEA_VENDOR_ID)195195+ if (le16_to_cpu(udev->descriptor.idVendor) != ALEA_VENDOR_ID)196196 dev->reads_started = 1;197197198198 dev->size = size;
···341341static342342int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)343343{344344+ struct usb_device *udev = interface_to_usbdev(iface);344345 struct i1480_usb *i1480_usb;345346 struct i1480 *i1480;346347 struct device *dev = &iface->dev;···353352 iface->cur_altsetting->desc.bInterfaceNumber);354353 goto error;355354 }356356- if (iface->num_altsetting > 1357357- && interface_to_usbdev(iface)->descriptor.idProduct == 0xbabe) {355355+ if (iface->num_altsetting > 1 &&356356+ le16_to_cpu(udev->descriptor.idProduct) == 0xbabe) {358357 /* Need altsetting #1 [HW QUIRK] or EP1 won't work */359358 result = usb_set_interface(interface_to_usbdev(iface), 0, 1);360359 if (result < 0)
+1-1
drivers/watchdog/Kconfig
···452452453453config ORION_WATCHDOG454454 tristate "Orion watchdog"455455- depends on ARCH_ORION5X || ARCH_DOVE || MACH_DOVE || ARCH_MVEBU || COMPILE_TEST455455+ depends on ARCH_ORION5X || ARCH_DOVE || MACH_DOVE || ARCH_MVEBU || (COMPILE_TEST && !ARCH_EBSA110)456456 depends on ARM457457 select WATCHDOG_CORE458458 help
+2-1
drivers/watchdog/bcm_kona_wdt.c
···304304 if (!wdt)305305 return -ENOMEM;306306307307+ spin_lock_init(&wdt->lock);308308+307309 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);308310 wdt->base = devm_ioremap_resource(dev, res);309311 if (IS_ERR(wdt->base))···318316 return ret;319317 }320318321321- spin_lock_init(&wdt->lock);322319 platform_set_drvdata(pdev, wdt);323320 watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt);324321 bcm_kona_wdt_wdd.parent = &pdev->dev;
+1-1
drivers/watchdog/cadence_wdt.c
···4949/* Counter maximum value */5050#define CDNS_WDT_COUNTER_MAX 0xFFF51515252-static int wdt_timeout = CDNS_WDT_DEFAULT_TIMEOUT;5252+static int wdt_timeout;5353static int nowayout = WATCHDOG_NOWAYOUT;54545555module_param(wdt_timeout, int, 0);
+11-13
drivers/watchdog/iTCO_wdt.c
···306306307307 iTCO_vendor_pre_keepalive(p->smi_res, wd_dev->timeout);308308309309- /* Reload the timer by writing to the TCO Timer Counter register */310310- if (p->iTCO_version >= 2) {311311- outw(0x01, TCO_RLD(p));312312- } else if (p->iTCO_version == 1) {313313- /* Reset the timeout status bit so that the timer314314- * needs to count down twice again before rebooting */315315- outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */309309+ /* Reset the timeout status bit so that the timer310310+ * needs to count down twice again before rebooting */311311+ outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */316312313313+ /* Reload the timer by writing to the TCO Timer Counter register */314314+ if (p->iTCO_version >= 2)315315+ outw(0x01, TCO_RLD(p));316316+ else if (p->iTCO_version == 1)317317 outb(0x01, TCO_RLD(p));318318- }319318320319 spin_unlock(&p->io_lock);321320 return 0;···327328 unsigned char val8;328329 unsigned int tmrval;329330330330- tmrval = seconds_to_ticks(p, t);331331-332332- /* For TCO v1 the timer counts down twice before rebooting */333333- if (p->iTCO_version == 1)334334- tmrval /= 2;331331+ /* The timer counts down twice before rebooting */332332+ tmrval = seconds_to_ticks(p, t) / 2;335333336334 /* from the specs: */337335 /* "Values of 0h-3h are ignored and should not be attempted" */···381385 spin_lock(&p->io_lock);382386 val16 = inw(TCO_RLD(p));383387 val16 &= 0x3ff;388388+ if (!(inw(TCO1_STS(p)) & 0x0008))389389+ val16 += (inw(TCOv2_TMR(p)) & 0x3ff);384390 spin_unlock(&p->io_lock);385391386392 time_left = ticks_to_seconds(p, val16);
+3
drivers/watchdog/pcwd_usb.c
···630630 return -ENODEV;631631 }632632633633+ if (iface_desc->desc.bNumEndpoints < 1)634634+ return -ENODEV;635635+633636 /* check out the endpoint: it has to be Interrupt & IN */634637 endpoint = &iface_desc->endpoint[0].desc;635638
+57-20
drivers/watchdog/sama5d4_wdt.c
···66 * Licensed under GPLv2.77 */8899+#include <linux/delay.h>910#include <linux/interrupt.h>1011#include <linux/io.h>1112#include <linux/kernel.h>···3029 struct watchdog_device wdd;3130 void __iomem *reg_base;3231 u32 mr;3232+ unsigned long last_ping;3333};34343535static int wdt_timeout = WDT_DEFAULT_TIMEOUT;···4644 "Watchdog cannot be stopped once started (default="4745 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");48464747+#define wdt_enabled (!(wdt->mr & AT91_WDT_WDDIS))4848+4949#define wdt_read(wdt, field) \5050 readl_relaxed((wdt)->reg_base + (field))51515252-#define wdt_write(wtd, field, val) \5353- writel_relaxed((val), (wdt)->reg_base + (field))5252+/* 4 slow clock periods is 4/32768 = 122.07µs*/5353+#define WDT_DELAY usecs_to_jiffies(123)5454+5555+static void wdt_write(struct sama5d4_wdt *wdt, u32 field, u32 val)5656+{5757+ /*5858+ * WDT_CR and WDT_MR must not be modified within three slow clock5959+ * periods following a restart of the watchdog performed by a write6060+ * access in WDT_CR.6161+ */6262+ while (time_before(jiffies, wdt->last_ping + WDT_DELAY))6363+ usleep_range(30, 125);6464+ writel_relaxed(val, wdt->reg_base + field);6565+ wdt->last_ping = jiffies;6666+}6767+6868+static void wdt_write_nosleep(struct sama5d4_wdt *wdt, u32 field, u32 val)6969+{7070+ if (time_before(jiffies, wdt->last_ping + WDT_DELAY))7171+ udelay(123);7272+ writel_relaxed(val, wdt->reg_base + field);7373+ wdt->last_ping = jiffies;7474+}54755576static int sama5d4_wdt_start(struct watchdog_device *wdd)5677{···11489 wdt->mr &= ~AT91_WDT_WDD;11590 wdt->mr |= AT91_WDT_SET_WDV(value);11691 wdt->mr |= AT91_WDT_SET_WDD(value);117117- wdt_write(wdt, AT91_WDT_MR, wdt->mr);9292+9393+ /*9494+ * WDDIS has to be 0 when updating WDD/WDV. The datasheet states: When9595+ * setting the WDDIS bit, and while it is set, the fields WDV and WDD9696+ * must not be modified.9797+ * If the watchdog is enabled, then the timeout can be updated. Else,9898+ * wait that the user enables it.9999+ */100100+ if (wdt_enabled)101101+ wdt_write(wdt, AT91_WDT_MR, wdt->mr & ~AT91_WDT_WDDIS);118102119103 wdd->timeout = timeout;120104···179145180146static int sama5d4_wdt_init(struct sama5d4_wdt *wdt)181147{182182- struct watchdog_device *wdd = &wdt->wdd;183183- u32 value = WDT_SEC2TICKS(wdd->timeout);184148 u32 reg;185185-186149 /*187187- * Because the fields WDV and WDD must not be modified when the WDDIS188188- * bit is set, so clear the WDDIS bit before writing the WDT_MR.150150+ * When booting and resuming, the bootloader may have changed the151151+ * watchdog configuration.152152+ * If the watchdog is already running, we can safely update it.153153+ * Else, we have to disable it properly.189154 */190190- reg = wdt_read(wdt, AT91_WDT_MR);191191- reg &= ~AT91_WDT_WDDIS;192192- wdt_write(wdt, AT91_WDT_MR, reg);193193-194194- wdt->mr |= AT91_WDT_SET_WDD(value);195195- wdt->mr |= AT91_WDT_SET_WDV(value);196196-197197- wdt_write(wdt, AT91_WDT_MR, wdt->mr);198198-155155+ if (wdt_enabled) {156156+ wdt_write_nosleep(wdt, AT91_WDT_MR, wdt->mr);157157+ } else {158158+ reg = wdt_read(wdt, AT91_WDT_MR);159159+ if (!(reg & AT91_WDT_WDDIS))160160+ wdt_write_nosleep(wdt, AT91_WDT_MR,161161+ reg | AT91_WDT_WDDIS);162162+ }199163 return 0;200164}201165···204172 struct resource *res;205173 void __iomem *regs;206174 u32 irq = 0;175175+ u32 timeout;207176 int ret;208177209178 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);···217184 wdd->ops = &sama5d4_wdt_ops;218185 wdd->min_timeout = MIN_WDT_TIMEOUT;219186 wdd->max_timeout = MAX_WDT_TIMEOUT;187187+ wdt->last_ping = jiffies;220188221189 watchdog_set_drvdata(wdd, wdt);222190···254220 dev_err(&pdev->dev, "unable to set timeout value\n");255221 return ret;256222 }223223+224224+ timeout = WDT_SEC2TICKS(wdd->timeout);225225+226226+ wdt->mr |= AT91_WDT_SET_WDD(timeout);227227+ wdt->mr |= AT91_WDT_SET_WDV(timeout);257228258229 ret = sama5d4_wdt_init(wdt);259230 if (ret)···302263{303264 struct sama5d4_wdt *wdt = dev_get_drvdata(dev);304265305305- wdt_write(wdt, AT91_WDT_MR, wdt->mr & ~AT91_WDT_WDDIS);306306- if (wdt->mr & AT91_WDT_WDDIS)307307- wdt_write(wdt, AT91_WDT_MR, wdt->mr);266266+ sama5d4_wdt_init(wdt);308267309268 return 0;310269}
+1-1
drivers/watchdog/wdt_pci.c
···332332 pr_crit("Would Reboot\n");333333#else334334 pr_crit("Initiating system reboot\n");335335- emergency_restart(NULL);335335+ emergency_restart();336336#endif337337#else338338 pr_crit("Reset in 5ms\n");
+1-3
drivers/watchdog/zx2967_wdt.c
···211211212212 base = platform_get_resource(pdev, IORESOURCE_MEM, 0);213213 wdt->reg_base = devm_ioremap_resource(dev, base);214214- if (IS_ERR(wdt->reg_base)) {215215- dev_err(dev, "ioremap failed\n");214214+ if (IS_ERR(wdt->reg_base))216215 return PTR_ERR(wdt->reg_base);217217- }218216219217 zx2967_wdt_reset_sysctrl(dev);220218
+14-16
fs/cifs/cifsacl.c
···11351135 u32 acllen = 0;11361136 int rc = 0;11371137 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);11381138- struct cifs_tcon *tcon;11381138+ struct smb_version_operations *ops;1139113911401140 cifs_dbg(NOISY, "converting ACL to mode for %s\n", path);1141114111421142 if (IS_ERR(tlink))11431143 return PTR_ERR(tlink);11441144- tcon = tlink_tcon(tlink);1145114411461146- if (pfid && (tcon->ses->server->ops->get_acl_by_fid))11471147- pntsd = tcon->ses->server->ops->get_acl_by_fid(cifs_sb, pfid,11481148- &acllen);11491149- else if (tcon->ses->server->ops->get_acl)11501150- pntsd = tcon->ses->server->ops->get_acl(cifs_sb, inode, path,11511151- &acllen);11451145+ ops = tlink_tcon(tlink)->ses->server->ops;11461146+11471147+ if (pfid && (ops->get_acl_by_fid))11481148+ pntsd = ops->get_acl_by_fid(cifs_sb, pfid, &acllen);11491149+ else if (ops->get_acl)11501150+ pntsd = ops->get_acl(cifs_sb, inode, path, &acllen);11521151 else {11531152 cifs_put_tlink(tlink);11541153 return -EOPNOTSUPP;···11801181 struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */11811182 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);11821183 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);11831183- struct cifs_tcon *tcon;11841184+ struct smb_version_operations *ops;1184118511851186 if (IS_ERR(tlink))11861187 return PTR_ERR(tlink);11871187- tcon = tlink_tcon(tlink);11881188+11891189+ ops = tlink_tcon(tlink)->ses->server->ops;1188119011891191 cifs_dbg(NOISY, "set ACL from mode for %s\n", path);1190119211911193 /* Get the security descriptor */1192119411931193- if (tcon->ses->server->ops->get_acl == NULL) {11951195+ if (ops->get_acl == NULL) {11941196 cifs_put_tlink(tlink);11951197 return -EOPNOTSUPP;11961198 }1197119911981198- pntsd = tcon->ses->server->ops->get_acl(cifs_sb, inode, path,11991199- &secdesclen);12001200+ pntsd = ops->get_acl(cifs_sb, inode, path, &secdesclen);12001201 if (IS_ERR(pntsd)) {12011202 rc = PTR_ERR(pntsd);12021203 cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);···1223122412241225 cifs_dbg(NOISY, "build_sec_desc rc: %d\n", rc);1225122612261226- if (tcon->ses->server->ops->set_acl == NULL)12271227+ if (ops->set_acl == NULL)12271228 rc = -EOPNOTSUPP;1228122912291230 if (!rc) {12301231 /* Set the security descriptor */12311231- rc = tcon->ses->server->ops->set_acl(pnntsd, secdesclen, inode,12321232- path, aclflag);12321232+ rc = ops->set_acl(pnntsd, secdesclen, inode, path, aclflag);12331233 cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc);12341234 }12351235 cifs_put_tlink(tlink);
···582582 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);583583 int rc = 0;584584585585- down_read(&cinode->lock_sem);585585+ down_read_nested(&cinode->lock_sem, SINGLE_DEPTH_NESTING);586586 if (cinode->can_cache_brlcks) {587587 /* can cache locks - no need to relock */588588 up_read(&cinode->lock_sem);
···12401240 goto tcon_exit;12411241 }1242124212431243- if (rsp->ShareType & SMB2_SHARE_TYPE_DISK)12431243+ switch (rsp->ShareType) {12441244+ case SMB2_SHARE_TYPE_DISK:12441245 cifs_dbg(FYI, "connection to disk share\n");12451245- else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) {12461246+ break;12471247+ case SMB2_SHARE_TYPE_PIPE:12461248 tcon->ipc = true;12471249 cifs_dbg(FYI, "connection to pipe share\n");12481248- } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) {12491249- tcon->print = true;12501250+ break;12511251+ case SMB2_SHARE_TYPE_PRINT:12521252+ tcon->ipc = true;12501253 cifs_dbg(FYI, "connection to printer\n");12511251- } else {12541254+ break;12551255+ default:12521256 cifs_dbg(VFS, "unknown share type %d\n", rsp->ShareType);12531257 rc = -EOPNOTSUPP;12541258 goto tcon_error_exit;···21772173 if (mid->mid_state == MID_RESPONSE_RECEIVED)21782174 credits_received = le16_to_cpu(rsp->hdr.sync_hdr.CreditRequest);2179217521802180- mutex_lock(&server->srv_mutex);21812176 DeleteMidQEntry(mid);21822182- mutex_unlock(&server->srv_mutex);21832177 add_credits(server, credits_received, CIFS_ECHO_OP);21842178}21852179···24352433 cifs_stats_fail_inc(tcon, SMB2_READ_HE);2436243424372435 queue_work(cifsiod_wq, &rdata->work);24382438- mutex_lock(&server->srv_mutex);24392436 DeleteMidQEntry(mid);24402440- mutex_unlock(&server->srv_mutex);24412437 add_credits(server, credits_received, 0);24422438}24432439···25942594{25952595 struct cifs_writedata *wdata = mid->callback_data;25962596 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink);25972597- struct TCP_Server_Info *server = tcon->ses->server;25982597 unsigned int written;25992598 struct smb2_write_rsp *rsp = (struct smb2_write_rsp *)mid->resp_buf;26002599 unsigned int credits_received = 1;···26332634 cifs_stats_fail_inc(tcon, SMB2_WRITE_HE);2634263526352636 queue_work(cifsiod_wq, &wdata->work);26362636- mutex_lock(&server->srv_mutex);26372637 DeleteMidQEntry(mid);26382638- mutex_unlock(&server->srv_mutex);26392638 add_credits(tcon->ses->server, credits_received, 0);26402639}26412640
+1-3
fs/cifs/transport.c
···9494 now = jiffies;9595 /* commands taking longer than one second are indications that9696 something is wrong, unless it is quite a slow link or server */9797- if ((now - midEntry->when_alloc) > HZ) {9797+ if (time_after(now, midEntry->when_alloc + HZ)) {9898 if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) {9999 pr_debug(" CIFS slow rsp: cmd %d mid %llu",100100 midEntry->command, midEntry->mid);···613613 }614614 spin_unlock(&GlobalMid_Lock);615615616616- mutex_lock(&server->srv_mutex);617616 DeleteMidQEntry(mid);618618- mutex_unlock(&server->srv_mutex);619617 return rc;620618}621619
···975975 int err;976976 char *suffix = "";977977978978- if (sb->s_bdev)978978+ if (sb->s_bdev) {979979 suffix = "-fuseblk";980980+ /*981981+ * sb->s_bdi points to blkdev's bdi however we want to redirect982982+ * it to our private bdi...983983+ */984984+ bdi_put(sb->s_bdi);985985+ sb->s_bdi = &noop_backing_dev_info;986986+ }980987 err = super_setup_bdi_name(sb, "%u:%u%s", MAJOR(fc->dev),981988 MINOR(fc->dev), suffix);982989 if (err)
+2-2
fs/xfs/xfs_iomap.c
···10681068 /* optionally associate a dax device with the iomap bdev */10691069 bdev = iomap->bdev;10701070 if (blk_queue_dax(bdev->bd_queue))10711071- iomap->dax_dev = dax_get_by_host(bdev->bd_disk->disk_name);10711071+ iomap->dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);10721072 else10731073 iomap->dax_dev = NULL;10741074···11491149 unsigned flags,11501150 struct iomap *iomap)11511151{11521152- put_dax(iomap->dax_dev);11521152+ fs_put_dax(iomap->dax_dev);11531153 if ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC)11541154 return xfs_file_iomap_end_delalloc(XFS_I(inode), offset,11551155 length, written, iomap);
+4-1
include/kvm/arm_vgic.h
···195195 /* either a GICv2 CPU interface */196196 gpa_t vgic_cpu_base;197197 /* or a number of GICv3 redistributor regions */198198- gpa_t vgic_redist_base;198198+ struct {199199+ gpa_t vgic_redist_base;200200+ gpa_t vgic_redist_free_offset;201201+ };199202 };200203201204 /* distributor enabled */
+4
include/linux/bpf_verifier.h
···4040 */4141 s64 min_value;4242 u64 max_value;4343+ u32 min_align;4444+ u32 aux_off;4545+ u32 aux_off_align;4346};44474548enum bpf_stack_slot_type {···9087 struct bpf_prog *prog; /* eBPF program being verified */9188 struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */9289 int stack_size; /* number of states to be processed */9090+ bool strict_alignment; /* perform strict pointer alignment checks */9391 struct bpf_verifier_state cur_state; /* current verifier state */9492 struct bpf_verifier_state_list **explored_states; /* search pruning optimization */9593 const struct bpf_ext_analyzer_ops *analyzer_ops; /* external analyzer ops */
···27272828/* FC Port role bitmask - can merge with FC Port Roles in fc transport */2929#define FC_PORT_ROLE_NVME_INITIATOR 0x103030-#define FC_PORT_ROLE_NVME_TARGET 0x113131-#define FC_PORT_ROLE_NVME_DISCOVERY 0x123030+#define FC_PORT_ROLE_NVME_TARGET 0x203131+#define FC_PORT_ROLE_NVME_DISCOVERY 0x40323233333434/**···642642 * sequence in one LLDD operation. Errors during Data643643 * sequence transmit must not allow RSP sequence to be sent.644644 */645645- NVMET_FCTGTFEAT_NEEDS_CMD_CPUSCHED = (1 << 1),646646- /* Bit 1: When 0, the LLDD will deliver FCP CMD647647- * on the CPU it should be affinitized to. Thus work will648648- * be scheduled on the cpu received on. When 1, the LLDD649649- * may not deliver the CMD on the CPU it should be worked650650- * on. The transport should pick a cpu to schedule the work651651- * on.652652- */653653- NVMET_FCTGTFEAT_CMD_IN_ISR = (1 << 2),645645+ NVMET_FCTGTFEAT_CMD_IN_ISR = (1 << 1),654646 /* Bit 2: When 0, the LLDD is calling the cmd rcv handler655647 * in a non-isr context, allowing the transport to finish656648 * op completion in the calling context. When 1, the LLDD···650658 * requiring the transport to transition to a workqueue651659 * for op completion.652660 */653653- NVMET_FCTGTFEAT_OPDONE_IN_ISR = (1 << 3),661661+ NVMET_FCTGTFEAT_OPDONE_IN_ISR = (1 << 2),654662 /* Bit 3: When 0, the LLDD is calling the op done handler655663 * in a non-isr context, allowing the transport to finish656664 * op completion in the calling context. When 1, the LLDD
+1-1
include/linux/of_irq.h
···88#include <linux/ioport.h>99#include <linux/of.h>10101111-typedef int const (*of_irq_init_cb_t)(struct device_node *, struct device_node *);1111+typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *);12121313/*1414 * Workarounds only applied to 32bit powermac machines
···148148 unsigned rh_registered:1;/* is root hub registered? */149149 unsigned rh_pollable:1; /* may we poll the root hub? */150150 unsigned msix_enabled:1; /* driver has MSI-X enabled? */151151+ unsigned msi_enabled:1; /* driver has MSI enabled? */151152 unsigned remove_phy:1; /* auto-remove USB phy */152153153154 /* The next flag is a stopgap, to be removed when all the HCDs
···132132 */133133#define BPF_F_ALLOW_OVERRIDE (1U << 0)134134135135+/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the136136+ * verifier will perform strict alignment checking as if the kernel137137+ * has been built with CONFIG_EFFICIENT_UNALIGNED_ACCESS not set,138138+ * and NET_IP_ALIGN defined to 2.139139+ */140140+#define BPF_F_STRICT_ALIGNMENT (1U << 0)141141+135142#define BPF_PSEUDO_MAP_FD 1136143137144/* flags for BPF_MAP_UPDATE_ELEM command */···184177 __u32 log_size; /* size of user buffer */185178 __aligned_u64 log_buf; /* user supplied buffer */186179 __u32 kern_version; /* checked when prog_type=kprobe */180180+ __u32 prog_flags;187181 };188182189183 struct { /* anonymous struct used by BPF_OBJ_* commands */
···2222 */2323#define USB_MAXCHILDREN 3124242525+/* See USB 3.1 spec Table 10-5 */2626+#define USB_SS_MAXPORTS 152727+2528/*2629 * Hub request types2730 */
+4-1
kernel/bpf/syscall.c
···783783EXPORT_SYMBOL_GPL(bpf_prog_get_type);784784785785/* last field in 'union bpf_attr' used by this command */786786-#define BPF_PROG_LOAD_LAST_FIELD kern_version786786+#define BPF_PROG_LOAD_LAST_FIELD prog_flags787787788788static int bpf_prog_load(union bpf_attr *attr)789789{···794794 bool is_gpl;795795796796 if (CHECK_ATTR(BPF_PROG_LOAD))797797+ return -EINVAL;798798+799799+ if (attr->prog_flags & ~BPF_F_STRICT_ALIGNMENT)797800 return -EINVAL;798801799802 /* copy eBPF program license from user space */
+120-25
kernel/bpf/verifier.c
···140140 struct bpf_verifier_stack_elem *next;141141};142142143143-#define BPF_COMPLEXITY_LIMIT_INSNS 65536143143+#define BPF_COMPLEXITY_LIMIT_INSNS 98304144144#define BPF_COMPLEXITY_LIMIT_STACK 1024145145146146#define BPF_MAP_PTR_POISON ((void *)0xeB9F + POISON_POINTER_DELTA)···241241 if (reg->max_value != BPF_REGISTER_MAX_RANGE)242242 verbose(",max_value=%llu",243243 (unsigned long long)reg->max_value);244244+ if (reg->min_align)245245+ verbose(",min_align=%u", reg->min_align);246246+ if (reg->aux_off)247247+ verbose(",aux_off=%u", reg->aux_off);248248+ if (reg->aux_off_align)249249+ verbose(",aux_off_align=%u", reg->aux_off_align);244250 }245251 for (i = 0; i < MAX_BPF_STACK; i += BPF_REG_SIZE) {246252 if (state->stack_slot_type[i] == STACK_SPILL)···472466 regs[i].imm = 0;473467 regs[i].min_value = BPF_REGISTER_MIN_RANGE;474468 regs[i].max_value = BPF_REGISTER_MAX_RANGE;469469+ regs[i].min_align = 0;470470+ regs[i].aux_off = 0;471471+ regs[i].aux_off_align = 0;475472 }476473477474 /* frame pointer */···501492{502493 regs[regno].min_value = BPF_REGISTER_MIN_RANGE;503494 regs[regno].max_value = BPF_REGISTER_MAX_RANGE;495495+ regs[regno].min_align = 0;504496}505497506498static void mark_reg_unknown_value_and_range(struct bpf_reg_state *regs,···789779}790780791781static int check_pkt_ptr_alignment(const struct bpf_reg_state *reg,792792- int off, int size)782782+ int off, int size, bool strict)793783{794794- if (reg->id && size != 1) {795795- verbose("Unknown alignment. Only byte-sized access allowed in packet access.\n");796796- return -EACCES;784784+ int ip_align;785785+ int reg_off;786786+787787+ /* Byte size accesses are always allowed. */788788+ if (!strict || size == 1)789789+ return 0;790790+791791+ reg_off = reg->off;792792+ if (reg->id) {793793+ if (reg->aux_off_align % size) {794794+ verbose("Packet access is only %u byte aligned, %d byte access not allowed\n",795795+ reg->aux_off_align, size);796796+ return -EACCES;797797+ }798798+ reg_off += reg->aux_off;797799 }798800799799- /* skb->data is NET_IP_ALIGN-ed */800800- if ((NET_IP_ALIGN + reg->off + off) % size != 0) {801801+ /* skb->data is NET_IP_ALIGN-ed, but for strict alignment checking802802+ * we force this to 2 which is universally what architectures use803803+ * when they don't set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.804804+ */805805+ ip_align = strict ? 2 : NET_IP_ALIGN;806806+ if ((ip_align + reg_off + off) % size != 0) {801807 verbose("misaligned packet access off %d+%d+%d size %d\n",802802- NET_IP_ALIGN, reg->off, off, size);808808+ ip_align, reg_off, off, size);803809 return -EACCES;804810 }805811···823797}824798825799static int check_val_ptr_alignment(const struct bpf_reg_state *reg,826826- int size)800800+ int size, bool strict)827801{828828- if (size != 1) {802802+ if (strict && size != 1) {829803 verbose("Unknown alignment. Only byte-sized access allowed in value access.\n");830804 return -EACCES;831805 }···833807 return 0;834808}835809836836-static int check_ptr_alignment(const struct bpf_reg_state *reg,810810+static int check_ptr_alignment(struct bpf_verifier_env *env,811811+ const struct bpf_reg_state *reg,837812 int off, int size)838813{814814+ bool strict = env->strict_alignment;815815+816816+ if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS))817817+ strict = true;818818+839819 switch (reg->type) {840820 case PTR_TO_PACKET:841841- return IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) ? 0 :842842- check_pkt_ptr_alignment(reg, off, size);821821+ return check_pkt_ptr_alignment(reg, off, size, strict);843822 case PTR_TO_MAP_VALUE_ADJ:844844- return IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) ? 0 :845845- check_val_ptr_alignment(reg, size);823823+ return check_val_ptr_alignment(reg, size, strict);846824 default:847825 if (off % size != 0) {848826 verbose("misaligned access off %d size %d\n",···879849 if (size < 0)880850 return size;881851882882- err = check_ptr_alignment(reg, off, size);852852+ err = check_ptr_alignment(env, reg, off, size);883853 if (err)884854 return err;885855···913883 value_regno);914884 /* note that reg.[id|off|range] == 0 */915885 state->regs[value_regno].type = reg_type;886886+ state->regs[value_regno].aux_off = 0;887887+ state->regs[value_regno].aux_off_align = 0;916888 }917889918890 } else if (reg->type == FRAME_PTR || reg->type == PTR_TO_STACK) {···14871455 */14881456 dst_reg->off += imm;14891457 } else {14581458+ bool had_id;14591459+14901460 if (src_reg->type == PTR_TO_PACKET) {14911461 /* R6=pkt(id=0,off=0,r=62) R7=imm22; r7 += r6 */14921462 tmp_reg = *dst_reg; /* save r7 state */···15221488 src_reg->imm);15231489 return -EACCES;15241490 }14911491+14921492+ had_id = (dst_reg->id != 0);14931493+15251494 /* dst_reg stays as pkt_ptr type and since some positive15261495 * integer value was added to the pointer, increment its 'id'15271496 */15281497 dst_reg->id = ++env->id_gen;1529149815301530- /* something was added to pkt_ptr, set range and off to zero */14991499+ /* something was added to pkt_ptr, set range to zero */15001500+ dst_reg->aux_off += dst_reg->off;15311501 dst_reg->off = 0;15321502 dst_reg->range = 0;15031503+ if (had_id)15041504+ dst_reg->aux_off_align = min(dst_reg->aux_off_align,15051505+ src_reg->min_align);15061506+ else15071507+ dst_reg->aux_off_align = src_reg->min_align;15331508 }15341509 return 0;15351510}···17121669 reg->min_value = BPF_REGISTER_MIN_RANGE;17131670}1714167116721672+static u32 calc_align(u32 imm)16731673+{16741674+ if (!imm)16751675+ return 1U << 31;16761676+ return imm - ((imm - 1) & imm);16771677+}16781678+17151679static void adjust_reg_min_max_vals(struct bpf_verifier_env *env,17161680 struct bpf_insn *insn)17171681{···17261676 s64 min_val = BPF_REGISTER_MIN_RANGE;17271677 u64 max_val = BPF_REGISTER_MAX_RANGE;17281678 u8 opcode = BPF_OP(insn->code);16791679+ u32 dst_align, src_align;1729168017301681 dst_reg = ®s[insn->dst_reg];16821682+ src_align = 0;17311683 if (BPF_SRC(insn->code) == BPF_X) {17321684 check_reg_overflow(®s[insn->src_reg]);17331685 min_val = regs[insn->src_reg].min_value;···17451693 regs[insn->src_reg].type != UNKNOWN_VALUE) {17461694 min_val = BPF_REGISTER_MIN_RANGE;17471695 max_val = BPF_REGISTER_MAX_RANGE;16961696+ src_align = 0;16971697+ } else {16981698+ src_align = regs[insn->src_reg].min_align;17481699 }17491700 } else if (insn->imm < BPF_REGISTER_MAX_RANGE &&17501701 (s64)insn->imm > BPF_REGISTER_MIN_RANGE) {17511702 min_val = max_val = insn->imm;17031703+ src_align = calc_align(insn->imm);17521704 }17051705+17061706+ dst_align = dst_reg->min_align;1753170717541708 /* We don't know anything about what was done to this register, mark it17551709 * as unknown.···17811723 dst_reg->min_value += min_val;17821724 if (dst_reg->max_value != BPF_REGISTER_MAX_RANGE)17831725 dst_reg->max_value += max_val;17261726+ dst_reg->min_align = min(src_align, dst_align);17841727 break;17851728 case BPF_SUB:17861729 if (dst_reg->min_value != BPF_REGISTER_MIN_RANGE)17871730 dst_reg->min_value -= min_val;17881731 if (dst_reg->max_value != BPF_REGISTER_MAX_RANGE)17891732 dst_reg->max_value -= max_val;17331733+ dst_reg->min_align = min(src_align, dst_align);17901734 break;17911735 case BPF_MUL:17921736 if (dst_reg->min_value != BPF_REGISTER_MIN_RANGE)17931737 dst_reg->min_value *= min_val;17941738 if (dst_reg->max_value != BPF_REGISTER_MAX_RANGE)17951739 dst_reg->max_value *= max_val;17401740+ dst_reg->min_align = max(src_align, dst_align);17961741 break;17971742 case BPF_AND:17981743 /* Disallow AND'ing of negative numbers, ain't nobody got time···18071746 else18081747 dst_reg->min_value = 0;18091748 dst_reg->max_value = max_val;17491749+ dst_reg->min_align = max(src_align, dst_align);18101750 break;18111751 case BPF_LSH:18121752 /* Gotta have special overflow logic here, if we're shifting18131753 * more than MAX_RANGE then just assume we have an invalid18141754 * range.18151755 */18161816- if (min_val > ilog2(BPF_REGISTER_MAX_RANGE))17561756+ if (min_val > ilog2(BPF_REGISTER_MAX_RANGE)) {18171757 dst_reg->min_value = BPF_REGISTER_MIN_RANGE;18181818- else if (dst_reg->min_value != BPF_REGISTER_MIN_RANGE)18191819- dst_reg->min_value <<= min_val;18201820-17581758+ dst_reg->min_align = 1;17591759+ } else {17601760+ if (dst_reg->min_value != BPF_REGISTER_MIN_RANGE)17611761+ dst_reg->min_value <<= min_val;17621762+ if (!dst_reg->min_align)17631763+ dst_reg->min_align = 1;17641764+ dst_reg->min_align <<= min_val;17651765+ }18211766 if (max_val > ilog2(BPF_REGISTER_MAX_RANGE))18221767 dst_reg->max_value = BPF_REGISTER_MAX_RANGE;18231768 else if (dst_reg->max_value != BPF_REGISTER_MAX_RANGE)···18331766 /* RSH by a negative number is undefined, and the BPF_RSH is an18341767 * unsigned shift, so make the appropriate casts.18351768 */18361836- if (min_val < 0 || dst_reg->min_value < 0)17691769+ if (min_val < 0 || dst_reg->min_value < 0) {18371770 dst_reg->min_value = BPF_REGISTER_MIN_RANGE;18381838- else17711771+ } else {18391772 dst_reg->min_value =18401773 (u64)(dst_reg->min_value) >> min_val;17741774+ }17751775+ if (min_val < 0) {17761776+ dst_reg->min_align = 1;17771777+ } else {17781778+ dst_reg->min_align >>= (u64) min_val;17791779+ if (!dst_reg->min_align)17801780+ dst_reg->min_align = 1;17811781+ }18411782 if (dst_reg->max_value != BPF_REGISTER_MAX_RANGE)18421783 dst_reg->max_value >>= max_val;18431784 break;···19471872 regs[insn->dst_reg].imm = insn->imm;19481873 regs[insn->dst_reg].max_value = insn->imm;19491874 regs[insn->dst_reg].min_value = insn->imm;18751875+ regs[insn->dst_reg].min_align = calc_align(insn->imm);19501876 }1951187719521878 } else if (opcode > BPF_END) {···26402564 env->explored_states[t + 1] = STATE_LIST_MARK;26412565 } else {26422566 /* conditional jump with two edges */25672567+ env->explored_states[t] = STATE_LIST_MARK;26432568 ret = push_insn(t, t + 1, FALLTHROUGH, env);26442569 if (ret == 1)26452570 goto peek_stack;···27992722 rcur->type != NOT_INIT))28002723 continue;2801272427252725+ /* Don't care about the reg->id in this case. */27262726+ if (rold->type == PTR_TO_MAP_VALUE_OR_NULL &&27272727+ rcur->type == PTR_TO_MAP_VALUE_OR_NULL &&27282728+ rold->map_ptr == rcur->map_ptr)27292729+ continue;27302730+28022731 if (rold->type == PTR_TO_PACKET && rcur->type == PTR_TO_PACKET &&28032732 compare_ptrs_to_packet(rold, rcur))28042733 continue;···29392856 goto process_bpf_exit;29402857 }2941285829422942- if (log_level && do_print_state) {29432943- verbose("\nfrom %d to %d:", prev_insn_idx, insn_idx);28592859+ if (need_resched())28602860+ cond_resched();28612861+28622862+ if (log_level > 1 || (log_level && do_print_state)) {28632863+ if (log_level > 1)28642864+ verbose("%d:", insn_idx);28652865+ else28662866+ verbose("\nfrom %d to %d:",28672867+ prev_insn_idx, insn_idx);29442868 print_verifier_state(&env->cur_state);29452869 do_print_state = false;29462870 }···35843494 } else {35853495 log_level = 0;35863496 }34973497+ if (attr->prog_flags & BPF_F_STRICT_ALIGNMENT)34983498+ env->strict_alignment = true;34993499+ else35003500+ env->strict_alignment = false;3587350135883502 ret = replace_map_fd_with_map_ptr(env);35893503 if (ret < 0)···36933599 mutex_lock(&bpf_verifier_lock);3694360036953601 log_level = 0;36023602+ env->strict_alignment = false;3696360336973604 env->explored_states = kcalloc(env->prog->len,36983605 sizeof(struct bpf_verifier_state_list *),
···595595}596596597597/* Wait for completing optimization and unoptimization */598598-static void wait_for_kprobe_optimizer(void)598598+void wait_for_kprobe_optimizer(void)599599{600600 mutex_lock(&kprobe_mutex);601601···21832183 * The vaddr this probe is installed will soon21842184 * be vfreed buy not synced to disk. Hence,21852185 * disarming the breakpoint isn't needed.21862186+ *21872187+ * Note, this will also move any optimized probes21882188+ * that are pending to be removed from their21892189+ * corresponding lists to the freeing_list and21902190+ * will not be touched by the delayed21912191+ * kprobe_optimizer work handler.21862192 */21872193 kill_kprobe(p);21882194 }
+1-1
kernel/pid_namespace.c
···277277 * if reparented.278278 */279279 for (;;) {280280- set_current_state(TASK_UNINTERRUPTIBLE);280280+ set_current_state(TASK_INTERRUPTIBLE);281281 if (pid_ns->nr_hashed == init_pids)282282 break;283283 schedule();
+25
kernel/sched/core.c
···35023502}35033503EXPORT_SYMBOL(schedule);3504350435053505+/*35063506+ * synchronize_rcu_tasks() makes sure that no task is stuck in preempted35073507+ * state (have scheduled out non-voluntarily) by making sure that all35083508+ * tasks have either left the run queue or have gone into user space.35093509+ * As idle tasks do not do either, they must not ever be preempted35103510+ * (schedule out non-voluntarily).35113511+ *35123512+ * schedule_idle() is similar to schedule_preempt_disable() except that it35133513+ * never enables preemption because it does not call sched_submit_work().35143514+ */35153515+void __sched schedule_idle(void)35163516+{35173517+ /*35183518+ * As this skips calling sched_submit_work(), which the idle task does35193519+ * regardless because that function is a nop when the task is in a35203520+ * TASK_RUNNING state, make sure this isn't used someplace that the35213521+ * current task can be in any other state. Note, idle is always in the35223522+ * TASK_RUNNING state.35233523+ */35243524+ WARN_ON_ONCE(current->state);35253525+ do {35263526+ __schedule(false);35273527+ } while (need_resched());35283528+}35293529+35053530#ifdef CONFIG_CONTEXT_TRACKING35063531asmlinkage __visible void __sched schedule_user(void)35073532{
+1-1
kernel/sched/idle.c
···265265 smp_mb__after_atomic();266266267267 sched_ttwu_pending();268268- schedule_preempt_disabled();268268+ schedule_idle();269269270270 if (unlikely(klp_patch_pending(current)))271271 klp_update_patch_state(current);
···16621662 goto out;1663166316641664 if (attr == &dev_attr_act_mask) {16651665- if (sscanf(buf, "%llx", &value) != 1) {16651665+ if (kstrtoull(buf, 0, &value)) {16661666 /* Assume it is a list of trace category names */16671667 ret = blk_trace_str2mask(buf);16681668 if (ret < 0)16691669 goto out;16701670 value = ret;16711671 }16721672- } else if (sscanf(buf, "%llu", &value) != 1)16721672+ } else if (kstrtoull(buf, 0, &value))16731673 goto out;1674167416751675 ret = -ENXIO;
+10-2
kernel/trace/ftrace.c
···41444144 int i, ret = -ENODEV;41454145 int size;4146414641474147- if (glob && (strcmp(glob, "*") == 0 || !strlen(glob)))41474147+ if (!glob || !strlen(glob) || !strcmp(glob, "*"))41484148 func_g.search = NULL;41494149- else if (glob) {41494149+ else {41504150 int not;4151415141524152 func_g.type = filter_parse_regex(glob, strlen(glob),···42544254 err_unlock_ftrace:42554255 mutex_unlock(&ftrace_lock);42564256 return ret;42574257+}42584258+42594259+void clear_ftrace_function_probes(struct trace_array *tr)42604260+{42614261+ struct ftrace_func_probe *probe, *n;42624262+42634263+ list_for_each_entry_safe(probe, n, &tr->func_probes, list)42644264+ unregister_ftrace_function_probe_func(NULL, tr, probe->probe_ops);42574265}4258426642594267static LIST_HEAD(ftrace_commands);
+32-2
kernel/trace/trace.c
···1558155815591559 return 0;15601560}15611561-early_initcall(init_trace_selftests);15611561+core_initcall(init_trace_selftests);15621562#else15631563static inline int run_tracer_selftest(struct tracer *type)15641564{···25682568void __trace_stack(struct trace_array *tr, unsigned long flags, int skip,25692569 int pc)25702570{25712571- __ftrace_trace_stack(tr->trace_buffer.buffer, flags, skip, pc, NULL);25712571+ struct ring_buffer *buffer = tr->trace_buffer.buffer;25722572+25732573+ if (rcu_is_watching()) {25742574+ __ftrace_trace_stack(buffer, flags, skip, pc, NULL);25752575+ return;25762576+ }25772577+25782578+ /*25792579+ * When an NMI triggers, RCU is enabled via rcu_nmi_enter(),25802580+ * but if the above rcu_is_watching() failed, then the NMI25812581+ * triggered someplace critical, and rcu_irq_enter() should25822582+ * not be called from NMI.25832583+ */25842584+ if (unlikely(in_nmi()))25852585+ return;25862586+25872587+ /*25882588+ * It is possible that a function is being traced in a25892589+ * location that RCU is not watching. A call to25902590+ * rcu_irq_enter() will make sure that it is, but there's25912591+ * a few internal rcu functions that could be traced25922592+ * where that wont work either. In those cases, we just25932593+ * do nothing.25942594+ */25952595+ if (unlikely(rcu_irq_enter_disabled()))25962596+ return;25972597+25982598+ rcu_irq_enter_irqson();25992599+ __ftrace_trace_stack(buffer, flags, skip, pc, NULL);26002600+ rcu_irq_exit_irqson();25722601}2573260225742603/**···75797550 }7580755175817552 tracing_set_nop(tr);75537553+ clear_ftrace_function_probes(tr);75827554 event_trace_del_tracer(tr);75837555 ftrace_clear_pids(tr);75847556 ftrace_destroy_function_files(tr);
+5
kernel/trace/trace.h
···980980extern int981981unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr,982982 struct ftrace_probe_ops *ops);983983+extern void clear_ftrace_function_probes(struct trace_array *tr);983984984985int register_ftrace_command(struct ftrace_func_command *cmd);985986int unregister_ftrace_command(struct ftrace_func_command *cmd);···999998{1000999 return -EINVAL;10011000}10011001+static inline void clear_ftrace_function_probes(struct trace_array *tr)10021002+{10031003+}10041004+10021005/*10031006 * The ops parameter passed in is usually undefined.10041007 * This must be a macro.
+5
kernel/trace/trace_kprobe.c
···1535153515361536end:15371537 release_all_trace_kprobes();15381538+ /*15391539+ * Wait for the optimizer work to finish. Otherwise it might fiddle15401540+ * with probes in already freed __init text.15411541+ */15421542+ wait_for_kprobe_optimizer();15381543 if (warn)15391544 pr_cont("NG: Some tests are failed. Please check them.\n");15401545 else
+4-4
net/9p/trans_xen.c
···454454 goto error_xenbus;455455 }456456 priv->tag = xenbus_read(xbt, dev->nodename, "tag", NULL);457457- if (!priv->tag) {458458- ret = -EINVAL;457457+ if (IS_ERR(priv->tag)) {458458+ ret = PTR_ERR(priv->tag);459459 goto error_xenbus;460460 }461461 ret = xenbus_transaction_end(xbt, 0);···525525 .otherend_changed = xen_9pfs_front_changed,526526};527527528528-int p9_trans_xen_init(void)528528+static int p9_trans_xen_init(void)529529{530530 if (!xen_domain())531531 return -ENODEV;···537537}538538module_init(p9_trans_xen_init);539539540540-void p9_trans_xen_exit(void)540540+static void p9_trans_xen_exit(void)541541{542542 v9fs_unregister_trans(&p9_xen_trans);543543 return xenbus_unregister_driver(&xen_9pfs_front_driver);
···11321132 lladdr = neigh->ha;11331133 }1134113411351135- if (new & NUD_CONNECTED)11361136- neigh->confirmed = jiffies;11371137- neigh->updated = jiffies;11381138-11391135 /* If entry was valid and address is not changed,11401136 do not change entry state, if new one is STALE.11411137 */···11511155 !(flags & NEIGH_UPDATE_F_ADMIN))11521156 new = old;11531157 }11581158+ }11591159+11601160+ /* Update timestamps only once we know we will make a change to the11611161+ * neighbour entry. Otherwise we risk to move the locktime window with11621162+ * noop updates and ignore relevant ARP updates.11631163+ */11641164+ if (new != old || lladdr != neigh->ha) {11651165+ if (new & NUD_CONNECTED)11661166+ neigh->confirmed = jiffies;11671167+ neigh->updated = jiffies;11541168 }1155116911561170 if (new != old) {
+46-33
net/core/rtnetlink.c
···899899static size_t rtnl_xdp_size(void)900900{901901 size_t xdp_size = nla_total_size(0) + /* nest IFLA_XDP */902902- nla_total_size(1) + /* XDP_ATTACHED */903903- nla_total_size(4); /* XDP_FLAGS */902902+ nla_total_size(1); /* XDP_ATTACHED */904903905904 return xdp_size;906905}···12461247 return 0;12471248}1248124912501250+static u8 rtnl_xdp_attached_mode(struct net_device *dev)12511251+{12521252+ const struct net_device_ops *ops = dev->netdev_ops;12531253+12541254+ ASSERT_RTNL();12551255+12561256+ if (rcu_access_pointer(dev->xdp_prog))12571257+ return XDP_ATTACHED_SKB;12581258+ if (ops->ndo_xdp && __dev_xdp_attached(dev, ops->ndo_xdp))12591259+ return XDP_ATTACHED_DRV;12601260+12611261+ return XDP_ATTACHED_NONE;12621262+}12631263+12491264static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)12501265{12511266 struct nlattr *xdp;12521252- u32 xdp_flags = 0;12531253- u8 val = 0;12541267 int err;1255126812561269 xdp = nla_nest_start(skb, IFLA_XDP);12571270 if (!xdp)12581271 return -EMSGSIZE;12591259- if (rcu_access_pointer(dev->xdp_prog)) {12601260- xdp_flags = XDP_FLAGS_SKB_MODE;12611261- val = 1;12621262- } else if (dev->netdev_ops->ndo_xdp) {12631263- struct netdev_xdp xdp_op = {};1264127212651265- xdp_op.command = XDP_QUERY_PROG;12661266- err = dev->netdev_ops->ndo_xdp(dev, &xdp_op);12671267- if (err)12681268- goto err_cancel;12691269- val = xdp_op.prog_attached;12701270- }12711271- err = nla_put_u8(skb, IFLA_XDP_ATTACHED, val);12731273+ err = nla_put_u8(skb, IFLA_XDP_ATTACHED,12741274+ rtnl_xdp_attached_mode(dev));12721275 if (err)12731276 goto err_cancel;1274127712751275- if (xdp_flags) {12761276- err = nla_put_u32(skb, IFLA_XDP_FLAGS, xdp_flags);12771277- if (err)12781278- goto err_cancel;12791279- }12801278 nla_nest_end(skb, xdp);12811279 return 0;12821280···16271631 cb->nlh->nlmsg_seq, 0,16281632 flags,16291633 ext_filter_mask);16301630- /* If we ran out of room on the first message,16311631- * we're in trouble16321632- */16331633- WARN_ON((err == -EMSGSIZE) && (skb->len == 0));1634163416351635- if (err < 0)16361636- goto out;16351635+ if (err < 0) {16361636+ if (likely(skb->len))16371637+ goto out;16381638+16391639+ goto out_err;16401640+ }1637164116381642 nl_dump_check_consistent(cb, nlmsg_hdr(skb));16391643cont:···16411645 }16421646 }16431647out:16481648+ err = skb->len;16491649+out_err:16441650 cb->args[1] = idx;16451651 cb->args[0] = h;1646165216471647- return skb->len;16531653+ return err;16481654}1649165516501656int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len,···21942196 if (xdp[IFLA_XDP_FLAGS]) {21952197 xdp_flags = nla_get_u32(xdp[IFLA_XDP_FLAGS]);21962198 if (xdp_flags & ~XDP_FLAGS_MASK) {21992199+ err = -EINVAL;22002200+ goto errout;22012201+ }22022202+ if ((xdp_flags & XDP_FLAGS_SKB_MODE) &&22032203+ (xdp_flags & XDP_FLAGS_DRV_MODE)) {21972204 err = -EINVAL;21982205 goto errout;21992206 }···34553452 err = br_dev->netdev_ops->ndo_bridge_getlink(34563453 skb, portid, seq, dev,34573454 filter_mask, NLM_F_MULTI);34583458- if (err < 0 && err != -EOPNOTSUPP)34593459- break;34553455+ if (err < 0 && err != -EOPNOTSUPP) {34563456+ if (likely(skb->len))34573457+ break;34583458+34593459+ goto out_err;34603460+ }34603461 }34613462 idx++;34623463 }···34713464 seq, dev,34723465 filter_mask,34733466 NLM_F_MULTI);34743474- if (err < 0 && err != -EOPNOTSUPP)34753475- break;34673467+ if (err < 0 && err != -EOPNOTSUPP) {34683468+ if (likely(skb->len))34693469+ break;34703470+34713471+ goto out_err;34723472+ }34763473 }34773474 idx++;34783475 }34793476 }34773477+ err = skb->len;34783478+out_err:34803479 rcu_read_unlock();34813480 cb->args[0] = idx;3482348134833483- return skb->len;34823482+ return err;34843483}3485348434863485static inline size_t bridge_nlmsg_size(void)
+8-15
net/core/sock.c
···139139140140#include <trace/events/sock.h>141141142142-#ifdef CONFIG_INET143142#include <net/tcp.h>144144-#endif145145-146143#include <net/busy_poll.h>147144148145static DEFINE_MUTEX(proto_list_mutex);···18001803 * delay queue. We want to allow the owner socket to send more18011804 * packets, as if they were already TX completed by a typical driver.18021805 * But we also want to keep skb->sk set because some packet schedulers18031803- * rely on it (sch_fq for example). So we set skb->truesize to a small18041804- * amount (1) and decrease sk_wmem_alloc accordingly.18061806+ * rely on it (sch_fq for example).18051807 */18061808void skb_orphan_partial(struct sk_buff *skb)18071809{18081808- /* If this skb is a TCP pure ACK or already went here,18091809- * we have nothing to do. 2 is already a very small truesize.18101810- */18111811- if (skb->truesize <= 2)18101810+ if (skb_is_tcp_pure_ack(skb))18121811 return;1813181218141814- /* TCP stack sets skb->ooo_okay based on sk_wmem_alloc,18151815- * so we do not completely orphan skb, but transfert all18161816- * accounted bytes but one, to avoid unexpected reorders.18171817- */18181813 if (skb->destructor == sock_wfree18191814#ifdef CONFIG_INET18201815 || skb->destructor == tcp_wfree18211816#endif18221817 ) {18231823- atomic_sub(skb->truesize - 1, &skb->sk->sk_wmem_alloc);18241824- skb->truesize = 1;18181818+ struct sock *sk = skb->sk;18191819+18201820+ if (atomic_inc_not_zero(&sk->sk_refcnt)) {18211821+ atomic_sub(skb->truesize, &sk->sk_wmem_alloc);18221822+ skb->destructor = sock_efree;18231823+ }18251824 } else {18261825 skb_orphan(skb);18271826 }
···653653 unsigned char *arp_ptr;654654 struct rtable *rt;655655 unsigned char *sha;656656+ unsigned char *tha = NULL;656657 __be32 sip, tip;657658 u16 dev_type = dev->type;658659 int addr_type;···725724 break;726725#endif727726 default:727727+ tha = arp_ptr;728728 arp_ptr += dev->addr_len;729729 }730730 memcpy(&tip, arp_ptr, 4);···844842 It is possible, that this option should be enabled for some845843 devices (strip is candidate)846844 */847847- is_garp = arp->ar_op == htons(ARPOP_REQUEST) && tip == sip &&848848- addr_type == RTN_UNICAST;845845+ is_garp = tip == sip && addr_type == RTN_UNICAST;846846+847847+ /* Unsolicited ARP _replies_ also require target hwaddr to be848848+ * the same as source.849849+ */850850+ if (is_garp && arp->ar_op == htons(ARPOP_REPLY))851851+ is_garp =852852+ /* IPv4 over IEEE 1394 doesn't provide target853853+ * hardware address field in its ARP payload.854854+ */855855+ tha &&856856+ !memcmp(tha, sha, dev->addr_len);849857850858 if (!n &&851859 ((arp->ar_op == htons(ARPOP_REPLY) &&
+11-4
net/ipv4/fib_frontend.c
···763763 unsigned int e = 0, s_e;764764 struct fib_table *tb;765765 struct hlist_head *head;766766- int dumped = 0;766766+ int dumped = 0, err;767767768768 if (nlmsg_len(cb->nlh) >= sizeof(struct rtmsg) &&769769 ((struct rtmsg *) nlmsg_data(cb->nlh))->rtm_flags & RTM_F_CLONED)···783783 if (dumped)784784 memset(&cb->args[2], 0, sizeof(cb->args) -785785 2 * sizeof(cb->args[0]));786786- if (fib_table_dump(tb, skb, cb) < 0)787787- goto out;786786+ err = fib_table_dump(tb, skb, cb);787787+ if (err < 0) {788788+ if (likely(skb->len))789789+ goto out;790790+791791+ goto out_err;792792+ }788793 dumped = 1;789794next:790795 e++;791796 }792797 }793798out:799799+ err = skb->len;800800+out_err:794801 rcu_read_unlock();795802796803 cb->args[1] = e;797804 cb->args[0] = h;798805799799- return skb->len;806806+ return err;800807}801808802809/* Prepare and feed intra-kernel routing request.
+14-12
net/ipv4/fib_trie.c
···1983198319841984 /* rcu_read_lock is hold by caller */19851985 hlist_for_each_entry_rcu(fa, &l->leaf, fa_list) {19861986+ int err;19871987+19861988 if (i < s_i) {19871989 i++;19881990 continue;···19951993 continue;19961994 }1997199519981998- if (fib_dump_info(skb, NETLINK_CB(cb->skb).portid,19991999- cb->nlh->nlmsg_seq,20002000- RTM_NEWROUTE,20012001- tb->tb_id,20022002- fa->fa_type,20032003- xkey,20042004- KEYLENGTH - fa->fa_slen,20052005- fa->fa_tos,20062006- fa->fa_info, NLM_F_MULTI) < 0) {19961996+ err = fib_dump_info(skb, NETLINK_CB(cb->skb).portid,19971997+ cb->nlh->nlmsg_seq, RTM_NEWROUTE,19981998+ tb->tb_id, fa->fa_type,19991999+ xkey, KEYLENGTH - fa->fa_slen,20002000+ fa->fa_tos, fa->fa_info, NLM_F_MULTI);20012001+ if (err < 0) {20072002 cb->args[4] = i;20082008- return -1;20032003+ return err;20092004 }20102005 i++;20112006 }···20242025 t_key key = cb->args[3];2025202620262027 while ((l = leaf_walk_rcu(&tp, key)) != NULL) {20272027- if (fn_trie_dump_leaf(l, tb, skb, cb) < 0) {20282028+ int err;20292029+20302030+ err = fn_trie_dump_leaf(l, tb, skb, cb);20312031+ if (err < 0) {20282032 cb->args[3] = key;20292033 cb->args[2] = count;20302030- return -1;20342034+ return err;20312035 }2032203620332037 ++count;
+16-2
net/ipv4/ipmr.c
···19801980 struct net *net = dev_net(skb->dev);19811981 int local = skb_rtable(skb)->rt_flags & RTCF_LOCAL;19821982 struct mr_table *mrt;19831983+ struct net_device *dev;19841984+19851985+ /* skb->dev passed in is the loX master dev for vrfs.19861986+ * As there are no vifs associated with loopback devices,19871987+ * get the proper interface that does have a vif associated with it.19881988+ */19891989+ dev = skb->dev;19901990+ if (netif_is_l3_master(skb->dev)) {19911991+ dev = dev_get_by_index_rcu(net, IPCB(skb)->iif);19921992+ if (!dev) {19931993+ kfree_skb(skb);19941994+ return -ENODEV;19951995+ }19961996+ }1983199719841998 /* Packet is looped back after forward, it should not be19851999 * forwarded second time, but still can be delivered locally.···20312017 /* already under rcu_read_lock() */20322018 cache = ipmr_cache_find(mrt, ip_hdr(skb)->saddr, ip_hdr(skb)->daddr);20332019 if (!cache) {20342034- int vif = ipmr_find_vif(mrt, skb->dev);20202020+ int vif = ipmr_find_vif(mrt, dev);2035202120362022 if (vif >= 0)20372023 cache = ipmr_cache_find_any(mrt, ip_hdr(skb)->daddr,···20512037 }2052203820532039 read_lock(&mrt_lock);20542054- vif = ipmr_find_vif(mrt, skb->dev);20402040+ vif = ipmr_find_vif(mrt, dev);20552041 if (vif >= 0) {20562042 int err2 = ipmr_cache_unresolved(mrt, vif, skb);20572043 read_unlock(&mrt_lock);
+6-5
net/ipv4/tcp_input.c
···11791179 */11801180 if (pkt_len > mss) {11811181 unsigned int new_len = (pkt_len / mss) * mss;11821182- if (!in_sack && new_len < pkt_len) {11821182+ if (!in_sack && new_len < pkt_len)11831183 new_len += mss;11841184- if (new_len >= skb->len)11851185- return 0;11861186- }11871184 pkt_len = new_len;11881185 }11861186+11871187+ if (pkt_len >= skb->len && !in_sack)11881188+ return 0;11891189+11891190 err = tcp_fragment(sk, skb, pkt_len, mss, GFP_ATOMIC);11901191 if (err < 0)11911192 return err;···31903189 int delta;3191319031923191 /* Non-retransmitted hole got filled? That's reordering */31933193- if (reord < prior_fackets)31923192+ if (reord < prior_fackets && reord <= tp->fackets_out)31943193 tcp_update_reordering(sk, tp->fackets_out - reord, 0);3195319431963195 delta = tcp_is_fack(tp) ? pkts_acked :
+2-2
net/ipv4/udp.c
···16121612 udp_lib_rehash(sk, new_hash);16131613}1614161416151615-int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)16151615+static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)16161616{16171617 int rc;16181618···16571657 * Note that in the success and error cases, the skb is assumed to16581658 * have either been requeued or freed.16591659 */16601660-int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)16601660+static int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)16611661{16621662 struct udp_sock *up = udp_sk(sk);16631663 int is_udplite = IS_UDPLITE(sk);
-1
net/ipv4/udp_impl.h
···2525 int flags, int *addr_len);2626int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,2727 int flags);2828-int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);2928void udp_destroy_sock(struct sock *sk);30293130#ifdef CONFIG_PROC_FS
+4-1
net/ipv6/addrconf.c
···10221022 INIT_HLIST_NODE(&ifa->addr_lst);10231023 ifa->scope = scope;10241024 ifa->prefix_len = pfxlen;10251025- ifa->flags = flags | IFA_F_TENTATIVE;10251025+ ifa->flags = flags;10261026+ /* No need to add the TENTATIVE flag for addresses with NODAD */10271027+ if (!(flags & IFA_F_NODAD))10281028+ ifa->flags |= IFA_F_TENTATIVE;10261029 ifa->valid_lft = valid_lft;10271030 ifa->prefered_lft = prefered_lft;10281031 ifa->cstamp = ifa->tstamp = jiffies;
+4-3
net/ipv6/ip6_offload.c
···6363 const struct net_offload *ops;6464 int proto;6565 struct frag_hdr *fptr;6666- unsigned int unfrag_ip6hlen;6766 unsigned int payload_len;6867 u8 *prevhdr;6968 int offset = 0;···115116 skb->network_header = (u8 *)ipv6h - skb->head;116117117118 if (udpfrag) {118118- unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr);119119- fptr = (struct frag_hdr *)((u8 *)ipv6h + unfrag_ip6hlen);119119+ int err = ip6_find_1stfragopt(skb, &prevhdr);120120+ if (err < 0)121121+ return ERR_PTR(err);122122+ fptr = (struct frag_hdr *)((u8 *)ipv6h + err);120123 fptr->frag_off = htons(offset);121124 if (skb->next)122125 fptr->frag_off |= htons(IP6_MF);
···88 The Linux implementation of the SMC-R solution is designed as99 a separate socket family SMC.10101111+ Warning: SMC will expose all memory for remote reads and writes1212+ once a connection is established. Don't enable this option except1313+ for tightly controlled lab environment.1414+1115 Select this option if you want to run SMC socket applications12161317config SMC_DIAG
···306306 prog_attach_iptables(argv[2]);307307 if (cfg_test_traffic) {308308 if (signal(SIGINT, finish) == SIG_ERR)309309- error(1, errno, "register handler failed");309309+ error(1, errno, "register SIGINT handler failed");310310+ if (signal(SIGTERM, finish) == SIG_ERR)311311+ error(1, errno, "register SIGTERM handler failed");310312 while (!test_finish) {311313 print_table();312314 printf("\n");
+1
samples/bpf/offwaketime_user.c
···100100 setrlimit(RLIMIT_MEMLOCK, &r);101101102102 signal(SIGINT, int_exit);103103+ signal(SIGTERM, int_exit);103104104105 if (load_kallsyms()) {105106 printf("failed to process /proc/kallsyms\n");
+1
samples/bpf/sampleip_user.c
···180180 return 1;181181 }182182 signal(SIGINT, int_exit);183183+ signal(SIGTERM, int_exit);183184184185 /* do sampling */185186 printf("Sampling at %d Hertz for %d seconds. Ctrl-C also ends.\n",
+1
samples/bpf/trace_event_user.c
···192192 setrlimit(RLIMIT_MEMLOCK, &r);193193194194 signal(SIGINT, int_exit);195195+ signal(SIGTERM, int_exit);195196196197 if (load_kallsyms()) {197198 printf("failed to process /proc/kallsyms\n");
+1
samples/bpf/tracex2_user.c
···127127 }128128129129 signal(SIGINT, int_exit);130130+ signal(SIGTERM, int_exit);130131131132 /* start 'ping' in the background to have some kfree_skb events */132133 f = popen("ping -c5 localhost", "r");
···873873 while (size--)874874 reg = (reg << 32) | fdt32_to_cpu(*(cells++));875875876876- snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);876876+ snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);877877 if (!streq(unitname, unit_addr))878878 FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"",879879 node->fullpath, unit_addr);
-4
sound/x86/intel_hdmi_audio.c
···18091809 pdata->notify_pending = false;18101810 spin_unlock_irq(&pdata->lpe_audio_slock);1811181118121812- /* runtime PM isn't enabled as default, since it won't save much on18131813- * BYT/CHT devices; user who want the runtime PM should adjust the18141814- * power/ontrol and power/autosuspend_delay_ms sysfs entries instead18151815- */18161812 pm_runtime_use_autosuspend(&pdev->dev);18171813 pm_runtime_mark_last_busy(&pdev->dev);18181814 pm_runtime_set_active(&pdev->dev);
+1
tools/build/feature/test-bpf.c
···2929 attr.log_size = 0;3030 attr.log_level = 0;3131 attr.kern_version = 0;3232+ attr.prog_flags = 0;32333334 /*3435 * Test existence of __NR_bpf and BPF_PROG_LOAD.
+9-2
tools/include/uapi/linux/bpf.h
···132132 */133133#define BPF_F_ALLOW_OVERRIDE (1U << 0)134134135135+/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the136136+ * verifier will perform strict alignment checking as if the kernel137137+ * has been built with CONFIG_EFFICIENT_UNALIGNED_ACCESS not set,138138+ * and NET_IP_ALIGN defined to 2.139139+ */140140+#define BPF_F_STRICT_ALIGNMENT (1U << 0)141141+135142#define BPF_PSEUDO_MAP_FD 1136143137144/* flags for BPF_MAP_UPDATE_ELEM command */···184177 __u32 log_size; /* size of user buffer */185178 __aligned_u64 log_buf; /* user supplied buffer */186179 __u32 kern_version; /* checked when prog_type=kprobe */180180+ __u32 prog_flags;187181 };188182189183 struct { /* anonymous struct used by BPF_OBJ_* commands */···489481 * u32 bpf_get_socket_uid(skb)490482 * Get the owner uid of the socket stored inside sk_buff.491483 * @skb: pointer to skb492492- * Return: uid of the socket owner on success or 0 if the socket pointer493493- * inside sk_buff is NULL484484+ * Return: uid of the socket owner on success or overflowuid if failed.494485 */495486#define __BPF_FUNC_MAPPER(FN) \496487 FN(unspec), \
···11+#include <asm/types.h>22+#include <linux/types.h>33+#include <stdint.h>44+#include <stdio.h>55+#include <stdlib.h>66+#include <unistd.h>77+#include <errno.h>88+#include <string.h>99+#include <stddef.h>1010+#include <stdbool.h>1111+1212+#include <linux/unistd.h>1313+#include <linux/filter.h>1414+#include <linux/bpf_perf_event.h>1515+#include <linux/bpf.h>1616+1717+#include <bpf/bpf.h>1818+1919+#include "../../../include/linux/filter.h"2020+2121+#ifndef ARRAY_SIZE2222+# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))2323+#endif2424+2525+#define MAX_INSNS 5122626+#define MAX_MATCHES 162727+2828+struct bpf_align_test {2929+ const char *descr;3030+ struct bpf_insn insns[MAX_INSNS];3131+ enum {3232+ UNDEF,3333+ ACCEPT,3434+ REJECT3535+ } result;3636+ enum bpf_prog_type prog_type;3737+ const char *matches[MAX_MATCHES];3838+};3939+4040+static struct bpf_align_test tests[] = {4141+ {4242+ .descr = "mov",4343+ .insns = {4444+ BPF_MOV64_IMM(BPF_REG_3, 2),4545+ BPF_MOV64_IMM(BPF_REG_3, 4),4646+ BPF_MOV64_IMM(BPF_REG_3, 8),4747+ BPF_MOV64_IMM(BPF_REG_3, 16),4848+ BPF_MOV64_IMM(BPF_REG_3, 32),4949+ BPF_MOV64_IMM(BPF_REG_0, 0),5050+ BPF_EXIT_INSN(),5151+ },5252+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,5353+ .matches = {5454+ "1: R1=ctx R3=imm2,min_value=2,max_value=2,min_align=2 R10=fp",5555+ "2: R1=ctx R3=imm4,min_value=4,max_value=4,min_align=4 R10=fp",5656+ "3: R1=ctx R3=imm8,min_value=8,max_value=8,min_align=8 R10=fp",5757+ "4: R1=ctx R3=imm16,min_value=16,max_value=16,min_align=16 R10=fp",5858+ "5: R1=ctx R3=imm32,min_value=32,max_value=32,min_align=32 R10=fp",5959+ },6060+ },6161+ {6262+ .descr = "shift",6363+ .insns = {6464+ BPF_MOV64_IMM(BPF_REG_3, 1),6565+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),6666+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),6767+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),6868+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),6969+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_3, 4),7070+ BPF_MOV64_IMM(BPF_REG_4, 32),7171+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),7272+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),7373+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),7474+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),7575+ BPF_MOV64_IMM(BPF_REG_0, 0),7676+ BPF_EXIT_INSN(),7777+ },7878+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,7979+ .matches = {8080+ "1: R1=ctx R3=imm1,min_value=1,max_value=1,min_align=1 R10=fp",8181+ "2: R1=ctx R3=imm2,min_value=2,max_value=2,min_align=2 R10=fp",8282+ "3: R1=ctx R3=imm4,min_value=4,max_value=4,min_align=4 R10=fp",8383+ "4: R1=ctx R3=imm8,min_value=8,max_value=8,min_align=8 R10=fp",8484+ "5: R1=ctx R3=imm16,min_value=16,max_value=16,min_align=16 R10=fp",8585+ "6: R1=ctx R3=imm1,min_value=1,max_value=1,min_align=1 R10=fp",8686+ "7: R1=ctx R3=imm1,min_value=1,max_value=1,min_align=1 R4=imm32,min_value=32,max_value=32,min_align=32 R10=fp",8787+ "8: R1=ctx R3=imm1,min_value=1,max_value=1,min_align=1 R4=imm16,min_value=16,max_value=16,min_align=16 R10=fp",8888+ "9: R1=ctx R3=imm1,min_value=1,max_value=1,min_align=1 R4=imm8,min_value=8,max_value=8,min_align=8 R10=fp",8989+ "10: R1=ctx R3=imm1,min_value=1,max_value=1,min_align=1 R4=imm4,min_value=4,max_value=4,min_align=4 R10=fp",9090+ "11: R1=ctx R3=imm1,min_value=1,max_value=1,min_align=1 R4=imm2,min_value=2,max_value=2,min_align=2 R10=fp",9191+ },9292+ },9393+ {9494+ .descr = "addsub",9595+ .insns = {9696+ BPF_MOV64_IMM(BPF_REG_3, 4),9797+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_3, 4),9898+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_3, 2),9999+ BPF_MOV64_IMM(BPF_REG_4, 8),100100+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 4),101101+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 2),102102+ BPF_MOV64_IMM(BPF_REG_0, 0),103103+ BPF_EXIT_INSN(),104104+ },105105+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,106106+ .matches = {107107+ "1: R1=ctx R3=imm4,min_value=4,max_value=4,min_align=4 R10=fp",108108+ "2: R1=ctx R3=imm8,min_value=8,max_value=8,min_align=4 R10=fp",109109+ "3: R1=ctx R3=imm10,min_value=10,max_value=10,min_align=2 R10=fp",110110+ "4: R1=ctx R3=imm10,min_value=10,max_value=10,min_align=2 R4=imm8,min_value=8,max_value=8,min_align=8 R10=fp",111111+ "5: R1=ctx R3=imm10,min_value=10,max_value=10,min_align=2 R4=imm12,min_value=12,max_value=12,min_align=4 R10=fp",112112+ "6: R1=ctx R3=imm10,min_value=10,max_value=10,min_align=2 R4=imm14,min_value=14,max_value=14,min_align=2 R10=fp",113113+ },114114+ },115115+ {116116+ .descr = "mul",117117+ .insns = {118118+ BPF_MOV64_IMM(BPF_REG_3, 7),119119+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_3, 1),120120+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_3, 2),121121+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_3, 4),122122+ BPF_MOV64_IMM(BPF_REG_0, 0),123123+ BPF_EXIT_INSN(),124124+ },125125+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,126126+ .matches = {127127+ "1: R1=ctx R3=imm7,min_value=7,max_value=7,min_align=1 R10=fp",128128+ "2: R1=ctx R3=imm7,min_value=7,max_value=7,min_align=1 R10=fp",129129+ "3: R1=ctx R3=imm14,min_value=14,max_value=14,min_align=2 R10=fp",130130+ "4: R1=ctx R3=imm56,min_value=56,max_value=56,min_align=4 R10=fp",131131+ },132132+ },133133+134134+#define PREP_PKT_POINTERS \135135+ BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1, \136136+ offsetof(struct __sk_buff, data)), \137137+ BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1, \138138+ offsetof(struct __sk_buff, data_end))139139+140140+#define LOAD_UNKNOWN(DST_REG) \141141+ PREP_PKT_POINTERS, \142142+ BPF_MOV64_REG(BPF_REG_0, BPF_REG_2), \143143+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8), \144144+ BPF_JMP_REG(BPF_JGE, BPF_REG_3, BPF_REG_0, 1), \145145+ BPF_EXIT_INSN(), \146146+ BPF_LDX_MEM(BPF_B, DST_REG, BPF_REG_2, 0)147147+148148+ {149149+ .descr = "unknown shift",150150+ .insns = {151151+ LOAD_UNKNOWN(BPF_REG_3),152152+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),153153+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),154154+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),155155+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_3, 1),156156+ LOAD_UNKNOWN(BPF_REG_4),157157+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_4, 5),158158+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),159159+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),160160+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),161161+ BPF_ALU64_IMM(BPF_RSH, BPF_REG_4, 1),162162+ BPF_MOV64_IMM(BPF_REG_0, 0),163163+ BPF_EXIT_INSN(),164164+ },165165+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,166166+ .matches = {167167+ "7: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R10=fp",168168+ "8: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv55,min_align=2 R10=fp",169169+ "9: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv54,min_align=4 R10=fp",170170+ "10: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv53,min_align=8 R10=fp",171171+ "11: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv52,min_align=16 R10=fp",172172+ "18: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv56 R10=fp",173173+ "19: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv51,min_align=32 R10=fp",174174+ "20: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv52,min_align=16 R10=fp",175175+ "21: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv53,min_align=8 R10=fp",176176+ "22: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv54,min_align=4 R10=fp",177177+ "23: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv55,min_align=2 R10=fp",178178+ },179179+ },180180+ {181181+ .descr = "unknown mul",182182+ .insns = {183183+ LOAD_UNKNOWN(BPF_REG_3),184184+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_3),185185+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_4, 1),186186+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_3),187187+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_4, 2),188188+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_3),189189+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_4, 4),190190+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_3),191191+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_4, 8),192192+ BPF_ALU64_IMM(BPF_MUL, BPF_REG_4, 2),193193+ BPF_MOV64_IMM(BPF_REG_0, 0),194194+ BPF_EXIT_INSN(),195195+ },196196+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,197197+ .matches = {198198+ "7: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R10=fp",199199+ "8: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv56 R10=fp",200200+ "9: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv55,min_align=1 R10=fp",201201+ "10: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv56 R10=fp",202202+ "11: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv54,min_align=2 R10=fp",203203+ "12: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv56 R10=fp",204204+ "13: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv53,min_align=4 R10=fp",205205+ "14: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv56 R10=fp",206206+ "15: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv52,min_align=8 R10=fp",207207+ "16: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=inv56 R4=inv50,min_align=8 R10=fp"208208+ },209209+ },210210+ {211211+ .descr = "packet const offset",212212+ .insns = {213213+ PREP_PKT_POINTERS,214214+ BPF_MOV64_REG(BPF_REG_5, BPF_REG_2),215215+216216+ BPF_MOV64_IMM(BPF_REG_0, 0),217217+218218+ /* Skip over ethernet header. */219219+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_5, 14),220220+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_5),221221+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 4),222222+ BPF_JMP_REG(BPF_JGE, BPF_REG_3, BPF_REG_4, 1),223223+ BPF_EXIT_INSN(),224224+225225+ BPF_LDX_MEM(BPF_B, BPF_REG_4, BPF_REG_5, 0),226226+ BPF_LDX_MEM(BPF_B, BPF_REG_4, BPF_REG_5, 1),227227+ BPF_LDX_MEM(BPF_B, BPF_REG_4, BPF_REG_5, 2),228228+ BPF_LDX_MEM(BPF_B, BPF_REG_4, BPF_REG_5, 3),229229+ BPF_LDX_MEM(BPF_H, BPF_REG_4, BPF_REG_5, 0),230230+ BPF_LDX_MEM(BPF_H, BPF_REG_4, BPF_REG_5, 2),231231+ BPF_LDX_MEM(BPF_W, BPF_REG_4, BPF_REG_5, 0),232232+233233+ BPF_MOV64_IMM(BPF_REG_0, 0),234234+ BPF_EXIT_INSN(),235235+ },236236+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,237237+ .matches = {238238+ "4: R0=imm0,min_value=0,max_value=0,min_align=2147483648 R1=ctx R2=pkt(id=0,off=0,r=0) R3=pkt_end R5=pkt(id=0,off=0,r=0) R10=fp",239239+ "5: R0=imm0,min_value=0,max_value=0,min_align=2147483648 R1=ctx R2=pkt(id=0,off=0,r=0) R3=pkt_end R5=pkt(id=0,off=14,r=0) R10=fp",240240+ "6: R0=imm0,min_value=0,max_value=0,min_align=2147483648 R1=ctx R2=pkt(id=0,off=0,r=0) R3=pkt_end R4=pkt(id=0,off=14,r=0) R5=pkt(id=0,off=14,r=0) R10=fp",241241+ "10: R0=imm0,min_value=0,max_value=0,min_align=2147483648 R1=ctx R2=pkt(id=0,off=0,r=18) R3=pkt_end R4=inv56 R5=pkt(id=0,off=14,r=18) R10=fp",242242+ "14: R0=imm0,min_value=0,max_value=0,min_align=2147483648 R1=ctx R2=pkt(id=0,off=0,r=18) R3=pkt_end R4=inv48 R5=pkt(id=0,off=14,r=18) R10=fp",243243+ "15: R0=imm0,min_value=0,max_value=0,min_align=2147483648 R1=ctx R2=pkt(id=0,off=0,r=18) R3=pkt_end R4=inv48 R5=pkt(id=0,off=14,r=18) R10=fp",244244+ },245245+ },246246+ {247247+ .descr = "packet variable offset",248248+ .insns = {249249+ LOAD_UNKNOWN(BPF_REG_6),250250+ BPF_ALU64_IMM(BPF_LSH, BPF_REG_6, 2),251251+252252+ /* First, add a constant to the R5 packet pointer,253253+ * then a variable with a known alignment.254254+ */255255+ BPF_MOV64_REG(BPF_REG_5, BPF_REG_2),256256+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_5, 14),257257+ BPF_ALU64_REG(BPF_ADD, BPF_REG_5, BPF_REG_6),258258+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_5),259259+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 4),260260+ BPF_JMP_REG(BPF_JGE, BPF_REG_3, BPF_REG_4, 1),261261+ BPF_EXIT_INSN(),262262+ BPF_LDX_MEM(BPF_W, BPF_REG_4, BPF_REG_5, 0),263263+264264+ /* Now, test in the other direction. Adding first265265+ * the variable offset to R5, then the constant.266266+ */267267+ BPF_MOV64_REG(BPF_REG_5, BPF_REG_2),268268+ BPF_ALU64_REG(BPF_ADD, BPF_REG_5, BPF_REG_6),269269+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_5, 14),270270+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_5),271271+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 4),272272+ BPF_JMP_REG(BPF_JGE, BPF_REG_3, BPF_REG_4, 1),273273+ BPF_EXIT_INSN(),274274+ BPF_LDX_MEM(BPF_W, BPF_REG_4, BPF_REG_5, 0),275275+276276+ /* Test multiple accumulations of unknown values277277+ * into a packet pointer.278278+ */279279+ BPF_MOV64_REG(BPF_REG_5, BPF_REG_2),280280+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_5, 14),281281+ BPF_ALU64_REG(BPF_ADD, BPF_REG_5, BPF_REG_6),282282+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_5, 4),283283+ BPF_ALU64_REG(BPF_ADD, BPF_REG_5, BPF_REG_6),284284+ BPF_MOV64_REG(BPF_REG_4, BPF_REG_5),285285+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 4),286286+ BPF_JMP_REG(BPF_JGE, BPF_REG_3, BPF_REG_4, 1),287287+ BPF_EXIT_INSN(),288288+ BPF_LDX_MEM(BPF_W, BPF_REG_4, BPF_REG_5, 0),289289+290290+ BPF_MOV64_IMM(BPF_REG_0, 0),291291+ BPF_EXIT_INSN(),292292+ },293293+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,294294+ .matches = {295295+ /* Calculated offset in R6 has unknown value, but known296296+ * alignment of 4.297297+ */298298+ "8: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R6=inv54,min_align=4 R10=fp",299299+300300+ /* Offset is added to packet pointer R5, resulting in known301301+ * auxiliary alignment and offset.302302+ */303303+ "11: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R5=pkt(id=1,off=0,r=0),aux_off=14,aux_off_align=4 R6=inv54,min_align=4 R10=fp",304304+305305+ /* At the time the word size load is performed from R5,306306+ * it's total offset is NET_IP_ALIGN + reg->off (0) +307307+ * reg->aux_off (14) which is 16. Then the variable308308+ * offset is considered using reg->aux_off_align which309309+ * is 4 and meets the load's requirements.310310+ */311311+ "15: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=pkt(id=1,off=4,r=4),aux_off=14,aux_off_align=4 R5=pkt(id=1,off=0,r=4),aux_off=14,aux_off_align=4 R6=inv54,min_align=4 R10=fp",312312+313313+314314+ /* Variable offset is added to R5 packet pointer,315315+ * resulting in auxiliary alignment of 4.316316+ */317317+ "18: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv,aux_off=14,aux_off_align=4 R5=pkt(id=2,off=0,r=0),aux_off_align=4 R6=inv54,min_align=4 R10=fp",318318+319319+ /* Constant offset is added to R5, resulting in320320+ * reg->off of 14.321321+ */322322+ "19: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv,aux_off=14,aux_off_align=4 R5=pkt(id=2,off=14,r=0),aux_off_align=4 R6=inv54,min_align=4 R10=fp",323323+324324+ /* At the time the word size load is performed from R5,325325+ * it's total offset is NET_IP_ALIGN + reg->off (14) which326326+ * is 16. Then the variable offset is considered using327327+ * reg->aux_off_align which is 4 and meets the load's328328+ * requirements.329329+ */330330+ "23: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=pkt(id=2,off=18,r=18),aux_off_align=4 R5=pkt(id=2,off=14,r=18),aux_off_align=4 R6=inv54,min_align=4 R10=fp",331331+332332+ /* Constant offset is added to R5 packet pointer,333333+ * resulting in reg->off value of 14.334334+ */335335+ "26: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv,aux_off_align=4 R5=pkt(id=0,off=14,r=8) R6=inv54,min_align=4 R10=fp",336336+ /* Variable offset is added to R5, resulting in an337337+ * auxiliary offset of 14, and an auxiliary alignment of 4.338338+ */339339+ "27: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv,aux_off_align=4 R5=pkt(id=3,off=0,r=0),aux_off=14,aux_off_align=4 R6=inv54,min_align=4 R10=fp",340340+ /* Constant is added to R5 again, setting reg->off to 4. */341341+ "28: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv,aux_off_align=4 R5=pkt(id=3,off=4,r=0),aux_off=14,aux_off_align=4 R6=inv54,min_align=4 R10=fp",342342+ /* And once more we add a variable, which causes an accumulation343343+ * of reg->off into reg->aux_off_align, with resulting value of344344+ * 18. The auxiliary alignment stays at 4.345345+ */346346+ "29: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=inv,aux_off_align=4 R5=pkt(id=4,off=0,r=0),aux_off=18,aux_off_align=4 R6=inv54,min_align=4 R10=fp",347347+ /* At the time the word size load is performed from R5,348348+ * it's total offset is NET_IP_ALIGN + reg->off (0) +349349+ * reg->aux_off (18) which is 20. Then the variable offset350350+ * is considered using reg->aux_off_align which is 4 and meets351351+ * the load's requirements.352352+ */353353+ "33: R0=pkt(id=0,off=8,r=8) R1=ctx R2=pkt(id=0,off=0,r=8) R3=pkt_end R4=pkt(id=4,off=4,r=4),aux_off=18,aux_off_align=4 R5=pkt(id=4,off=0,r=4),aux_off=18,aux_off_align=4 R6=inv54,min_align=4 R10=fp",354354+ },355355+ },356356+};357357+358358+static int probe_filter_length(const struct bpf_insn *fp)359359+{360360+ int len;361361+362362+ for (len = MAX_INSNS - 1; len > 0; --len)363363+ if (fp[len].code != 0 || fp[len].imm != 0)364364+ break;365365+ return len + 1;366366+}367367+368368+static char bpf_vlog[32768];369369+370370+static int do_test_single(struct bpf_align_test *test)371371+{372372+ struct bpf_insn *prog = test->insns;373373+ int prog_type = test->prog_type;374374+ int prog_len, i;375375+ int fd_prog;376376+ int ret;377377+378378+ prog_len = probe_filter_length(prog);379379+ fd_prog = bpf_verify_program(prog_type ? : BPF_PROG_TYPE_SOCKET_FILTER,380380+ prog, prog_len, 1, "GPL", 0,381381+ bpf_vlog, sizeof(bpf_vlog));382382+ if (fd_prog < 0) {383383+ printf("Failed to load program.\n");384384+ printf("%s", bpf_vlog);385385+ ret = 1;386386+ } else {387387+ ret = 0;388388+ for (i = 0; i < MAX_MATCHES; i++) {389389+ const char *t, *m = test->matches[i];390390+391391+ if (!m)392392+ break;393393+ t = strstr(bpf_vlog, m);394394+ if (!t) {395395+ printf("Failed to find match: %s\n", m);396396+ ret = 1;397397+ printf("%s", bpf_vlog);398398+ break;399399+ }400400+ }401401+ close(fd_prog);402402+ }403403+ return ret;404404+}405405+406406+static int do_test(unsigned int from, unsigned int to)407407+{408408+ int all_pass = 0;409409+ int all_fail = 0;410410+ unsigned int i;411411+412412+ for (i = from; i < to; i++) {413413+ struct bpf_align_test *test = &tests[i];414414+ int fail;415415+416416+ printf("Test %3d: %s ... ",417417+ i, test->descr);418418+ fail = do_test_single(test);419419+ if (fail) {420420+ all_fail++;421421+ printf("FAIL\n");422422+ } else {423423+ all_pass++;424424+ printf("PASS\n");425425+ }426426+ }427427+ printf("Results: %d pass %d fail\n",428428+ all_pass, all_fail);429429+ return 0;430430+}431431+432432+int main(int argc, char **argv)433433+{434434+ unsigned int from = 0, to = ARRAY_SIZE(tests);435435+436436+ if (argc == 3) {437437+ unsigned int l = atoi(argv[argc - 2]);438438+ unsigned int u = atoi(argv[argc - 1]);439439+440440+ if (l < to && u < to) {441441+ from = l;442442+ to = u + 1;443443+ }444444+ } else if (argc == 2) {445445+ unsigned int t = atoi(argv[argc - 1]);446446+447447+ if (t < to) {448448+ from = t;449449+ to = t + 1;450450+ }451451+ }452452+ return do_test(from, to);453453+}
+1
tools/testing/selftests/bpf/test_pkt_access.c
···55 * License as published by the Free Software Foundation.66 */77#include <stddef.h>88+#include <string.h>89#include <linux/bpf.h>910#include <linux/if_ether.h>1011#include <linux/if_packet.h>
···295295 assert_spin_locked(&kvm->mmu_lock);296296 pgd = kvm->arch.pgd + stage2_pgd_index(addr);297297 do {298298+ /*299299+ * Make sure the page table is still active, as another thread300300+ * could have possibly freed the page table, while we released301301+ * the lock.302302+ */303303+ if (!READ_ONCE(kvm->arch.pgd))304304+ break;298305 next = stage2_pgd_addr_end(addr, end);299306 if (!stage2_pgd_none(*pgd))300307 unmap_stage2_puds(kvm, pgd, addr, next);···836829 * Walks the level-1 page table pointed to by kvm->arch.pgd and frees all837830 * underlying level-2 and level-3 tables before freeing the actual level-1 table838831 * and setting the struct pointer to NULL.839839- *840840- * Note we don't need locking here as this is only called when the VM is841841- * destroyed, which can only be done once.842832 */843833void kvm_free_stage2_pgd(struct kvm *kvm)844834{845845- if (kvm->arch.pgd == NULL)846846- return;835835+ void *pgd = NULL;847836848837 spin_lock(&kvm->mmu_lock);849849- unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);838838+ if (kvm->arch.pgd) {839839+ unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);840840+ pgd = READ_ONCE(kvm->arch.pgd);841841+ kvm->arch.pgd = NULL;842842+ }850843 spin_unlock(&kvm->mmu_lock);851844852845 /* Free the HW pgd, one page at a time */853853- free_pages_exact(kvm->arch.pgd, S2_PGD_SIZE);854854- kvm->arch.pgd = NULL;846846+ if (pgd)847847+ free_pages_exact(pgd, S2_PGD_SIZE);855848}856849857850static pud_t *stage2_get_pud(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,···11771170 * large. Otherwise, we may see kernel panics with11781171 * CONFIG_DETECT_HUNG_TASK, CONFIG_LOCKUP_DETECTOR,11791172 * CONFIG_LOCKDEP. Additionally, holding the lock too long11801180- * will also starve other vCPUs.11731173+ * will also starve other vCPUs. We have to also make sure11741174+ * that the page tables are not freed while we released11751175+ * the lock.11811176 */11821182- if (need_resched() || spin_needbreak(&kvm->mmu_lock))11831183- cond_resched_lock(&kvm->mmu_lock);11841184-11771177+ cond_resched_lock(&kvm->mmu_lock);11781178+ if (!READ_ONCE(kvm->arch.pgd))11791179+ break;11851180 next = stage2_pgd_addr_end(addr, end);11861181 if (stage2_pgd_present(*pgd))11871182 stage2_wp_puds(pgd, addr, next);
+4-1
virt/kvm/arm/vgic/vgic-init.c
···242242 * If we are creating a VCPU with a GICv3 we must also register the243243 * KVM io device for the redistributor that belongs to this VCPU.244244 */245245- if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)245245+ if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {246246+ mutex_lock(&vcpu->kvm->lock);246247 ret = vgic_register_redist_iodev(vcpu);248248+ mutex_unlock(&vcpu->kvm->lock);249249+ }247250 return ret;248251}249252
+9-3
virt/kvm/arm/vgic/vgic-mmio-v3.c
···586586 if (!vgic_v3_check_base(kvm))587587 return -EINVAL;588588589589- rd_base = vgic->vgic_redist_base + kvm_vcpu_get_idx(vcpu) * SZ_64K * 2;589589+ rd_base = vgic->vgic_redist_base + vgic->vgic_redist_free_offset;590590 sgi_base = rd_base + SZ_64K;591591592592 kvm_iodevice_init(&rd_dev->dev, &kvm_io_gic_ops);···614614 mutex_lock(&kvm->slots_lock);615615 ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS, sgi_base,616616 SZ_64K, &sgi_dev->dev);617617- mutex_unlock(&kvm->slots_lock);618618- if (ret)617617+ if (ret) {619618 kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS,620619 &rd_dev->dev);620620+ goto out;621621+ }621622623623+ vgic->vgic_redist_free_offset += 2 * SZ_64K;624624+out:625625+ mutex_unlock(&kvm->slots_lock);622626 return ret;623627}624628···648644649645 if (ret) {650646 /* The current c failed, so we start with the previous one. */647647+ mutex_lock(&kvm->slots_lock);651648 for (c--; c >= 0; c--) {652649 vcpu = kvm_get_vcpu(kvm, c);653650 vgic_unregister_redist_iodev(vcpu);654651 }652652+ mutex_unlock(&kvm->slots_lock);655653 }656654657655 return ret;
+7
virt/kvm/arm/vgic/vgic-v2.c
···149149 if (irq->hw) {150150 val |= GICH_LR_HW;151151 val |= irq->hwintid << GICH_LR_PHYSID_CPUID_SHIFT;152152+ /*153153+ * Never set pending+active on a HW interrupt, as the154154+ * pending state is kept at the physical distributor155155+ * level.156156+ */157157+ if (irq->active && irq_is_pending(irq))158158+ val &= ~GICH_LR_PENDING_BIT;152159 } else {153160 if (irq->config == VGIC_CONFIG_LEVEL)154161 val |= GICH_LR_EOI;
+7
virt/kvm/arm/vgic/vgic-v3.c
···127127 if (irq->hw) {128128 val |= ICH_LR_HW;129129 val |= ((u64)irq->hwintid) << ICH_LR_PHYS_ID_SHIFT;130130+ /*131131+ * Never set pending+active on a HW interrupt, as the132132+ * pending state is kept at the physical distributor133133+ * level.134134+ */135135+ if (irq->active && irq_is_pending(irq))136136+ val &= ~ICH_LR_PENDING_BIT;130137 } else {131138 if (irq->config == VGIC_CONFIG_LEVEL)132139 val |= ICH_LR_EOI;