mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
This is the 4.14.171 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl5HEegACgkQONu9yGCS aT6cNw//eNxBC6h0ibDOVeVbItkku2c0lwPRSrxtvhyUbE/RG63FlisA2TFEOUp8 y+Ionderw4+d8ySuExEcsE644d/ykES1Lj1dVR4Lzlbxo33X6p9opN9GCMHH1VH2 sRVWR8xLTUxzamGm4i5rUXMDplqTB+pTscVWJbisH1o3XW6SGnxAX3UjvqCHhjrW 9iLPBMZF/KkZDvhYbfl59QsB+FuLsjET3D1n+csypCzlZTf7zbi96tPMidprvhyt xWYl4NZCyLxqUFmKFILsWK3KN7tQNXMFILfwUMOVcn15689GGXRS1X4W7OA+nOKs rnSYM1KHBrsLHWdnLLcHh+qq7sKvgsIpIhvEyixl52c+qoMB1qJC+soZhhGJ4/kQ 93nl5ibHNUmPwc7a+R2G2U6C83aAS1zvV4LFIBtPXMc9oKOISDBkQgRJhsJ0HmQA 4euecjN7o1V+sE1LzvtMja6XcXqDEe7BrgT4e5TyL0Gd7IUGSbwyt61oIKPODcHM YWn4hnflpDXOxYtSiqFWTi9psrdja54G0b1eBuhJ4ve9Katdqb1xhj2p9+HRt5rr 38f3nNOHLI/ozWL4DrWVSUgxWM86zqr6cyI2iJmINIOVH5+oWjq4RzinT5TNbQby mgFNw/0rOyJXjdRiTB2qiOQZSaiAp/NbfO9OBlnBgR2BGcF5F6U= =BC1c -----END PGP SIGNATURE----- Merge 4.14.171 into android-4.14 Changes in 4.14.171 kernel/module: Fix memleak in module_add_modinfo_attrs() media: iguanair: fix endpoint sanity check x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR iwlwifi: mvm: fix NVM check for 3168 devices sparc32: fix struct ipc64_perm type definition cls_rsvp: fix rsvp_policy gtp: use __GFP_NOWARN to avoid memalloc warning l2tp: Allow duplicate session creation with UDP net: hsr: fix possible NULL deref in hsr_handle_frame() net_sched: fix an OOB access in cls_tcindex bnxt_en: Fix TC queue mapping. tcp: clear tp->total_retrans in tcp_disconnect() tcp: clear tp->delivered in tcp_disconnect() tcp: clear tp->data_segs{in|out} in tcp_disconnect() tcp: clear tp->segs_{in|out} in tcp_disconnect() rxrpc: Fix insufficient receive notification generation rxrpc: Fix NULL pointer deref due to call->conn being cleared on disconnect media: uvcvideo: Avoid cyclic entity chains due to malformed USB descriptors mfd: dln2: More sanity checking for endpoints tracing: Fix sched switch start/stop refcount racy updates brcmfmac: Fix memory leak in brcmf_usbdev_qinit usb: gadget: legacy: set max_speed to super-speed usb: gadget: f_ncm: Use atomic_t to track in-flight request usb: gadget: f_ecm: Use atomic_t to track in-flight request ALSA: dummy: Fix PCM format loop in proc output media/v4l2-core: set pages dirty upon releasing DMA buffers media: v4l2-rect.h: fix v4l2_rect_map_inside() top/left adjustments lib/test_kasan.c: fix memory leak in kmalloc_oob_krealloc_more() irqdomain: Fix a memory leak in irq_domain_push_irq() platform/x86: intel_scu_ipc: Fix interrupt support KVM: arm64: Only sign-extend MMIO up to register width MIPS: fix indentation of the 'RELOCS' message s390/mm: fix dynamic pagetable upgrade for hugetlbfs powerpc/xmon: don't access ASDR in VMs powerpc/pseries: Advance pfn if section is not present in lmb_is_removable() mmc: spi: Toggle SPI polarity, do not hardcode it ACPI: video: Do not export a non working backlight interface on MSI MS-7721 boards alarmtimer: Unregister wakeup source when module get fails ubifs: Reject unsupported ioctl flags explicitly ubifs: Fix FS_IOC_SETFLAGS unexpectedly clearing encrypt flag ubifs: Fix deadlock in concurrent bulk-read and writepage PCI: keystone: Fix link training retries initiation mmc: sdhci-of-at91: fix memleak on clk_get failure ubifs: don't trigger assertion on invalid no-key filename hv_balloon: Balloon up according to request page number crypto: api - Check spawn->alg under lock in crypto_drop_spawn scsi: qla2xxx: Fix mtcp dump collection failure power: supply: ltc2941-battery-gauge: fix use-after-free f2fs: choose hardlimit when softlimit is larger than hardlimit in f2fs_statfs_project() f2fs: fix miscounted block limit in f2fs_statfs_project() f2fs: code cleanup for f2fs_statfs_project() PM: core: Fix handling of devices deleted during system-wide resume of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc dm zoned: support zone sizes smaller than 128MiB dm space map common: fix to ensure new block isn't already in use dm crypt: fix benbi IV constructor crash if used in authenticated mode tracing: Annotate ftrace_graph_hash pointer with __rcu tracing: Annotate ftrace_graph_notrace_hash pointer with __rcu ftrace: Add comment to why rcu_dereference_sched() is open coded ftrace: Protect ftrace_graph_hash with ftrace_sync samples/bpf: Don't try to remove user's homedir on clean crypto: ccp - set max RSA modulus size for v3 platform devices as well crypto: pcrypt - Do not clear MAY_SLEEP flag in original request crypto: atmel-aes - Fix counter overflow in CTR mode crypto: api - Fix race condition in crypto_spawn_alg crypto: picoxcell - adjust the position of tasklet_init and fix missed tasklet_kill scsi: qla2xxx: Fix unbound NVME response length NFS: Fix memory leaks and corruption in readdir NFS: Directory page cache pages need to be locked when read btrfs: set trans->drity in btrfs_commit_transaction ARM: tegra: Enable PLLP bypass during Tegra124 LP1 iwlwifi: don't throw error when trying to remove IGTK mwifiex: fix unbalanced locking in mwifiex_process_country_ie() sunrpc: expiry_time should be seconds not timeval tools/kvm_stat: Fix kvm_exit filter name xen/balloon: Support xend-based toolstack take two KVM: x86: Refactor picdev_write() to prevent Spectre-v1/L1TF attacks KVM: x86: Refactor prefix decoding to prevent Spectre-v1/L1TF attacks KVM: x86: Protect DR-based index computations from Spectre-v1/L1TF attacks KVM: x86: Protect kvm_lapic_reg_write() from Spectre-v1/L1TF attacks KVM: x86: Protect kvm_hv_msr_[get|set]_crash_data() from Spectre-v1/L1TF attacks KVM: x86: Protect ioapic_write_indirect() from Spectre-v1/L1TF attacks KVM: x86: Protect MSR-based index computations in pmu.h from Spectre-v1/L1TF attacks KVM: x86: Protect ioapic_read_indirect() from Spectre-v1/L1TF attacks KVM: x86: Protect MSR-based index computations from Spectre-v1/L1TF attacks in x86.c KVM: x86: Protect x86_decode_insn from Spectre-v1/L1TF attacks KVM: x86: Protect MSR-based index computations in fixed_msr_to_seg_unit() from Spectre-v1/L1TF attacks KVM: PPC: Book3S HV: Uninit vCPU if vcore creation fails KVM: PPC: Book3S PR: Free shared page if mmu initialization fails KVM: x86: Free wbinvd_dirty_mask if vCPU creation fails clk: tegra: Mark fuse clock as critical scsi: qla2xxx: Fix the endianness of the qla82xx_get_fw_size() return type scsi: csiostor: Adjust indentation in csio_device_reset scsi: qla4xxx: Adjust indentation in qla4xxx_mem_free scsi: ufs: Recheck bkops level if bkops is disabled phy: qualcomm: Adjust indentation in read_poll_timeout ext2: Adjust indentation in ext2_fill_super powerpc/44x: Adjust indentation in ibm4xx_denali_fixup_memsize NFC: pn544: Adjust indentation in pn544_hci_check_presence ppp: Adjust indentation into ppp_async_input net: smc911x: Adjust indentation in smc911x_phy_configure net: tulip: Adjust indentation in {dmfe, uli526x}_init_module IB/mlx5: Fix outstanding_pi index for GSI qps IB/core: Fix ODP get user pages flow nfsd: fix delay timer on 32-bit architectures nfsd: fix jiffies/time_t mixup in LRU list ubi: fastmap: Fix inverted logic in seen selfcheck ubi: Fix an error pointer dereference in error handling code mfd: da9062: Fix watchdog compatible string mfd: rn5t618: Mark ADC control register volatile net: dsa: bcm_sf2: Only 7278 supports 2Gb/sec IMP port net_sched: fix a resource leak in tcindex_set_parms() net: systemport: Avoid RBUF stuck in Wake-on-LAN mode net: macb: Remove unnecessary alignment check for TSO net: macb: Limit maximum GEM TX length in TSO bonding/alb: properly access headers in bond_alb_xmit() ext4: fix deadlock allocating crypto bounce page from mempool btrfs: Get rid of the confusing btrfs_file_extent_inline_len Btrfs: fix assertion failure on fsync with NO_HOLES enabled Btrfs: fix missing hole after hole punching and fsync when using NO_HOLES btrfs: use bool argument in free_root_pointers() btrfs: free block groups after free'ing fs trees btrfs: remove trivial locking wrappers of tree mod log Btrfs: fix race between adding and putting tree mod seq elements and nodes drm: atmel-hlcdc: enable clock before configuring timing engine KVM: x86: Protect pmu_intel.c from Spectre-v1/L1TF attacks btrfs: flush write bio if we loop in extent_write_cache_pages KVM: x86: Fix potential put_fpu() w/o load_fpu() on MPX platform KVM: x86/mmu: Apply max PA check for MMIO sptes to 32-bit KVM KVM: VMX: Add non-canonical check on writes to RTIT address MSRs KVM: nVMX: vmread should not set rflags to specify success in case of #PF KVM: Use vcpu-specific gva->hva translation when querying host page size KVM: Play nice with read-only memslots when querying host page size KVM: s390: do not clobber registers during guest reset/store status cifs: fail i/o on soft mounts if sessionsetup errors out clocksource: Prevent double add_timer_on() for watchdog_timer perf/core: Fix mlock accounting in perf_mmap() rxrpc: Fix service call disconnection ASoC: pcm: update FE/BE trigger order based on the command hv_sock: Remove the accept port restriction RDMA/netlink: Do not always generate an ACK for some netlink operations scsi: ufs: Fix ufshcd_probe_hba() reture value in case ufshcd_scsi_add_wlus() fails PCI/switchtec: Fix vep_vector_number ioread width PCI: Don't disable bridge BARs when assigning bus resources nfs: NFS_SWAP should depend on SWAP NFS/pnfs: Fix pnfs_generic_prepare_to_resend_writes() NFSv4: try lease recovery on NFS4ERR_EXPIRED serial: uartps: Add a timeout to the tx empty wait rtc: hym8563: Return -EINVAL if the time is known to be invalid rtc: cmos: Stop using shared IRQ ARC: [plat-axs10x]: Add missing multicast filter number to GMAC node platform/x86: intel_mid_powerbtn: Take a copy of ddata ARM: dts: at91: sama5d3: fix maximum peripheral clock rates ARM: dts: at91: sama5d3: define clock rate range for tcb1 tools/power/acpi: fix compilation error powerpc/pseries/vio: Fix iommu_table use-after-free refcount warning powerpc/pseries: Allow not having ibm, hypertas-functions::hcall-multi-tce for DDW KVM: arm/arm64: vgic-its: Fix restoration of unmapped collections ARM: 8949/1: mm: mark free_memmap as __init arm64: cpufeature: Fix the type of no FP/SIMD capability KVM: arm/arm64: Fix young bit from mmu notifier crypto: artpec6 - return correct error code for failed setkey() crypto: atmel-sha - fix error handling when setting hmac key media: i2c: adv748x: Fix unsafe macros pinctrl: sh-pfc: r8a7778: Fix duplicate SDSELF_B and SD1_CLK_B scsi: megaraid_sas: Do not initiate OCR if controller is not in ready state dm: fix potential for q->make_request_fn NULL pointer serial: uartps: Move the spinlock after the read of the tx empty mwifiex: Fix possible buffer overflows in mwifiex_ret_wmm_get_status() mwifiex: Fix possible buffer overflows in mwifiex_cmd_append_vsie_tlv() libertas: don't exit from lbs_ibss_join_existing() with RCU read lock held libertas: make lbs_ibss_join_existing() return error code on rates overflow Linux 4.14.171 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I2ffa7bd44800917ea3b327486b387470ab5d31b9
This commit is contained in:
commit
998aa7d8f2
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 170
|
||||
SUBLEVEL = 171
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
@ -70,6 +70,7 @@
|
||||
interrupt-names = "macirq";
|
||||
phy-mode = "rgmii";
|
||||
snps,pbl = < 32 >;
|
||||
snps,multicast-filter-bins = <256>;
|
||||
clocks = <&apbclk>;
|
||||
clock-names = "stmmaceth";
|
||||
max-speed = <100>;
|
||||
|
@ -1185,49 +1185,49 @@
|
||||
usart0_clk: usart0_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <12>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
usart1_clk: usart1_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <13>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
usart2_clk: usart2_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <14>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
usart3_clk: usart3_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <15>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
uart0_clk: uart0_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <16>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
twi0_clk: twi0_clk {
|
||||
reg = <18>;
|
||||
#clock-cells = <0>;
|
||||
atmel,clk-output-range = <0 16625000>;
|
||||
atmel,clk-output-range = <0 41500000>;
|
||||
};
|
||||
|
||||
twi1_clk: twi1_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <19>;
|
||||
atmel,clk-output-range = <0 16625000>;
|
||||
atmel,clk-output-range = <0 41500000>;
|
||||
};
|
||||
|
||||
twi2_clk: twi2_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <20>;
|
||||
atmel,clk-output-range = <0 16625000>;
|
||||
atmel,clk-output-range = <0 41500000>;
|
||||
};
|
||||
|
||||
mci0_clk: mci0_clk {
|
||||
@ -1243,19 +1243,19 @@
|
||||
spi0_clk: spi0_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <24>;
|
||||
atmel,clk-output-range = <0 133000000>;
|
||||
atmel,clk-output-range = <0 166000000>;
|
||||
};
|
||||
|
||||
spi1_clk: spi1_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <25>;
|
||||
atmel,clk-output-range = <0 133000000>;
|
||||
atmel,clk-output-range = <0 166000000>;
|
||||
};
|
||||
|
||||
tcb0_clk: tcb0_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <26>;
|
||||
atmel,clk-output-range = <0 133000000>;
|
||||
atmel,clk-output-range = <0 166000000>;
|
||||
};
|
||||
|
||||
pwm_clk: pwm_clk {
|
||||
@ -1266,7 +1266,7 @@
|
||||
adc_clk: adc_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <29>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
dma0_clk: dma0_clk {
|
||||
@ -1297,13 +1297,13 @@
|
||||
ssc0_clk: ssc0_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <38>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
ssc1_clk: ssc1_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <39>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
sha_clk: sha_clk {
|
||||
|
@ -37,13 +37,13 @@
|
||||
can0_clk: can0_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <40>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
can1_clk: can1_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <41>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -23,6 +23,7 @@
|
||||
tcb1_clk: tcb1_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <27>;
|
||||
atmel,clk-output-range = <0 166000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -42,13 +42,13 @@
|
||||
uart0_clk: uart0_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <16>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
|
||||
uart1_clk: uart1_clk {
|
||||
#clock-cells = <0>;
|
||||
reg = <17>;
|
||||
atmel,clk-output-range = <0 66000000>;
|
||||
atmel,clk-output-range = <0 83000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -144,6 +144,11 @@ static inline bool kvm_vcpu_dabt_issext(struct kvm_vcpu *vcpu)
|
||||
return kvm_vcpu_get_hsr(vcpu) & HSR_SSE;
|
||||
}
|
||||
|
||||
static inline bool kvm_vcpu_dabt_issf(const struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int kvm_vcpu_dabt_get_rd(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return (kvm_vcpu_get_hsr(vcpu) & HSR_SRT_MASK) >> HSR_SRT_SHIFT;
|
||||
|
@ -26,6 +26,8 @@
|
||||
struct kvm_decode {
|
||||
unsigned long rt;
|
||||
bool sign_extend;
|
||||
/* Not used on 32-bit arm */
|
||||
bool sixty_four;
|
||||
};
|
||||
|
||||
void kvm_mmio_write_buf(void *buf, unsigned int len, unsigned long data);
|
||||
|
@ -382,6 +382,14 @@ _pll_m_c_x_done:
|
||||
pll_locked r1, r0, CLK_RESET_PLLC_BASE
|
||||
pll_locked r1, r0, CLK_RESET_PLLX_BASE
|
||||
|
||||
tegra_get_soc_id TEGRA_APB_MISC_BASE, r1
|
||||
cmp r1, #TEGRA30
|
||||
beq 1f
|
||||
ldr r1, [r0, #CLK_RESET_PLLP_BASE]
|
||||
bic r1, r1, #(1<<31) @ disable PllP bypass
|
||||
str r1, [r0, #CLK_RESET_PLLP_BASE]
|
||||
1:
|
||||
|
||||
mov32 r7, TEGRA_TMRUS_BASE
|
||||
ldr r1, [r7]
|
||||
add r1, r1, #LOCK_DELAY
|
||||
@ -641,7 +649,10 @@ tegra30_switch_cpu_to_clk32k:
|
||||
str r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
|
||||
|
||||
/* disable PLLP, PLLA, PLLC and PLLX */
|
||||
tegra_get_soc_id TEGRA_APB_MISC_BASE, r1
|
||||
cmp r1, #TEGRA30
|
||||
ldr r0, [r5, #CLK_RESET_PLLP_BASE]
|
||||
orrne r0, r0, #(1 << 31) @ enable PllP bypass on fast cluster
|
||||
bic r0, r0, #(1 << 30)
|
||||
str r0, [r5, #CLK_RESET_PLLP_BASE]
|
||||
ldr r0, [r5, #CLK_RESET_PLLA_BASE]
|
||||
|
@ -356,7 +356,7 @@ static inline void poison_init_mem(void *s, size_t count)
|
||||
*p++ = 0xe7fddef0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static inline void __init
|
||||
free_memmap(unsigned long start_pfn, unsigned long end_pfn)
|
||||
{
|
||||
struct page *start_pg, *end_pg;
|
||||
|
@ -188,6 +188,11 @@ static inline bool kvm_vcpu_dabt_issext(const struct kvm_vcpu *vcpu)
|
||||
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SSE);
|
||||
}
|
||||
|
||||
static inline bool kvm_vcpu_dabt_issf(const struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SF);
|
||||
}
|
||||
|
||||
static inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SRT_MASK) >> ESR_ELx_SRT_SHIFT;
|
||||
|
@ -21,13 +21,11 @@
|
||||
#include <linux/kvm_host.h>
|
||||
#include <asm/kvm_arm.h>
|
||||
|
||||
/*
|
||||
* This is annoying. The mmio code requires this, even if we don't
|
||||
* need any decoding. To be fixed.
|
||||
*/
|
||||
struct kvm_decode {
|
||||
unsigned long rt;
|
||||
bool sign_extend;
|
||||
/* Witdth of the register accessed by the faulting instruction is 64-bits */
|
||||
bool sixty_four;
|
||||
};
|
||||
|
||||
void kvm_mmio_write_buf(void *buf, unsigned int len, unsigned long data);
|
||||
|
@ -1108,7 +1108,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
|
||||
{
|
||||
/* FP/SIMD is not implemented */
|
||||
.capability = ARM64_HAS_NO_FPSIMD,
|
||||
.type = ARM64_CPUCAP_SYSTEM_FEATURE,
|
||||
.type = ARM64_CPUCAP_BOOT_RESTRICTED_CPU_LOCAL_FEATURE,
|
||||
.min_field_value = 0,
|
||||
.matches = has_no_fpsimd,
|
||||
},
|
||||
|
@ -12,7 +12,7 @@ __archpost:
|
||||
include scripts/Kbuild.include
|
||||
|
||||
CMD_RELOCS = arch/mips/boot/tools/relocs
|
||||
quiet_cmd_relocs = RELOCS $@
|
||||
quiet_cmd_relocs = RELOCS $@
|
||||
cmd_relocs = $(CMD_RELOCS) $@
|
||||
|
||||
# `@true` prevents complaint when there is nothing to be done
|
||||
|
@ -225,6 +225,7 @@ config PPC
|
||||
select MODULES_USE_ELF_RELA
|
||||
select NO_BOOTMEM
|
||||
select OF
|
||||
select OF_DMA_DEFAULT_COHERENT if !NOT_COHERENT_CACHE
|
||||
select OF_EARLY_FLATTREE
|
||||
select OF_RESERVED_MEM
|
||||
select OLD_SIGACTION if PPC32
|
||||
|
@ -232,7 +232,7 @@ void ibm4xx_denali_fixup_memsize(void)
|
||||
dpath = 8; /* 64 bits */
|
||||
|
||||
/* get address pins (rows) */
|
||||
val = SDRAM0_READ(DDR0_42);
|
||||
val = SDRAM0_READ(DDR0_42);
|
||||
|
||||
row = DDR_GET_VAL(val, DDR_APIN, DDR_APIN_SHIFT);
|
||||
if (row > max_row)
|
||||
|
@ -1997,7 +1997,7 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_hv(struct kvm *kvm,
|
||||
mutex_unlock(&kvm->lock);
|
||||
|
||||
if (!vcore)
|
||||
goto free_vcpu;
|
||||
goto uninit_vcpu;
|
||||
|
||||
spin_lock(&vcore->lock);
|
||||
++vcore->num_threads;
|
||||
@ -2014,6 +2014,8 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_hv(struct kvm *kvm,
|
||||
|
||||
return vcpu;
|
||||
|
||||
uninit_vcpu:
|
||||
kvm_vcpu_uninit(vcpu);
|
||||
free_vcpu:
|
||||
kmem_cache_free(kvm_vcpu_cache, vcpu);
|
||||
out:
|
||||
|
@ -1482,10 +1482,12 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_pr(struct kvm *kvm,
|
||||
|
||||
err = kvmppc_mmu_init(vcpu);
|
||||
if (err < 0)
|
||||
goto uninit_vcpu;
|
||||
goto free_shared_page;
|
||||
|
||||
return vcpu;
|
||||
|
||||
free_shared_page:
|
||||
free_page((unsigned long)vcpu->arch.shared);
|
||||
uninit_vcpu:
|
||||
kvm_vcpu_uninit(vcpu);
|
||||
free_shadow_vcpu:
|
||||
|
@ -452,8 +452,10 @@ static bool lmb_is_removable(struct of_drconf_cell *lmb)
|
||||
|
||||
for (i = 0; i < scns_per_block; i++) {
|
||||
pfn = PFN_DOWN(phys_addr);
|
||||
if (!pfn_present(pfn))
|
||||
if (!pfn_present(pfn)) {
|
||||
phys_addr += MIN_MEMORY_BLOCK_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
|
||||
phys_addr += MIN_MEMORY_BLOCK_SIZE;
|
||||
|
@ -168,10 +168,10 @@ static unsigned long tce_get_pseries(struct iommu_table *tbl, long index)
|
||||
return be64_to_cpu(*tcep);
|
||||
}
|
||||
|
||||
static void tce_free_pSeriesLP(struct iommu_table*, long, long);
|
||||
static void tce_free_pSeriesLP(unsigned long liobn, long, long);
|
||||
static void tce_freemulti_pSeriesLP(struct iommu_table*, long, long);
|
||||
|
||||
static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
|
||||
static int tce_build_pSeriesLP(unsigned long liobn, long tcenum, long tceshift,
|
||||
long npages, unsigned long uaddr,
|
||||
enum dma_data_direction direction,
|
||||
unsigned long attrs)
|
||||
@ -182,25 +182,25 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
|
||||
int ret = 0;
|
||||
long tcenum_start = tcenum, npages_start = npages;
|
||||
|
||||
rpn = __pa(uaddr) >> TCE_SHIFT;
|
||||
rpn = __pa(uaddr) >> tceshift;
|
||||
proto_tce = TCE_PCI_READ;
|
||||
if (direction != DMA_TO_DEVICE)
|
||||
proto_tce |= TCE_PCI_WRITE;
|
||||
|
||||
while (npages--) {
|
||||
tce = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
|
||||
rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, tce);
|
||||
tce = proto_tce | (rpn & TCE_RPN_MASK) << tceshift;
|
||||
rc = plpar_tce_put((u64)liobn, (u64)tcenum << tceshift, tce);
|
||||
|
||||
if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) {
|
||||
ret = (int)rc;
|
||||
tce_free_pSeriesLP(tbl, tcenum_start,
|
||||
tce_free_pSeriesLP(liobn, tcenum_start,
|
||||
(npages_start - (npages + 1)));
|
||||
break;
|
||||
}
|
||||
|
||||
if (rc && printk_ratelimit()) {
|
||||
printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
|
||||
printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
|
||||
printk("\tindex = 0x%llx\n", (u64)liobn);
|
||||
printk("\ttcenum = 0x%llx\n", (u64)tcenum);
|
||||
printk("\ttce val = 0x%llx\n", tce );
|
||||
dump_stack();
|
||||
@ -229,7 +229,8 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
|
||||
unsigned long flags;
|
||||
|
||||
if ((npages == 1) || !firmware_has_feature(FW_FEATURE_MULTITCE)) {
|
||||
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
|
||||
return tce_build_pSeriesLP(tbl->it_index, tcenum,
|
||||
tbl->it_page_shift, npages, uaddr,
|
||||
direction, attrs);
|
||||
}
|
||||
|
||||
@ -245,8 +246,9 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
|
||||
/* If allocation fails, fall back to the loop implementation */
|
||||
if (!tcep) {
|
||||
local_irq_restore(flags);
|
||||
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
|
||||
direction, attrs);
|
||||
return tce_build_pSeriesLP(tbl->it_index, tcenum,
|
||||
tbl->it_page_shift,
|
||||
npages, uaddr, direction, attrs);
|
||||
}
|
||||
__this_cpu_write(tce_page, tcep);
|
||||
}
|
||||
@ -297,16 +299,16 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages)
|
||||
static void tce_free_pSeriesLP(unsigned long liobn, long tcenum, long npages)
|
||||
{
|
||||
u64 rc;
|
||||
|
||||
while (npages--) {
|
||||
rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
|
||||
rc = plpar_tce_put((u64)liobn, (u64)tcenum << 12, 0);
|
||||
|
||||
if (rc && printk_ratelimit()) {
|
||||
printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
|
||||
printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
|
||||
printk("\tindex = 0x%llx\n", (u64)liobn);
|
||||
printk("\ttcenum = 0x%llx\n", (u64)tcenum);
|
||||
dump_stack();
|
||||
}
|
||||
@ -321,7 +323,7 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
|
||||
u64 rc;
|
||||
|
||||
if (!firmware_has_feature(FW_FEATURE_MULTITCE))
|
||||
return tce_free_pSeriesLP(tbl, tcenum, npages);
|
||||
return tce_free_pSeriesLP(tbl->it_index, tcenum, npages);
|
||||
|
||||
rc = plpar_tce_stuff((u64)tbl->it_index, (u64)tcenum << 12, 0, npages);
|
||||
|
||||
@ -436,6 +438,19 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn,
|
||||
u64 rc = 0;
|
||||
long l, limit;
|
||||
|
||||
if (!firmware_has_feature(FW_FEATURE_MULTITCE)) {
|
||||
unsigned long tceshift = be32_to_cpu(maprange->tce_shift);
|
||||
unsigned long dmastart = (start_pfn << PAGE_SHIFT) +
|
||||
be64_to_cpu(maprange->dma_base);
|
||||
unsigned long tcenum = dmastart >> tceshift;
|
||||
unsigned long npages = num_pfn << PAGE_SHIFT >> tceshift;
|
||||
void *uaddr = __va(start_pfn << PAGE_SHIFT);
|
||||
|
||||
return tce_build_pSeriesLP(be32_to_cpu(maprange->liobn),
|
||||
tcenum, tceshift, npages, (unsigned long) uaddr,
|
||||
DMA_BIDIRECTIONAL, 0);
|
||||
}
|
||||
|
||||
local_irq_disable(); /* to protect tcep and the page behind it */
|
||||
tcep = __this_cpu_read(tce_page);
|
||||
|
||||
|
@ -1195,6 +1195,8 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
|
||||
if (tbl == NULL)
|
||||
return NULL;
|
||||
|
||||
kref_init(&tbl->it_kref);
|
||||
|
||||
of_parse_dma_window(dev->dev.of_node, dma_window,
|
||||
&tbl->it_index, &offset, &size);
|
||||
|
||||
|
@ -1830,15 +1830,14 @@ static void dump_300_sprs(void)
|
||||
|
||||
printf("pidr = %.16lx tidr = %.16lx\n",
|
||||
mfspr(SPRN_PID), mfspr(SPRN_TIDR));
|
||||
printf("asdr = %.16lx psscr = %.16lx\n",
|
||||
mfspr(SPRN_ASDR), hv ? mfspr(SPRN_PSSCR)
|
||||
: mfspr(SPRN_PSSCR_PR));
|
||||
printf("psscr = %.16lx\n",
|
||||
hv ? mfspr(SPRN_PSSCR) : mfspr(SPRN_PSSCR_PR));
|
||||
|
||||
if (!hv)
|
||||
return;
|
||||
|
||||
printf("ptcr = %.16lx\n",
|
||||
mfspr(SPRN_PTCR));
|
||||
printf("ptcr = %.16lx asdr = %.16lx\n",
|
||||
mfspr(SPRN_PTCR), mfspr(SPRN_ASDR));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,8 @@
|
||||
#define ARCH_HAS_PREPARE_HUGEPAGE
|
||||
#define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
|
||||
|
||||
#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
|
||||
|
||||
#include <asm/setup.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
@ -2384,9 +2384,7 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
|
||||
memset(vcpu->arch.sie_block->gcr, 0, 16 * sizeof(__u64));
|
||||
vcpu->arch.sie_block->gcr[0] = 0xE0UL;
|
||||
vcpu->arch.sie_block->gcr[14] = 0xC2000000UL;
|
||||
/* make sure the new fpc will be lazily loaded */
|
||||
save_fpu_regs();
|
||||
current->thread.fpu.fpc = 0;
|
||||
vcpu->run->s.regs.fpc = 0;
|
||||
vcpu->arch.sie_block->gbea = 1;
|
||||
vcpu->arch.sie_block->pp = 0;
|
||||
vcpu->arch.sie_block->fpf &= ~FPF_BPBC;
|
||||
@ -3753,7 +3751,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
|
||||
}
|
||||
case KVM_S390_STORE_STATUS:
|
||||
idx = srcu_read_lock(&vcpu->kvm->srcu);
|
||||
r = kvm_s390_vcpu_store_status(vcpu, arg);
|
||||
r = kvm_s390_store_status_unloaded(vcpu, arg);
|
||||
srcu_read_unlock(&vcpu->kvm->srcu, idx);
|
||||
break;
|
||||
case KVM_S390_SET_INITIAL_PSW: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* IBM System z Huge TLB Page Support for Kernel.
|
||||
*
|
||||
* Copyright IBM Corp. 2007,2016
|
||||
* Copyright IBM Corp. 2007,2020
|
||||
* Author(s): Gerald Schaefer <gerald.schaefer@de.ibm.com>
|
||||
*/
|
||||
|
||||
@ -11,6 +11,9 @@
|
||||
|
||||
#include <linux/mm.h>
|
||||
#include <linux/hugetlb.h>
|
||||
#include <linux/mman.h>
|
||||
#include <linux/sched/mm.h>
|
||||
#include <linux/security.h>
|
||||
|
||||
/*
|
||||
* If the bit selected by single-bit bitmask "a" is set within "x", move
|
||||
@ -243,3 +246,98 @@ static __init int setup_hugepagesz(char *opt)
|
||||
return 1;
|
||||
}
|
||||
__setup("hugepagesz=", setup_hugepagesz);
|
||||
|
||||
static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file,
|
||||
unsigned long addr, unsigned long len,
|
||||
unsigned long pgoff, unsigned long flags)
|
||||
{
|
||||
struct hstate *h = hstate_file(file);
|
||||
struct vm_unmapped_area_info info;
|
||||
|
||||
info.flags = 0;
|
||||
info.length = len;
|
||||
info.low_limit = current->mm->mmap_base;
|
||||
info.high_limit = TASK_SIZE;
|
||||
info.align_mask = PAGE_MASK & ~huge_page_mask(h);
|
||||
info.align_offset = 0;
|
||||
return vm_unmapped_area(&info);
|
||||
}
|
||||
|
||||
static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file,
|
||||
unsigned long addr0, unsigned long len,
|
||||
unsigned long pgoff, unsigned long flags)
|
||||
{
|
||||
struct hstate *h = hstate_file(file);
|
||||
struct vm_unmapped_area_info info;
|
||||
unsigned long addr;
|
||||
|
||||
info.flags = VM_UNMAPPED_AREA_TOPDOWN;
|
||||
info.length = len;
|
||||
info.low_limit = max(PAGE_SIZE, mmap_min_addr);
|
||||
info.high_limit = current->mm->mmap_base;
|
||||
info.align_mask = PAGE_MASK & ~huge_page_mask(h);
|
||||
info.align_offset = 0;
|
||||
addr = vm_unmapped_area(&info);
|
||||
|
||||
/*
|
||||
* A failed mmap() very likely causes application failure,
|
||||
* so fall back to the bottom-up function here. This scenario
|
||||
* can happen with large stack limits and large mmap()
|
||||
* allocations.
|
||||
*/
|
||||
if (addr & ~PAGE_MASK) {
|
||||
VM_BUG_ON(addr != -ENOMEM);
|
||||
info.flags = 0;
|
||||
info.low_limit = TASK_UNMAPPED_BASE;
|
||||
info.high_limit = TASK_SIZE;
|
||||
addr = vm_unmapped_area(&info);
|
||||
}
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
|
||||
unsigned long len, unsigned long pgoff, unsigned long flags)
|
||||
{
|
||||
struct hstate *h = hstate_file(file);
|
||||
struct mm_struct *mm = current->mm;
|
||||
struct vm_area_struct *vma;
|
||||
int rc;
|
||||
|
||||
if (len & ~huge_page_mask(h))
|
||||
return -EINVAL;
|
||||
if (len > TASK_SIZE - mmap_min_addr)
|
||||
return -ENOMEM;
|
||||
|
||||
if (flags & MAP_FIXED) {
|
||||
if (prepare_hugepage_range(file, addr, len))
|
||||
return -EINVAL;
|
||||
goto check_asce_limit;
|
||||
}
|
||||
|
||||
if (addr) {
|
||||
addr = ALIGN(addr, huge_page_size(h));
|
||||
vma = find_vma(mm, addr);
|
||||
if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
|
||||
(!vma || addr + len <= vm_start_gap(vma)))
|
||||
goto check_asce_limit;
|
||||
}
|
||||
|
||||
if (mm->get_unmapped_area == arch_get_unmapped_area)
|
||||
addr = hugetlb_get_unmapped_area_bottomup(file, addr, len,
|
||||
pgoff, flags);
|
||||
else
|
||||
addr = hugetlb_get_unmapped_area_topdown(file, addr, len,
|
||||
pgoff, flags);
|
||||
if (addr & ~PAGE_MASK)
|
||||
return addr;
|
||||
|
||||
check_asce_limit:
|
||||
if (addr + len > current->mm->context.asce_limit &&
|
||||
addr + len <= TASK_SIZE) {
|
||||
rc = crst_table_upgrade(mm, addr + len);
|
||||
if (rc)
|
||||
return (unsigned long) rc;
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
@ -15,19 +15,19 @@
|
||||
|
||||
struct ipc64_perm
|
||||
{
|
||||
__kernel_key_t key;
|
||||
__kernel_uid_t uid;
|
||||
__kernel_gid_t gid;
|
||||
__kernel_uid_t cuid;
|
||||
__kernel_gid_t cgid;
|
||||
__kernel_key_t key;
|
||||
__kernel_uid32_t uid;
|
||||
__kernel_gid32_t gid;
|
||||
__kernel_uid32_t cuid;
|
||||
__kernel_gid32_t cgid;
|
||||
#ifndef __arch64__
|
||||
unsigned short __pad0;
|
||||
unsigned short __pad0;
|
||||
#endif
|
||||
__kernel_mode_t mode;
|
||||
unsigned short __pad1;
|
||||
unsigned short seq;
|
||||
unsigned long long __unused1;
|
||||
unsigned long long __unused2;
|
||||
__kernel_mode_t mode;
|
||||
unsigned short __pad1;
|
||||
unsigned short seq;
|
||||
unsigned long long __unused1;
|
||||
unsigned long long __unused2;
|
||||
};
|
||||
|
||||
#endif /* __SPARC_IPCBUF_H */
|
||||
|
@ -115,11 +115,12 @@ void __init tsx_init(void)
|
||||
tsx_disable();
|
||||
|
||||
/*
|
||||
* tsx_disable() will change the state of the
|
||||
* RTM CPUID bit. Clear it here since it is now
|
||||
* expected to be not set.
|
||||
* tsx_disable() will change the state of the RTM and HLE CPUID
|
||||
* bits. Clear them here since they are now expected to be not
|
||||
* set.
|
||||
*/
|
||||
setup_clear_cpu_cap(X86_FEATURE_RTM);
|
||||
setup_clear_cpu_cap(X86_FEATURE_HLE);
|
||||
} else if (tsx_ctrl_state == TSX_CTRL_ENABLE) {
|
||||
|
||||
/*
|
||||
@ -131,10 +132,10 @@ void __init tsx_init(void)
|
||||
tsx_enable();
|
||||
|
||||
/*
|
||||
* tsx_enable() will change the state of the
|
||||
* RTM CPUID bit. Force it here since it is now
|
||||
* expected to be set.
|
||||
* tsx_enable() will change the state of the RTM and HLE CPUID
|
||||
* bits. Force them here since they are now expected to be set.
|
||||
*/
|
||||
setup_force_cpu_cap(X86_FEATURE_RTM);
|
||||
setup_force_cpu_cap(X86_FEATURE_HLE);
|
||||
}
|
||||
}
|
||||
|
@ -5094,16 +5094,28 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
|
||||
ctxt->ad_bytes = def_ad_bytes ^ 6;
|
||||
break;
|
||||
case 0x26: /* ES override */
|
||||
has_seg_override = true;
|
||||
ctxt->seg_override = VCPU_SREG_ES;
|
||||
break;
|
||||
case 0x2e: /* CS override */
|
||||
has_seg_override = true;
|
||||
ctxt->seg_override = VCPU_SREG_CS;
|
||||
break;
|
||||
case 0x36: /* SS override */
|
||||
has_seg_override = true;
|
||||
ctxt->seg_override = VCPU_SREG_SS;
|
||||
break;
|
||||
case 0x3e: /* DS override */
|
||||
has_seg_override = true;
|
||||
ctxt->seg_override = (ctxt->b >> 3) & 3;
|
||||
ctxt->seg_override = VCPU_SREG_DS;
|
||||
break;
|
||||
case 0x64: /* FS override */
|
||||
has_seg_override = true;
|
||||
ctxt->seg_override = VCPU_SREG_FS;
|
||||
break;
|
||||
case 0x65: /* GS override */
|
||||
has_seg_override = true;
|
||||
ctxt->seg_override = ctxt->b & 7;
|
||||
ctxt->seg_override = VCPU_SREG_GS;
|
||||
break;
|
||||
case 0x40 ... 0x4f: /* REX */
|
||||
if (mode != X86EMUL_MODE_PROT64)
|
||||
@ -5187,10 +5199,15 @@ done_prefixes:
|
||||
}
|
||||
break;
|
||||
case Escape:
|
||||
if (ctxt->modrm > 0xbf)
|
||||
opcode = opcode.u.esc->high[ctxt->modrm - 0xc0];
|
||||
else
|
||||
if (ctxt->modrm > 0xbf) {
|
||||
size_t size = ARRAY_SIZE(opcode.u.esc->high);
|
||||
u32 index = array_index_nospec(
|
||||
ctxt->modrm - 0xc0, size);
|
||||
|
||||
opcode = opcode.u.esc->high[index];
|
||||
} else {
|
||||
opcode = opcode.u.esc->op[(ctxt->modrm >> 3) & 7];
|
||||
}
|
||||
break;
|
||||
case InstrDual:
|
||||
if ((ctxt->modrm >> 6) == 3)
|
||||
|
@ -747,11 +747,12 @@ static int kvm_hv_msr_get_crash_data(struct kvm_vcpu *vcpu,
|
||||
u32 index, u64 *pdata)
|
||||
{
|
||||
struct kvm_hv *hv = &vcpu->kvm->arch.hyperv;
|
||||
size_t size = ARRAY_SIZE(hv->hv_crash_param);
|
||||
|
||||
if (WARN_ON_ONCE(index >= ARRAY_SIZE(hv->hv_crash_param)))
|
||||
if (WARN_ON_ONCE(index >= size))
|
||||
return -EINVAL;
|
||||
|
||||
*pdata = hv->hv_crash_param[index];
|
||||
*pdata = hv->hv_crash_param[array_index_nospec(index, size)];
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -790,11 +791,12 @@ static int kvm_hv_msr_set_crash_data(struct kvm_vcpu *vcpu,
|
||||
u32 index, u64 data)
|
||||
{
|
||||
struct kvm_hv *hv = &vcpu->kvm->arch.hyperv;
|
||||
size_t size = ARRAY_SIZE(hv->hv_crash_param);
|
||||
|
||||
if (WARN_ON_ONCE(index >= ARRAY_SIZE(hv->hv_crash_param)))
|
||||
if (WARN_ON_ONCE(index >= size))
|
||||
return -EINVAL;
|
||||
|
||||
hv->hv_crash_param[index] = data;
|
||||
hv->hv_crash_param[array_index_nospec(index, size)] = data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -460,10 +460,14 @@ static int picdev_write(struct kvm_pic *s,
|
||||
switch (addr) {
|
||||
case 0x20:
|
||||
case 0x21:
|
||||
pic_lock(s);
|
||||
pic_ioport_write(&s->pics[0], addr, data);
|
||||
pic_unlock(s);
|
||||
break;
|
||||
case 0xa0:
|
||||
case 0xa1:
|
||||
pic_lock(s);
|
||||
pic_ioport_write(&s->pics[addr >> 7], addr, data);
|
||||
pic_ioport_write(&s->pics[1], addr, data);
|
||||
pic_unlock(s);
|
||||
break;
|
||||
case 0x4d0:
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/nospec.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/current.h>
|
||||
@ -73,13 +74,14 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,
|
||||
default:
|
||||
{
|
||||
u32 redir_index = (ioapic->ioregsel - 0x10) >> 1;
|
||||
u64 redir_content;
|
||||
u64 redir_content = ~0ULL;
|
||||
|
||||
if (redir_index < IOAPIC_NUM_PINS)
|
||||
redir_content =
|
||||
ioapic->redirtbl[redir_index].bits;
|
||||
else
|
||||
redir_content = ~0ULL;
|
||||
if (redir_index < IOAPIC_NUM_PINS) {
|
||||
u32 index = array_index_nospec(
|
||||
redir_index, IOAPIC_NUM_PINS);
|
||||
|
||||
redir_content = ioapic->redirtbl[index].bits;
|
||||
}
|
||||
|
||||
result = (ioapic->ioregsel & 0x1) ?
|
||||
(redir_content >> 32) & 0xffffffff :
|
||||
@ -297,6 +299,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
|
||||
ioapic_debug("change redir index %x val %x\n", index, val);
|
||||
if (index >= IOAPIC_NUM_PINS)
|
||||
return;
|
||||
index = array_index_nospec(index, IOAPIC_NUM_PINS);
|
||||
e = &ioapic->redirtbl[index];
|
||||
mask_before = e->fields.mask;
|
||||
/* Preserve read-only fields */
|
||||
|
@ -1754,15 +1754,20 @@ int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val)
|
||||
case APIC_LVTTHMR:
|
||||
case APIC_LVTPC:
|
||||
case APIC_LVT1:
|
||||
case APIC_LVTERR:
|
||||
case APIC_LVTERR: {
|
||||
/* TODO: Check vector */
|
||||
size_t size;
|
||||
u32 index;
|
||||
|
||||
if (!kvm_apic_sw_enabled(apic))
|
||||
val |= APIC_LVT_MASKED;
|
||||
|
||||
val &= apic_lvt_mask[(reg - APIC_LVTT) >> 4];
|
||||
size = ARRAY_SIZE(apic_lvt_mask);
|
||||
index = array_index_nospec(
|
||||
(reg - APIC_LVTT) >> 4, size);
|
||||
val &= apic_lvt_mask[index];
|
||||
kvm_lapic_set_reg(apic, reg, val);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case APIC_LVTT:
|
||||
if (!kvm_apic_sw_enabled(apic))
|
||||
|
@ -1165,12 +1165,12 @@ static bool mmu_gfn_lpage_is_disallowed(struct kvm_vcpu *vcpu, gfn_t gfn,
|
||||
return __mmu_gfn_lpage_is_disallowed(gfn, level, slot);
|
||||
}
|
||||
|
||||
static int host_mapping_level(struct kvm *kvm, gfn_t gfn)
|
||||
static int host_mapping_level(struct kvm_vcpu *vcpu, gfn_t gfn)
|
||||
{
|
||||
unsigned long page_size;
|
||||
int i, ret = 0;
|
||||
|
||||
page_size = kvm_host_page_size(kvm, gfn);
|
||||
page_size = kvm_host_page_size(vcpu, gfn);
|
||||
|
||||
for (i = PT_PAGE_TABLE_LEVEL; i <= PT_MAX_HUGEPAGE_LEVEL; ++i) {
|
||||
if (page_size >= KVM_HPAGE_SIZE(i))
|
||||
@ -1220,7 +1220,7 @@ static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn,
|
||||
if (unlikely(*force_pt_level))
|
||||
return PT_PAGE_TABLE_LEVEL;
|
||||
|
||||
host_level = host_mapping_level(vcpu->kvm, large_gfn);
|
||||
host_level = host_mapping_level(vcpu, large_gfn);
|
||||
|
||||
if (host_level == PT_PAGE_TABLE_LEVEL)
|
||||
return host_level;
|
||||
|
@ -202,11 +202,15 @@ static bool fixed_msr_to_seg_unit(u32 msr, int *seg, int *unit)
|
||||
break;
|
||||
case MSR_MTRRfix16K_80000 ... MSR_MTRRfix16K_A0000:
|
||||
*seg = 1;
|
||||
*unit = msr - MSR_MTRRfix16K_80000;
|
||||
*unit = array_index_nospec(
|
||||
msr - MSR_MTRRfix16K_80000,
|
||||
MSR_MTRRfix16K_A0000 - MSR_MTRRfix16K_80000 + 1);
|
||||
break;
|
||||
case MSR_MTRRfix4K_C0000 ... MSR_MTRRfix4K_F8000:
|
||||
*seg = 2;
|
||||
*unit = msr - MSR_MTRRfix4K_C0000;
|
||||
*unit = array_index_nospec(
|
||||
msr - MSR_MTRRfix4K_C0000,
|
||||
MSR_MTRRfix4K_F8000 - MSR_MTRRfix4K_C0000 + 1);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
@ -2,6 +2,8 @@
|
||||
#ifndef __KVM_X86_PMU_H
|
||||
#define __KVM_X86_PMU_H
|
||||
|
||||
#include <linux/nospec.h>
|
||||
|
||||
#define vcpu_to_pmu(vcpu) (&(vcpu)->arch.pmu)
|
||||
#define pmu_to_vcpu(pmu) (container_of((pmu), struct kvm_vcpu, arch.pmu))
|
||||
#define pmc_to_pmu(pmc) (&(pmc)->vcpu->arch.pmu)
|
||||
@ -81,8 +83,12 @@ static inline bool pmc_is_enabled(struct kvm_pmc *pmc)
|
||||
static inline struct kvm_pmc *get_gp_pmc(struct kvm_pmu *pmu, u32 msr,
|
||||
u32 base)
|
||||
{
|
||||
if (msr >= base && msr < base + pmu->nr_arch_gp_counters)
|
||||
return &pmu->gp_counters[msr - base];
|
||||
if (msr >= base && msr < base + pmu->nr_arch_gp_counters) {
|
||||
u32 index = array_index_nospec(msr - base,
|
||||
pmu->nr_arch_gp_counters);
|
||||
|
||||
return &pmu->gp_counters[index];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -92,8 +98,12 @@ static inline struct kvm_pmc *get_fixed_pmc(struct kvm_pmu *pmu, u32 msr)
|
||||
{
|
||||
int base = MSR_CORE_PERF_FIXED_CTR0;
|
||||
|
||||
if (msr >= base && msr < base + pmu->nr_arch_fixed_counters)
|
||||
return &pmu->fixed_counters[msr - base];
|
||||
if (msr >= base && msr < base + pmu->nr_arch_fixed_counters) {
|
||||
u32 index = array_index_nospec(msr - base,
|
||||
pmu->nr_arch_fixed_counters);
|
||||
|
||||
return &pmu->fixed_counters[index];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -87,10 +87,14 @@ static unsigned intel_find_arch_event(struct kvm_pmu *pmu,
|
||||
|
||||
static unsigned intel_find_fixed_event(int idx)
|
||||
{
|
||||
if (idx >= ARRAY_SIZE(fixed_pmc_events))
|
||||
u32 event;
|
||||
size_t size = ARRAY_SIZE(fixed_pmc_events);
|
||||
|
||||
if (idx >= size)
|
||||
return PERF_COUNT_HW_MAX;
|
||||
|
||||
return intel_arch_events[fixed_pmc_events[idx]].event_type;
|
||||
event = fixed_pmc_events[array_index_nospec(idx, size)];
|
||||
return intel_arch_events[event].event_type;
|
||||
}
|
||||
|
||||
/* check if a PMC is enabled by comparing it with globl_ctrl bits. */
|
||||
@ -131,15 +135,19 @@ static struct kvm_pmc *intel_msr_idx_to_pmc(struct kvm_vcpu *vcpu,
|
||||
struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
|
||||
bool fixed = idx & (1u << 30);
|
||||
struct kvm_pmc *counters;
|
||||
unsigned int num_counters;
|
||||
|
||||
idx &= ~(3u << 30);
|
||||
if (!fixed && idx >= pmu->nr_arch_gp_counters)
|
||||
if (fixed) {
|
||||
counters = pmu->fixed_counters;
|
||||
num_counters = pmu->nr_arch_fixed_counters;
|
||||
} else {
|
||||
counters = pmu->gp_counters;
|
||||
num_counters = pmu->nr_arch_gp_counters;
|
||||
}
|
||||
if (idx >= num_counters)
|
||||
return NULL;
|
||||
if (fixed && idx >= pmu->nr_arch_fixed_counters)
|
||||
return NULL;
|
||||
counters = fixed ? pmu->fixed_counters : pmu->gp_counters;
|
||||
|
||||
return &counters[idx];
|
||||
return &counters[array_index_nospec(idx, num_counters)];
|
||||
}
|
||||
|
||||
static bool intel_is_valid_msr(struct kvm_vcpu *vcpu, u32 msr)
|
||||
|
@ -8014,8 +8014,10 @@ static int handle_vmread(struct kvm_vcpu *vcpu)
|
||||
/* _system ok, nested_vmx_check_permission has verified cpl=0 */
|
||||
if (kvm_write_guest_virt_system(vcpu, gva, &field_value,
|
||||
(is_long_mode(vcpu) ? 8 : 4),
|
||||
&e))
|
||||
&e)) {
|
||||
kvm_inject_page_fault(vcpu, &e);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
nested_vmx_succeed(vcpu);
|
||||
|
8033
arch/x86/kvm/vmx/vmx.c
Normal file
8033
arch/x86/kvm/vmx/vmx.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -924,9 +924,11 @@ static u64 kvm_dr6_fixed(struct kvm_vcpu *vcpu)
|
||||
|
||||
static int __kvm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long val)
|
||||
{
|
||||
size_t size = ARRAY_SIZE(vcpu->arch.db);
|
||||
|
||||
switch (dr) {
|
||||
case 0 ... 3:
|
||||
vcpu->arch.db[dr] = val;
|
||||
vcpu->arch.db[array_index_nospec(dr, size)] = val;
|
||||
if (!(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP))
|
||||
vcpu->arch.eff_db[dr] = val;
|
||||
break;
|
||||
@ -963,9 +965,11 @@ EXPORT_SYMBOL_GPL(kvm_set_dr);
|
||||
|
||||
int kvm_get_dr(struct kvm_vcpu *vcpu, int dr, unsigned long *val)
|
||||
{
|
||||
size_t size = ARRAY_SIZE(vcpu->arch.db);
|
||||
|
||||
switch (dr) {
|
||||
case 0 ... 3:
|
||||
*val = vcpu->arch.db[dr];
|
||||
*val = vcpu->arch.db[array_index_nospec(dr, size)];
|
||||
break;
|
||||
case 4:
|
||||
/* fall through */
|
||||
@ -2161,7 +2165,10 @@ static int set_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 data)
|
||||
default:
|
||||
if (msr >= MSR_IA32_MC0_CTL &&
|
||||
msr < MSR_IA32_MCx_CTL(bank_num)) {
|
||||
u32 offset = msr - MSR_IA32_MC0_CTL;
|
||||
u32 offset = array_index_nospec(
|
||||
msr - MSR_IA32_MC0_CTL,
|
||||
MSR_IA32_MCx_CTL(bank_num) - MSR_IA32_MC0_CTL);
|
||||
|
||||
/* only 0 or all 1s can be written to IA32_MCi_CTL
|
||||
* some Linux kernels though clear bit 10 in bank 4 to
|
||||
* workaround a BIOS/GART TBL issue on AMD K8s, ignore
|
||||
@ -2545,7 +2552,10 @@ static int get_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
|
||||
default:
|
||||
if (msr >= MSR_IA32_MC0_CTL &&
|
||||
msr < MSR_IA32_MCx_CTL(bank_num)) {
|
||||
u32 offset = msr - MSR_IA32_MC0_CTL;
|
||||
u32 offset = array_index_nospec(
|
||||
msr - MSR_IA32_MC0_CTL,
|
||||
MSR_IA32_MCx_CTL(bank_num) - MSR_IA32_MC0_CTL);
|
||||
|
||||
data = vcpu->arch.mce_banks[offset];
|
||||
break;
|
||||
}
|
||||
@ -6304,7 +6314,7 @@ static void kvm_set_mmio_spte_mask(void)
|
||||
* If reserved bit is not supported, clear the present bit to disable
|
||||
* mmio page fault.
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_X86_64) && maxphyaddr == 52)
|
||||
if (maxphyaddr == 52)
|
||||
mask &= ~1ull;
|
||||
|
||||
kvm_mmu_set_mmio_spte_mask(mask, mask);
|
||||
@ -7667,6 +7677,9 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
|
||||
int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
|
||||
struct kvm_mp_state *mp_state)
|
||||
{
|
||||
if (kvm_mpx_supported())
|
||||
kvm_load_guest_fpu(vcpu);
|
||||
|
||||
kvm_apic_accept_events(vcpu);
|
||||
if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED &&
|
||||
vcpu->arch.pv.pv_unhalted)
|
||||
@ -7674,6 +7687,8 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
|
||||
else
|
||||
mp_state->mp_state = vcpu->arch.mp_state;
|
||||
|
||||
if (kvm_mpx_supported())
|
||||
kvm_put_guest_fpu(vcpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -8053,7 +8068,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
|
||||
kvm_mmu_unload(vcpu);
|
||||
vcpu_put(vcpu);
|
||||
|
||||
kvm_x86_ops->vcpu_free(vcpu);
|
||||
kvm_arch_vcpu_free(vcpu);
|
||||
}
|
||||
|
||||
void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
|
||||
|
@ -652,11 +652,9 @@ EXPORT_SYMBOL_GPL(crypto_grab_spawn);
|
||||
|
||||
void crypto_drop_spawn(struct crypto_spawn *spawn)
|
||||
{
|
||||
if (!spawn->alg)
|
||||
return;
|
||||
|
||||
down_write(&crypto_alg_sem);
|
||||
list_del(&spawn->list);
|
||||
if (spawn->alg)
|
||||
list_del(&spawn->list);
|
||||
up_write(&crypto_alg_sem);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(crypto_drop_spawn);
|
||||
@ -664,22 +662,16 @@ EXPORT_SYMBOL_GPL(crypto_drop_spawn);
|
||||
static struct crypto_alg *crypto_spawn_alg(struct crypto_spawn *spawn)
|
||||
{
|
||||
struct crypto_alg *alg;
|
||||
struct crypto_alg *alg2;
|
||||
|
||||
down_read(&crypto_alg_sem);
|
||||
alg = spawn->alg;
|
||||
alg2 = alg;
|
||||
if (alg2)
|
||||
alg2 = crypto_mod_get(alg2);
|
||||
if (alg && !crypto_mod_get(alg)) {
|
||||
alg->cra_flags |= CRYPTO_ALG_DYING;
|
||||
alg = NULL;
|
||||
}
|
||||
up_read(&crypto_alg_sem);
|
||||
|
||||
if (!alg2) {
|
||||
if (alg)
|
||||
crypto_shoot_alg(alg);
|
||||
return ERR_PTR(-EAGAIN);
|
||||
}
|
||||
|
||||
return alg;
|
||||
return alg ?: ERR_PTR(-EAGAIN);
|
||||
}
|
||||
|
||||
struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn, u32 type,
|
||||
|
@ -340,13 +340,12 @@ static unsigned int crypto_ctxsize(struct crypto_alg *alg, u32 type, u32 mask)
|
||||
return len;
|
||||
}
|
||||
|
||||
void crypto_shoot_alg(struct crypto_alg *alg)
|
||||
static void crypto_shoot_alg(struct crypto_alg *alg)
|
||||
{
|
||||
down_write(&crypto_alg_sem);
|
||||
alg->cra_flags |= CRYPTO_ALG_DYING;
|
||||
up_write(&crypto_alg_sem);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(crypto_shoot_alg);
|
||||
|
||||
struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
|
||||
u32 mask)
|
||||
|
@ -84,7 +84,6 @@ void crypto_alg_tested(const char *name, int err);
|
||||
void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list,
|
||||
struct crypto_alg *nalg);
|
||||
void crypto_remove_final(struct list_head *list);
|
||||
void crypto_shoot_alg(struct crypto_alg *alg);
|
||||
struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
|
||||
u32 mask);
|
||||
void *crypto_create_tfm(struct crypto_alg *alg,
|
||||
|
@ -130,7 +130,6 @@ static void pcrypt_aead_done(struct crypto_async_request *areq, int err)
|
||||
struct padata_priv *padata = pcrypt_request_padata(preq);
|
||||
|
||||
padata->info = err;
|
||||
req->base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
|
||||
padata_do_serial(padata);
|
||||
}
|
||||
|
@ -328,6 +328,11 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"),
|
||||
},
|
||||
},
|
||||
|
||||
/*
|
||||
* Desktops which falsely report a backlight and which our heuristics
|
||||
* for this do not catch.
|
||||
*/
|
||||
{
|
||||
.callback = video_detect_force_none,
|
||||
.ident = "Dell OptiPlex 9020M",
|
||||
@ -336,6 +341,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020M"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = video_detect_force_none,
|
||||
.ident = "MSI MS-7721",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "MS-7721"),
|
||||
},
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
|
@ -277,10 +277,38 @@ static void dpm_wait_for_suppliers(struct device *dev, bool async)
|
||||
device_links_read_unlock(idx);
|
||||
}
|
||||
|
||||
static void dpm_wait_for_superior(struct device *dev, bool async)
|
||||
static bool dpm_wait_for_superior(struct device *dev, bool async)
|
||||
{
|
||||
dpm_wait(dev->parent, async);
|
||||
struct device *parent;
|
||||
|
||||
/*
|
||||
* If the device is resumed asynchronously and the parent's callback
|
||||
* deletes both the device and the parent itself, the parent object may
|
||||
* be freed while this function is running, so avoid that by reference
|
||||
* counting the parent once more unless the device has been deleted
|
||||
* already (in which case return right away).
|
||||
*/
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
|
||||
if (!device_pm_initialized(dev)) {
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
return false;
|
||||
}
|
||||
|
||||
parent = get_device(dev->parent);
|
||||
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
|
||||
dpm_wait(parent, async);
|
||||
put_device(parent);
|
||||
|
||||
dpm_wait_for_suppliers(dev, async);
|
||||
|
||||
/*
|
||||
* If the parent's callback has deleted the device, attempting to resume
|
||||
* it would be invalid, so avoid doing that then.
|
||||
*/
|
||||
return device_pm_initialized(dev);
|
||||
}
|
||||
|
||||
static void dpm_wait_for_consumers(struct device *dev, bool async)
|
||||
@ -559,7 +587,8 @@ static int device_resume_noirq(struct device *dev, pm_message_t state, bool asyn
|
||||
if (!dev->power.is_noirq_suspended)
|
||||
goto Out;
|
||||
|
||||
dpm_wait_for_superior(dev, async);
|
||||
if (!dpm_wait_for_superior(dev, async))
|
||||
goto Out;
|
||||
|
||||
if (dev->pm_domain) {
|
||||
info = "noirq power domain ";
|
||||
@ -699,7 +728,8 @@ static int device_resume_early(struct device *dev, pm_message_t state, bool asyn
|
||||
if (!dev->power.is_late_suspended)
|
||||
goto Out;
|
||||
|
||||
dpm_wait_for_superior(dev, async);
|
||||
if (!dpm_wait_for_superior(dev, async))
|
||||
goto Out;
|
||||
|
||||
if (dev->pm_domain) {
|
||||
info = "early power domain ";
|
||||
@ -831,7 +861,9 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
|
||||
goto Complete;
|
||||
}
|
||||
|
||||
dpm_wait_for_superior(dev, async);
|
||||
if (!dpm_wait_for_superior(dev, async))
|
||||
goto Complete;
|
||||
|
||||
dpm_watchdog_set(&wd, dev);
|
||||
device_lock(dev);
|
||||
|
||||
|
@ -825,7 +825,11 @@ static struct tegra_periph_init_data gate_clks[] = {
|
||||
GATE("vcp", "clk_m", 29, 0, tegra_clk_vcp, 0),
|
||||
GATE("apbdma", "clk_m", 34, 0, tegra_clk_apbdma, 0),
|
||||
GATE("kbc", "clk_32k", 36, TEGRA_PERIPH_ON_APB | TEGRA_PERIPH_NO_RESET, tegra_clk_kbc, 0),
|
||||
GATE("fuse", "clk_m", 39, TEGRA_PERIPH_ON_APB, tegra_clk_fuse, 0),
|
||||
/*
|
||||
* Critical for RAM re-repair operation, which must occur on resume
|
||||
* from LP1 system suspend and as part of CCPLEX cluster switching.
|
||||
*/
|
||||
GATE("fuse", "clk_m", 39, TEGRA_PERIPH_ON_APB, tegra_clk_fuse, CLK_IS_CRITICAL),
|
||||
GATE("fuse_burn", "clk_m", 39, TEGRA_PERIPH_ON_APB, tegra_clk_fuse_burn, 0),
|
||||
GATE("kfuse", "clk_m", 40, TEGRA_PERIPH_ON_APB, tegra_clk_kfuse, 0),
|
||||
GATE("apbif", "clk_m", 107, TEGRA_PERIPH_ON_APB, tegra_clk_apbif, 0),
|
||||
|
@ -91,7 +91,6 @@
|
||||
struct atmel_aes_caps {
|
||||
bool has_dualbuff;
|
||||
bool has_cfb64;
|
||||
bool has_ctr32;
|
||||
bool has_gcm;
|
||||
bool has_xts;
|
||||
bool has_authenc;
|
||||
@ -990,8 +989,9 @@ static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd)
|
||||
struct atmel_aes_ctr_ctx *ctx = atmel_aes_ctr_ctx_cast(dd->ctx);
|
||||
struct ablkcipher_request *req = ablkcipher_request_cast(dd->areq);
|
||||
struct scatterlist *src, *dst;
|
||||
u32 ctr, blocks;
|
||||
size_t datalen;
|
||||
u32 ctr;
|
||||
u16 blocks, start, end;
|
||||
bool use_dma, fragmented = false;
|
||||
|
||||
/* Check for transfer completion. */
|
||||
@ -1003,27 +1003,17 @@ static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd)
|
||||
datalen = req->nbytes - ctx->offset;
|
||||
blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE);
|
||||
ctr = be32_to_cpu(ctx->iv[3]);
|
||||
if (dd->caps.has_ctr32) {
|
||||
/* Check 32bit counter overflow. */
|
||||
u32 start = ctr;
|
||||
u32 end = start + blocks - 1;
|
||||
|
||||
if (end < start) {
|
||||
ctr |= 0xffffffff;
|
||||
datalen = AES_BLOCK_SIZE * -start;
|
||||
fragmented = true;
|
||||
}
|
||||
} else {
|
||||
/* Check 16bit counter overflow. */
|
||||
u16 start = ctr & 0xffff;
|
||||
u16 end = start + (u16)blocks - 1;
|
||||
/* Check 16bit counter overflow. */
|
||||
start = ctr & 0xffff;
|
||||
end = start + blocks - 1;
|
||||
|
||||
if (blocks >> 16 || end < start) {
|
||||
ctr |= 0xffff;
|
||||
datalen = AES_BLOCK_SIZE * (0x10000-start);
|
||||
fragmented = true;
|
||||
}
|
||||
if (blocks >> 16 || end < start) {
|
||||
ctr |= 0xffff;
|
||||
datalen = AES_BLOCK_SIZE * (0x10000 - start);
|
||||
fragmented = true;
|
||||
}
|
||||
|
||||
use_dma = (datalen >= ATMEL_AES_DMA_THRESHOLD);
|
||||
|
||||
/* Jump to offset. */
|
||||
@ -2536,7 +2526,6 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd)
|
||||
{
|
||||
dd->caps.has_dualbuff = 0;
|
||||
dd->caps.has_cfb64 = 0;
|
||||
dd->caps.has_ctr32 = 0;
|
||||
dd->caps.has_gcm = 0;
|
||||
dd->caps.has_xts = 0;
|
||||
dd->caps.has_authenc = 0;
|
||||
@ -2547,7 +2536,6 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd)
|
||||
case 0x500:
|
||||
dd->caps.has_dualbuff = 1;
|
||||
dd->caps.has_cfb64 = 1;
|
||||
dd->caps.has_ctr32 = 1;
|
||||
dd->caps.has_gcm = 1;
|
||||
dd->caps.has_xts = 1;
|
||||
dd->caps.has_authenc = 1;
|
||||
@ -2556,7 +2544,6 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd)
|
||||
case 0x200:
|
||||
dd->caps.has_dualbuff = 1;
|
||||
dd->caps.has_cfb64 = 1;
|
||||
dd->caps.has_ctr32 = 1;
|
||||
dd->caps.has_gcm = 1;
|
||||
dd->caps.max_burst_size = 4;
|
||||
break;
|
||||
|
@ -1921,12 +1921,7 @@ static int atmel_sha_hmac_setkey(struct crypto_ahash *tfm, const u8 *key,
|
||||
{
|
||||
struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm);
|
||||
|
||||
if (atmel_sha_hmac_key_set(&hmac->hkey, key, keylen)) {
|
||||
crypto_ahash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return atmel_sha_hmac_key_set(&hmac->hkey, key, keylen);
|
||||
}
|
||||
|
||||
static int atmel_sha_hmac_init(struct ahash_request *req)
|
||||
|
@ -1256,7 +1256,7 @@ static int artpec6_crypto_aead_set_key(struct crypto_aead *tfm, const u8 *key,
|
||||
|
||||
if (len != 16 && len != 24 && len != 32) {
|
||||
crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -1;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ctx->key_length = len;
|
||||
|
@ -590,6 +590,7 @@ const struct ccp_vdata ccpv3_platform = {
|
||||
.setup = NULL,
|
||||
.perform = &ccp3_actions,
|
||||
.offset = 0,
|
||||
.rsamax = CCP_RSA_MAX_WIDTH,
|
||||
};
|
||||
|
||||
const struct ccp_vdata ccpv3 = {
|
||||
|
@ -1616,6 +1616,11 @@ static const struct of_device_id spacc_of_id_table[] = {
|
||||
MODULE_DEVICE_TABLE(of, spacc_of_id_table);
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
static void spacc_tasklet_kill(void *data)
|
||||
{
|
||||
tasklet_kill(data);
|
||||
}
|
||||
|
||||
static int spacc_probe(struct platform_device *pdev)
|
||||
{
|
||||
int i, err, ret = -EINVAL;
|
||||
@ -1659,6 +1664,14 @@ static int spacc_probe(struct platform_device *pdev)
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
tasklet_init(&engine->complete, spacc_spacc_complete,
|
||||
(unsigned long)engine);
|
||||
|
||||
ret = devm_add_action(&pdev->dev, spacc_tasklet_kill,
|
||||
&engine->complete);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (devm_request_irq(&pdev->dev, irq->start, spacc_spacc_irq, 0,
|
||||
engine->name, engine)) {
|
||||
dev_err(engine->dev, "failed to request IRQ\n");
|
||||
@ -1721,8 +1734,6 @@ static int spacc_probe(struct platform_device *pdev)
|
||||
INIT_LIST_HEAD(&engine->completed);
|
||||
INIT_LIST_HEAD(&engine->in_progress);
|
||||
engine->in_flight = 0;
|
||||
tasklet_init(&engine->complete, spacc_spacc_complete,
|
||||
(unsigned long)engine);
|
||||
|
||||
platform_set_drvdata(pdev, engine);
|
||||
|
||||
|
@ -79,7 +79,11 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
|
||||
struct videomode vm;
|
||||
unsigned long prate;
|
||||
unsigned int cfg;
|
||||
int div;
|
||||
int div, ret;
|
||||
|
||||
ret = clk_prepare_enable(crtc->dc->hlcdc->sys_clk);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
vm.vfront_porch = adj->crtc_vsync_start - adj->crtc_vdisplay;
|
||||
vm.vback_porch = adj->crtc_vtotal - adj->crtc_vsync_end;
|
||||
@ -138,6 +142,8 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
|
||||
ATMEL_HLCDC_VSPSU | ATMEL_HLCDC_VSPHO |
|
||||
ATMEL_HLCDC_GUARDTIME_MASK | ATMEL_HLCDC_MODE_MASK,
|
||||
cfg);
|
||||
|
||||
clk_disable_unprepare(crtc->dc->hlcdc->sys_clk);
|
||||
}
|
||||
|
||||
static enum drm_mode_status
|
||||
|
@ -1170,10 +1170,7 @@ static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm,
|
||||
unsigned int i = 0;
|
||||
struct page *pg;
|
||||
|
||||
if (num_pages < alloc_unit)
|
||||
return 0;
|
||||
|
||||
for (i = 0; (i * alloc_unit) < num_pages; i++) {
|
||||
for (i = 0; i < num_pages / alloc_unit; i++) {
|
||||
if (bl_resp->hdr.size + sizeof(union dm_mem_page_range) >
|
||||
PAGE_SIZE)
|
||||
return i * alloc_unit;
|
||||
@ -1207,7 +1204,7 @@ static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm,
|
||||
|
||||
}
|
||||
|
||||
return num_pages;
|
||||
return i * alloc_unit;
|
||||
}
|
||||
|
||||
static void balloon_up(struct work_struct *dummy)
|
||||
@ -1222,9 +1219,6 @@ static void balloon_up(struct work_struct *dummy)
|
||||
long avail_pages;
|
||||
unsigned long floor;
|
||||
|
||||
/* The host balloons pages in 2M granularity. */
|
||||
WARN_ON_ONCE(num_pages % PAGES_IN_2M != 0);
|
||||
|
||||
/*
|
||||
* We will attempt 2M allocations. However, if we fail to
|
||||
* allocate 2M chunks, we will go back to 4k allocations.
|
||||
@ -1234,14 +1228,13 @@ static void balloon_up(struct work_struct *dummy)
|
||||
avail_pages = si_mem_available();
|
||||
floor = compute_balloon_floor();
|
||||
|
||||
/* Refuse to balloon below the floor, keep the 2M granularity. */
|
||||
/* Refuse to balloon below the floor. */
|
||||
if (avail_pages < num_pages || avail_pages - num_pages < floor) {
|
||||
pr_warn("Balloon request will be partially fulfilled. %s\n",
|
||||
avail_pages < num_pages ? "Not enough memory." :
|
||||
"Balloon floor reached.");
|
||||
|
||||
num_pages = avail_pages > floor ? (avail_pages - floor) : 0;
|
||||
num_pages -= num_pages % PAGES_IN_2M;
|
||||
}
|
||||
|
||||
while (!done) {
|
||||
|
@ -140,7 +140,7 @@ int ib_nl_handle_ip_res_resp(struct sk_buff *skb,
|
||||
if (ib_nl_is_good_ip_resp(nlh))
|
||||
ib_nl_process_good_ip_rsep(nlh);
|
||||
|
||||
return skb->len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ib_nl_ip_send_msg(struct rdma_dev_addr *dev_addr,
|
||||
|
@ -1078,7 +1078,7 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
settimeout_out:
|
||||
return skb->len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ib_nl_is_good_resolve_resp(const struct nlmsghdr *nlh)
|
||||
@ -1149,7 +1149,7 @@ int ib_nl_handle_resolve_resp(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
resp_out:
|
||||
return skb->len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void free_sm_ah(struct kref *kref)
|
||||
|
@ -637,7 +637,7 @@ int ib_umem_odp_map_dma_pages(struct ib_umem *umem, u64 user_virt, u64 bcnt,
|
||||
|
||||
while (bcnt > 0) {
|
||||
const size_t gup_num_pages = min_t(size_t,
|
||||
(bcnt + BIT(page_shift) - 1) >> page_shift,
|
||||
ALIGN(bcnt, PAGE_SIZE) / PAGE_SIZE,
|
||||
PAGE_SIZE / sizeof(struct page *));
|
||||
|
||||
down_read(&owning_mm->mmap_sem);
|
||||
|
@ -507,8 +507,7 @@ int mlx5_ib_gsi_post_send(struct ib_qp *qp, struct ib_send_wr *wr,
|
||||
ret = ib_post_send(tx_qp, &cur_wr.wr, bad_wr);
|
||||
if (ret) {
|
||||
/* Undo the effect of adding the outstanding wr */
|
||||
gsi->outstanding_pi = (gsi->outstanding_pi - 1) %
|
||||
gsi->cap.max_send_wr;
|
||||
gsi->outstanding_pi--;
|
||||
goto err;
|
||||
}
|
||||
spin_unlock_irqrestore(&gsi->lock, flags);
|
||||
|
@ -485,8 +485,14 @@ static int crypt_iv_essiv_gen(struct crypt_config *cc, u8 *iv,
|
||||
static int crypt_iv_benbi_ctr(struct crypt_config *cc, struct dm_target *ti,
|
||||
const char *opts)
|
||||
{
|
||||
unsigned bs = crypto_skcipher_blocksize(any_tfm(cc));
|
||||
int log = ilog2(bs);
|
||||
unsigned bs;
|
||||
int log;
|
||||
|
||||
if (test_bit(CRYPT_MODE_INTEGRITY_AEAD, &cc->cipher_flags))
|
||||
bs = crypto_aead_blocksize(any_tfm_aead(cc));
|
||||
else
|
||||
bs = crypto_skcipher_blocksize(any_tfm(cc));
|
||||
log = ilog2(bs);
|
||||
|
||||
/* we need to calculate how far we must shift the sector count
|
||||
* to get the cipher block count, we use this shift in _gen */
|
||||
|
@ -132,6 +132,7 @@ struct dmz_metadata {
|
||||
|
||||
sector_t zone_bitmap_size;
|
||||
unsigned int zone_nr_bitmap_blocks;
|
||||
unsigned int zone_bits_per_mblk;
|
||||
|
||||
unsigned int nr_bitmap_blocks;
|
||||
unsigned int nr_map_blocks;
|
||||
@ -1165,7 +1166,10 @@ static int dmz_init_zones(struct dmz_metadata *zmd)
|
||||
|
||||
/* Init */
|
||||
zmd->zone_bitmap_size = dev->zone_nr_blocks >> 3;
|
||||
zmd->zone_nr_bitmap_blocks = zmd->zone_bitmap_size >> DMZ_BLOCK_SHIFT;
|
||||
zmd->zone_nr_bitmap_blocks =
|
||||
max_t(sector_t, 1, zmd->zone_bitmap_size >> DMZ_BLOCK_SHIFT);
|
||||
zmd->zone_bits_per_mblk = min_t(sector_t, dev->zone_nr_blocks,
|
||||
DMZ_BLOCK_SIZE_BITS);
|
||||
|
||||
/* Allocate zone array */
|
||||
zmd->zones = kcalloc(dev->nr_zones, sizeof(struct dm_zone), GFP_KERNEL);
|
||||
@ -1982,7 +1986,7 @@ int dmz_copy_valid_blocks(struct dmz_metadata *zmd, struct dm_zone *from_zone,
|
||||
dmz_release_mblock(zmd, to_mblk);
|
||||
dmz_release_mblock(zmd, from_mblk);
|
||||
|
||||
chunk_block += DMZ_BLOCK_SIZE_BITS;
|
||||
chunk_block += zmd->zone_bits_per_mblk;
|
||||
}
|
||||
|
||||
to_zone->weight = from_zone->weight;
|
||||
@ -2043,7 +2047,7 @@ int dmz_validate_blocks(struct dmz_metadata *zmd, struct dm_zone *zone,
|
||||
|
||||
/* Set bits */
|
||||
bit = chunk_block & DMZ_BLOCK_MASK_BITS;
|
||||
nr_bits = min(nr_blocks, DMZ_BLOCK_SIZE_BITS - bit);
|
||||
nr_bits = min(nr_blocks, zmd->zone_bits_per_mblk - bit);
|
||||
|
||||
count = dmz_set_bits((unsigned long *)mblk->data, bit, nr_bits);
|
||||
if (count) {
|
||||
@ -2122,7 +2126,7 @@ int dmz_invalidate_blocks(struct dmz_metadata *zmd, struct dm_zone *zone,
|
||||
|
||||
/* Clear bits */
|
||||
bit = chunk_block & DMZ_BLOCK_MASK_BITS;
|
||||
nr_bits = min(nr_blocks, DMZ_BLOCK_SIZE_BITS - bit);
|
||||
nr_bits = min(nr_blocks, zmd->zone_bits_per_mblk - bit);
|
||||
|
||||
count = dmz_clear_bits((unsigned long *)mblk->data,
|
||||
bit, nr_bits);
|
||||
@ -2182,6 +2186,7 @@ static int dmz_to_next_set_block(struct dmz_metadata *zmd, struct dm_zone *zone,
|
||||
{
|
||||
struct dmz_mblock *mblk;
|
||||
unsigned int bit, set_bit, nr_bits;
|
||||
unsigned int zone_bits = zmd->zone_bits_per_mblk;
|
||||
unsigned long *bitmap;
|
||||
int n = 0;
|
||||
|
||||
@ -2196,15 +2201,15 @@ static int dmz_to_next_set_block(struct dmz_metadata *zmd, struct dm_zone *zone,
|
||||
/* Get offset */
|
||||
bitmap = (unsigned long *) mblk->data;
|
||||
bit = chunk_block & DMZ_BLOCK_MASK_BITS;
|
||||
nr_bits = min(nr_blocks, DMZ_BLOCK_SIZE_BITS - bit);
|
||||
nr_bits = min(nr_blocks, zone_bits - bit);
|
||||
if (set)
|
||||
set_bit = find_next_bit(bitmap, DMZ_BLOCK_SIZE_BITS, bit);
|
||||
set_bit = find_next_bit(bitmap, zone_bits, bit);
|
||||
else
|
||||
set_bit = find_next_zero_bit(bitmap, DMZ_BLOCK_SIZE_BITS, bit);
|
||||
set_bit = find_next_zero_bit(bitmap, zone_bits, bit);
|
||||
dmz_release_mblock(zmd, mblk);
|
||||
|
||||
n += set_bit - bit;
|
||||
if (set_bit < DMZ_BLOCK_SIZE_BITS)
|
||||
if (set_bit < zone_bits)
|
||||
break;
|
||||
|
||||
nr_blocks -= nr_bits;
|
||||
@ -2307,7 +2312,7 @@ static void dmz_get_zone_weight(struct dmz_metadata *zmd, struct dm_zone *zone)
|
||||
/* Count bits in this block */
|
||||
bitmap = mblk->data;
|
||||
bit = chunk_block & DMZ_BLOCK_MASK_BITS;
|
||||
nr_bits = min(nr_blocks, DMZ_BLOCK_SIZE_BITS - bit);
|
||||
nr_bits = min(nr_blocks, zmd->zone_bits_per_mblk - bit);
|
||||
n += dmz_count_bits(bitmap, bit, nr_bits);
|
||||
|
||||
dmz_release_mblock(zmd, mblk);
|
||||
|
@ -1650,7 +1650,6 @@ void dm_init_md_queue(struct mapped_device *md)
|
||||
* - must do so here (in alloc_dev callchain) before queue is used
|
||||
*/
|
||||
md->queue->queuedata = md;
|
||||
md->queue->backing_dev_info->congested_data = md;
|
||||
}
|
||||
|
||||
void dm_init_normal_md_queue(struct mapped_device *md)
|
||||
@ -1661,6 +1660,7 @@ void dm_init_normal_md_queue(struct mapped_device *md)
|
||||
/*
|
||||
* Initialize aspects of queue that aren't relevant for blk-mq
|
||||
*/
|
||||
md->queue->backing_dev_info->congested_data = md;
|
||||
md->queue->backing_dev_info->congested_fn = dm_any_congested;
|
||||
}
|
||||
|
||||
@ -1757,6 +1757,12 @@ static struct mapped_device *alloc_dev(int minor)
|
||||
goto bad;
|
||||
|
||||
dm_init_md_queue(md);
|
||||
/*
|
||||
* default to bio-based required ->make_request_fn until DM
|
||||
* table is loaded and md->type established. If request-based
|
||||
* table is loaded: blk-mq will override accordingly.
|
||||
*/
|
||||
blk_queue_make_request(md->queue, dm_make_request);
|
||||
|
||||
md->disk = alloc_disk_node(1, numa_node_id);
|
||||
if (!md->disk)
|
||||
@ -2145,7 +2151,6 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t)
|
||||
case DM_TYPE_BIO_BASED:
|
||||
case DM_TYPE_DAX_BIO_BASED:
|
||||
dm_init_normal_md_queue(md);
|
||||
blk_queue_make_request(md->queue, dm_make_request);
|
||||
/*
|
||||
* DM handles splitting bios as needed. Free the bio_split bioset
|
||||
* since it won't be used (saves 1 process per bio-based DM device).
|
||||
|
@ -382,6 +382,33 @@ int sm_ll_find_free_block(struct ll_disk *ll, dm_block_t begin,
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
int sm_ll_find_common_free_block(struct ll_disk *old_ll, struct ll_disk *new_ll,
|
||||
dm_block_t begin, dm_block_t end, dm_block_t *b)
|
||||
{
|
||||
int r;
|
||||
uint32_t count;
|
||||
|
||||
do {
|
||||
r = sm_ll_find_free_block(new_ll, begin, new_ll->nr_blocks, b);
|
||||
if (r)
|
||||
break;
|
||||
|
||||
/* double check this block wasn't used in the old transaction */
|
||||
if (*b >= old_ll->nr_blocks)
|
||||
count = 0;
|
||||
else {
|
||||
r = sm_ll_lookup(old_ll, *b, &count);
|
||||
if (r)
|
||||
break;
|
||||
|
||||
if (count)
|
||||
begin = *b + 1;
|
||||
}
|
||||
} while (count);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int sm_ll_mutate(struct ll_disk *ll, dm_block_t b,
|
||||
int (*mutator)(void *context, uint32_t old, uint32_t *new),
|
||||
void *context, enum allocation_event *ev)
|
||||
|
@ -109,6 +109,8 @@ int sm_ll_lookup_bitmap(struct ll_disk *ll, dm_block_t b, uint32_t *result);
|
||||
int sm_ll_lookup(struct ll_disk *ll, dm_block_t b, uint32_t *result);
|
||||
int sm_ll_find_free_block(struct ll_disk *ll, dm_block_t begin,
|
||||
dm_block_t end, dm_block_t *result);
|
||||
int sm_ll_find_common_free_block(struct ll_disk *old_ll, struct ll_disk *new_ll,
|
||||
dm_block_t begin, dm_block_t end, dm_block_t *result);
|
||||
int sm_ll_insert(struct ll_disk *ll, dm_block_t b, uint32_t ref_count, enum allocation_event *ev);
|
||||
int sm_ll_inc(struct ll_disk *ll, dm_block_t b, enum allocation_event *ev);
|
||||
int sm_ll_dec(struct ll_disk *ll, dm_block_t b, enum allocation_event *ev);
|
||||
|
@ -167,8 +167,10 @@ static int sm_disk_new_block(struct dm_space_map *sm, dm_block_t *b)
|
||||
enum allocation_event ev;
|
||||
struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
|
||||
|
||||
/* FIXME: we should loop round a couple of times */
|
||||
r = sm_ll_find_free_block(&smd->old_ll, smd->begin, smd->old_ll.nr_blocks, b);
|
||||
/*
|
||||
* Any block we allocate has to be free in both the old and current ll.
|
||||
*/
|
||||
r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, smd->begin, smd->ll.nr_blocks, b);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
|
@ -447,7 +447,10 @@ static int sm_metadata_new_block_(struct dm_space_map *sm, dm_block_t *b)
|
||||
enum allocation_event ev;
|
||||
struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm);
|
||||
|
||||
r = sm_ll_find_free_block(&smm->old_ll, smm->begin, smm->old_ll.nr_blocks, b);
|
||||
/*
|
||||
* Any block we allocate has to be free in both the old and current ll.
|
||||
*/
|
||||
r = sm_ll_find_common_free_block(&smm->old_ll, &smm->ll, smm->begin, smm->ll.nr_blocks, b);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
|
@ -372,10 +372,10 @@ int adv748x_write_block(struct adv748x_state *state, int client_page,
|
||||
|
||||
#define io_read(s, r) adv748x_read(s, ADV748X_PAGE_IO, r)
|
||||
#define io_write(s, r, v) adv748x_write(s, ADV748X_PAGE_IO, r, v)
|
||||
#define io_clrset(s, r, m, v) io_write(s, r, (io_read(s, r) & ~m) | v)
|
||||
#define io_clrset(s, r, m, v) io_write(s, r, (io_read(s, r) & ~(m)) | (v))
|
||||
|
||||
#define hdmi_read(s, r) adv748x_read(s, ADV748X_PAGE_HDMI, r)
|
||||
#define hdmi_read16(s, r, m) (((hdmi_read(s, r) << 8) | hdmi_read(s, r+1)) & m)
|
||||
#define hdmi_read16(s, r, m) (((hdmi_read(s, r) << 8) | hdmi_read(s, (r)+1)) & (m))
|
||||
#define hdmi_write(s, r, v) adv748x_write(s, ADV748X_PAGE_HDMI, r, v)
|
||||
|
||||
#define repeater_read(s, r) adv748x_read(s, ADV748X_PAGE_REPEATER, r)
|
||||
@ -383,11 +383,11 @@ int adv748x_write_block(struct adv748x_state *state, int client_page,
|
||||
|
||||
#define sdp_read(s, r) adv748x_read(s, ADV748X_PAGE_SDP, r)
|
||||
#define sdp_write(s, r, v) adv748x_write(s, ADV748X_PAGE_SDP, r, v)
|
||||
#define sdp_clrset(s, r, m, v) sdp_write(s, r, (sdp_read(s, r) & ~m) | v)
|
||||
#define sdp_clrset(s, r, m, v) sdp_write(s, r, (sdp_read(s, r) & ~(m)) | (v))
|
||||
|
||||
#define cp_read(s, r) adv748x_read(s, ADV748X_PAGE_CP, r)
|
||||
#define cp_write(s, r, v) adv748x_write(s, ADV748X_PAGE_CP, r, v)
|
||||
#define cp_clrset(s, r, m, v) cp_write(s, r, (cp_read(s, r) & ~m) | v)
|
||||
#define cp_clrset(s, r, m, v) cp_write(s, r, (cp_read(s, r) & ~(m)) | (v))
|
||||
|
||||
#define txa_read(s, r) adv748x_read(s, ADV748X_PAGE_TXA, r)
|
||||
#define txb_read(s, r) adv748x_read(s, ADV748X_PAGE_TXB, r)
|
||||
|
@ -427,7 +427,7 @@ static int iguanair_probe(struct usb_interface *intf,
|
||||
int ret, pipein, pipeout;
|
||||
struct usb_host_interface *idesc;
|
||||
|
||||
idesc = intf->altsetting;
|
||||
idesc = intf->cur_altsetting;
|
||||
if (idesc->desc.bNumEndpoints < 2)
|
||||
return -ENODEV;
|
||||
|
||||
|
@ -1446,6 +1446,11 @@ static int uvc_scan_chain_forward(struct uvc_video_chain *chain,
|
||||
break;
|
||||
if (forward == prev)
|
||||
continue;
|
||||
if (forward->chain.next || forward->chain.prev) {
|
||||
uvc_trace(UVC_TRACE_DESCR, "Found reference to "
|
||||
"entity %d already in chain.\n", forward->id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (UVC_ENTITY_TYPE(forward)) {
|
||||
case UVC_VC_EXTENSION_UNIT:
|
||||
@ -1527,6 +1532,13 @@ static int uvc_scan_chain_backward(struct uvc_video_chain *chain,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (term->chain.next || term->chain.prev) {
|
||||
uvc_trace(UVC_TRACE_DESCR, "Found reference to "
|
||||
"entity %d already in chain.\n",
|
||||
term->id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (uvc_trace_param & UVC_TRACE_PROBE)
|
||||
printk(KERN_CONT " %d", term->id);
|
||||
|
||||
|
@ -352,8 +352,11 @@ int videobuf_dma_free(struct videobuf_dmabuf *dma)
|
||||
BUG_ON(dma->sglen);
|
||||
|
||||
if (dma->pages) {
|
||||
for (i = 0; i < dma->nr_pages; i++)
|
||||
for (i = 0; i < dma->nr_pages; i++) {
|
||||
if (dma->direction == DMA_FROM_DEVICE)
|
||||
set_page_dirty_lock(dma->pages[i]);
|
||||
put_page(dma->pages[i]);
|
||||
}
|
||||
kfree(dma->pages);
|
||||
dma->pages = NULL;
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ static const struct mfd_cell da9062_devs[] = {
|
||||
.name = "da9062-watchdog",
|
||||
.num_resources = ARRAY_SIZE(da9062_wdt_resources),
|
||||
.resources = da9062_wdt_resources,
|
||||
.of_compatible = "dlg,da9062-wdt",
|
||||
.of_compatible = "dlg,da9062-watchdog",
|
||||
},
|
||||
{
|
||||
.name = "da9062-thermal",
|
||||
|
@ -729,6 +729,8 @@ static int dln2_probe(struct usb_interface *interface,
|
||||
const struct usb_device_id *usb_id)
|
||||
{
|
||||
struct usb_host_interface *hostif = interface->cur_altsetting;
|
||||
struct usb_endpoint_descriptor *epin;
|
||||
struct usb_endpoint_descriptor *epout;
|
||||
struct device *dev = &interface->dev;
|
||||
struct dln2_dev *dln2;
|
||||
int ret;
|
||||
@ -738,12 +740,19 @@ static int dln2_probe(struct usb_interface *interface,
|
||||
hostif->desc.bNumEndpoints < 2)
|
||||
return -ENODEV;
|
||||
|
||||
epin = &hostif->endpoint[0].desc;
|
||||
epout = &hostif->endpoint[1].desc;
|
||||
if (!usb_endpoint_is_bulk_out(epout))
|
||||
return -ENODEV;
|
||||
if (!usb_endpoint_is_bulk_in(epin))
|
||||
return -ENODEV;
|
||||
|
||||
dln2 = kzalloc(sizeof(*dln2), GFP_KERNEL);
|
||||
if (!dln2)
|
||||
return -ENOMEM;
|
||||
|
||||
dln2->ep_out = hostif->endpoint[0].desc.bEndpointAddress;
|
||||
dln2->ep_in = hostif->endpoint[1].desc.bEndpointAddress;
|
||||
dln2->ep_out = epout->bEndpointAddress;
|
||||
dln2->ep_in = epin->bEndpointAddress;
|
||||
dln2->usb_dev = usb_get_dev(interface_to_usbdev(interface));
|
||||
dln2->interface = interface;
|
||||
usb_set_intfdata(interface, dln2);
|
||||
|
@ -32,6 +32,7 @@ static bool rn5t618_volatile_reg(struct device *dev, unsigned int reg)
|
||||
case RN5T618_WATCHDOGCNT:
|
||||
case RN5T618_DCIRQ:
|
||||
case RN5T618_ILIMDATAH ... RN5T618_AIN0DATAL:
|
||||
case RN5T618_ADCCNT3:
|
||||
case RN5T618_IR_ADC1 ... RN5T618_IR_ADC3:
|
||||
case RN5T618_IR_GPR:
|
||||
case RN5T618_IR_GPF:
|
||||
|
@ -1154,17 +1154,22 @@ static void mmc_spi_initsequence(struct mmc_spi_host *host)
|
||||
* SPI protocol. Another is that when chipselect is released while
|
||||
* the card returns BUSY status, the clock must issue several cycles
|
||||
* with chipselect high before the card will stop driving its output.
|
||||
*
|
||||
* SPI_CS_HIGH means "asserted" here. In some cases like when using
|
||||
* GPIOs for chip select, SPI_CS_HIGH is set but this will be logically
|
||||
* inverted by gpiolib, so if we want to ascertain to drive it high
|
||||
* we should toggle the default with an XOR as we do here.
|
||||
*/
|
||||
host->spi->mode |= SPI_CS_HIGH;
|
||||
host->spi->mode ^= SPI_CS_HIGH;
|
||||
if (spi_setup(host->spi) != 0) {
|
||||
/* Just warn; most cards work without it. */
|
||||
dev_warn(&host->spi->dev,
|
||||
"can't change chip-select polarity\n");
|
||||
host->spi->mode &= ~SPI_CS_HIGH;
|
||||
host->spi->mode ^= SPI_CS_HIGH;
|
||||
} else {
|
||||
mmc_spi_readbytes(host, 18);
|
||||
|
||||
host->spi->mode &= ~SPI_CS_HIGH;
|
||||
host->spi->mode ^= SPI_CS_HIGH;
|
||||
if (spi_setup(host->spi) != 0) {
|
||||
/* Wot, we can't get the same setup we had before? */
|
||||
dev_err(&host->spi->dev,
|
||||
|
@ -331,19 +331,22 @@ static int sdhci_at91_probe(struct platform_device *pdev)
|
||||
priv->mainck = devm_clk_get(&pdev->dev, "baseclk");
|
||||
if (IS_ERR(priv->mainck)) {
|
||||
dev_err(&pdev->dev, "failed to get baseclk\n");
|
||||
return PTR_ERR(priv->mainck);
|
||||
ret = PTR_ERR(priv->mainck);
|
||||
goto sdhci_pltfm_free;
|
||||
}
|
||||
|
||||
priv->hclock = devm_clk_get(&pdev->dev, "hclock");
|
||||
if (IS_ERR(priv->hclock)) {
|
||||
dev_err(&pdev->dev, "failed to get hclock\n");
|
||||
return PTR_ERR(priv->hclock);
|
||||
ret = PTR_ERR(priv->hclock);
|
||||
goto sdhci_pltfm_free;
|
||||
}
|
||||
|
||||
priv->gck = devm_clk_get(&pdev->dev, "multclk");
|
||||
if (IS_ERR(priv->gck)) {
|
||||
dev_err(&pdev->dev, "failed to get multclk\n");
|
||||
return PTR_ERR(priv->gck);
|
||||
ret = PTR_ERR(priv->gck);
|
||||
goto sdhci_pltfm_free;
|
||||
}
|
||||
|
||||
ret = sdhci_at91_set_clks_presets(&pdev->dev);
|
||||
|
@ -73,7 +73,7 @@ static int self_check_seen(struct ubi_device *ubi, unsigned long *seen)
|
||||
return 0;
|
||||
|
||||
for (pnum = 0; pnum < ubi->peb_count; pnum++) {
|
||||
if (test_bit(pnum, seen) && ubi->lookuptbl[pnum]) {
|
||||
if (!test_bit(pnum, seen) && ubi->lookuptbl[pnum]) {
|
||||
ubi_err(ubi, "self-check failed for PEB %d, fastmap didn't see it", pnum);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@ -1147,7 +1147,7 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
||||
struct rb_node *tmp_rb;
|
||||
int ret, i, j, free_peb_count, used_peb_count, vol_count;
|
||||
int scrub_peb_count, erase_peb_count;
|
||||
unsigned long *seen_pebs = NULL;
|
||||
unsigned long *seen_pebs;
|
||||
|
||||
fm_raw = ubi->fm_buf;
|
||||
memset(ubi->fm_buf, 0, ubi->fm_size);
|
||||
@ -1161,7 +1161,7 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
||||
dvbuf = new_fm_vbuf(ubi, UBI_FM_DATA_VOLUME_ID);
|
||||
if (!dvbuf) {
|
||||
ret = -ENOMEM;
|
||||
goto out_kfree;
|
||||
goto out_free_avbuf;
|
||||
}
|
||||
|
||||
avhdr = ubi_get_vid_hdr(avbuf);
|
||||
@ -1170,7 +1170,7 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
||||
seen_pebs = init_seen(ubi);
|
||||
if (IS_ERR(seen_pebs)) {
|
||||
ret = PTR_ERR(seen_pebs);
|
||||
goto out_kfree;
|
||||
goto out_free_dvbuf;
|
||||
}
|
||||
|
||||
spin_lock(&ubi->volumes_lock);
|
||||
@ -1338,7 +1338,7 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
||||
ret = ubi_io_write_vid_hdr(ubi, new_fm->e[0]->pnum, avbuf);
|
||||
if (ret) {
|
||||
ubi_err(ubi, "unable to write vid_hdr to fastmap SB!");
|
||||
goto out_kfree;
|
||||
goto out_free_seen;
|
||||
}
|
||||
|
||||
for (i = 0; i < new_fm->used_blocks; i++) {
|
||||
@ -1360,7 +1360,7 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
||||
if (ret) {
|
||||
ubi_err(ubi, "unable to write vid_hdr to PEB %i!",
|
||||
new_fm->e[i]->pnum);
|
||||
goto out_kfree;
|
||||
goto out_free_seen;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1370,7 +1370,7 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
||||
if (ret) {
|
||||
ubi_err(ubi, "unable to write fastmap to PEB %i!",
|
||||
new_fm->e[i]->pnum);
|
||||
goto out_kfree;
|
||||
goto out_free_seen;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1380,10 +1380,13 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
||||
ret = self_check_seen(ubi, seen_pebs);
|
||||
dbg_bld("fastmap written!");
|
||||
|
||||
out_kfree:
|
||||
ubi_free_vid_buf(avbuf);
|
||||
ubi_free_vid_buf(dvbuf);
|
||||
out_free_seen:
|
||||
free_seen(seen_pebs);
|
||||
out_free_dvbuf:
|
||||
ubi_free_vid_buf(dvbuf);
|
||||
out_free_avbuf:
|
||||
ubi_free_vid_buf(avbuf);
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
@ -1403,26 +1403,31 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
|
||||
bool do_tx_balance = true;
|
||||
u32 hash_index = 0;
|
||||
const u8 *hash_start = NULL;
|
||||
struct ipv6hdr *ip6hdr;
|
||||
|
||||
skb_reset_mac_header(skb);
|
||||
eth_data = eth_hdr(skb);
|
||||
|
||||
switch (ntohs(skb->protocol)) {
|
||||
case ETH_P_IP: {
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
const struct iphdr *iph;
|
||||
|
||||
if (ether_addr_equal_64bits(eth_data->h_dest, mac_bcast) ||
|
||||
(iph->daddr == ip_bcast) ||
|
||||
(iph->protocol == IPPROTO_IGMP)) {
|
||||
(!pskb_network_may_pull(skb, sizeof(*iph)))) {
|
||||
do_tx_balance = false;
|
||||
break;
|
||||
}
|
||||
iph = ip_hdr(skb);
|
||||
if (iph->daddr == ip_bcast || iph->protocol == IPPROTO_IGMP) {
|
||||
do_tx_balance = false;
|
||||
break;
|
||||
}
|
||||
hash_start = (char *)&(iph->daddr);
|
||||
hash_size = sizeof(iph->daddr);
|
||||
}
|
||||
break;
|
||||
case ETH_P_IPV6:
|
||||
}
|
||||
case ETH_P_IPV6: {
|
||||
const struct ipv6hdr *ip6hdr;
|
||||
|
||||
/* IPv6 doesn't really use broadcast mac address, but leave
|
||||
* that here just in case.
|
||||
*/
|
||||
@ -1439,7 +1444,11 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Additianally, DAD probes should not be tx-balanced as that
|
||||
if (!pskb_network_may_pull(skb, sizeof(*ip6hdr))) {
|
||||
do_tx_balance = false;
|
||||
break;
|
||||
}
|
||||
/* Additionally, DAD probes should not be tx-balanced as that
|
||||
* will lead to false positives for duplicate addresses and
|
||||
* prevent address configuration from working.
|
||||
*/
|
||||
@ -1449,17 +1458,26 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
|
||||
break;
|
||||
}
|
||||
|
||||
hash_start = (char *)&(ipv6_hdr(skb)->daddr);
|
||||
hash_size = sizeof(ipv6_hdr(skb)->daddr);
|
||||
hash_start = (char *)&ip6hdr->daddr;
|
||||
hash_size = sizeof(ip6hdr->daddr);
|
||||
break;
|
||||
case ETH_P_IPX:
|
||||
if (ipx_hdr(skb)->ipx_checksum != IPX_NO_CHECKSUM) {
|
||||
}
|
||||
case ETH_P_IPX: {
|
||||
const struct ipxhdr *ipxhdr;
|
||||
|
||||
if (pskb_network_may_pull(skb, sizeof(*ipxhdr))) {
|
||||
do_tx_balance = false;
|
||||
break;
|
||||
}
|
||||
ipxhdr = (struct ipxhdr *)skb_network_header(skb);
|
||||
|
||||
if (ipxhdr->ipx_checksum != IPX_NO_CHECKSUM) {
|
||||
/* something is wrong with this packet */
|
||||
do_tx_balance = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ipx_hdr(skb)->ipx_type != IPX_TYPE_NCP) {
|
||||
if (ipxhdr->ipx_type != IPX_TYPE_NCP) {
|
||||
/* The only protocol worth balancing in
|
||||
* this family since it has an "ARP" like
|
||||
* mechanism
|
||||
@ -1468,9 +1486,11 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
|
||||
break;
|
||||
}
|
||||
|
||||
eth_data = eth_hdr(skb);
|
||||
hash_start = (char *)eth_data->h_dest;
|
||||
hash_size = ETH_ALEN;
|
||||
break;
|
||||
}
|
||||
case ETH_P_ARP:
|
||||
do_tx_balance = false;
|
||||
if (bond_info->rlb_enabled)
|
||||
|
@ -137,7 +137,9 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)
|
||||
|
||||
/* Force link status for IMP port */
|
||||
reg = core_readl(priv, offset);
|
||||
reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G);
|
||||
reg |= (MII_SW_OR | LINK_STS);
|
||||
if (priv->type == BCM7278_DEVICE_ID)
|
||||
reg |= GMII_SPEED_UP_2G;
|
||||
core_writel(priv, reg, offset);
|
||||
|
||||
/* Enable Broadcast, Multicast, Unicast forwarding to IMP port */
|
||||
|
@ -2329,6 +2329,9 @@ static int bcm_sysport_resume(struct device *d)
|
||||
|
||||
umac_reset(priv);
|
||||
|
||||
/* Disable the UniMAC RX/TX */
|
||||
umac_enable_set(priv, CMD_RX_EN | CMD_TX_EN, 0);
|
||||
|
||||
/* We may have been suspended and never received a WOL event that
|
||||
* would turn off MPD detection, take care of that now
|
||||
*/
|
||||
|
@ -5375,7 +5375,7 @@ static void bnxt_setup_msix(struct bnxt *bp)
|
||||
int tcs, i;
|
||||
|
||||
tcs = netdev_get_num_tc(dev);
|
||||
if (tcs > 1) {
|
||||
if (tcs) {
|
||||
int i, off, count;
|
||||
|
||||
for (i = 0; i < tcs; i++) {
|
||||
|
@ -66,7 +66,11 @@
|
||||
/* Max length of transmit frame must be a multiple of 8 bytes */
|
||||
#define MACB_TX_LEN_ALIGN 8
|
||||
#define MACB_MAX_TX_LEN ((unsigned int)((1 << MACB_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1)))
|
||||
#define GEM_MAX_TX_LEN ((unsigned int)((1 << GEM_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1)))
|
||||
/* Limit maximum TX length as per Cadence TSO errata. This is to avoid a
|
||||
* false amba_error in TX path from the DMA assuming there is not enough
|
||||
* space in the SRAM (16KB) even when there is.
|
||||
*/
|
||||
#define GEM_MAX_TX_LEN (unsigned int)(0x3FC0)
|
||||
|
||||
#define GEM_MTU_MIN_SIZE ETH_MIN_MTU
|
||||
#define MACB_NETIF_LSO NETIF_F_TSO
|
||||
@ -1577,16 +1581,14 @@ static netdev_features_t macb_features_check(struct sk_buff *skb,
|
||||
|
||||
/* Validate LSO compatibility */
|
||||
|
||||
/* there is only one buffer */
|
||||
if (!skb_is_nonlinear(skb))
|
||||
/* there is only one buffer or protocol is not UDP */
|
||||
if (!skb_is_nonlinear(skb) || (ip_hdr(skb)->protocol != IPPROTO_UDP))
|
||||
return features;
|
||||
|
||||
/* length of header */
|
||||
hdrlen = skb_transport_offset(skb);
|
||||
if (ip_hdr(skb)->protocol == IPPROTO_TCP)
|
||||
hdrlen += tcp_hdrlen(skb);
|
||||
|
||||
/* For LSO:
|
||||
/* For UFO only:
|
||||
* When software supplies two or more payload buffers all payload buffers
|
||||
* apart from the last must be a multiple of 8 bytes in size.
|
||||
*/
|
||||
|
@ -2224,15 +2224,16 @@ static int __init dmfe_init_module(void)
|
||||
if (cr6set)
|
||||
dmfe_cr6_user_set = cr6set;
|
||||
|
||||
switch(mode) {
|
||||
case DMFE_10MHF:
|
||||
switch (mode) {
|
||||
case DMFE_10MHF:
|
||||
case DMFE_100MHF:
|
||||
case DMFE_10MFD:
|
||||
case DMFE_100MFD:
|
||||
case DMFE_1M_HPNA:
|
||||
dmfe_media_mode = mode;
|
||||
break;
|
||||
default:dmfe_media_mode = DMFE_AUTO;
|
||||
default:
|
||||
dmfe_media_mode = DMFE_AUTO;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1819,8 +1819,8 @@ static int __init uli526x_init_module(void)
|
||||
if (cr6set)
|
||||
uli526x_cr6_user_set = cr6set;
|
||||
|
||||
switch (mode) {
|
||||
case ULI526X_10MHF:
|
||||
switch (mode) {
|
||||
case ULI526X_10MHF:
|
||||
case ULI526X_100MHF:
|
||||
case ULI526X_10MFD:
|
||||
case ULI526X_100MFD:
|
||||
|
@ -948,7 +948,7 @@ static void smc911x_phy_configure(struct work_struct *work)
|
||||
if (lp->ctl_rspeed != 100)
|
||||
my_ad_caps &= ~(ADVERTISE_100BASE4|ADVERTISE_100FULL|ADVERTISE_100HALF);
|
||||
|
||||
if (!lp->ctl_rfduplx)
|
||||
if (!lp->ctl_rfduplx)
|
||||
my_ad_caps &= ~(ADVERTISE_100FULL|ADVERTISE_10FULL);
|
||||
|
||||
/* Update our Auto-Neg Advertisement Register */
|
||||
|
@ -771,11 +771,13 @@ static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize)
|
||||
{
|
||||
int i;
|
||||
|
||||
gtp->addr_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL);
|
||||
gtp->addr_hash = kmalloc(sizeof(struct hlist_head) * hsize,
|
||||
GFP_KERNEL | __GFP_NOWARN);
|
||||
if (gtp->addr_hash == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
gtp->tid_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL);
|
||||
gtp->tid_hash = kmalloc(sizeof(struct hlist_head) * hsize,
|
||||
GFP_KERNEL | __GFP_NOWARN);
|
||||
if (gtp->tid_hash == NULL)
|
||||
goto err1;
|
||||
|
||||
|
@ -878,15 +878,15 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
|
||||
skb = dev_alloc_skb(ap->mru + PPP_HDRLEN + 2);
|
||||
if (!skb)
|
||||
goto nomem;
|
||||
ap->rpkt = skb;
|
||||
}
|
||||
if (skb->len == 0) {
|
||||
/* Try to get the payload 4-byte aligned.
|
||||
* This should match the
|
||||
* PPP_ALLSTATIONS/PPP_UI/compressed tests in
|
||||
* process_input_packet, but we do not have
|
||||
* enough chars here to test buf[1] and buf[2].
|
||||
*/
|
||||
ap->rpkt = skb;
|
||||
}
|
||||
if (skb->len == 0) {
|
||||
/* Try to get the payload 4-byte aligned.
|
||||
* This should match the
|
||||
* PPP_ALLSTATIONS/PPP_UI/compressed tests in
|
||||
* process_input_packet, but we do not have
|
||||
* enough chars here to test buf[1] and buf[2].
|
||||
*/
|
||||
if (buf[0] != PPP_ALLSTATIONS)
|
||||
skb_reserve(skb, 2 + (buf[0] & 1));
|
||||
}
|
||||
|
@ -441,6 +441,7 @@ fail:
|
||||
usb_free_urb(req->urb);
|
||||
list_del(q->next);
|
||||
}
|
||||
kfree(reqs);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
|
||||
int regulatory_type;
|
||||
|
||||
/* Checking for required sections */
|
||||
if (mvm->trans->cfg->nvm_type != IWL_NVM_EXT) {
|
||||
if (mvm->trans->cfg->nvm_type == IWL_NVM) {
|
||||
if (!mvm->nvm_sections[NVM_SECTION_TYPE_SW].data ||
|
||||
!mvm->nvm_sections[mvm->cfg->nvm_hw_section_num].data) {
|
||||
IWL_ERR(mvm, "Can't parse empty OTP/NVM sections\n");
|
||||
|
@ -2981,6 +2981,10 @@ static int iwl_mvm_send_sta_igtk(struct iwl_mvm *mvm,
|
||||
igtk_cmd.sta_id = cpu_to_le32(sta_id);
|
||||
|
||||
if (remove_key) {
|
||||
/* This is a valid situation for IGTK */
|
||||
if (sta_id == IWL_MVM_INVALID_STA)
|
||||
return 0;
|
||||
|
||||
igtk_cmd.ctrl_flags |= cpu_to_le32(STA_KEY_NOT_VALID);
|
||||
} else {
|
||||
struct ieee80211_key_seq seq;
|
||||
@ -3285,9 +3289,9 @@ int iwl_mvm_remove_sta_key(struct iwl_mvm *mvm,
|
||||
IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n",
|
||||
keyconf->keyidx, sta_id);
|
||||
|
||||
if (mvm_sta && (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
|
||||
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
|
||||
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256))
|
||||
if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
|
||||
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
|
||||
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)
|
||||
return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true);
|
||||
|
||||
if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) {
|
||||
|
@ -1788,6 +1788,8 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,
|
||||
rates_max = rates_eid[1];
|
||||
if (rates_max > MAX_RATES) {
|
||||
lbs_deb_join("invalid rates");
|
||||
rcu_read_unlock();
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
rates = cmd.bss.rates;
|
||||
|
@ -2890,6 +2890,13 @@ mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv,
|
||||
vs_param_set->header.len =
|
||||
cpu_to_le16((((u16) priv->vs_ie[id].ie[1])
|
||||
& 0x00FF) + 2);
|
||||
if (le16_to_cpu(vs_param_set->header.len) >
|
||||
MWIFIEX_MAX_VSIE_LEN) {
|
||||
mwifiex_dbg(priv->adapter, ERROR,
|
||||
"Invalid param length!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy(vs_param_set->ie, priv->vs_ie[id].ie,
|
||||
le16_to_cpu(vs_param_set->header.len));
|
||||
*buffer += le16_to_cpu(vs_param_set->header.len) +
|
||||
|
@ -274,6 +274,7 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv,
|
||||
|
||||
if (country_ie_len >
|
||||
(IEEE80211_COUNTRY_STRING_LEN + MWIFIEX_MAX_TRIPLET_802_11D)) {
|
||||
rcu_read_unlock();
|
||||
mwifiex_dbg(priv->adapter, ERROR,
|
||||
"11D: country_ie_len overflow!, deauth AP\n");
|
||||
return -EINVAL;
|
||||
|
@ -976,6 +976,10 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
|
||||
"WMM Parameter Set Count: %d\n",
|
||||
wmm_param_ie->qos_info_bitmap & mask);
|
||||
|
||||
if (wmm_param_ie->vend_hdr.len + 2 >
|
||||
sizeof(struct ieee_types_wmm_parameter))
|
||||
break;
|
||||
|
||||
memcpy((u8 *) &priv->curr_bss_params.bss_descriptor.
|
||||
wmm_ie, wmm_param_ie,
|
||||
wmm_param_ie->vend_hdr.len + 2);
|
||||
|
@ -704,7 +704,7 @@ static int pn544_hci_check_presence(struct nfc_hci_dev *hdev,
|
||||
target->nfcid1_len != 10)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return nfc_hci_send_cmd(hdev, NFC_HCI_RF_READER_A_GATE,
|
||||
return nfc_hci_send_cmd(hdev, NFC_HCI_RF_READER_A_GATE,
|
||||
PN544_RF_READER_CMD_ACTIVATE_NEXT,
|
||||
target->nfcid1, target->nfcid1_len, NULL);
|
||||
} else if (target->supported_protocols & (NFC_PROTO_JEWEL_MASK |
|
||||
|
@ -112,4 +112,8 @@ config OF_OVERLAY
|
||||
config OF_NUMA
|
||||
bool
|
||||
|
||||
config OF_DMA_DEFAULT_COHERENT
|
||||
# arches should select this if DMA is coherent by default for OF devices
|
||||
bool
|
||||
|
||||
endif # OF
|
||||
|
@ -894,12 +894,16 @@ EXPORT_SYMBOL_GPL(of_dma_get_range);
|
||||
* @np: device node
|
||||
*
|
||||
* It returns true if "dma-coherent" property was found
|
||||
* for this device in DT.
|
||||
* for this device in the DT, or if DMA is coherent by
|
||||
* default for OF devices on the current platform.
|
||||
*/
|
||||
bool of_dma_is_coherent(struct device_node *np)
|
||||
{
|
||||
struct device_node *node = of_node_get(np);
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF_DMA_DEFAULT_COHERENT))
|
||||
return true;
|
||||
|
||||
while (node) {
|
||||
if (of_property_read_bool(node, "dma-coherent")) {
|
||||
of_node_put(node);
|
||||
|
@ -510,7 +510,7 @@ void ks_dw_pcie_initiate_link_train(struct keystone_pcie *ks_pcie)
|
||||
/* Disable Link training */
|
||||
val = ks_dw_app_readl(ks_pcie, CMD_STATUS);
|
||||
val &= ~LTSSM_EN_VAL;
|
||||
ks_dw_app_writel(ks_pcie, CMD_STATUS, LTSSM_EN_VAL | val);
|
||||
ks_dw_app_writel(ks_pcie, CMD_STATUS, val);
|
||||
|
||||
/* Initiate Link Training */
|
||||
val = ks_dw_app_readl(ks_pcie, CMD_STATUS);
|
||||
|
@ -1824,12 +1824,18 @@ again:
|
||||
/* restore size and flags */
|
||||
list_for_each_entry(fail_res, &fail_head, list) {
|
||||
struct resource *res = fail_res->res;
|
||||
int idx;
|
||||
|
||||
res->start = fail_res->start;
|
||||
res->end = fail_res->end;
|
||||
res->flags = fail_res->flags;
|
||||
if (fail_res->dev->subordinate)
|
||||
res->flags = 0;
|
||||
|
||||
if (pci_is_bridge(fail_res->dev)) {
|
||||
idx = res - &fail_res->dev->resource[0];
|
||||
if (idx >= PCI_BRIDGE_RESOURCES &&
|
||||
idx <= PCI_BRIDGE_RESOURCE_END)
|
||||
res->flags = 0;
|
||||
}
|
||||
}
|
||||
free_list(&fail_head);
|
||||
|
||||
@ -1895,12 +1901,18 @@ again:
|
||||
/* restore size and flags */
|
||||
list_for_each_entry(fail_res, &fail_head, list) {
|
||||
struct resource *res = fail_res->res;
|
||||
int idx;
|
||||
|
||||
res->start = fail_res->start;
|
||||
res->end = fail_res->end;
|
||||
res->flags = fail_res->flags;
|
||||
if (fail_res->dev->subordinate)
|
||||
res->flags = 0;
|
||||
|
||||
if (pci_is_bridge(fail_res->dev)) {
|
||||
idx = res - &fail_res->dev->resource[0];
|
||||
if (idx >= PCI_BRIDGE_RESOURCES &&
|
||||
idx <= PCI_BRIDGE_RESOURCE_END)
|
||||
res->flags = 0;
|
||||
}
|
||||
}
|
||||
free_list(&fail_head);
|
||||
|
||||
|
@ -1399,7 +1399,7 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
|
||||
if (nvecs < 0)
|
||||
return nvecs;
|
||||
|
||||
event_irq = ioread32(&stdev->mmio_part_cfg->vep_vector_number);
|
||||
event_irq = ioread16(&stdev->mmio_part_cfg->vep_vector_number);
|
||||
if (event_irq < 0 || event_irq >= nvecs)
|
||||
return -EFAULT;
|
||||
|
||||
|
@ -88,7 +88,7 @@ static int read_poll_timeout(void __iomem *addr, u32 mask)
|
||||
if (readl_relaxed(addr) & mask)
|
||||
return 0;
|
||||
|
||||
usleep_range(DELAY_INTERVAL_US, DELAY_INTERVAL_US + 50);
|
||||
usleep_range(DELAY_INTERVAL_US, DELAY_INTERVAL_US + 50);
|
||||
} while (!time_after(jiffies, timeout));
|
||||
|
||||
return (readl_relaxed(addr) & mask) ? 0 : -ETIMEDOUT;
|
||||
|
@ -2325,7 +2325,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
|
||||
FN_ATAG0_A, 0, FN_REMOCON_B, 0,
|
||||
/* IP0_11_8 [4] */
|
||||
FN_SD1_DAT2_A, FN_MMC_D2, 0, FN_BS,
|
||||
FN_ATADIR0_A, 0, FN_SDSELF_B, 0,
|
||||
FN_ATADIR0_A, 0, FN_SDSELF_A, 0,
|
||||
FN_PWM4_B, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
/* IP0_7_5 [3] */
|
||||
@ -2367,7 +2367,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
|
||||
FN_TS_SDAT0_A, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
/* IP1_10_8 [3] */
|
||||
FN_SD1_CLK_B, FN_MMC_D6, 0, FN_A24,
|
||||
FN_SD1_CD_A, FN_MMC_D6, 0, FN_A24,
|
||||
FN_DREQ1_A, 0, FN_HRX0_B, FN_TS_SPSYNC0_A,
|
||||
/* IP1_7_5 [3] */
|
||||
FN_A23, FN_HTX0_B, FN_TX2_B, FN_DACK2_A,
|
||||
|
@ -158,9 +158,10 @@ static int mid_pb_probe(struct platform_device *pdev)
|
||||
|
||||
input_set_capability(input, EV_KEY, KEY_POWER);
|
||||
|
||||
ddata = (struct mid_pb_ddata *)id->driver_data;
|
||||
ddata = devm_kmemdup(&pdev->dev, (void *)id->driver_data,
|
||||
sizeof(*ddata), GFP_KERNEL);
|
||||
if (!ddata)
|
||||
return -ENODATA;
|
||||
return -ENOMEM;
|
||||
|
||||
ddata->dev = &pdev->dev;
|
||||
ddata->irq = irq;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user