Merge remote-tracking branch '4.9/tmp-82ab074' into 4.9
* 4.9/tmp-82ab074: Linux 4.9.17 crypto: powerpc - Fix initialisation of crc32c context locking/rwsem: Fix down_write_killable() for CONFIG_RWSEM_GENERIC_SPINLOCK=y futex: Add missing error handling to FUTEX_REQUEUE_PI futex: Fix potential use-after-free in FUTEX_REQUEUE_PI x86/perf: Fix CR4.PCE propagation to use active_mm instead of mm x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y x86/tsc: Fix ART for TSC_KNOWN_FREQ irqchip/gicv3-its: Add workaround for QDF2400 ITS erratum 0065 arm64: KVM: VHE: Clear HCR_TGE when invalidating guest TLBs drm/vc4: Fix ->clock_select setting for the VEC encoder drm/vc4: Fix race between page flip completion event and clean-up clk: bcm2835: Fix ->fixed_divider of pllh_aux powerpc/mm: Fix build break when CMA=n && SPAPR_TCE_IOMMU=y usb: gadget: udc: atmel: remove memory leak serial: 8250_pci: Detach low-level driver during PCI error recovery ACPI / blacklist: Make Dell Latitude 3350 ethernet work ACPI / blacklist: add _REV quirks for Dell Precision 5520 and 3520 slub: move synchronize_sched out of slab_mutex on shrink uvcvideo: uvc_scan_fallback() for webcams with broken chain s390/zcrypt: Introduce CEX6 toleration block: allow WRITE_SAME commands with the SG_IO ioctl drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices vfio/spapr: Postpone default window creation vfio/spapr: Add a helper to create default DMA window powerpc/mm/iommu, vfio/spapr: Put pages on VFIO container shutdown vfio/spapr: Reference mm in tce_container powerpc/iommu: Stop using @current in mm_iommu_xxx powerpc/iommu: Pass mm_struct to init/cleanup helpers vfio/spapr: Postpone allocation of userspace version of TCE table Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() (v2) ibmveth: calculate gso_segs for large packets PCI: Do any VF BAR updates before enabling the BARs PCI: Ignore BAR updates on virtual functions PCI: Update BARs using property bits appropriate for type PCI: Don't update VF BARs while VF memory space is enabled PCI: Decouple IORESOURCE_ROM_ENABLE and PCI_ROM_ADDRESS_ENABLE PCI: Add comments about ROM BAR updating PCI: Remove pci_resource_bar() and pci_iov_resource_bar() PCI: Separate VF BAR updates from standard BAR updates x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic scsi: ibmvscsis: Synchronize cmds at remove time scsi: ibmvscsis: Synchronize cmds at tpg_enable_store time scsi: ibmvscsis: Rearrange functions for future patches scsi: ibmvscsis: Clean up properly if target_submit_cmd/tmr fails scsi: ibmvscsis: Return correct partition name/# to client scsi: ibmvscsis: Issues from Dan Carpenter/Smatch igb: add i211 to i210 PHY workaround igb: Workaround for igb i210 firmware issue xen: do not re-use pirq number cached in pci device msi msg data dmaengine: iota: ioat_alloc_chan_resources should not perform sleeping allocations. bpf: fix mark_reg_unknown_value for spilled regs on map value marking bpf: fix regression on verifier pruning wrt map lookups bpf: fix state equivalence bpf: Detect identical PTR_TO_MAP_VALUE_OR_NULL registers dccp: fix memory leak during tear-down of unsuccessful connection request tun: fix premature POLLOUT notification on tun devices dccp/tcp: fix routing redirect race bridge: drop netfilter fake rtable unconditionally ipv6: avoid write to a possibly cloned skb ipv6: make ECMP route replacement less greedy mpls: Do not decrement alive counter for unregister events mpls: Send route delete notifications when router module is unloaded act_connmark: avoid crashing on malformed nlattrs with null parms uapi: fix linux/packet_diag.h userspace compilation error net/tunnel: set inner protocol in network gro hooks vrf: Fix use-after-free in vrf_xmit dccp: fix use-after-free in dccp_feat_activate_values net/sched: act_skbmod: remove unneeded rcu_read_unlock in tcf_skbmod_dump net: fix socket refcounting in skb_complete_tx_timestamp() net: fix socket refcounting in skb_complete_wifi_ack() tcp: fix various issues for sockets morphing to listen state strparser: destroy workqueue on module exit dccp: Unlock sock before calling sk_free() ipv6: orphan skbs in reassembly unit net: net_enable_timestamp() can be called from irq contexts net: don't call strlen() on the user buffer in packet_bind_spkt() net: bridge: allow IPv6 when multicast flood is disabled tcp/dccp: block BH for SYN processing mlxsw: spectrum_router: Avoid potential packets loss geneve: lock RCU on TX path vxlan: lock RCU on TX path net: phy: Avoid deadlock during phy_error() l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv net sched actions: decrement module reference count after table flush. ipv4: mask tos for input route vxlan: don't allow overwrite of config src addr vti6: return GRE_KEY for vti6 vxlan: correctly validate VXLAN ID against VXLAN_N_VID net/mlx5e: Fix wrong CQE decompression net/mlx5e: Do not reduce LRO WQE size when not using build_skb net/mlx5e: Register/unregister vport representors on interface attach/detach ANDROID: mmc: core: export emmc revision ANDROID: sdcardfs: Fix gid issue ANDROID: sdcardfs: Remove uninformative prints ANDROID: sdcardfs: move path_put outside of spinlock ANDROID: sdcardfs: Use case insensitive hash function ANDROID: sdcardfs: declare MODULE_ALIAS_FS ANDROID: sdcardfs: Get the blocksize from the lower fs ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisve ANDROID: sdcardfs: Switch to internal case insensitive compare ANDROID: sdcardfs: Use spin_lock_nested ANDROID: sdcardfs: Replace get/put with d_lock ANDROID: sdcardfs: rate limit warning print ANDROID: sdcardfs: Fix case insensitive lookup ANDROID: sdcardfs: support direct-IO (DIO) operations ANDROID: sdcardfs: implement vm_ops->page_mkwrite ANDROID: sdcardfs: Don't bother deleting freelist ANDROID: sdcardfs: Add missing path_put ANDROID: sdcardfs: Fix incorrect hash ANDROID: export security_path_chown ANDROID: sdcardfs: Switch strcasecmp for internal call ANDROID: sdcardfs: switch to full_name_hash and qstr ANDROID: sdcardfs: Add GID Derivation to sdcardfs ANDROID: sdcardfs: Remove redundant operation ANDROID: sdcardfs: add support for user permission isolation ANDROID: sdcardfs: Refactor configfs interface ANDROID: sdcardfs: Allow non-owners to touch ANDROID: binder: add padding to binder_fd_array_object. ANDROID: binder: use group leader instead of open thread BACKPORT: mmc: core: Export device lifetime information through sysfs ANDROID: android-verity: do not compile as independent module Change-Id: I7d409ec3e84eaa7f499c951d38f4cba2614415f7 Signed-off-by: Kyle Yan <kyan@codeaurora.org>
This commit is contained in:
commit
110cce4ad4
129 changed files with 2893 additions and 1652 deletions
|
|
@ -42,24 +42,26 @@ file acts as a registry of software workarounds in the Linux Kernel and
|
|||
will be updated when new workarounds are committed and backported to
|
||||
stable kernels.
|
||||
|
||||
| Implementor | Component | Erratum ID | Kconfig |
|
||||
+----------------+-----------------+-----------------+-------------------------+
|
||||
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
|
||||
| ARM | Cortex-A53 | #827319 | ARM64_ERRATUM_827319 |
|
||||
| ARM | Cortex-A53 | #824069 | ARM64_ERRATUM_824069 |
|
||||
| ARM | Cortex-A53 | #819472 | ARM64_ERRATUM_819472 |
|
||||
| ARM | Cortex-A53 | #845719 | ARM64_ERRATUM_845719 |
|
||||
| ARM | Cortex-A53 | #843419 | ARM64_ERRATUM_843419 |
|
||||
| ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 |
|
||||
| ARM | Cortex-A57 | #852523 | N/A |
|
||||
| ARM | Cortex-A57 | #834220 | ARM64_ERRATUM_834220 |
|
||||
| ARM | Cortex-A72 | #853709 | N/A |
|
||||
| ARM | MMU-500 | #841119,#826419 | N/A |
|
||||
| | | | |
|
||||
| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
|
||||
| Cavium | ThunderX ITS | #23144 | CAVIUM_ERRATUM_23144 |
|
||||
| Cavium | ThunderX GICv3 | #23154 | CAVIUM_ERRATUM_23154 |
|
||||
| Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
|
||||
| Cavium | ThunderX SMMUv2 | #27704 | N/A |
|
||||
| | | | |
|
||||
| Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
|
||||
| Implementor | Component | Erratum ID | Kconfig |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
|
||||
| ARM | Cortex-A53 | #827319 | ARM64_ERRATUM_827319 |
|
||||
| ARM | Cortex-A53 | #824069 | ARM64_ERRATUM_824069 |
|
||||
| ARM | Cortex-A53 | #819472 | ARM64_ERRATUM_819472 |
|
||||
| ARM | Cortex-A53 | #845719 | ARM64_ERRATUM_845719 |
|
||||
| ARM | Cortex-A53 | #843419 | ARM64_ERRATUM_843419 |
|
||||
| ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 |
|
||||
| ARM | Cortex-A57 | #852523 | N/A |
|
||||
| ARM | Cortex-A57 | #834220 | ARM64_ERRATUM_834220 |
|
||||
| ARM | Cortex-A72 | #853709 | N/A |
|
||||
| ARM | MMU-500 | #841119,#826419 | N/A |
|
||||
| | | | |
|
||||
| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
|
||||
| Cavium | ThunderX ITS | #23144 | CAVIUM_ERRATUM_23144 |
|
||||
| Cavium | ThunderX GICv3 | #23154 | CAVIUM_ERRATUM_23154 |
|
||||
| Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
|
||||
| Cavium | ThunderX SMMUv2 | #27704 | N/A |
|
||||
| | | | |
|
||||
| Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
|
||||
| | | | |
|
||||
| Qualcomm Tech. | QDF2400 ITS | E0065 | QCOM_QDF2400_ERRATUM_0065 |
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 16
|
||||
SUBLEVEL = 17
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
|
|
|||
|
|
@ -478,6 +478,16 @@ config CAVIUM_ERRATUM_27456
|
|||
|
||||
If unsure, say Y.
|
||||
|
||||
config QCOM_QDF2400_ERRATUM_0065
|
||||
bool "QDF2400 E0065: Incorrect GITS_TYPER.ITT_Entry_size"
|
||||
default y
|
||||
help
|
||||
On Qualcomm Datacenter Technologies QDF2400 SoC, ITS hardware reports
|
||||
ITE size incorrectly. The GITS_TYPER.ITT_Entry_size field should have
|
||||
been indicated as 16Bytes (0xf), not 8Bytes (0x7).
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,62 @@
|
|||
|
||||
#include <asm/kvm_hyp.h>
|
||||
|
||||
static void __hyp_text __tlb_switch_to_guest_vhe(struct kvm *kvm)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
/*
|
||||
* With VHE enabled, we have HCR_EL2.{E2H,TGE} = {1,1}, and
|
||||
* most TLB operations target EL2/EL0. In order to affect the
|
||||
* guest TLBs (EL1/EL0), we need to change one of these two
|
||||
* bits. Changing E2H is impossible (goodbye TTBR1_EL2), so
|
||||
* let's flip TGE before executing the TLB operation.
|
||||
*/
|
||||
write_sysreg(kvm->arch.vttbr, vttbr_el2);
|
||||
val = read_sysreg(hcr_el2);
|
||||
val &= ~HCR_TGE;
|
||||
write_sysreg(val, hcr_el2);
|
||||
isb();
|
||||
}
|
||||
|
||||
static void __hyp_text __tlb_switch_to_guest_nvhe(struct kvm *kvm)
|
||||
{
|
||||
write_sysreg(kvm->arch.vttbr, vttbr_el2);
|
||||
isb();
|
||||
}
|
||||
|
||||
static hyp_alternate_select(__tlb_switch_to_guest,
|
||||
__tlb_switch_to_guest_nvhe,
|
||||
__tlb_switch_to_guest_vhe,
|
||||
ARM64_HAS_VIRT_HOST_EXTN);
|
||||
|
||||
static void __hyp_text __tlb_switch_to_host_vhe(struct kvm *kvm)
|
||||
{
|
||||
/*
|
||||
* We're done with the TLB operation, let's restore the host's
|
||||
* view of HCR_EL2.
|
||||
*/
|
||||
write_sysreg(0, vttbr_el2);
|
||||
write_sysreg(HCR_HOST_VHE_FLAGS, hcr_el2);
|
||||
}
|
||||
|
||||
static void __hyp_text __tlb_switch_to_host_nvhe(struct kvm *kvm)
|
||||
{
|
||||
write_sysreg(0, vttbr_el2);
|
||||
}
|
||||
|
||||
static hyp_alternate_select(__tlb_switch_to_host,
|
||||
__tlb_switch_to_host_nvhe,
|
||||
__tlb_switch_to_host_vhe,
|
||||
ARM64_HAS_VIRT_HOST_EXTN);
|
||||
|
||||
void __hyp_text __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
|
||||
{
|
||||
dsb(ishst);
|
||||
|
||||
/* Switch to requested VMID */
|
||||
kvm = kern_hyp_va(kvm);
|
||||
write_sysreg(kvm->arch.vttbr, vttbr_el2);
|
||||
isb();
|
||||
__tlb_switch_to_guest()(kvm);
|
||||
|
||||
/*
|
||||
* We could do so much better if we had the VA as well.
|
||||
|
|
@ -45,7 +93,7 @@ void __hyp_text __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
|
|||
dsb(ish);
|
||||
isb();
|
||||
|
||||
write_sysreg(0, vttbr_el2);
|
||||
__tlb_switch_to_host()(kvm);
|
||||
}
|
||||
|
||||
void __hyp_text __kvm_tlb_flush_vmid(struct kvm *kvm)
|
||||
|
|
@ -54,14 +102,13 @@ void __hyp_text __kvm_tlb_flush_vmid(struct kvm *kvm)
|
|||
|
||||
/* Switch to requested VMID */
|
||||
kvm = kern_hyp_va(kvm);
|
||||
write_sysreg(kvm->arch.vttbr, vttbr_el2);
|
||||
isb();
|
||||
__tlb_switch_to_guest()(kvm);
|
||||
|
||||
asm volatile("tlbi vmalls12e1is" : : );
|
||||
dsb(ish);
|
||||
isb();
|
||||
|
||||
write_sysreg(0, vttbr_el2);
|
||||
__tlb_switch_to_host()(kvm);
|
||||
}
|
||||
|
||||
void __hyp_text __kvm_tlb_flush_local_vmid(struct kvm_vcpu *vcpu)
|
||||
|
|
@ -69,14 +116,13 @@ void __hyp_text __kvm_tlb_flush_local_vmid(struct kvm_vcpu *vcpu)
|
|||
struct kvm *kvm = kern_hyp_va(kern_hyp_va(vcpu)->kvm);
|
||||
|
||||
/* Switch to requested VMID */
|
||||
write_sysreg(kvm->arch.vttbr, vttbr_el2);
|
||||
isb();
|
||||
__tlb_switch_to_guest()(kvm);
|
||||
|
||||
asm volatile("tlbi vmalle1" : : );
|
||||
dsb(nsh);
|
||||
isb();
|
||||
|
||||
write_sysreg(0, vttbr_el2);
|
||||
__tlb_switch_to_host()(kvm);
|
||||
}
|
||||
|
||||
void __hyp_text __kvm_flush_vm_context(void)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static int crc32c_vpmsum_cra_init(struct crypto_tfm *tfm)
|
|||
{
|
||||
u32 *key = crypto_tfm_ctx(tfm);
|
||||
|
||||
*key = 0;
|
||||
*key = ~0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,16 +19,18 @@ extern void destroy_context(struct mm_struct *mm);
|
|||
struct mm_iommu_table_group_mem_t;
|
||||
|
||||
extern int isolate_lru_page(struct page *page); /* from internal.h */
|
||||
extern bool mm_iommu_preregistered(void);
|
||||
extern long mm_iommu_get(unsigned long ua, unsigned long entries,
|
||||
extern bool mm_iommu_preregistered(struct mm_struct *mm);
|
||||
extern long mm_iommu_get(struct mm_struct *mm,
|
||||
unsigned long ua, unsigned long entries,
|
||||
struct mm_iommu_table_group_mem_t **pmem);
|
||||
extern long mm_iommu_put(struct mm_iommu_table_group_mem_t *mem);
|
||||
extern void mm_iommu_init(mm_context_t *ctx);
|
||||
extern void mm_iommu_cleanup(mm_context_t *ctx);
|
||||
extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup(unsigned long ua,
|
||||
unsigned long size);
|
||||
extern struct mm_iommu_table_group_mem_t *mm_iommu_find(unsigned long ua,
|
||||
unsigned long entries);
|
||||
extern long mm_iommu_put(struct mm_struct *mm,
|
||||
struct mm_iommu_table_group_mem_t *mem);
|
||||
extern void mm_iommu_init(struct mm_struct *mm);
|
||||
extern void mm_iommu_cleanup(struct mm_struct *mm);
|
||||
extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup(struct mm_struct *mm,
|
||||
unsigned long ua, unsigned long size);
|
||||
extern struct mm_iommu_table_group_mem_t *mm_iommu_find(struct mm_struct *mm,
|
||||
unsigned long ua, unsigned long entries);
|
||||
extern long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
|
||||
unsigned long ua, unsigned long *hpa);
|
||||
extern long mm_iommu_mapped_inc(struct mm_iommu_table_group_mem_t *mem);
|
||||
|
|
|
|||
|
|
@ -915,7 +915,7 @@ void __init setup_arch(char **cmdline_p)
|
|||
init_mm.context.pte_frag = NULL;
|
||||
#endif
|
||||
#ifdef CONFIG_SPAPR_TCE_IOMMU
|
||||
mm_iommu_init(&init_mm.context);
|
||||
mm_iommu_init(&init_mm);
|
||||
#endif
|
||||
irqstack_early_init();
|
||||
exc_lvl_early_init();
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
|||
mm->context.pte_frag = NULL;
|
||||
#endif
|
||||
#ifdef CONFIG_SPAPR_TCE_IOMMU
|
||||
mm_iommu_init(&mm->context);
|
||||
mm_iommu_init(mm);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -156,13 +156,11 @@ static inline void destroy_pagetable_page(struct mm_struct *mm)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
void destroy_context(struct mm_struct *mm)
|
||||
{
|
||||
#ifdef CONFIG_SPAPR_TCE_IOMMU
|
||||
mm_iommu_cleanup(&mm->context);
|
||||
WARN_ON_ONCE(!list_empty(&mm->context.iommu_group_mem_list));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC_ICSWX
|
||||
drop_cop(mm->context.acop, mm);
|
||||
kfree(mm->context.cop_lockp);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static long mm_iommu_adjust_locked_vm(struct mm_struct *mm,
|
|||
}
|
||||
|
||||
pr_debug("[%d] RLIMIT_MEMLOCK HASH64 %c%ld %ld/%ld\n",
|
||||
current->pid,
|
||||
current ? current->pid : 0,
|
||||
incr ? '+' : '-',
|
||||
npages << PAGE_SHIFT,
|
||||
mm->locked_vm << PAGE_SHIFT,
|
||||
|
|
@ -66,12 +66,9 @@ static long mm_iommu_adjust_locked_vm(struct mm_struct *mm,
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool mm_iommu_preregistered(void)
|
||||
bool mm_iommu_preregistered(struct mm_struct *mm)
|
||||
{
|
||||
if (!current || !current->mm)
|
||||
return false;
|
||||
|
||||
return !list_empty(¤t->mm->context.iommu_group_mem_list);
|
||||
return !list_empty(&mm->context.iommu_group_mem_list);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mm_iommu_preregistered);
|
||||
|
||||
|
|
@ -124,19 +121,16 @@ static int mm_iommu_move_page_from_cma(struct page *page)
|
|||
return 0;
|
||||
}
|
||||
|
||||
long mm_iommu_get(unsigned long ua, unsigned long entries,
|
||||
long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
|
||||
struct mm_iommu_table_group_mem_t **pmem)
|
||||
{
|
||||
struct mm_iommu_table_group_mem_t *mem;
|
||||
long i, j, ret = 0, locked_entries = 0;
|
||||
struct page *page = NULL;
|
||||
|
||||
if (!current || !current->mm)
|
||||
return -ESRCH; /* process exited */
|
||||
|
||||
mutex_lock(&mem_list_mutex);
|
||||
|
||||
list_for_each_entry_rcu(mem, ¤t->mm->context.iommu_group_mem_list,
|
||||
list_for_each_entry_rcu(mem, &mm->context.iommu_group_mem_list,
|
||||
next) {
|
||||
if ((mem->ua == ua) && (mem->entries == entries)) {
|
||||
++mem->used;
|
||||
|
|
@ -154,7 +148,7 @@ long mm_iommu_get(unsigned long ua, unsigned long entries,
|
|||
|
||||
}
|
||||
|
||||
ret = mm_iommu_adjust_locked_vm(current->mm, entries, true);
|
||||
ret = mm_iommu_adjust_locked_vm(mm, entries, true);
|
||||
if (ret)
|
||||
goto unlock_exit;
|
||||
|
||||
|
|
@ -190,7 +184,7 @@ long mm_iommu_get(unsigned long ua, unsigned long entries,
|
|||
* of the CMA zone if possible. NOTE: faulting in + migration
|
||||
* can be expensive. Batching can be considered later
|
||||
*/
|
||||
if (get_pageblock_migratetype(page) == MIGRATE_CMA) {
|
||||
if (is_migrate_cma_page(page)) {
|
||||
if (mm_iommu_move_page_from_cma(page))
|
||||
goto populate;
|
||||
if (1 != get_user_pages_fast(ua + (i << PAGE_SHIFT),
|
||||
|
|
@ -215,11 +209,11 @@ populate:
|
|||
mem->entries = entries;
|
||||
*pmem = mem;
|
||||
|
||||
list_add_rcu(&mem->next, ¤t->mm->context.iommu_group_mem_list);
|
||||
list_add_rcu(&mem->next, &mm->context.iommu_group_mem_list);
|
||||
|
||||
unlock_exit:
|
||||
if (locked_entries && ret)
|
||||
mm_iommu_adjust_locked_vm(current->mm, locked_entries, false);
|
||||
mm_iommu_adjust_locked_vm(mm, locked_entries, false);
|
||||
|
||||
mutex_unlock(&mem_list_mutex);
|
||||
|
||||
|
|
@ -264,17 +258,13 @@ static void mm_iommu_free(struct rcu_head *head)
|
|||
static void mm_iommu_release(struct mm_iommu_table_group_mem_t *mem)
|
||||
{
|
||||
list_del_rcu(&mem->next);
|
||||
mm_iommu_adjust_locked_vm(current->mm, mem->entries, false);
|
||||
call_rcu(&mem->rcu, mm_iommu_free);
|
||||
}
|
||||
|
||||
long mm_iommu_put(struct mm_iommu_table_group_mem_t *mem)
|
||||
long mm_iommu_put(struct mm_struct *mm, struct mm_iommu_table_group_mem_t *mem)
|
||||
{
|
||||
long ret = 0;
|
||||
|
||||
if (!current || !current->mm)
|
||||
return -ESRCH; /* process exited */
|
||||
|
||||
mutex_lock(&mem_list_mutex);
|
||||
|
||||
if (mem->used == 0) {
|
||||
|
|
@ -297,6 +287,8 @@ long mm_iommu_put(struct mm_iommu_table_group_mem_t *mem)
|
|||
/* @mapped became 0 so now mappings are disabled, release the region */
|
||||
mm_iommu_release(mem);
|
||||
|
||||
mm_iommu_adjust_locked_vm(mm, mem->entries, false);
|
||||
|
||||
unlock_exit:
|
||||
mutex_unlock(&mem_list_mutex);
|
||||
|
||||
|
|
@ -304,14 +296,12 @@ unlock_exit:
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(mm_iommu_put);
|
||||
|
||||
struct mm_iommu_table_group_mem_t *mm_iommu_lookup(unsigned long ua,
|
||||
unsigned long size)
|
||||
struct mm_iommu_table_group_mem_t *mm_iommu_lookup(struct mm_struct *mm,
|
||||
unsigned long ua, unsigned long size)
|
||||
{
|
||||
struct mm_iommu_table_group_mem_t *mem, *ret = NULL;
|
||||
|
||||
list_for_each_entry_rcu(mem,
|
||||
¤t->mm->context.iommu_group_mem_list,
|
||||
next) {
|
||||
list_for_each_entry_rcu(mem, &mm->context.iommu_group_mem_list, next) {
|
||||
if ((mem->ua <= ua) &&
|
||||
(ua + size <= mem->ua +
|
||||
(mem->entries << PAGE_SHIFT))) {
|
||||
|
|
@ -324,14 +314,12 @@ struct mm_iommu_table_group_mem_t *mm_iommu_lookup(unsigned long ua,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(mm_iommu_lookup);
|
||||
|
||||
struct mm_iommu_table_group_mem_t *mm_iommu_find(unsigned long ua,
|
||||
unsigned long entries)
|
||||
struct mm_iommu_table_group_mem_t *mm_iommu_find(struct mm_struct *mm,
|
||||
unsigned long ua, unsigned long entries)
|
||||
{
|
||||
struct mm_iommu_table_group_mem_t *mem, *ret = NULL;
|
||||
|
||||
list_for_each_entry_rcu(mem,
|
||||
¤t->mm->context.iommu_group_mem_list,
|
||||
next) {
|
||||
list_for_each_entry_rcu(mem, &mm->context.iommu_group_mem_list, next) {
|
||||
if ((mem->ua == ua) && (mem->entries == entries)) {
|
||||
ret = mem;
|
||||
break;
|
||||
|
|
@ -373,17 +361,7 @@ void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(mm_iommu_mapped_dec);
|
||||
|
||||
void mm_iommu_init(mm_context_t *ctx)
|
||||
void mm_iommu_init(struct mm_struct *mm)
|
||||
{
|
||||
INIT_LIST_HEAD_RCU(&ctx->iommu_group_mem_list);
|
||||
}
|
||||
|
||||
void mm_iommu_cleanup(mm_context_t *ctx)
|
||||
{
|
||||
struct mm_iommu_table_group_mem_t *mem, *tmp;
|
||||
|
||||
list_for_each_entry_safe(mem, tmp, &ctx->iommu_group_mem_list, next) {
|
||||
list_del_rcu(&mem->next);
|
||||
mm_iommu_do_free(mem);
|
||||
}
|
||||
INIT_LIST_HEAD_RCU(&mm->context.iommu_group_mem_list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2096,8 +2096,8 @@ static int x86_pmu_event_init(struct perf_event *event)
|
|||
|
||||
static void refresh_pce(void *ignored)
|
||||
{
|
||||
if (current->mm)
|
||||
load_mm_cr4(current->mm);
|
||||
if (current->active_mm)
|
||||
load_mm_cr4(current->active_mm);
|
||||
}
|
||||
|
||||
static void x86_pmu_event_mapped(struct perf_event *event)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include <asm/apic.h>
|
||||
#include <asm/timer.h>
|
||||
#include <asm/reboot.h>
|
||||
#include <asm/nmi.h>
|
||||
|
||||
struct ms_hyperv_info ms_hyperv;
|
||||
EXPORT_SYMBOL_GPL(ms_hyperv);
|
||||
|
|
@ -158,6 +159,26 @@ static unsigned char hv_get_nmi_reason(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_LOCAL_APIC
|
||||
/*
|
||||
* Prior to WS2016 Debug-VM sends NMIs to all CPUs which makes
|
||||
* it dificult to process CHANNELMSG_UNLOAD in case of crash. Handle
|
||||
* unknown NMI on the first CPU which gets it.
|
||||
*/
|
||||
static int hv_nmi_unknown(unsigned int val, struct pt_regs *regs)
|
||||
{
|
||||
static atomic_t nmi_cpu = ATOMIC_INIT(-1);
|
||||
|
||||
if (!unknown_nmi_panic)
|
||||
return NMI_DONE;
|
||||
|
||||
if (atomic_cmpxchg(&nmi_cpu, -1, raw_smp_processor_id()) != -1)
|
||||
return NMI_HANDLED;
|
||||
|
||||
return NMI_DONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void __init ms_hyperv_init_platform(void)
|
||||
{
|
||||
/*
|
||||
|
|
@ -183,6 +204,9 @@ static void __init ms_hyperv_init_platform(void)
|
|||
pr_info("HyperV: LAPIC Timer Frequency: %#x\n",
|
||||
lapic_timer_frequency);
|
||||
}
|
||||
|
||||
register_nmi_handler(NMI_UNKNOWN, hv_nmi_unknown, NMI_FLAG_FIRST,
|
||||
"hv_nmi_unknown");
|
||||
#endif
|
||||
|
||||
if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
|
||||
*/
|
||||
|
||||
#define DISABLE_BRANCH_PROFILING
|
||||
#include <linux/init.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/types.h>
|
||||
|
|
|
|||
|
|
@ -1287,6 +1287,8 @@ static int __init init_tsc_clocksource(void)
|
|||
* exporting a reliable TSC.
|
||||
*/
|
||||
if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) {
|
||||
if (boot_cpu_has(X86_FEATURE_ART))
|
||||
art_related_clocksource = &clocksource_tsc;
|
||||
clocksource_register_khz(&clocksource_tsc, tsc_khz);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#define DISABLE_BRANCH_PROFILING
|
||||
#define pr_fmt(fmt) "kasan: " fmt
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/kasan.h>
|
||||
|
|
|
|||
|
|
@ -234,23 +234,14 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
|
|||
return 1;
|
||||
|
||||
for_each_pci_msi_entry(msidesc, dev) {
|
||||
__pci_read_msi_msg(msidesc, &msg);
|
||||
pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) |
|
||||
((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff);
|
||||
if (msg.data != XEN_PIRQ_MSI_DATA ||
|
||||
xen_irq_from_pirq(pirq) < 0) {
|
||||
pirq = xen_allocate_pirq_msi(dev, msidesc);
|
||||
if (pirq < 0) {
|
||||
irq = -ENODEV;
|
||||
goto error;
|
||||
}
|
||||
xen_msi_compose_msg(dev, pirq, &msg);
|
||||
__pci_write_msi_msg(msidesc, &msg);
|
||||
dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq);
|
||||
} else {
|
||||
dev_dbg(&dev->dev,
|
||||
"xen: msi already bound to pirq=%d\n", pirq);
|
||||
pirq = xen_allocate_pirq_msi(dev, msidesc);
|
||||
if (pirq < 0) {
|
||||
irq = -ENODEV;
|
||||
goto error;
|
||||
}
|
||||
xen_msi_compose_msg(dev, pirq, &msg);
|
||||
__pci_write_msi_msg(msidesc, &msg);
|
||||
dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq);
|
||||
irq = xen_bind_pirq_msi_to_irq(dev, msidesc, pirq,
|
||||
(type == PCI_CAP_ID_MSI) ? nvec : 1,
|
||||
(type == PCI_CAP_ID_MSIX) ?
|
||||
|
|
|
|||
|
|
@ -182,6 +182,9 @@ static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
|
|||
__set_bit(WRITE_16, filter->write_ok);
|
||||
__set_bit(WRITE_LONG, filter->write_ok);
|
||||
__set_bit(WRITE_LONG_2, filter->write_ok);
|
||||
__set_bit(WRITE_SAME, filter->write_ok);
|
||||
__set_bit(WRITE_SAME_16, filter->write_ok);
|
||||
__set_bit(WRITE_SAME_32, filter->write_ok);
|
||||
__set_bit(ERASE, filter->write_ok);
|
||||
__set_bit(GPCMD_MODE_SELECT_10, filter->write_ok);
|
||||
__set_bit(MODE_SELECT, filter->write_ok);
|
||||
|
|
|
|||
|
|
@ -160,6 +160,34 @@ static struct dmi_system_id acpi_rev_dmi_table[] __initdata = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = dmi_enable_rev_override,
|
||||
.ident = "DELL Precision 5520",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Precision 5520"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = dmi_enable_rev_override,
|
||||
.ident = "DELL Precision 3520",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3520"),
|
||||
},
|
||||
},
|
||||
/*
|
||||
* Resolves a quirk with the Dell Latitude 3350 that
|
||||
* causes the ethernet adapter to not function.
|
||||
*/
|
||||
{
|
||||
.callback = dmi_enable_rev_override,
|
||||
.ident = "DELL Latitude 3350",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude 3350"),
|
||||
},
|
||||
},
|
||||
#endif
|
||||
{}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3434,7 +3434,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
|
|||
const char *failure_string;
|
||||
struct binder_buffer *buffer;
|
||||
|
||||
if (proc->tsk != current)
|
||||
if (proc->tsk != current->group_leader)
|
||||
return -EINVAL;
|
||||
|
||||
if ((vma->vm_end - vma->vm_start) > SZ_4M)
|
||||
|
|
@ -3540,9 +3540,9 @@ static int binder_open(struct inode *nodp, struct file *filp)
|
|||
proc = kzalloc(sizeof(*proc), GFP_KERNEL);
|
||||
if (proc == NULL)
|
||||
return -ENOMEM;
|
||||
get_task_struct(current);
|
||||
proc->tsk = current;
|
||||
proc->vma_vm_mm = current->mm;
|
||||
get_task_struct(current->group_leader);
|
||||
proc->tsk = current->group_leader;
|
||||
proc->vma_vm_mm = current->group_leader->mm;
|
||||
INIT_LIST_HEAD(&proc->todo);
|
||||
init_waitqueue_head(&proc->wait);
|
||||
proc->default_priority = task_nice(current);
|
||||
|
|
|
|||
|
|
@ -1598,7 +1598,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
|
|||
.a2w_reg = A2W_PLLH_AUX,
|
||||
.load_mask = CM_PLLH_LOADAUX,
|
||||
.hold_mask = 0,
|
||||
.fixed_divider = 10),
|
||||
.fixed_divider = 1),
|
||||
[BCM2835_PLLH_PIX] = REGISTER_PLL_DIV(
|
||||
.name = "pllh_pix",
|
||||
.source_pll = "pllh",
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ static int ioat_alloc_chan_resources(struct dma_chan *c)
|
|||
/* doing 2 32bit writes to mmio since 1 64b write doesn't work */
|
||||
ioat_chan->completion =
|
||||
dma_pool_zalloc(ioat_chan->ioat_dma->completion_pool,
|
||||
GFP_KERNEL, &ioat_chan->completion_dma);
|
||||
GFP_NOWAIT, &ioat_chan->completion_dma);
|
||||
if (!ioat_chan->completion)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -701,7 +701,7 @@ static int ioat_alloc_chan_resources(struct dma_chan *c)
|
|||
ioat_chan->reg_base + IOAT_CHANCMP_OFFSET_HIGH);
|
||||
|
||||
order = IOAT_MAX_ORDER;
|
||||
ring = ioat_alloc_ring(c, order, GFP_KERNEL);
|
||||
ring = ioat_alloc_ring(c, order, GFP_NOWAIT);
|
||||
if (!ring)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue