diff -u linux-gcp-4.15.0/Documentation/ABI/testing/sysfs-devices-system-cpu linux-gcp-4.15.0/Documentation/ABI/testing/sysfs-devices-system-cpu --- linux-gcp-4.15.0/Documentation/ABI/testing/sysfs-devices-system-cpu +++ linux-gcp-4.15.0/Documentation/ABI/testing/sysfs-devices-system-cpu @@ -395,7 +395,8 @@ "Vulnerable" CPU is affected and no mitigation in effect "Mitigation: $M" CPU is affected and mitigation $M is in effect - See also: Documentation/admin-guide/hw-vuln/index.rst + Details about the l1tf file can be found in + Documentation/admin-guide/l1tf.rst What: /sys/devices/system/cpu/smt /sys/devices/system/cpu/smt/active diff -u linux-gcp-4.15.0/Documentation/admin-guide/hw-vuln/mds.rst linux-gcp-4.15.0/Documentation/admin-guide/hw-vuln/mds.rst --- linux-gcp-4.15.0/Documentation/admin-guide/hw-vuln/mds.rst +++ linux-gcp-4.15.0/Documentation/admin-guide/hw-vuln/mds.rst @@ -32,12 +32,11 @@ The following CVE entries are related to the MDS vulnerability: - ============== ===== =================================================== + ============== ===== ============================================== CVE-2018-12126 MSBDS Microarchitectural Store Buffer Data Sampling CVE-2018-12130 MFBDS Microarchitectural Fill Buffer Data Sampling CVE-2018-12127 MLPDS Microarchitectural Load Port Data Sampling - CVE-2019-11091 MDSUM Microarchitectural Data Sampling Uncacheable Memory - ============== ===== =================================================== + ============== ===== ============================================== Problem ------- @@ -95,19 +94,22 @@ The possible values in this file are: - .. list-table:: + ========================================= ================================= + 'Not affected' The processor is not vulnerable - * - 'Not affected' - - The processor is not vulnerable - * - 'Vulnerable' - - The processor is vulnerable, but no mitigation enabled - * - 'Vulnerable: Clear CPU buffers attempted, no microcode' - - The processor is vulnerable but microcode is not updated. - - The mitigation is enabled on a best effort basis. See :ref:`vmwerv` - * - 'Mitigation: Clear CPU buffers' - - The processor is vulnerable and the CPU buffer clearing mitigation is - enabled. + 'Vulnerable' The processor is vulnerable, + but no mitigation enabled + + 'Vulnerable: Clear CPU buffers attempted' The processor is vulnerable but + microcode is not updated. + The mitigation is enabled on a + best effort basis. + See :ref:`vmwerv` + + 'Mitigation: CPU buffer clear' The processor is vulnerable and the + CPU buffer clearing mitigation is + enabled. + ========================================= ================================= If the processor is vulnerable then the following information is appended to the above information: diff -u linux-gcp-4.15.0/Documentation/admin-guide/kernel-parameters.txt linux-gcp-4.15.0/Documentation/admin-guide/kernel-parameters.txt --- linux-gcp-4.15.0/Documentation/admin-guide/kernel-parameters.txt +++ linux-gcp-4.15.0/Documentation/admin-guide/kernel-parameters.txt @@ -2008,7 +2008,7 @@ Default is 'flush'. - For details see: Documentation/admin-guide/hw-vuln/l1tf.rst + For details see: Documentation/admin-guide/l1tf.rst l2cr= [PPC] @@ -2275,8 +2275,6 @@ Not specifying this option is equivalent to mds=full. - For details see: Documentation/admin-guide/hw-vuln/mds.rst - mem=nn[KMG] [KNL,BOOT] Force usage of a specific amount of memory Amount of memory to be used when the kernel is not able to see the whole system memory or for test. diff -u linux-gcp-4.15.0/Documentation/x86/mds.rst linux-gcp-4.15.0/Documentation/x86/mds.rst --- linux-gcp-4.15.0/Documentation/x86/mds.rst +++ linux-gcp-4.15.0/Documentation/x86/mds.rst @@ -12,7 +12,6 @@ - Microarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126) - Microarchitectural Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130) - Microarchitectural Load Port Data Sampling (MLPDS) (CVE-2018-12127) - - Microarchitectural Data Sampling Uncacheable Memory (MDSUM) (CVE-2019-11091) MSBDS leaks Store Buffer Entries which can be speculatively forwarded to a dependent load (store-to-load forwarding) as an optimization. The forward @@ -39,10 +38,6 @@ exploited eventually. Load ports are shared between Hyper-Threads so cross thread leakage is possible. -MDSUM is a special case of MSBDS, MFBDS and MLPDS. An uncacheable load from -memory that takes a fault or assist can leave data in a microarchitectural -structure that may later be observed using one of the same methods used by -MSBDS, MFBDS or MLPDS. Exposure assumptions -------------------- @@ -116,7 +111,7 @@ off Mitigation is disabled. Either the CPU is not affected or mds=off is supplied on the kernel command line - full Mitigation is enabled. CPU is affected and MD_CLEAR is + full Mitigation is eanbled. CPU is affected and MD_CLEAR is advertised in CPUID. vmwerv Mitigation is enabled. CPU is affected and MD_CLEAR is not diff -u linux-gcp-4.15.0/arch/powerpc/include/asm/opal-api.h linux-gcp-4.15.0/arch/powerpc/include/asm/opal-api.h --- linux-gcp-4.15.0/arch/powerpc/include/asm/opal-api.h +++ linux-gcp-4.15.0/arch/powerpc/include/asm/opal-api.h @@ -207,8 +207,7 @@ #define OPAL_NPU_TL_SET 161 #define OPAL_PCI_GET_PBCQ_TUNNEL_BAR 164 #define OPAL_PCI_SET_PBCQ_TUNNEL_BAR 165 -#define OPAL_NX_COPROC_INIT 167 -#define OPAL_LAST 167 +#define OPAL_LAST 165 #define QUIESCE_HOLD 1 /* Spin all calls at entry */ #define QUIESCE_REJECT 2 /* Fail all calls with OPAL_BUSY */ diff -u linux-gcp-4.15.0/arch/powerpc/include/asm/opal.h linux-gcp-4.15.0/arch/powerpc/include/asm/opal.h --- linux-gcp-4.15.0/arch/powerpc/include/asm/opal.h +++ linux-gcp-4.15.0/arch/powerpc/include/asm/opal.h @@ -291,7 +291,6 @@ int opal_get_power_shift_ratio(u32 handle, int token, u32 *psr); int opal_set_power_shift_ratio(u32 handle, int token, u32 psr); int opal_sensor_group_clear(u32 group_hndl, int token); -int opal_nx_coproc_init(uint32_t chip_id, uint32_t ct); s64 opal_signal_system_reset(s32 cpu); s64 opal_quiesce(u64 shutdown_type, s32 cpu); diff -u linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal-wrappers.S linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal-wrappers.S --- linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal-wrappers.S +++ linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal-wrappers.S @@ -329 +328,0 @@ -OPAL_CALL(opal_nx_coproc_init, OPAL_NX_COPROC_INIT); diff -u linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal.c linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal.c --- linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal.c +++ linux-gcp-4.15.0/arch/powerpc/platforms/powernv/opal.c @@ -1046,2 +1045,0 @@ -/* Export the below symbol for NX compression */ -EXPORT_SYMBOL(opal_nx_coproc_init); diff -u linux-gcp-4.15.0/arch/s390/kernel/early.c linux-gcp-4.15.0/arch/s390/kernel/early.c --- linux-gcp-4.15.0/arch/s390/kernel/early.c +++ linux-gcp-4.15.0/arch/s390/kernel/early.c @@ -90,10 +90,10 @@ if (stsi(vmms, 3, 2, 2) || !vmms->count) return; - /* Detect known hypervisors */ + /* Running under KVM? If not we assume z/VM */ if (!memcmp(vmms->vm[0].cpi, "\xd2\xe5\xd4", 3)) S390_lowcore.machine_flags |= MACHINE_FLAG_KVM; - else if (!memcmp(vmms->vm[0].cpi, "\xa9\x61\xe5\xd4", 4)) + else S390_lowcore.machine_flags |= MACHINE_FLAG_VM; } diff -u linux-gcp-4.15.0/arch/s390/kernel/setup.c linux-gcp-4.15.0/arch/s390/kernel/setup.c --- linux-gcp-4.15.0/arch/s390/kernel/setup.c +++ linux-gcp-4.15.0/arch/s390/kernel/setup.c @@ -880,8 +880,6 @@ pr_info("Linux is running under KVM in 64-bit mode\n"); else if (MACHINE_IS_LPAR) pr_info("Linux is running natively in 64-bit mode\n"); - else - pr_info("Linux is running as a guest in 64-bit mode\n"); /* Have one command line that is parsed and saved in /proc/cmdline */ /* boot_command_line has been already set up in early.c */ reverted: --- linux-gcp-4.15.0/arch/x86/include/asm/irq_remapping.h +++ linux-gcp-4.15.0.orig/arch/x86/include/asm/irq_remapping.h @@ -33,11 +33,6 @@ IRQ_POSTING_CAP = 0, }; -enum { - IRQ_REMAP_XAPIC_MODE, - IRQ_REMAP_X2APIC_MODE, -}; - struct vcpu_data { u64 pi_desc_addr; /* Physical address of PI Descriptor */ u32 vector; /* Guest vector of the interrupt */ diff -u linux-gcp-4.15.0/arch/x86/kernel/amd_nb.c linux-gcp-4.15.0/arch/x86/kernel/amd_nb.c --- linux-gcp-4.15.0/arch/x86/kernel/amd_nb.c +++ linux-gcp-4.15.0/arch/x86/kernel/amd_nb.c @@ -11,15 +11,14 @@ #include #include #include -#include #include #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 -#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 +#define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463 #define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464 +#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec -#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494 /* Protect the PCI config register pairs used for SMN and DF indirect access. */ static DEFINE_MUTEX(smn_mutex); @@ -29,11 +28,9 @@ static const struct pci_device_id amd_root_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_ROOT) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_ROOT) }, {} }; - #define PCI_DEVICE_ID_AMD_CNB17H_F4 0x1704 const struct pci_device_id amd_nb_misc_ids[] = { @@ -47,7 +44,6 @@ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, {} }; @@ -61,7 +57,6 @@ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F4) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, {} }; @@ -199,67 +194,35 @@ int amd_cache_northbridges(void) { - const struct pci_device_id *root_ids = amd_root_ids; + u16 i = 0; struct amd_northbridge *nb; struct pci_dev *root, *misc, *link; - u16 roots_per_misc = 0; - u16 misc_count = 0; - u16 root_count = 0; - u16 i, j; if (amd_northbridges.num) return 0; misc = NULL; while ((misc = next_northbridge(misc, amd_nb_misc_ids)) != NULL) - misc_count++; + i++; - if (!misc_count) + if (!i) return -ENODEV; - root = NULL; - while ((root = next_northbridge(root, root_ids)) != NULL) - root_count++; - - if (root_count) { - roots_per_misc = root_count / misc_count; - - /* - * There should be _exactly_ N roots for each DF/SMN - * interface. - */ - if (!roots_per_misc || (root_count % roots_per_misc)) { - pr_info("Unsupported AMD DF/PCI configuration found\n"); - return -ENODEV; - } - } - - nb = kcalloc(misc_count, sizeof(struct amd_northbridge), GFP_KERNEL); + nb = kcalloc(i, sizeof(struct amd_northbridge), GFP_KERNEL); if (!nb) return -ENOMEM; amd_northbridges.nb = nb; - amd_northbridges.num = misc_count; + amd_northbridges.num = i; link = misc = root = NULL; - for (i = 0; i < amd_northbridges.num; i++) { + for (i = 0; i != amd_northbridges.num; i++) { node_to_amd_nb(i)->root = root = next_northbridge(root, amd_root_ids); node_to_amd_nb(i)->misc = misc = next_northbridge(misc, amd_nb_misc_ids); node_to_amd_nb(i)->link = link = next_northbridge(link, amd_nb_link_ids); - /* - * If there are more PCI root devices than data fabric/ - * system management network interfaces, then the (N) - * PCI roots per DF/SMN interface are functionally the - * same (for DF/SMN access) and N-1 are redundant. N-1 - * PCI roots should be skipped per DF/SMN interface so - * the following DF/SMN interfaces get mapped to - * correct PCI roots. - */ - for (j = 1; j < roots_per_misc; j++) - root = next_northbridge(root, root_ids); } if (amd_gart_present()) diff -u linux-gcp-4.15.0/arch/x86/kernel/cpu/bugs.c linux-gcp-4.15.0/arch/x86/kernel/cpu/bugs.c --- linux-gcp-4.15.0/arch/x86/kernel/cpu/bugs.c +++ linux-gcp-4.15.0/arch/x86/kernel/cpu/bugs.c @@ -229,7 +229,7 @@ [MDS_MITIGATION_VMWERV] = "Vulnerable: Clear CPU buffers attempted, no microcode", }; -static void __init mds_select_mitigation(void) +static void mds_select_mitigation(void) { if (!boot_cpu_has_bug(X86_BUG_MDS) || cpu_mitigations_off()) { mds_mitigation = MDS_MITIGATION_OFF; @@ -678,14 +678,12 @@ static void update_mds_branch_idle(void) { /* - * Enable the idle clearing if SMT is active on CPUs which are - * affected only by MSBDS and not any other MDS variant. - * - * The other variants cannot be mitigated when SMT is enabled, so - * clearing the buffers on idle just to prevent the Store Buffer - * repartitioning leak would be a window dressing exercise. + * Enable the idle clearing on CPUs which are affected only by + * MDBDS and not any other MDS variant. The other variants cannot + * be mitigated when SMT is enabled, so clearing the buffers on + * idle would be a window dressing exercise. */ - if (!boot_cpu_has_bug(X86_BUG_MSBDS_ONLY)) + if (!boot_cpu_has(X86_BUG_MSBDS_ONLY)) return; if (sched_smt_active()) @@ -717,7 +715,7 @@ break; } - switch (mds_mitigation) { + switch(mds_mitigation) { case MDS_MITIGATION_FULL: case MDS_MITIGATION_VMWERV: if (sched_smt_active() && !boot_cpu_has(X86_BUG_MSBDS_ONLY)) @@ -1127,7 +1125,7 @@ pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n", half_pa); pr_info("However, doing so will make a part of your RAM unusable.\n"); - pr_info("Reading https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html might help you decide.\n"); + pr_info("Reading https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html might help you decide.\n"); return; } diff -u linux-gcp-4.15.0/arch/x86/kernel/cpu/common.c linux-gcp-4.15.0/arch/x86/kernel/cpu/common.c --- linux-gcp-4.15.0/arch/x86/kernel/cpu/common.c +++ linux-gcp-4.15.0/arch/x86/kernel/cpu/common.c @@ -964,16 +964,16 @@ VULNWL_INTEL(ATOM_BONNELL, NO_SPECULATION), VULNWL_INTEL(ATOM_BONNELL_MID, NO_SPECULATION), - VULNWL_INTEL(ATOM_SILVERMONT, NO_SSB | NO_L1TF | MSBDS_ONLY), - VULNWL_INTEL(ATOM_SILVERMONT_X, NO_SSB | NO_L1TF | MSBDS_ONLY), - VULNWL_INTEL(ATOM_SILVERMONT_MID, NO_SSB | NO_L1TF | MSBDS_ONLY), - VULNWL_INTEL(ATOM_AIRMONT, NO_SSB | NO_L1TF | MSBDS_ONLY), + VULNWL_INTEL(ATOM_SILVERMONT, NO_SSB | NO_L1TF), + VULNWL_INTEL(ATOM_SILVERMONT_X, NO_SSB | NO_L1TF), + VULNWL_INTEL(ATOM_SILVERMONT_MID, NO_SSB | NO_L1TF), + VULNWL_INTEL(ATOM_AIRMONT, NO_SSB | NO_L1TF), VULNWL_INTEL(XEON_PHI_KNL, NO_SSB | NO_L1TF | MSBDS_ONLY), VULNWL_INTEL(XEON_PHI_KNM, NO_SSB | NO_L1TF | MSBDS_ONLY), VULNWL_INTEL(CORE_YONAH, NO_SSB), - VULNWL_INTEL(ATOM_AIRMONT_MID, NO_L1TF | MSBDS_ONLY), + VULNWL_INTEL(ATOM_AIRMONT_MID, NO_L1TF), VULNWL_INTEL(ATOM_GOLDMONT, NO_MDS | NO_L1TF), VULNWL_INTEL(ATOM_GOLDMONT_X, NO_MDS | NO_L1TF), diff -u linux-gcp-4.15.0/arch/x86/kernel/cpu/mcheck/mce_amd.c linux-gcp-4.15.0/arch/x86/kernel/cpu/mcheck/mce_amd.c --- linux-gcp-4.15.0/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ linux-gcp-4.15.0/arch/x86/kernel/cpu/mcheck/mce_amd.c @@ -56,7 +56,7 @@ /* Threshold LVT offset is at MSR0xC0000410[15:12] */ #define SMCA_THR_LVT_OFF 0xF000 -static bool thresholding_irq_en; +static bool thresholding_en; static const char * const th_names[] = { "load_store", @@ -533,8 +533,9 @@ set_offset: offset = setup_APIC_mce_threshold(offset, new); - if (offset == new) - thresholding_irq_en = true; + + if ((offset == new) && (mce_threshold_vector != amd_threshold_interrupt)) + mce_threshold_vector = amd_threshold_interrupt; done: mce_threshold_block_init(&b, offset); @@ -1344,6 +1345,9 @@ { unsigned int bank; + if (!thresholding_en) + return 0; + for (bank = 0; bank < mca_cfg.banks; ++bank) { if (!(per_cpu(bank_map, cpu) & (1 << bank))) continue; @@ -1361,6 +1365,9 @@ struct threshold_bank **bp; int err = 0; + if (!thresholding_en) + return 0; + bp = per_cpu(threshold_banks, cpu); if (bp) return 0; @@ -1389,6 +1396,9 @@ { unsigned lcpu = 0; + if (mce_threshold_vector == amd_threshold_interrupt) + thresholding_en = true; + /* to hit CPUs online before the notifier is up */ for_each_online_cpu(lcpu) { int err = mce_threshold_create_device(lcpu); @@ -1397,9 +1407,6 @@ return err; } - if (thresholding_irq_en) - mce_threshold_vector = amd_threshold_interrupt; - return 0; } /* diff -u linux-gcp-4.15.0/arch/x86/kernel/traps.c linux-gcp-4.15.0/arch/x86/kernel/traps.c --- linux-gcp-4.15.0/arch/x86/kernel/traps.c +++ linux-gcp-4.15.0/arch/x86/kernel/traps.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include diff -u linux-gcp-4.15.0/arch/x86/kvm/vmx.c linux-gcp-4.15.0/arch/x86/kvm/vmx.c --- linux-gcp-4.15.0/arch/x86/kvm/vmx.c +++ linux-gcp-4.15.0/arch/x86/kvm/vmx.c @@ -9732,7 +9732,6 @@ vmx->__launched = vmx->loaded_vmcs->launched; - /* L1D Flush includes CPU buffer clear to mitigate MDS */ if (static_branch_unlikely(&vmx_l1d_should_flush)) vmx_l1d_flush(vcpu); else if (static_branch_unlikely(&mds_user_clear)) @@ -10087,8 +10086,8 @@ return ERR_PTR(err); } -#define L1TF_MSG_SMT "L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details.\n" -#define L1TF_MSG_L1D "L1TF CPU bug present and virtualization mitigation disabled, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details.\n" +#define L1TF_MSG_SMT "L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html for details.\n" +#define L1TF_MSG_L1D "L1TF CPU bug present and virtualization mitigation disabled, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html for details.\n" static int vmx_vm_init(struct kvm *kvm) { diff -u linux-gcp-4.15.0/crypto/authenc.c linux-gcp-4.15.0/crypto/authenc.c --- linux-gcp-4.15.0/crypto/authenc.c +++ linux-gcp-4.15.0/crypto/authenc.c @@ -58,22 +58,14 @@ return -EINVAL; if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) return -EINVAL; - - /* - * RTA_OK() didn't align the rtattr's payload when validating that it - * fits in the buffer. Yet, the keys should start on the next 4-byte - * aligned boundary. To avoid confusion, require that the rtattr - * payload be exactly the param struct, which has a 4-byte aligned size. - */ - if (RTA_PAYLOAD(rta) != sizeof(*param)) + if (RTA_PAYLOAD(rta) < sizeof(*param)) return -EINVAL; - BUILD_BUG_ON(sizeof(*param) % RTA_ALIGNTO); param = RTA_DATA(rta); keys->enckeylen = be32_to_cpu(param->enckeylen); - key += rta->rta_len; - keylen -= rta->rta_len; + key += RTA_ALIGN(rta->rta_len); + keylen -= RTA_ALIGN(rta->rta_len); if (keylen < keys->enckeylen) return -EINVAL; diff -u linux-gcp-4.15.0/debian.gcp/changelog linux-gcp-4.15.0/debian.gcp/changelog --- linux-gcp-4.15.0/debian.gcp/changelog +++ linux-gcp-4.15.0/debian.gcp/changelog @@ -1,71 +1,18 @@ -linux-gcp (4.15.0-1035.37) bionic; urgency=medium +linux-gcp (4.15.0-1036.38) bionic; urgency=medium - * linux-gcp: 4.15.0-1035.37 -proposed tracker (LP: #1832561) + * linux-gcp: 4.15.0-1036.38 -proposed tracker (LP: #1833973) - [ Ubuntu: 4.15.0-53.57 ] + [ Ubuntu: 4.15.0-54.58 ] - * linux: 4.15.0-53.57 -proposed tracker (LP: #1832578) + * linux: 4.15.0-54.58 -proposed tracker (LP: #1833987) + * Remote denial of service (resource exhaustion) caused by TCP SACK scoreboard + manipulation (LP: #1831638) // CVE-2019-11478 + - tcp: refine memory limit test in tcp_fragment() * CVE-2019-11479 - SAUCE: tcp: add tcp_min_snd_mss sysctl - SAUCE: tcp: enforce tcp_min_snd_mss in tcp_mtu_probing() - * CVE-2019-11085 - - drm/i915/gvt: Fix mmap range check - - drm/i915: make mappable struct resource centric - - drm/i915/gvt: Fix aperture read/write emulation when enable x-no-mmap=on - * CVE-2019-11884 - - Bluetooth: hidp: fix buffer overflow - * af_alg06 test from crypto test suite in LTP failed with kernel oops on B/C - (LP: #1829725) - - crypto: authenc - fix parsing key with misaligned rta_len - * CVE-2018-12126 // CVE-2018-12127 // CVE-2018-12130 // CVE-2019-11091 - - SAUCE: Synchronize MDS mitigations with upstream - - Documentation: Correct the possible MDS sysfs values - - x86/speculation/mds: Fix documentation typo - * CVE-2019-11091 - - x86/mds: Add MDSUM variant to the MDS documentation - * alignment test in powerpc from ubuntu_kernel_selftests failed on B/C Power9 - (LP: #1813118) - - selftests/powerpc: Remove Power9 copy_unaligned test - * TRACE_syscall.ptrace_syscall_dropped in seccomp from ubuntu_kernel_selftests - failed on B/C PowerPC (LP: #1812796) - - selftests/seccomp: Enhance per-arch ptrace syscall skip tests - * Add powerpc/alignment_handler test for selftests (LP: #1828935) - - selftests/powerpc: Add alignment handler selftest - - selftests/powerpc: Fix to use ucontext_t instead of struct ucontext - * Cannot build kernel 4.15.0-48.51 due to an in-source-tree ZFS module. - (LP: #1828763) - - SAUCE: (noup) Update zfs to 0.7.5-1ubuntu16.5 - * Eletrical noise occurred when external headset enter powersaving mode on a - DEll machine (LP: #1828798) - - ALSA: hda/realtek - Reduce click noise on Dell Precision 5820 headphone - - ALSA: hda/realtek - Fixup headphone noise via runtime suspend - * [18.04/18.10] File libperf-jvmti.so is missing in linux-tools-common deb on - Ubuntu (LP: #1761379) - - [Packaging] Support building libperf-jvmti.so - * TCP : race condition on socket ownership in tcp_close() (LP: #1830813) - - tcp: do not release socket ownership in tcp_close() - * bionic: netlink: potential shift overflow in netlink_bind() (LP: #1831103) - - netlink: Don't shift on 64 for ngroups - * Add support to Comet Lake LPSS (LP: #1830175) - - mfd: intel-lpss: Add Intel Comet Lake PCI IDs - * Reduce NAPI weight in hns driver from 256 to 64 (LP: #1830587) - - net: hns: Use NAPI_POLL_WEIGHT for hns driver - * x86: add support for AMD Rome (LP: #1819485) - - x86: irq_remapping: Move irq remapping mode enum - - iommu/amd: Add support for higher 64-bit IOMMU Control Register - - iommu/amd: Add support for IOMMU XT mode - - hwmon/k10temp, x86/amd_nb: Consolidate shared device IDs - - hwmon/k10temp: Add support for AMD family 17h, model 30h CPUs - - x86/amd_nb: Add PCI device IDs for family 17h, model 30h - - x86/MCE/AMD: Fix the thresholding machinery initialization order - - x86/amd_nb: Add support for newer PCI topologies - * nx842 - CRB request time out (-110) when uninstall NX modules and initiate - NX request (LP: #1827755) - - crypto/nx: Initialize 842 high and normal RxFIFO control registers - * Require improved hypervisor detection patch in Ubuntu 18.04 (LP: #1829972) - - s390/early: improve machine detection - -- Khalid Elmously Tue, 18 Jun 2019 19:54:01 -0400 + -- Kleber Sacilotto de Souza Mon, 24 Jun 2019 14:48:10 +0200 linux-gcp (4.15.0-1034.36) bionic; urgency=medium diff -u linux-gcp-4.15.0/debian.gcp/reconstruct linux-gcp-4.15.0/debian.gcp/reconstruct --- linux-gcp-4.15.0/debian.gcp/reconstruct +++ linux-gcp-4.15.0/debian.gcp/reconstruct @@ -28,7 +28,6 @@ rm -f 'include/linux/mfd/rtsx_common.h' rm -f 'include/linux/mfd/rtsx_pci.h' rm -f 'include/linux/mfd/rtsx_usb.h' -rm -f 'tools/testing/selftests/powerpc/alignment/copy_unaligned.c' rm -f 'tools/testing/selftests/powerpc/context_switch/.gitignore' rm -f 'tools/testing/selftests/powerpc/context_switch/Makefile' rm -f 'tools/testing/selftests/powerpc/context_switch/cp_abort.c' diff -u linux-gcp-4.15.0/debian.gcp/tracking-bug linux-gcp-4.15.0/debian.gcp/tracking-bug --- linux-gcp-4.15.0/debian.gcp/tracking-bug +++ linux-gcp-4.15.0/debian.gcp/tracking-bug @@ -1 +1 @@ -1832561 +1833973 diff -u linux-gcp-4.15.0/debian.master/changelog linux-gcp-4.15.0/debian.master/changelog --- linux-gcp-4.15.0/debian.master/changelog +++ linux-gcp-4.15.0/debian.master/changelog @@ -1,86 +1,16 @@ -linux (4.15.0-53.57) bionic; urgency=medium +linux (4.15.0-54.58) bionic; urgency=medium - * linux: 4.15.0-53.57 -proposed tracker (LP: #1832578) + * linux: 4.15.0-54.58 -proposed tracker (LP: #1833987) + + * Remote denial of service (resource exhaustion) caused by TCP SACK scoreboard + manipulation (LP: #1831638) // CVE-2019-11478 + - tcp: refine memory limit test in tcp_fragment() * CVE-2019-11479 - SAUCE: tcp: add tcp_min_snd_mss sysctl - SAUCE: tcp: enforce tcp_min_snd_mss in tcp_mtu_probing() - * CVE-2019-11085 - - drm/i915/gvt: Fix mmap range check - - drm/i915: make mappable struct resource centric - - drm/i915/gvt: Fix aperture read/write emulation when enable x-no-mmap=on - - * CVE-2019-11884 - - Bluetooth: hidp: fix buffer overflow - - * af_alg06 test from crypto test suite in LTP failed with kernel oops on B/C - (LP: #1829725) - - crypto: authenc - fix parsing key with misaligned rta_len - - * CVE-2018-12126 // CVE-2018-12127 // CVE-2018-12130 // CVE-2019-11091 - - SAUCE: Synchronize MDS mitigations with upstream - - Documentation: Correct the possible MDS sysfs values - - x86/speculation/mds: Fix documentation typo - - * CVE-2019-11091 - - x86/mds: Add MDSUM variant to the MDS documentation - - * alignment test in powerpc from ubuntu_kernel_selftests failed on B/C Power9 - (LP: #1813118) - - selftests/powerpc: Remove Power9 copy_unaligned test - - * TRACE_syscall.ptrace_syscall_dropped in seccomp from ubuntu_kernel_selftests - failed on B/C PowerPC (LP: #1812796) - - selftests/seccomp: Enhance per-arch ptrace syscall skip tests - - * Add powerpc/alignment_handler test for selftests (LP: #1828935) - - selftests/powerpc: Add alignment handler selftest - - selftests/powerpc: Fix to use ucontext_t instead of struct ucontext - - * Cannot build kernel 4.15.0-48.51 due to an in-source-tree ZFS module. - (LP: #1828763) - - SAUCE: (noup) Update zfs to 0.7.5-1ubuntu16.5 - - * Eletrical noise occurred when external headset enter powersaving mode on a - DEll machine (LP: #1828798) - - ALSA: hda/realtek - Reduce click noise on Dell Precision 5820 headphone - - ALSA: hda/realtek - Fixup headphone noise via runtime suspend - - * [18.04/18.10] File libperf-jvmti.so is missing in linux-tools-common deb on - Ubuntu (LP: #1761379) - - [Packaging] Support building libperf-jvmti.so - - * TCP : race condition on socket ownership in tcp_close() (LP: #1830813) - - tcp: do not release socket ownership in tcp_close() - - * bionic: netlink: potential shift overflow in netlink_bind() (LP: #1831103) - - netlink: Don't shift on 64 for ngroups - - * Add support to Comet Lake LPSS (LP: #1830175) - - mfd: intel-lpss: Add Intel Comet Lake PCI IDs - - * Reduce NAPI weight in hns driver from 256 to 64 (LP: #1830587) - - net: hns: Use NAPI_POLL_WEIGHT for hns driver - - * x86: add support for AMD Rome (LP: #1819485) - - x86: irq_remapping: Move irq remapping mode enum - - iommu/amd: Add support for higher 64-bit IOMMU Control Register - - iommu/amd: Add support for IOMMU XT mode - - hwmon/k10temp, x86/amd_nb: Consolidate shared device IDs - - hwmon/k10temp: Add support for AMD family 17h, model 30h CPUs - - x86/amd_nb: Add PCI device IDs for family 17h, model 30h - - x86/MCE/AMD: Fix the thresholding machinery initialization order - - x86/amd_nb: Add support for newer PCI topologies - - * nx842 - CRB request time out (-110) when uninstall NX modules and initiate - NX request (LP: #1827755) - - crypto/nx: Initialize 842 high and normal RxFIFO control registers - - * Require improved hypervisor detection patch in Ubuntu 18.04 (LP: #1829972) - - s390/early: improve machine detection - - -- Stefan Bader Thu, 13 Jun 2019 10:27:05 +0200 + -- Kleber Sacilotto de Souza Mon, 24 Jun 2019 11:39:50 +0200 linux (4.15.0-52.56) bionic; urgency=medium diff -u linux-gcp-4.15.0/debian.master/control.stub.in linux-gcp-4.15.0/debian.master/control.stub.in --- linux-gcp-4.15.0/debian.master/control.stub.in +++ linux-gcp-4.15.0/debian.master/control.stub.in @@ -13,8 +13,6 @@ libelf-dev , libnewt-dev , libiberty-dev , - default-jdk-headless , - java-common , rsync , libdw-dev , libpci-dev , diff -u linux-gcp-4.15.0/debian.master/reconstruct linux-gcp-4.15.0/debian.master/reconstruct --- linux-gcp-4.15.0/debian.master/reconstruct +++ linux-gcp-4.15.0/debian.master/reconstruct @@ -28,7 +28,6 @@ rm -f 'include/linux/mfd/rtsx_common.h' rm -f 'include/linux/mfd/rtsx_pci.h' rm -f 'include/linux/mfd/rtsx_usb.h' -rm -f 'tools/testing/selftests/powerpc/alignment/copy_unaligned.c' rm -f 'tools/testing/selftests/powerpc/context_switch/.gitignore' rm -f 'tools/testing/selftests/powerpc/context_switch/Makefile' rm -f 'tools/testing/selftests/powerpc/context_switch/cp_abort.c' diff -u linux-gcp-4.15.0/debian.master/rules.d/amd64.mk linux-gcp-4.15.0/debian.master/rules.d/amd64.mk --- linux-gcp-4.15.0/debian.master/rules.d/amd64.mk +++ linux-gcp-4.15.0/debian.master/rules.d/amd64.mk @@ -13,7 +13,6 @@ do_tools_usbip = true do_tools_cpupower = true do_tools_perf = true -do_tools_perf_jvmti = true do_tools_x86 = true do_tools_hyperv = true do_tools_host = true diff -u linux-gcp-4.15.0/debian.master/rules.d/arm64.mk linux-gcp-4.15.0/debian.master/rules.d/arm64.mk --- linux-gcp-4.15.0/debian.master/rules.d/arm64.mk +++ linux-gcp-4.15.0/debian.master/rules.d/arm64.mk @@ -15,7 +15,6 @@ do_tools_usbip = true do_tools_cpupower = true do_tools_perf = true -do_tools_perf_jvmti = true do_dtbs = true do_zfs = true diff -u linux-gcp-4.15.0/debian.master/rules.d/armhf.mk linux-gcp-4.15.0/debian.master/rules.d/armhf.mk --- linux-gcp-4.15.0/debian.master/rules.d/armhf.mk +++ linux-gcp-4.15.0/debian.master/rules.d/armhf.mk @@ -14,5 +14,4 @@ do_tools_cpupower = true do_tools_perf = true -do_tools_perf_jvmti = true do_dtbs = true diff -u linux-gcp-4.15.0/debian.master/rules.d/i386.mk linux-gcp-4.15.0/debian.master/rules.d/i386.mk --- linux-gcp-4.15.0/debian.master/rules.d/i386.mk +++ linux-gcp-4.15.0/debian.master/rules.d/i386.mk @@ -12,7 +12,6 @@ do_tools_usbip = true do_tools_cpupower = true do_tools_perf = true -do_tools_perf_jvmti = true do_tools_x86 = true do_tools_hyperv = true do_extras_package = true diff -u linux-gcp-4.15.0/debian.master/rules.d/ppc64el.mk linux-gcp-4.15.0/debian.master/rules.d/ppc64el.mk --- linux-gcp-4.15.0/debian.master/rules.d/ppc64el.mk +++ linux-gcp-4.15.0/debian.master/rules.d/ppc64el.mk @@ -14,7 +14,6 @@ do_tools_usbip = true do_tools_cpupower = true do_tools_perf = true -do_tools_perf_jvmti = true #do_flavour_image_package = false do_zfs = true diff -u linux-gcp-4.15.0/debian.master/rules.d/s390x.mk linux-gcp-4.15.0/debian.master/rules.d/s390x.mk --- linux-gcp-4.15.0/debian.master/rules.d/s390x.mk +++ linux-gcp-4.15.0/debian.master/rules.d/s390x.mk @@ -16,5 +16,4 @@ do_tools_cpupower = true do_tools_perf = true -do_tools_perf_jvmti = true do_zfs = true diff -u linux-gcp-4.15.0/debian.master/tracking-bug linux-gcp-4.15.0/debian.master/tracking-bug --- linux-gcp-4.15.0/debian.master/tracking-bug +++ linux-gcp-4.15.0/debian.master/tracking-bug @@ -1 +1 @@ -1832578 +1833987 diff -u linux-gcp-4.15.0/debian/changelog linux-gcp-4.15.0/debian/changelog --- linux-gcp-4.15.0/debian/changelog +++ linux-gcp-4.15.0/debian/changelog @@ -1,71 +1,18 @@ -linux-gcp (4.15.0-1035.37) bionic; urgency=medium +linux-gcp (4.15.0-1036.38) bionic; urgency=medium - * linux-gcp: 4.15.0-1035.37 -proposed tracker (LP: #1832561) + * linux-gcp: 4.15.0-1036.38 -proposed tracker (LP: #1833973) - [ Ubuntu: 4.15.0-53.57 ] + [ Ubuntu: 4.15.0-54.58 ] - * linux: 4.15.0-53.57 -proposed tracker (LP: #1832578) + * linux: 4.15.0-54.58 -proposed tracker (LP: #1833987) + * Remote denial of service (resource exhaustion) caused by TCP SACK scoreboard + manipulation (LP: #1831638) // CVE-2019-11478 + - tcp: refine memory limit test in tcp_fragment() * CVE-2019-11479 - SAUCE: tcp: add tcp_min_snd_mss sysctl - SAUCE: tcp: enforce tcp_min_snd_mss in tcp_mtu_probing() - * CVE-2019-11085 - - drm/i915/gvt: Fix mmap range check - - drm/i915: make mappable struct resource centric - - drm/i915/gvt: Fix aperture read/write emulation when enable x-no-mmap=on - * CVE-2019-11884 - - Bluetooth: hidp: fix buffer overflow - * af_alg06 test from crypto test suite in LTP failed with kernel oops on B/C - (LP: #1829725) - - crypto: authenc - fix parsing key with misaligned rta_len - * CVE-2018-12126 // CVE-2018-12127 // CVE-2018-12130 // CVE-2019-11091 - - SAUCE: Synchronize MDS mitigations with upstream - - Documentation: Correct the possible MDS sysfs values - - x86/speculation/mds: Fix documentation typo - * CVE-2019-11091 - - x86/mds: Add MDSUM variant to the MDS documentation - * alignment test in powerpc from ubuntu_kernel_selftests failed on B/C Power9 - (LP: #1813118) - - selftests/powerpc: Remove Power9 copy_unaligned test - * TRACE_syscall.ptrace_syscall_dropped in seccomp from ubuntu_kernel_selftests - failed on B/C PowerPC (LP: #1812796) - - selftests/seccomp: Enhance per-arch ptrace syscall skip tests - * Add powerpc/alignment_handler test for selftests (LP: #1828935) - - selftests/powerpc: Add alignment handler selftest - - selftests/powerpc: Fix to use ucontext_t instead of struct ucontext - * Cannot build kernel 4.15.0-48.51 due to an in-source-tree ZFS module. - (LP: #1828763) - - SAUCE: (noup) Update zfs to 0.7.5-1ubuntu16.5 - * Eletrical noise occurred when external headset enter powersaving mode on a - DEll machine (LP: #1828798) - - ALSA: hda/realtek - Reduce click noise on Dell Precision 5820 headphone - - ALSA: hda/realtek - Fixup headphone noise via runtime suspend - * [18.04/18.10] File libperf-jvmti.so is missing in linux-tools-common deb on - Ubuntu (LP: #1761379) - - [Packaging] Support building libperf-jvmti.so - * TCP : race condition on socket ownership in tcp_close() (LP: #1830813) - - tcp: do not release socket ownership in tcp_close() - * bionic: netlink: potential shift overflow in netlink_bind() (LP: #1831103) - - netlink: Don't shift on 64 for ngroups - * Add support to Comet Lake LPSS (LP: #1830175) - - mfd: intel-lpss: Add Intel Comet Lake PCI IDs - * Reduce NAPI weight in hns driver from 256 to 64 (LP: #1830587) - - net: hns: Use NAPI_POLL_WEIGHT for hns driver - * x86: add support for AMD Rome (LP: #1819485) - - x86: irq_remapping: Move irq remapping mode enum - - iommu/amd: Add support for higher 64-bit IOMMU Control Register - - iommu/amd: Add support for IOMMU XT mode - - hwmon/k10temp, x86/amd_nb: Consolidate shared device IDs - - hwmon/k10temp: Add support for AMD family 17h, model 30h CPUs - - x86/amd_nb: Add PCI device IDs for family 17h, model 30h - - x86/MCE/AMD: Fix the thresholding machinery initialization order - - x86/amd_nb: Add support for newer PCI topologies - * nx842 - CRB request time out (-110) when uninstall NX modules and initiate - NX request (LP: #1827755) - - crypto/nx: Initialize 842 high and normal RxFIFO control registers - * Require improved hypervisor detection patch in Ubuntu 18.04 (LP: #1829972) - - s390/early: improve machine detection - -- Khalid Elmously Tue, 18 Jun 2019 19:54:01 -0400 + -- Kleber Sacilotto de Souza Mon, 24 Jun 2019 14:48:10 +0200 linux-gcp (4.15.0-1034.36) bionic; urgency=medium diff -u linux-gcp-4.15.0/debian/control linux-gcp-4.15.0/debian/control --- linux-gcp-4.15.0/debian/control +++ linux-gcp-4.15.0/debian/control @@ -48,7 +48,7 @@ XS-Testsuite: autopkgtest #XS-Testsuite-Depends: gcc-4.7 binutils -Package: linux-gcp-headers-4.15.0-1035 +Package: linux-gcp-headers-4.15.0-1036 Build-Profiles: Architecture: amd64 Multi-Arch: foreign @@ -59,32 +59,32 @@ Description: Header files related to Linux kernel version 4.15.0 This package provides kernel header files for version 4.15.0, for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-gcp-headers-4.15.0-1035/debian.README.gz for details + /usr/share/doc/linux-gcp-headers-4.15.0-1036/debian.README.gz for details -Package: linux-gcp-tools-4.15.0-1035 +Package: linux-gcp-tools-4.15.0-1036 Build-Profiles: Architecture: amd64 Section: devel Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, linux-tools-common -Description: Linux kernel version specific tools for version 4.15.0-1035 +Description: Linux kernel version specific tools for version 4.15.0-1036 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 4.15.0-1035 on + version 4.15.0-1036 on 64 bit x86. - You probably want to install linux-tools-4.15.0-1035-. + You probably want to install linux-tools-4.15.0-1036-. -Package: linux-image-unsigned-4.15.0-1035-gcp +Package: linux-image-unsigned-4.15.0-1036-gcp Build-Profiles: Architecture: amd64 Section: kernel Priority: optional Provides: linux-image, fuse-module, aufs-dkms, ${linux:rprovides} -Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-4.15.0-1035-gcp +Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-4.15.0-1036-gcp Recommends: grub-pc | grub-efi-amd64 | grub-efi-ia32 | grub | lilo Breaks: flash-kernel (<< 3.90ubuntu2) [arm64 armhf], s390-tools (<< 2.3.0-0ubuntu3) [s390x] -Conflicts: linux-image-4.15.0-1035-gcp -Suggests: fdutils, linux-gcp-doc-4.15.0 | linux-gcp-source-4.15.0, linux-gcp-tools, linux-headers-4.15.0-1035-gcp, initramfs-tools | linux-initramfs-tool +Conflicts: linux-image-4.15.0-1036-gcp +Suggests: fdutils, linux-gcp-doc-4.15.0 | linux-gcp-source-4.15.0, linux-gcp-tools, linux-headers-4.15.0-1036-gcp, initramfs-tools | linux-initramfs-tool Description: Linux kernel image for version 4.15.0 on 64 bit x86 SMP This package contains the unsigned Linux kernel image for version 4.15.0 on 64 bit x86 SMP. @@ -97,7 +97,7 @@ the linux-gcp meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-4.15.0-1035-gcp +Package: linux-modules-4.15.0-1036-gcp Build-Profiles: Architecture: amd64 Section: kernel @@ -116,12 +116,12 @@ the linux-gcp meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-extra-4.15.0-1035-gcp +Package: linux-modules-extra-4.15.0-1036-gcp Build-Profiles: Architecture: amd64 Section: kernel Priority: optional -Depends: ${misc:Depends}, ${shlibs:Depends}, linux-image-4.15.0-1035-gcp | linux-image-unsigned-4.15.0-1035-gcp, crda | wireless-crda +Depends: ${misc:Depends}, ${shlibs:Depends}, linux-image-4.15.0-1036-gcp | linux-image-unsigned-4.15.0-1036-gcp, crda | wireless-crda Description: Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP This package contains the Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP. @@ -138,21 +138,21 @@ the linux-gcp meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-headers-4.15.0-1035-gcp +Package: linux-headers-4.15.0-1036-gcp Build-Profiles: Architecture: amd64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-gcp-headers-4.15.0-1035, ${shlibs:Depends} +Depends: ${misc:Depends}, linux-gcp-headers-4.15.0-1036, ${shlibs:Depends} Provides: linux-headers, linux-headers-3.0 Description: Linux kernel headers for version 4.15.0 on 64 bit x86 SMP This package provides kernel header files for version 4.15.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-4.15.0-1035/debian.README.gz for details. + /usr/share/doc/linux-headers-4.15.0-1036/debian.README.gz for details. -Package: linux-image-unsigned-4.15.0-1035-gcp-dbgsym +Package: linux-image-unsigned-4.15.0-1036-gcp-dbgsym Build-Profiles: Architecture: amd64 Section: devel @@ -169,20 +169,20 @@ is uncompressed, and unstripped. This package also includes the unstripped modules. -Package: linux-tools-4.15.0-1035-gcp +Package: linux-tools-4.15.0-1036-gcp Build-Profiles: Architecture: amd64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-gcp-tools-4.15.0-1035 -Description: Linux kernel version specific tools for version 4.15.0-1035 +Depends: ${misc:Depends}, linux-gcp-tools-4.15.0-1036 +Description: Linux kernel version specific tools for version 4.15.0-1036 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 4.15.0-1035 on + version 4.15.0-1036 on 64 bit x86. -Package: linux-buildinfo-4.15.0-1035-gcp +Package: linux-buildinfo-4.15.0-1036-gcp Build-Profiles: Architecture: amd64 Section: kernel diff -u linux-gcp-4.15.0/debian/rules linux-gcp-4.15.0/debian/rules --- linux-gcp-4.15.0/debian/rules +++ linux-gcp-4.15.0/debian/rules @@ -36,7 +36,6 @@ do_linux_tools=$(sort $(filter-out false,$(do_tools_usbip) $(do_tools_cpupower) $(do_tools_perf) $(do_tools_x86))) do_cloud_tools=$(sort $(filter-out false,$(do_tools_hyperv))) do_tools_host?=false -do_tools_perf_jvmti?=false # Don't build tools or udebs in a cross compile environment. ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) diff -u linux-gcp-4.15.0/debian/rules.d/2-binary-arch.mk linux-gcp-4.15.0/debian/rules.d/2-binary-arch.mk --- linux-gcp-4.15.0/debian/rules.d/2-binary-arch.mk +++ linux-gcp-4.15.0/debian/rules.d/2-binary-arch.mk @@ -384,9 +384,6 @@ endif ifeq ($(do_tools_perf),true) $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/perf $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$* -ifeq ($(do_tools_perf_jvmti),true) - $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/libperf-jvmti.so $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$* -endif endif ifeq ($(do_tools_x86),true) $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/x86_energy_perf_policy $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$* @@ -692,9 +689,6 @@ endif ifeq ($(do_tools_perf),true) install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release) -ifeq ($(do_tools_perf_jvmti),true) - install -m755 $(builddirpa)/tools/perf/libperf-jvmti.so $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release) -endif endif ifeq ($(do_tools_x86),true) install -m755 $(builddirpa)/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy \ reverted: --- linux-gcp-4.15.0/drivers/crypto/nx/nx-842-powernv.c +++ linux-gcp-4.15.0.orig/drivers/crypto/nx/nx-842-powernv.c @@ -24,8 +24,6 @@ #include #include #include -#include -#include MODULE_LICENSE("GPL"); MODULE_AUTHOR("Dan Streetman "); @@ -755,7 +753,7 @@ } static int __init vas_cfg_coproc_info(struct device_node *dn, int chip_id, + int vasid) - int vasid, int *ct) { struct vas_window *rxwin = NULL; struct vas_rx_win_attr rxattr; @@ -839,15 +837,6 @@ coproc->vas.id = vasid; nx842_add_coprocs_list(coproc, chip_id); - /* - * (lpid, pid, tid) combination has to be unique for each - * coprocessor instance in the system. So to make it - * unique, skiboot uses coprocessor type such as 842 or - * GZIP for pid and provides this value to kernel in pid - * device-tree property. - */ - *ct = pid; - return 0; err_out: @@ -861,7 +850,6 @@ struct device_node *dn; int chip_id, vasid, ret = 0; int nx_fifo_found = 0; - int uninitialized_var(ct); chip_id = of_get_ibm_chip_id(pn); if (chip_id < 0) { @@ -877,7 +865,7 @@ for_each_child_of_node(pn, dn) { if (of_device_is_compatible(dn, "ibm,p9-nx-842")) { + ret = vas_cfg_coproc_info(dn, chip_id, vasid); - ret = vas_cfg_coproc_info(dn, chip_id, vasid, &ct); if (ret) { of_node_put(dn); return ret; @@ -888,22 +876,9 @@ if (!nx_fifo_found) { pr_err("NX842 FIFO nodes are missing\n"); + ret = -EINVAL; - return -EINVAL; } - /* - * Initialize NX instance for both high and normal priority FIFOs. - */ - if (opal_check_token(OPAL_NX_COPROC_INIT)) { - ret = opal_nx_coproc_init(chip_id, ct); - if (ret) { - pr_err("Failed to initialize NX for chip(%d): %d\n", - chip_id, ret); - ret = opal_error_code(ret); - } - } else - pr_warn("Firmware doesn't support NX initialization\n"); - return ret; } reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/gvt/cfg_space.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/gvt/cfg_space.c @@ -119,6 +119,16 @@ if (map == vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_APERTURE].tracked) return 0; + if (map) { + vgpu->gm.aperture_va = memremap(aperture_pa, aperture_sz, + MEMREMAP_WC); + if (!vgpu->gm.aperture_va) + return -ENOMEM; + } else { + memunmap(vgpu->gm.aperture_va); + vgpu->gm.aperture_va = NULL; + } + val = vgpu_cfg_space(vgpu)[PCI_BASE_ADDRESS_2]; if (val & PCI_BASE_ADDRESS_MEM_TYPE_64) val = *(u64 *)(vgpu_cfg_space(vgpu) + PCI_BASE_ADDRESS_2); @@ -131,8 +141,11 @@ aperture_pa >> PAGE_SHIFT, aperture_sz >> PAGE_SHIFT, map); + if (ret) { + memunmap(vgpu->gm.aperture_va); + vgpu->gm.aperture_va = NULL; - if (ret) return ret; + } vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_APERTURE].tracked = map; return 0; reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/gvt/gvt.h +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/gvt/gvt.h @@ -80,6 +80,7 @@ struct intel_vgpu_gm { u64 aperture_sz; u64 hidden_sz; + void *aperture_va; struct drm_mm_node low_gm_node; struct drm_mm_node high_gm_node; }; @@ -315,7 +316,7 @@ /* Aperture/GM space definitions for GVT device */ #define gvt_aperture_sz(gvt) (gvt->dev_priv->ggtt.mappable_end) +#define gvt_aperture_pa_base(gvt) (gvt->dev_priv->ggtt.mappable_base) -#define gvt_aperture_pa_base(gvt) (gvt->dev_priv->ggtt.gmadr.start) #define gvt_ggtt_gm_sz(gvt) (gvt->dev_priv->ggtt.base.total) #define gvt_ggtt_sz(gvt) \ diff -u linux-gcp-4.15.0/drivers/gpu/drm/i915/gvt/kvmgt.c linux-gcp-4.15.0/drivers/gpu/drm/i915/gvt/kvmgt.c --- linux-gcp-4.15.0/drivers/gpu/drm/i915/gvt/kvmgt.c +++ linux-gcp-4.15.0/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -653,39 +653,6 @@ return ret; } -static inline bool intel_vgpu_in_aperture(struct intel_vgpu *vgpu, uint64_t off) -{ - return off >= vgpu_aperture_offset(vgpu) && - off < vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu); -} - -static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, uint64_t off, - void *buf, unsigned long count, bool is_write) -{ - void *aperture_va; - - if (!intel_vgpu_in_aperture(vgpu, off) || - !intel_vgpu_in_aperture(vgpu, off + count)) { - gvt_vgpu_err("Invalid aperture offset %llu\n", off); - return -EINVAL; - } - - aperture_va = io_mapping_map_wc(&vgpu->gvt->dev_priv->ggtt.iomap, - ALIGN_DOWN(off, PAGE_SIZE), - count + offset_in_page(off)); - if (!aperture_va) - return -EIO; - - if (is_write) - memcpy(aperture_va + offset_in_page(off), buf, count); - else - memcpy(buf, aperture_va + offset_in_page(off), count); - - io_mapping_unmap(aperture_va); - - return 0; -} - static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf, size_t count, loff_t *ppos, bool is_write) { @@ -714,7 +681,8 @@ buf, count, is_write); break; case VFIO_PCI_BAR2_REGION_INDEX: - ret = intel_vgpu_aperture_rw(vgpu, pos, buf, count, is_write); + ret = intel_vgpu_bar_rw(vgpu, PCI_BASE_ADDRESS_2, pos, + buf, count, is_write); break; case VFIO_PCI_BAR1_REGION_INDEX: case VFIO_PCI_BAR3_REGION_INDEX: @@ -851,7 +819,7 @@ { unsigned int index; u64 virtaddr; - unsigned long req_size, pgoff, req_start; + unsigned long req_size, pgoff = 0; pgprot_t pg_prot; struct intel_vgpu *vgpu = mdev_get_drvdata(mdev); @@ -869,17 +837,7 @@ pg_prot = vma->vm_page_prot; virtaddr = vma->vm_start; req_size = vma->vm_end - vma->vm_start; - pgoff = vma->vm_pgoff & - ((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1); - req_start = pgoff << PAGE_SHIFT; - - if (!intel_vgpu_in_aperture(vgpu, req_start)) - return -EINVAL; - if (req_start + req_size > - vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu)) - return -EINVAL; - - pgoff = (gvt_aperture_pa_base(vgpu->gvt) >> PAGE_SHIFT) + pgoff; + pgoff = vgpu_aperture_pa_base(vgpu) >> PAGE_SHIFT; return remap_pfn_range(vma, virtaddr, pgoff, req_size, pg_prot); } reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/gvt/mmio.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/gvt/mmio.c @@ -56,6 +56,38 @@ (reg >= gvt->device_info.gtt_start_offset \ && reg < gvt->device_info.gtt_start_offset + gvt_ggtt_sz(gvt)) +static bool vgpu_gpa_is_aperture(struct intel_vgpu *vgpu, uint64_t gpa) +{ + u64 aperture_gpa = intel_vgpu_get_bar_gpa(vgpu, PCI_BASE_ADDRESS_2); + u64 aperture_sz = vgpu_aperture_sz(vgpu); + + return gpa >= aperture_gpa && gpa < aperture_gpa + aperture_sz; +} + +static int vgpu_aperture_rw(struct intel_vgpu *vgpu, uint64_t gpa, + void *pdata, unsigned int size, bool is_read) +{ + u64 aperture_gpa = intel_vgpu_get_bar_gpa(vgpu, PCI_BASE_ADDRESS_2); + u64 offset = gpa - aperture_gpa; + + if (!vgpu_gpa_is_aperture(vgpu, gpa + size - 1)) { + gvt_vgpu_err("Aperture rw out of range, offset %llx, size %d\n", + offset, size); + return -EINVAL; + } + + if (!vgpu->gm.aperture_va) { + gvt_vgpu_err("BAR is not enabled\n"); + return -ENXIO; + } + + if (is_read) + memcpy(pdata, vgpu->gm.aperture_va + offset, size); + else + memcpy(vgpu->gm.aperture_va + offset, pdata, size); + return 0; +} + static void failsafe_emulate_mmio_rw(struct intel_vgpu *vgpu, uint64_t pa, void *p_data, unsigned int bytes, bool read) { @@ -132,6 +164,12 @@ } mutex_lock(&gvt->lock); + if (vgpu_gpa_is_aperture(vgpu, pa)) { + ret = vgpu_aperture_rw(vgpu, pa, p_data, bytes, true); + mutex_unlock(&gvt->lock); + return ret; + } + if (atomic_read(&vgpu->gtt.n_write_protected_guest_page)) { struct intel_vgpu_guest_page *gp; @@ -223,6 +261,12 @@ mutex_lock(&gvt->lock); + if (vgpu_gpa_is_aperture(vgpu, pa)) { + ret = vgpu_aperture_rw(vgpu, pa, p_data, bytes, false); + mutex_unlock(&gvt->lock); + return ret; + } + if (atomic_read(&vgpu->gtt.n_write_protected_guest_page)) { struct intel_vgpu_guest_page *gp; diff -u linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_drv.c linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_drv.c --- linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_drv.c +++ linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_drv.c @@ -724,7 +724,7 @@ if (!ap) return -ENOMEM; - ap->ranges[0].base = ggtt->gmadr.start; + ap->ranges[0].base = ggtt->mappable_base; ap->ranges[0].size = ggtt->mappable_end; primary = reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gem.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/i915_gem.c @@ -1099,7 +1099,7 @@ page_base += offset & PAGE_MASK; } + if (gtt_user_read(&ggtt->mappable, page_base, page_offset, - if (gtt_user_read(&ggtt->iomap, page_base, page_offset, user_data, page_length)) { ret = -EFAULT; break; @@ -1307,7 +1307,7 @@ * If the object is non-shmem backed, we retry again with the * path that handles page fault. */ + if (ggtt_write(&ggtt->mappable, page_base, page_offset, - if (ggtt_write(&ggtt->iomap, page_base, page_offset, user_data, page_length)) { ret = -EFAULT; break; @@ -1936,9 +1936,9 @@ /* Finally, remap it using the new GTT offset */ ret = remap_io_mapping(area, area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT), + (ggtt->mappable_base + vma->node.start) >> PAGE_SHIFT, - (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT, min_t(u64, vma->size, area->vm_end - area->vm_start), + &ggtt->mappable); - &ggtt->iomap); if (ret) goto err_fence; diff -u linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gem_execbuffer.c --- linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1014,7 +1014,7 @@ offset += page << PAGE_SHIFT; } - vaddr = (void __force *)io_mapping_map_atomic_wc(&ggtt->iomap, + vaddr = (void __force *)io_mapping_map_atomic_wc(&ggtt->mappable, offset); cache->page = page; cache->vaddr = (unsigned long)vaddr; reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gem_gtt.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -2877,7 +2877,7 @@ mutex_unlock(&dev_priv->drm.struct_mutex); arch_phys_wc_del(ggtt->mtrr); + io_mapping_fini(&ggtt->mappable); - io_mapping_fini(&ggtt->iomap); } static unsigned int gen6_get_total_gtt_size(u16 snb_gmch_ctl) @@ -3303,10 +3303,8 @@ int err; /* TODO: We're not aware of mappable constraints on gen8 yet */ + ggtt->mappable_base = pci_resource_start(pdev, 2); + ggtt->mappable_end = pci_resource_len(pdev, 2); - ggtt->gmadr = - (struct resource) DEFINE_RES_MEM(pci_resource_start(pdev, 2), - pci_resource_len(pdev, 2)); - ggtt->mappable_end = resource_size(&ggtt->gmadr); err = pci_set_dma_mask(pdev, DMA_BIT_MASK(39)); if (!err) @@ -3363,10 +3361,8 @@ u16 snb_gmch_ctl; int err; + ggtt->mappable_base = pci_resource_start(pdev, 2); + ggtt->mappable_end = pci_resource_len(pdev, 2); - ggtt->gmadr = - (struct resource) DEFINE_RES_MEM(pci_resource_start(pdev, 2), - pci_resource_len(pdev, 2)); - ggtt->mappable_end = resource_size(&ggtt->gmadr); /* 64/512MB is the current min/max we actually know of, but this is just * a coarse sanity check. @@ -3421,7 +3417,6 @@ static int i915_gmch_probe(struct i915_ggtt *ggtt) { struct drm_i915_private *dev_priv = ggtt->base.i915; - phys_addr_t gmadr_base; int ret; ret = intel_gmch_probe(dev_priv->bridge_dev, dev_priv->drm.pdev, NULL); @@ -3432,13 +3427,9 @@ intel_gtt_get(&ggtt->base.total, &ggtt->stolen_size, + &ggtt->mappable_base, - &gmadr_base, &ggtt->mappable_end); - ggtt->gmadr = - (struct resource) DEFINE_RES_MEM(gmadr_base, - ggtt->mappable_end); - ggtt->do_idle_maps = needs_idle_maps(dev_priv); ggtt->base.insert_page = i915_ggtt_insert_page; ggtt->base.insert_entries = i915_ggtt_insert_entries; @@ -3506,7 +3497,7 @@ /* GMADR is the PCI mmio aperture into the global GTT. */ DRM_INFO("Memory usable by graphics device = %lluM\n", ggtt->base.total >> 20); + DRM_DEBUG_DRIVER("GMADR size = %lldM\n", ggtt->mappable_end >> 20); - DRM_DEBUG_DRIVER("GMADR size = %lluM\n", (u64)ggtt->mappable_end >> 20); DRM_DEBUG_DRIVER("GTT stolen size = %uM\n", ggtt->stolen_size >> 20); if (intel_vtd_active()) DRM_INFO("VT-d active for gfx access\n"); @@ -3536,14 +3527,14 @@ ggtt->base.mm.color_adjust = i915_gtt_color_adjust; mutex_unlock(&dev_priv->drm.struct_mutex); + if (!io_mapping_init_wc(&dev_priv->ggtt.mappable, + dev_priv->ggtt.mappable_base, - if (!io_mapping_init_wc(&dev_priv->ggtt.iomap, - dev_priv->ggtt.gmadr.start, dev_priv->ggtt.mappable_end)) { ret = -EIO; goto out_gtt_cleanup; } + ggtt->mtrr = arch_phys_wc_add(ggtt->mappable_base, ggtt->mappable_end); - ggtt->mtrr = arch_phys_wc_add(ggtt->gmadr.start, ggtt->mappable_end); /* * Initialise stolen early so that we may reserve preallocated reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gem_gtt.h +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/i915_gem_gtt.h @@ -368,9 +368,9 @@ */ struct i915_ggtt { struct i915_address_space base; + struct io_mapping mappable; /* Mapping to our CPU mappable region */ + phys_addr_t mappable_base; /* PA of our GMADR */ - struct io_mapping iomap; /* Mapping to our CPU mappable region */ - struct resource gmadr; /* GMADR resource */ u64 mappable_end; /* End offset that we can CPU map */ /* Stolen memory is segmented in hardware with different portions reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_gpu_error.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/i915_gpu_error.c @@ -912,7 +912,7 @@ ggtt->base.insert_page(&ggtt->base, dma, slot, I915_CACHE_NONE, 0); + s = io_mapping_map_atomic_wc(&ggtt->mappable, slot); - s = io_mapping_map_atomic_wc(&ggtt->iomap, slot); ret = compress_page(&compress, (void __force *)s, dst); io_mapping_unmap_atomic(s); reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/i915_vma.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/i915_vma.c @@ -305,7 +305,7 @@ ptr = vma->iomap; if (ptr == NULL) { + ptr = io_mapping_map_wc(&i915_vm_to_ggtt(vma->vm)->mappable, - ptr = io_mapping_map_wc(&i915_vm_to_ggtt(vma->vm)->iomap, vma->node.start, vma->node.size); if (ptr == NULL) { diff -u linux-gcp-4.15.0/drivers/gpu/drm/i915/intel_display.c linux-gcp-4.15.0/drivers/gpu/drm/i915/intel_display.c --- linux-gcp-4.15.0/drivers/gpu/drm/i915/intel_display.c +++ linux-gcp-4.15.0/drivers/gpu/drm/i915/intel_display.c @@ -14565,7 +14565,7 @@ dev->mode_config.cursor_height = MAX_CURSOR_HEIGHT; } - dev->mode_config.fb_base = ggtt->gmadr.start; + dev->mode_config.fb_base = ggtt->mappable_base; DRM_DEBUG_KMS("%d display pipe%s available.\n", INTEL_INFO(dev_priv)->num_pipes, reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/intel_overlay.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/intel_overlay.c @@ -219,7 +219,7 @@ if (OVERLAY_NEEDS_PHYSICAL(dev_priv)) regs = (struct overlay_registers __iomem *)overlay->reg_bo->phys_handle->vaddr; else + regs = io_mapping_map_wc(&dev_priv->ggtt.mappable, - regs = io_mapping_map_wc(&dev_priv->ggtt.iomap, overlay->flip_addr, PAGE_SIZE); @@ -1508,7 +1508,7 @@ regs = (struct overlay_registers __iomem *) overlay->reg_bo->phys_handle->vaddr; else + regs = io_mapping_map_atomic_wc(&dev_priv->ggtt.mappable, - regs = io_mapping_map_atomic_wc(&dev_priv->ggtt.iomap, overlay->flip_addr); return regs; reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1055,7 +1055,7 @@ i915_gem_object_get_dma_address(obj, 0), offset, I915_CACHE_NONE, 0); + vaddr = io_mapping_map_atomic_wc(&ggtt->mappable, offset); - vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset); iowrite32(n, vaddr + n); io_mapping_unmap_atomic(vaddr); @@ -1073,7 +1073,7 @@ i915_gem_object_get_dma_address(obj, 0), offset, I915_CACHE_NONE, 0); + vaddr = io_mapping_map_atomic_wc(&ggtt->mappable, offset); - vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset); val = ioread32(vaddr + n); io_mapping_unmap_atomic(vaddr); reverted: --- linux-gcp-4.15.0/drivers/gpu/drm/i915/selftests/mock_gtt.c +++ linux-gcp-4.15.0.orig/drivers/gpu/drm/i915/selftests/mock_gtt.c @@ -110,8 +110,8 @@ ggtt->base.i915 = i915; + ggtt->mappable_base = 0; + ggtt->mappable_end = 2048 * PAGE_SIZE; - ggtt->gmadr = (struct resource) DEFINE_RES_MEM(0, 2048 * PAGE_SIZE); - ggtt->mappable_end = resource_size(&ggtt->gmadr); ggtt->base.total = 4096 * PAGE_SIZE; ggtt->base.clear_range = nop_clear_range; diff -u linux-gcp-4.15.0/drivers/hwmon/k10temp.c linux-gcp-4.15.0/drivers/hwmon/k10temp.c --- linux-gcp-4.15.0/drivers/hwmon/k10temp.c +++ linux-gcp-4.15.0/drivers/hwmon/k10temp.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -42,6 +41,14 @@ #define PCI_DEVICE_ID_AMD_15H_M70H_NB_F3 0x15b3 #endif +#ifndef PCI_DEVICE_ID_AMD_17H_DF_F3 +#define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463 +#endif + +#ifndef PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 +#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb +#endif + /* CPUID function 0x80000001, ebx */ #define CPUID_PKGTYPE_MASK 0xf0000000 #define CPUID_PKGTYPE_F 0x00000000 @@ -322,7 +329,6 @@ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) }, - { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) }, {} }; MODULE_DEVICE_TABLE(pci, k10temp_id_table); diff -u linux-gcp-4.15.0/drivers/iommu/amd_iommu.c linux-gcp-4.15.0/drivers/iommu/amd_iommu.c --- linux-gcp-4.15.0/drivers/iommu/amd_iommu.c +++ linux-gcp-4.15.0/drivers/iommu/amd_iommu.c @@ -3820,8 +3820,7 @@ irte->lo.fields_remap.int_type = delivery_mode; irte->lo.fields_remap.dm = dest_mode; irte->hi.fields.vector = vector; - irte->lo.fields_remap.destination = APICID_TO_IRTE_DEST_LO(dest_apicid); - irte->hi.fields.destination = APICID_TO_IRTE_DEST_HI(dest_apicid); + irte->lo.fields_remap.destination = dest_apicid; irte->lo.fields_remap.valid = 1; } @@ -3876,10 +3875,7 @@ if (!dev_data || !dev_data->use_vapic || !irte->lo.fields_remap.guest_mode) { irte->hi.fields.vector = vector; - irte->lo.fields_remap.destination = - APICID_TO_IRTE_DEST_LO(dest_apicid); - irte->hi.fields.destination = - APICID_TO_IRTE_DEST_HI(dest_apicid); + irte->lo.fields_remap.destination = dest_apicid; modify_irte_ga(devid, index, irte, NULL); } } @@ -4280,10 +4276,7 @@ irte->lo.val = 0; irte->hi.fields.vector = cfg->vector; irte->lo.fields_remap.guest_mode = 0; - irte->lo.fields_remap.destination = - APICID_TO_IRTE_DEST_LO(cfg->dest_apicid); - irte->hi.fields.destination = - APICID_TO_IRTE_DEST_HI(cfg->dest_apicid); + irte->lo.fields_remap.destination = cfg->dest_apicid; irte->lo.fields_remap.int_type = apic->irq_delivery_mode; irte->lo.fields_remap.dm = apic->irq_dest_mode; @@ -4400,12 +4393,8 @@ spin_lock_irqsave(&irt->lock, flags); if (ref->lo.fields_vapic.guest_mode) { - if (cpu >= 0) { - ref->lo.fields_vapic.destination = - APICID_TO_IRTE_DEST_LO(cpu); - ref->hi.fields.destination = - APICID_TO_IRTE_DEST_HI(cpu); - } + if (cpu >= 0) + ref->lo.fields_vapic.destination = cpu; ref->lo.fields_vapic.is_run = is_run; barrier(); } reverted: --- linux-gcp-4.15.0/drivers/iommu/amd_iommu_init.c +++ linux-gcp-4.15.0.orig/drivers/iommu/amd_iommu_init.c @@ -153,7 +153,6 @@ bool amd_iommu_irq_remap __read_mostly; int amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_VAPIC; -static int amd_iommu_xt_mode = IRQ_REMAP_X2APIC_MODE; static bool amd_iommu_detected; static bool __initdata amd_iommu_disabled; @@ -281,9 +280,9 @@ static void init_translation_status(struct amd_iommu *iommu) { + u32 ctrl; - u64 ctrl; + ctrl = readl(iommu->mmio_base + MMIO_CONTROL_OFFSET); - ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET); if (ctrl & (1<flags |= AMD_IOMMU_FLAG_TRANS_PRE_ENABLED; } @@ -387,30 +386,30 @@ /* Generic functions to enable/disable certain features of the IOMMU. */ static void iommu_feature_enable(struct amd_iommu *iommu, u8 bit) { + u32 ctrl; - u64 ctrl; + ctrl = readl(iommu->mmio_base + MMIO_CONTROL_OFFSET); + ctrl |= (1 << bit); + writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); - ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET); - ctrl |= (1ULL << bit); - writeq(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); } static void iommu_feature_disable(struct amd_iommu *iommu, u8 bit) { + u32 ctrl; - u64 ctrl; + ctrl = readl(iommu->mmio_base + MMIO_CONTROL_OFFSET); + ctrl &= ~(1 << bit); + writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); - ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET); - ctrl &= ~(1ULL << bit); - writeq(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); } static void iommu_set_inv_tlb_timeout(struct amd_iommu *iommu, int timeout) { + u32 ctrl; - u64 ctrl; + ctrl = readl(iommu->mmio_base + MMIO_CONTROL_OFFSET); - ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET); ctrl &= ~CTRL_INV_TO_MASK; ctrl |= (timeout << CONTROL_INV_TIMEOUT) & CTRL_INV_TO_MASK; + writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); - writeq(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); } /* Function to enable the hardware */ @@ -828,19 +827,6 @@ return ret; } -static void iommu_enable_xt(struct amd_iommu *iommu) -{ -#ifdef CONFIG_IRQ_REMAP - /* - * XT mode (32-bit APIC destination ID) requires - * GA mode (128-bit IRTE support) as a prerequisite. - */ - if (AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir) && - amd_iommu_xt_mode == IRQ_REMAP_X2APIC_MODE) - iommu_feature_enable(iommu, CONTROL_XT_EN); -#endif /* CONFIG_IRQ_REMAP */ -} - static void iommu_enable_gt(struct amd_iommu *iommu) { if (!iommu_feature(iommu, FEATURE_GT)) @@ -1521,8 +1507,6 @@ iommu->mmio_phys_end = MMIO_CNTR_CONF_OFFSET; if (((h->efr_attr & (0x1 << IOMMU_FEAT_GASUP_SHIFT)) == 0)) amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY; - if (((h->efr_attr & (0x1 << IOMMU_FEAT_XTSUP_SHIFT)) == 0)) - amd_iommu_xt_mode = IRQ_REMAP_XAPIC_MODE; break; case 0x11: case 0x40: @@ -1532,8 +1516,6 @@ iommu->mmio_phys_end = MMIO_CNTR_CONF_OFFSET; if (((h->efr_reg & (0x1 << IOMMU_EFR_GASUP_SHIFT)) == 0)) amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY; - if (((h->efr_reg & (0x1 << IOMMU_EFR_XTSUP_SHIFT)) == 0)) - amd_iommu_xt_mode = IRQ_REMAP_XAPIC_MODE; break; default: return -EINVAL; @@ -1849,8 +1831,6 @@ pr_info("AMD-Vi: Interrupt remapping enabled\n"); if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir)) pr_info("AMD-Vi: virtual APIC enabled\n"); - if (amd_iommu_xt_mode == IRQ_REMAP_X2APIC_MODE) - pr_info("AMD-Vi: X2APIC enabled\n"); } } @@ -2187,7 +2167,6 @@ iommu_enable_event_buffer(iommu); iommu_set_exclusion_range(iommu); iommu_enable_ga(iommu); - iommu_enable_xt(iommu); iommu_enable(iommu); iommu_flush_all_caches(iommu); } @@ -2232,7 +2211,6 @@ iommu_enable_command_buffer(iommu); iommu_enable_event_buffer(iommu); iommu_enable_ga(iommu); - iommu_enable_xt(iommu); iommu_set_device_table(iommu); iommu_flush_all_caches(iommu); } @@ -2712,7 +2690,8 @@ return ret; irq_remapping_enabled = 1; + + return 0; - return amd_iommu_xt_mode; } void amd_iommu_disable(void) reverted: --- linux-gcp-4.15.0/drivers/iommu/amd_iommu_types.h +++ linux-gcp-4.15.0.orig/drivers/iommu/amd_iommu_types.h @@ -159,7 +159,6 @@ #define CONTROL_GAM_EN 0x19ULL #define CONTROL_GALOG_EN 0x1CULL #define CONTROL_GAINT_EN 0x1DULL -#define CONTROL_XT_EN 0x32ULL #define CTRL_INV_TO_MASK (7 << CONTROL_INV_TIMEOUT) #define CTRL_INV_TO_NONE 0 @@ -376,11 +375,9 @@ #define IOMMU_CAP_EFR 27 /* IOMMU Feature Reporting Field (for IVHD type 10h */ -#define IOMMU_FEAT_XTSUP_SHIFT 0 #define IOMMU_FEAT_GASUP_SHIFT 6 /* IOMMU Extended Feature Register (EFR) */ -#define IOMMU_EFR_XTSUP_SHIFT 2 #define IOMMU_EFR_GASUP_SHIFT 7 #define MAX_DOMAIN_ID 65536 @@ -437,6 +434,7 @@ #define APERTURE_RANGE_INDEX(a) ((a) >> APERTURE_RANGE_SHIFT) #define APERTURE_PAGE_INDEX(a) (((a) >> 21) & 0x3fULL) + /* * This struct is used to pass information about * incoming PPR faults around. @@ -809,9 +807,6 @@ } fields; }; -#define APICID_TO_IRTE_DEST_LO(x) (x & 0xffffff) -#define APICID_TO_IRTE_DEST_HI(x) ((x >> 24) & 0xff) - union irte_ga_lo { u64 val; @@ -825,8 +820,8 @@ dm : 1, /* ------ */ guest_mode : 1, + destination : 8, + rsvd : 48; - destination : 24, - ga_tag : 32; } fields_remap; /* For guest vAPIC */ @@ -839,7 +834,8 @@ is_run : 1, /* ------ */ guest_mode : 1, + destination : 8, + rsvd2 : 16, - destination : 24, ga_tag : 32; } fields_vapic; }; @@ -850,8 +846,7 @@ u64 vector : 8, rsvd_1 : 4, ga_root_ptr : 40, + rsvd_2 : 12; - rsvd_2 : 4, - destination : 8; } fields; }; diff -u linux-gcp-4.15.0/drivers/mfd/intel-lpss-pci.c linux-gcp-4.15.0/drivers/mfd/intel-lpss-pci.c --- linux-gcp-4.15.0/drivers/mfd/intel-lpss-pci.c +++ linux-gcp-4.15.0/drivers/mfd/intel-lpss-pci.c @@ -130,19 +130,6 @@ }; static const struct pci_device_id intel_lpss_pci_ids[] = { - /* CML */ - { PCI_VDEVICE(INTEL, 0x02a8), (kernel_ulong_t)&spt_uart_info }, - { PCI_VDEVICE(INTEL, 0x02a9), (kernel_ulong_t)&spt_uart_info }, - { PCI_VDEVICE(INTEL, 0x02aa), (kernel_ulong_t)&spt_info }, - { PCI_VDEVICE(INTEL, 0x02ab), (kernel_ulong_t)&spt_info }, - { PCI_VDEVICE(INTEL, 0x02c5), (kernel_ulong_t)&cnl_i2c_info }, - { PCI_VDEVICE(INTEL, 0x02c6), (kernel_ulong_t)&cnl_i2c_info }, - { PCI_VDEVICE(INTEL, 0x02c7), (kernel_ulong_t)&spt_uart_info }, - { PCI_VDEVICE(INTEL, 0x02e8), (kernel_ulong_t)&cnl_i2c_info }, - { PCI_VDEVICE(INTEL, 0x02e9), (kernel_ulong_t)&cnl_i2c_info }, - { PCI_VDEVICE(INTEL, 0x02ea), (kernel_ulong_t)&cnl_i2c_info }, - { PCI_VDEVICE(INTEL, 0x02eb), (kernel_ulong_t)&cnl_i2c_info }, - { PCI_VDEVICE(INTEL, 0x02fb), (kernel_ulong_t)&spt_info }, /* BXT A-Step */ { PCI_VDEVICE(INTEL, 0x0aac), (kernel_ulong_t)&bxt_i2c_info }, { PCI_VDEVICE(INTEL, 0x0aae), (kernel_ulong_t)&bxt_i2c_info }, diff -u linux-gcp-4.15.0/drivers/net/ethernet/hisilicon/hns/hns_enet.c linux-gcp-4.15.0/drivers/net/ethernet/hisilicon/hns/hns_enet.c --- linux-gcp-4.15.0/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ linux-gcp-4.15.0/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -29,6 +29,9 @@ #define SERVICE_TIMER_HZ (1 * HZ) +#define NIC_TX_CLEAN_MAX_NUM 256 +#define NIC_RX_CLEAN_MAX_NUM 64 + #define RCB_IRQ_NOT_INITED 0 #define RCB_IRQ_INITED 1 #define HNS_BUFFER_SIZE_2048 2048 @@ -2137,7 +2140,7 @@ hns_nic_tx_fini_pro_v2; netif_napi_add(priv->netdev, &rd->napi, - hns_nic_common_poll, NAPI_POLL_WEIGHT); + hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM); rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED; } for (i = h->q_num; i < h->q_num * 2; i++) { @@ -2150,7 +2153,7 @@ hns_nic_rx_fini_pro_v2; netif_napi_add(priv->netdev, &rd->napi, - hns_nic_common_poll, NAPI_POLL_WEIGHT); + hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM); rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED; } diff -u linux-gcp-4.15.0/include/linux/dmar.h linux-gcp-4.15.0/include/linux/dmar.h --- linux-gcp-4.15.0/include/linux/dmar.h +++ linux-gcp-4.15.0/include/linux/dmar.h @@ -273,6 +273,11 @@ #define PDA_LOW_BIT 26 #define PDA_HIGH_BIT 32 +enum { + IRQ_REMAP_XAPIC_MODE, + IRQ_REMAP_X2APIC_MODE, +}; + /* Can't use the common MSI interrupt functions * since DMAR is not a pci device */ diff -u linux-gcp-4.15.0/include/linux/pci_ids.h linux-gcp-4.15.0/include/linux/pci_ids.h --- linux-gcp-4.15.0/include/linux/pci_ids.h +++ linux-gcp-4.15.0/include/linux/pci_ids.h @@ -538,9 +538,6 @@ #define PCI_DEVICE_ID_AMD_16H_NB_F4 0x1534 #define PCI_DEVICE_ID_AMD_16H_M30H_NB_F3 0x1583 #define PCI_DEVICE_ID_AMD_16H_M30H_NB_F4 0x1584 -#define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463 -#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb -#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493 #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 #define PCI_DEVICE_ID_AMD_LANCE 0x2000 #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 reverted: --- linux-gcp-4.15.0/include/net/sock.h +++ linux-gcp-4.15.0.orig/include/net/sock.h @@ -1461,7 +1461,6 @@ lock_sock_nested(sk, 0); } -void __release_sock(struct sock *sk); void release_sock(struct sock *sk); /* BH context may only use the following locking interface. */ reverted: --- linux-gcp-4.15.0/net/bluetooth/hidp/sock.c +++ linux-gcp-4.15.0.orig/net/bluetooth/hidp/sock.c @@ -76,7 +76,6 @@ sockfd_put(csock); return err; } - ca.name[sizeof(ca.name)-1] = 0; err = hidp_connection_add(&ca, csock, isock); if (!err && copy_to_user(argp, &ca, sizeof(ca))) diff -u linux-gcp-4.15.0/net/core/sock.c linux-gcp-4.15.0/net/core/sock.c --- linux-gcp-4.15.0/net/core/sock.c +++ linux-gcp-4.15.0/net/core/sock.c @@ -2242,7 +2242,7 @@ finish_wait(&sk->sk_lock.wq, &wait); } -void __release_sock(struct sock *sk) +static void __release_sock(struct sock *sk) __releases(&sk->sk_lock.slock) __acquires(&sk->sk_lock.slock) { diff -u linux-gcp-4.15.0/net/ipv4/tcp.c linux-gcp-4.15.0/net/ipv4/tcp.c --- linux-gcp-4.15.0/net/ipv4/tcp.c +++ linux-gcp-4.15.0/net/ipv4/tcp.c @@ -2242,10 +2242,16 @@ sock_hold(sk); sock_orphan(sk); + /* It is the last release_sock in its life. It will remove backlog. */ + release_sock(sk); + + + /* Now socket is owned by kernel and we acquire BH lock + * to finish close. No need to check for user refs. + */ local_bh_disable(); bh_lock_sock(sk); - /* remove backlog if any, without releasing ownership. */ - __release_sock(sk); + WARN_ON(sock_owned_by_user(sk)); percpu_counter_inc(sk->sk_prot->orphan_count); @@ -2314,7 +2320,6 @@ out: bh_unlock_sock(sk); local_bh_enable(); - release_sock(sk); sock_put(sk); } EXPORT_SYMBOL(tcp_close); diff -u linux-gcp-4.15.0/net/ipv4/tcp_output.c linux-gcp-4.15.0/net/ipv4/tcp_output.c --- linux-gcp-4.15.0/net/ipv4/tcp_output.c +++ linux-gcp-4.15.0/net/ipv4/tcp_output.c @@ -1321,7 +1321,8 @@ if (nsize < 0) nsize = 0; - if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf)) { + if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf && + tcp_queue != TCP_FRAG_IN_WRITE_QUEUE)) { NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPWQUEUETOOBIG); return -ENOMEM; } diff -u linux-gcp-4.15.0/net/netlink/af_netlink.c linux-gcp-4.15.0/net/netlink/af_netlink.c --- linux-gcp-4.15.0/net/netlink/af_netlink.c +++ linux-gcp-4.15.0/net/netlink/af_netlink.c @@ -980,8 +980,8 @@ if (nlk->ngroups == 0) groups = 0; - else if (nlk->ngroups < 8*sizeof(groups)) - groups &= (1UL << nlk->ngroups) - 1; + else + groups &= (1ULL << nlk->ngroups) - 1; bound = nlk->bound; if (bound) { diff -u linux-gcp-4.15.0/sound/pci/hda/patch_realtek.c linux-gcp-4.15.0/sound/pci/hda/patch_realtek.c --- linux-gcp-4.15.0/sound/pci/hda/patch_realtek.c +++ linux-gcp-4.15.0/sound/pci/hda/patch_realtek.c @@ -118,7 +118,6 @@ int codec_variant; /* flag for other variants */ unsigned int has_alc5505_dsp:1; unsigned int no_depop_delay:1; - unsigned int no_shutup_pins:1; /* for PLL fix */ hda_nid_t pll_nid; @@ -430,48 +429,6 @@ set_eapd(codec, *p, on); } -static int find_ext_mic_pin(struct hda_codec *codec); - -static void alc_headset_mic_no_shutup(struct hda_codec *codec) -{ - const struct hda_pincfg *pin; - int mic_pin = find_ext_mic_pin(codec); - int i; - - /* don't shut up pins when unloading the driver; otherwise it breaks - * the default pin setup at the next load of the driver - */ - if (codec->bus->shutdown) - return; - - for (i = 0; i < codec->init_pins.used; i++) { - pin = snd_array_elem(&codec->init_pins, i); - /* use read here for syncing after issuing each verb */ - if (pin->nid != mic_pin) - snd_hda_codec_read(codec, pin->nid, 0, - AC_VERB_SET_PIN_WIDGET_CONTROL, 0); - } - - codec->pins_shutup = 1; -} - -static void alc_shutup_pins(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - - switch (codec->core.vendor_id) { - case 0x10ec0286: - case 0x10ec0288: - case 0x10ec0298: - alc_headset_mic_no_shutup(codec); - break; - default: - if (!spec->no_shutup_pins) - snd_hda_shutup_pins(codec); - break; - } -} - /* generic shutup callback; * just turning off EAPD and a little pause for avoiding pop-noise */ @@ -482,7 +439,7 @@ alc_auto_setup_eapd(codec, false); if (!spec->no_depop_delay) msleep(200); - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); } /* generic EAPD initialization */ @@ -839,7 +796,7 @@ if (spec && spec->shutup) spec->shutup(codec); else - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); } static void alc_reboot_notify(struct hda_codec *codec) @@ -2899,6 +2856,27 @@ return alc_parse_auto_config(codec, alc269_ignore, ssids); } +static int find_ext_mic_pin(struct hda_codec *codec); + +static void alc286_shutup(struct hda_codec *codec) +{ + int i; + int mic_pin = find_ext_mic_pin(codec); + /* don't shut up pins when unloading the driver; otherwise it breaks + * the default pin setup at the next load of the driver + */ + if (codec->bus->shutdown) + return; + for (i = 0; i < codec->init_pins.used; i++) { + struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i); + /* use read here for syncing after issuing each verb */ + if (pin->nid != mic_pin) + snd_hda_codec_read(codec, pin->nid, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0); + } + codec->pins_shutup = 1; +} + static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) { alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); @@ -2914,7 +2892,7 @@ (alc_get_coef0(codec) & 0x00ff) == 0x018) { msleep(150); } - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); } static struct coef_fw alc282_coefs[] = { @@ -3017,15 +2995,14 @@ if (hp_pin_sense) msleep(85); - if (!spec->no_shutup_pins) - snd_hda_codec_write(codec, hp_pin, 0, - AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); if (hp_pin_sense) msleep(100); alc_auto_setup_eapd(codec, false); - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); alc_write_coef_idx(codec, 0x78, coef78); } @@ -3141,16 +3118,15 @@ if (hp_pin_sense) msleep(100); - if (!spec->no_shutup_pins) - snd_hda_codec_write(codec, hp_pin, 0, - AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); alc_update_coef_idx(codec, 0x46, 0, 3 << 12); if (hp_pin_sense) msleep(100); alc_auto_setup_eapd(codec, false); - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); alc_write_coef_idx(codec, 0x43, 0x9614); } @@ -3216,15 +3192,14 @@ /* NOTE: call this before clearing the pin, otherwise codec stalls */ alc_update_coef_idx(codec, 0x46, 0, 3 << 12); - if (!spec->no_shutup_pins) - snd_hda_codec_write(codec, hp_pin, 0, - AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); if (hp_pin_sense) msleep(100); alc_auto_setup_eapd(codec, false); - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); } static void alc225_init(struct hda_codec *codec) @@ -3311,7 +3286,7 @@ msleep(100); alc_auto_setup_eapd(codec, false); - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); } static void alc_default_init(struct hda_codec *codec) @@ -3365,15 +3340,14 @@ if (hp_pin_sense) msleep(85); - if (!spec->no_shutup_pins) - snd_hda_codec_write(codec, hp_pin, 0, - AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); if (hp_pin_sense) msleep(100); alc_auto_setup_eapd(codec, false); - alc_shutup_pins(codec); + snd_hda_shutup_pins(codec); } static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, @@ -5007,12 +4981,16 @@ } } +static void alc_no_shutup(struct hda_codec *codec) +{ +} + static void alc_fixup_no_shutup(struct hda_codec *codec, const struct hda_fixup *fix, int action) { if (action == HDA_FIXUP_ACT_PROBE) { struct alc_spec *spec = codec->spec; - spec->no_shutup_pins = 1; + spec->shutup = alc_no_shutup; } } @@ -6570,7 +6548,6 @@ SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), - SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), @@ -7387,6 +7364,7 @@ case 0x10ec0286: case 0x10ec0288: spec->codec_variant = ALC269_TYPE_ALC286; + spec->shutup = alc286_shutup; break; case 0x10ec0298: spec->codec_variant = ALC269_TYPE_ALC298; reverted: --- linux-gcp-4.15.0/tools/testing/selftests/powerpc/alignment/Makefile +++ linux-gcp-4.15.0.orig/tools/testing/selftests/powerpc/alignment/Makefile @@ -1,5 +1,4 @@ +TEST_GEN_PROGS := copy_unaligned copy_first_unaligned paste_unaligned paste_last_unaligned -TEST_GEN_PROGS := copy_first_unaligned paste_unaligned \ - paste_last_unaligned alignment_handler include ../../lib.mk reverted: --- linux-gcp-4.15.0/tools/testing/selftests/powerpc/alignment/alignment_handler.c +++ linux-gcp-4.15.0.orig/tools/testing/selftests/powerpc/alignment/alignment_handler.c @@ -1,491 +0,0 @@ -/* - * Test the powerpc alignment handler on POWER8/POWER9 - * - * Copyright (C) 2017 IBM Corporation (Michael Neuling, Andrew Donnellan) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -/* - * This selftest exercises the powerpc alignment fault handler. - * - * We create two sets of source and destination buffers, one in regular memory, - * the other cache-inhibited (we use /dev/fb0 for this). - * - * We initialise the source buffers, then use whichever set of load/store - * instructions is under test to copy bytes from the source buffers to the - * destination buffers. For the regular buffers, these instructions will - * execute normally. For the cache-inhibited buffers, these instructions - * will trap and cause an alignment fault, and the alignment fault handler - * will emulate the particular instruction under test. We then compare the - * destination buffers to ensure that the native and emulated cases give the - * same result. - * - * TODO: - * - Any FIXMEs below - * - Test VSX regs < 32 and > 32 - * - Test all loads and stores - * - Check update forms do update register - * - Test alignment faults over page boundary - * - * Some old binutils may not support all the instructions. - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" - -int bufsize; -int debug; -int testing; -volatile int gotsig; - -void sighandler(int sig, siginfo_t *info, void *ctx) -{ - ucontext_t *ucp = ctx; - - if (!testing) { - signal(sig, SIG_DFL); - kill(0, sig); - } - gotsig = sig; -#ifdef __powerpc64__ - ucp->uc_mcontext.gp_regs[PT_NIP] += 4; -#else - ucp->uc_mcontext.uc_regs->gregs[PT_NIP] += 4; -#endif -} - -#define XFORM(reg, n) " " #reg " ,%"#n",%2 ;" -#define DFORM(reg, n) " " #reg " ,0(%"#n") ;" - -#define TEST(name, ld_op, st_op, form, ld_reg, st_reg) \ - void test_##name(char *s, char *d) \ - { \ - asm volatile( \ - #ld_op form(ld_reg, 0) \ - #st_op form(st_reg, 1) \ - :: "r"(s), "r"(d), "r"(0) \ - : "memory", "vs0", "vs32", "r31"); \ - } \ - rc |= do_test(#name, test_##name) - -#define LOAD_VSX_XFORM_TEST(op) TEST(op, op, stxvd2x, XFORM, 32, 32) -#define STORE_VSX_XFORM_TEST(op) TEST(op, lxvd2x, op, XFORM, 32, 32) -#define LOAD_VSX_DFORM_TEST(op) TEST(op, op, stxv, DFORM, 32, 32) -#define STORE_VSX_DFORM_TEST(op) TEST(op, lxv, op, DFORM, 32, 32) -#define LOAD_VMX_XFORM_TEST(op) TEST(op, op, stxvd2x, XFORM, 0, 32) -#define STORE_VMX_XFORM_TEST(op) TEST(op, lxvd2x, op, XFORM, 32, 0) -#define LOAD_VMX_DFORM_TEST(op) TEST(op, op, stxv, DFORM, 0, 32) -#define STORE_VMX_DFORM_TEST(op) TEST(op, lxv, op, DFORM, 32, 0) - -#define LOAD_XFORM_TEST(op) TEST(op, op, stdx, XFORM, 31, 31) -#define STORE_XFORM_TEST(op) TEST(op, ldx, op, XFORM, 31, 31) -#define LOAD_DFORM_TEST(op) TEST(op, op, std, DFORM, 31, 31) -#define STORE_DFORM_TEST(op) TEST(op, ld, op, DFORM, 31, 31) - -#define LOAD_FLOAT_DFORM_TEST(op) TEST(op, op, stfd, DFORM, 0, 0) -#define STORE_FLOAT_DFORM_TEST(op) TEST(op, lfd, op, DFORM, 0, 0) -#define LOAD_FLOAT_XFORM_TEST(op) TEST(op, op, stfdx, XFORM, 0, 0) -#define STORE_FLOAT_XFORM_TEST(op) TEST(op, lfdx, op, XFORM, 0, 0) - - -/* FIXME: Unimplemented tests: */ -// STORE_DFORM_TEST(stq) /* FIXME: need two registers for quad */ -// STORE_DFORM_TEST(stswi) /* FIXME: string instruction */ - -// STORE_XFORM_TEST(stwat) /* AMO can't emulate or run on CI */ -// STORE_XFORM_TEST(stdat) /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ - - -/* preload byte by byte */ -void preload_data(void *dst, int offset, int width) -{ - char *c = dst; - int i; - - c += offset; - - for (i = 0 ; i < width ; i++) - c[i] = i; -} - -int test_memcpy(void *dst, void *src, int size, int offset, - void (*test_func)(char *, char *)) -{ - char *s, *d; - - s = src; - s += offset; - d = dst; - d += offset; - - assert(size == 16); - gotsig = 0; - testing = 1; - - test_func(s, d); /* run the actual test */ - - testing = 0; - if (gotsig) { - if (debug) - printf(" Got signal %i\n", gotsig); - return 1; - } - return 0; -} - -void dumpdata(char *s1, char *s2, int n, char *test_name) -{ - int i; - - printf(" %s: unexpected result:\n", test_name); - printf(" mem:"); - for (i = 0; i < n; i++) - printf(" %02x", s1[i]); - printf("\n"); - printf(" ci: "); - for (i = 0; i < n; i++) - printf(" %02x", s2[i]); - printf("\n"); -} - -int test_memcmp(void *s1, void *s2, int n, int offset, char *test_name) -{ - char *s1c, *s2c; - - s1c = s1; - s1c += offset; - s2c = s2; - s2c += offset; - - if (memcmp(s1c, s2c, n)) { - if (debug) { - printf("\n Compare failed. Offset:%i length:%i\n", - offset, n); - dumpdata(s1c, s2c, n, test_name); - } - return 1; - } - return 0; -} - -/* - * Do two memcpy tests using the same instructions. One cachable - * memory and the other doesn't. - */ -int do_test(char *test_name, void (*test_func)(char *, char *)) -{ - int offset, width, fd, rc = 0, r; - void *mem0, *mem1, *ci0, *ci1; - - printf("\tDoing %s:\t", test_name); - - fd = open("/dev/fb0", O_RDWR); - if (fd < 0) { - printf("\n"); - perror("Can't open /dev/fb0"); - SKIP_IF(1); - } - - ci0 = mmap(NULL, bufsize, PROT_WRITE, MAP_SHARED, - fd, 0x0); - ci1 = mmap(NULL, bufsize, PROT_WRITE, MAP_SHARED, - fd, bufsize); - if ((ci0 == MAP_FAILED) || (ci1 == MAP_FAILED)) { - printf("\n"); - perror("mmap failed"); - SKIP_IF(1); - } - - rc = posix_memalign(&mem0, bufsize, bufsize); - if (rc) { - printf("\n"); - return rc; - } - - rc = posix_memalign(&mem1, bufsize, bufsize); - if (rc) { - printf("\n"); - free(mem0); - return rc; - } - - /* offset = 0 no alignment fault, so skip */ - for (offset = 1; offset < 16; offset++) { - width = 16; /* vsx == 16 bytes */ - r = 0; - - /* load pattern into memory byte by byte */ - preload_data(ci0, offset, width); - preload_data(mem0, offset, width); // FIXME: remove?? - memcpy(ci0, mem0, bufsize); - memcpy(ci1, mem1, bufsize); /* initialise output to the same */ - - /* sanity check */ - test_memcmp(mem0, ci0, width, offset, test_name); - - r |= test_memcpy(ci1, ci0, width, offset, test_func); - r |= test_memcpy(mem1, mem0, width, offset, test_func); - if (r && !debug) { - printf("FAILED: Got signal"); - break; - } - - r |= test_memcmp(mem1, ci1, width, offset, test_name); - rc |= r; - if (r && !debug) { - printf("FAILED: Wrong Data"); - break; - } - } - if (!r) - printf("PASSED"); - printf("\n"); - - munmap(ci0, bufsize); - munmap(ci1, bufsize); - free(mem0); - free(mem1); - - return rc; -} - -int test_alignment_handler_vsx_206(void) -{ - int rc = 0; - - printf("VSX: 2.06B\n"); - LOAD_VSX_XFORM_TEST(lxvd2x); - LOAD_VSX_XFORM_TEST(lxvw4x); - LOAD_VSX_XFORM_TEST(lxsdx); - LOAD_VSX_XFORM_TEST(lxvdsx); - STORE_VSX_XFORM_TEST(stxvd2x); - STORE_VSX_XFORM_TEST(stxvw4x); - STORE_VSX_XFORM_TEST(stxsdx); - return rc; -} - -int test_alignment_handler_vsx_207(void) -{ - int rc = 0; - - printf("VSX: 2.07B\n"); - LOAD_VSX_XFORM_TEST(lxsspx); - LOAD_VSX_XFORM_TEST(lxsiwax); - LOAD_VSX_XFORM_TEST(lxsiwzx); - STORE_VSX_XFORM_TEST(stxsspx); - STORE_VSX_XFORM_TEST(stxsiwx); - return rc; -} - -int test_alignment_handler_vsx_300(void) -{ - int rc = 0; - - SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_3_00)); - printf("VSX: 3.00B\n"); - LOAD_VMX_DFORM_TEST(lxsd); - LOAD_VSX_XFORM_TEST(lxsibzx); - LOAD_VSX_XFORM_TEST(lxsihzx); - LOAD_VMX_DFORM_TEST(lxssp); - LOAD_VSX_DFORM_TEST(lxv); - LOAD_VSX_XFORM_TEST(lxvb16x); - LOAD_VSX_XFORM_TEST(lxvh8x); - LOAD_VSX_XFORM_TEST(lxvx); - LOAD_VSX_XFORM_TEST(lxvwsx); - LOAD_VSX_XFORM_TEST(lxvl); - LOAD_VSX_XFORM_TEST(lxvll); - STORE_VMX_DFORM_TEST(stxsd); - STORE_VSX_XFORM_TEST(stxsibx); - STORE_VSX_XFORM_TEST(stxsihx); - STORE_VMX_DFORM_TEST(stxssp); - STORE_VSX_DFORM_TEST(stxv); - STORE_VSX_XFORM_TEST(stxvb16x); - STORE_VSX_XFORM_TEST(stxvh8x); - STORE_VSX_XFORM_TEST(stxvx); - STORE_VSX_XFORM_TEST(stxvl); - STORE_VSX_XFORM_TEST(stxvll); - return rc; -} - -int test_alignment_handler_integer(void) -{ - int rc = 0; - - printf("Integer\n"); - LOAD_DFORM_TEST(lbz); - LOAD_DFORM_TEST(lbzu); - LOAD_XFORM_TEST(lbzx); - LOAD_XFORM_TEST(lbzux); - LOAD_DFORM_TEST(lhz); - LOAD_DFORM_TEST(lhzu); - LOAD_XFORM_TEST(lhzx); - LOAD_XFORM_TEST(lhzux); - LOAD_DFORM_TEST(lha); - LOAD_DFORM_TEST(lhau); - LOAD_XFORM_TEST(lhax); - LOAD_XFORM_TEST(lhaux); - LOAD_XFORM_TEST(lhbrx); - LOAD_DFORM_TEST(lwz); - LOAD_DFORM_TEST(lwzu); - LOAD_XFORM_TEST(lwzx); - LOAD_XFORM_TEST(lwzux); - LOAD_DFORM_TEST(lwa); - LOAD_XFORM_TEST(lwax); - LOAD_XFORM_TEST(lwaux); - LOAD_XFORM_TEST(lwbrx); - LOAD_DFORM_TEST(ld); - LOAD_DFORM_TEST(ldu); - LOAD_XFORM_TEST(ldx); - LOAD_XFORM_TEST(ldux); - LOAD_XFORM_TEST(ldbrx); - LOAD_DFORM_TEST(lmw); - STORE_DFORM_TEST(stb); - STORE_XFORM_TEST(stbx); - STORE_DFORM_TEST(stbu); - STORE_XFORM_TEST(stbux); - STORE_DFORM_TEST(sth); - STORE_XFORM_TEST(sthx); - STORE_DFORM_TEST(sthu); - STORE_XFORM_TEST(sthux); - STORE_XFORM_TEST(sthbrx); - STORE_DFORM_TEST(stw); - STORE_XFORM_TEST(stwx); - STORE_DFORM_TEST(stwu); - STORE_XFORM_TEST(stwux); - STORE_XFORM_TEST(stwbrx); - STORE_DFORM_TEST(std); - STORE_XFORM_TEST(stdx); - STORE_DFORM_TEST(stdu); - STORE_XFORM_TEST(stdux); - STORE_XFORM_TEST(stdbrx); - STORE_DFORM_TEST(stmw); - return rc; -} - -int test_alignment_handler_vmx(void) -{ - int rc = 0; - - printf("VMX\n"); - LOAD_VMX_XFORM_TEST(lvx); - - /* - * FIXME: These loads only load part of the register, so our - * testing method doesn't work. Also they don't take alignment - * faults, so it's kinda pointless anyway - * - LOAD_VMX_XFORM_TEST(lvebx) - LOAD_VMX_XFORM_TEST(lvehx) - LOAD_VMX_XFORM_TEST(lvewx) - LOAD_VMX_XFORM_TEST(lvxl) - */ - STORE_VMX_XFORM_TEST(stvx); - STORE_VMX_XFORM_TEST(stvebx); - STORE_VMX_XFORM_TEST(stvehx); - STORE_VMX_XFORM_TEST(stvewx); - STORE_VMX_XFORM_TEST(stvxl); - return rc; -} - -int test_alignment_handler_fp(void) -{ - int rc = 0; - - printf("Floating point\n"); - LOAD_FLOAT_DFORM_TEST(lfd); - LOAD_FLOAT_XFORM_TEST(lfdx); - LOAD_FLOAT_DFORM_TEST(lfdp); - LOAD_FLOAT_XFORM_TEST(lfdpx); - LOAD_FLOAT_DFORM_TEST(lfdu); - LOAD_FLOAT_XFORM_TEST(lfdux); - LOAD_FLOAT_DFORM_TEST(lfs); - LOAD_FLOAT_XFORM_TEST(lfsx); - LOAD_FLOAT_DFORM_TEST(lfsu); - LOAD_FLOAT_XFORM_TEST(lfsux); - LOAD_FLOAT_XFORM_TEST(lfiwzx); - LOAD_FLOAT_XFORM_TEST(lfiwax); - STORE_FLOAT_DFORM_TEST(stfd); - STORE_FLOAT_XFORM_TEST(stfdx); - STORE_FLOAT_DFORM_TEST(stfdp); - STORE_FLOAT_XFORM_TEST(stfdpx); - STORE_FLOAT_DFORM_TEST(stfdu); - STORE_FLOAT_XFORM_TEST(stfdux); - STORE_FLOAT_DFORM_TEST(stfs); - STORE_FLOAT_XFORM_TEST(stfsx); - STORE_FLOAT_DFORM_TEST(stfsu); - STORE_FLOAT_XFORM_TEST(stfsux); - STORE_FLOAT_XFORM_TEST(stfiwx); - - return rc; -} - -void usage(char *prog) -{ - printf("Usage: %s [options]\n", prog); - printf(" -d Enable debug error output\n"); - printf("\n"); - printf("This test requires a POWER8 or POWER9 CPU and a usable "); - printf("framebuffer at /dev/fb0.\n"); -} - -int main(int argc, char *argv[]) -{ - - struct sigaction sa; - int rc = 0; - int option = 0; - - while ((option = getopt(argc, argv, "d")) != -1) { - switch (option) { - case 'd': - debug++; - break; - default: - usage(argv[0]); - exit(1); - } - } - - bufsize = getpagesize(); - - sa.sa_sigaction = sighandler; - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_SIGINFO; - if (sigaction(SIGSEGV, &sa, NULL) == -1 - || sigaction(SIGBUS, &sa, NULL) == -1 - || sigaction(SIGILL, &sa, NULL) == -1) { - perror("sigaction"); - exit(1); - } - - rc |= test_harness(test_alignment_handler_vsx_206, - "test_alignment_handler_vsx_206"); - rc |= test_harness(test_alignment_handler_vsx_207, - "test_alignment_handler_vsx_207"); - rc |= test_harness(test_alignment_handler_vsx_300, - "test_alignment_handler_vsx_300"); - rc |= test_harness(test_alignment_handler_integer, - "test_alignment_handler_integer"); - rc |= test_harness(test_alignment_handler_vmx, - "test_alignment_handler_vmx"); - rc |= test_harness(test_alignment_handler_fp, - "test_alignment_handler_fp"); - return rc; -} diff -u linux-gcp-4.15.0/tools/testing/selftests/seccomp/seccomp_bpf.c linux-gcp-4.15.0/tools/testing/selftests/seccomp/seccomp_bpf.c --- linux-gcp-4.15.0/tools/testing/selftests/seccomp/seccomp_bpf.c +++ linux-gcp-4.15.0/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -1563,16 +1563,7 @@ #ifdef SYSCALL_NUM_RET_SHARE_REG # define EXPECT_SYSCALL_RETURN(val, action) EXPECT_EQ(-1, action) #else -# define EXPECT_SYSCALL_RETURN(val, action) \ - do { \ - errno = 0; \ - if (val < 0) { \ - EXPECT_EQ(-1, action); \ - EXPECT_EQ(-(val), errno); \ - } else { \ - EXPECT_EQ(val, action); \ - } \ - } while (0) +# define EXPECT_SYSCALL_RETURN(val, action) EXPECT_EQ(val, action) #endif /* Use PTRACE_GETREGS and PTRACE_SETREGS when available. This is useful for @@ -1611,7 +1602,7 @@ /* Architecture-specific syscall changing routine. */ void change_syscall(struct __test_metadata *_metadata, - pid_t tracee, int syscall, int result) + pid_t tracee, int syscall) { int ret; ARCH_REGS regs; @@ -1670,7 +1661,7 @@ #ifdef SYSCALL_NUM_RET_SHARE_REG TH_LOG("Can't modify syscall return on this architecture"); #else - regs.SYSCALL_RET = result; + regs.SYSCALL_RET = EPERM; #endif #ifdef HAVE_GETREGS @@ -1698,19 +1689,14 @@ case 0x1002: /* change getpid to getppid. */ EXPECT_EQ(__NR_getpid, get_syscall(_metadata, tracee)); - change_syscall(_metadata, tracee, __NR_getppid, 0); + change_syscall(_metadata, tracee, __NR_getppid); break; case 0x1003: - /* skip gettid with valid return code. */ + /* skip gettid. */ EXPECT_EQ(__NR_gettid, get_syscall(_metadata, tracee)); - change_syscall(_metadata, tracee, -1, 45000); + change_syscall(_metadata, tracee, -1); break; case 0x1004: - /* skip openat with error. */ - EXPECT_EQ(__NR_openat, get_syscall(_metadata, tracee)); - change_syscall(_metadata, tracee, -1, -ESRCH); - break; - case 0x1005: /* do nothing (allow getppid) */ EXPECT_EQ(__NR_getppid, get_syscall(_metadata, tracee)); break; @@ -1743,11 +1729,9 @@ nr = get_syscall(_metadata, tracee); if (nr == __NR_getpid) - change_syscall(_metadata, tracee, __NR_getppid, 0); - if (nr == __NR_gettid) - change_syscall(_metadata, tracee, -1, 45000); + change_syscall(_metadata, tracee, __NR_getppid); if (nr == __NR_openat) - change_syscall(_metadata, tracee, -1, -ESRCH); + change_syscall(_metadata, tracee, -1); } FIXTURE_DATA(TRACE_syscall) { @@ -1764,10 +1748,8 @@ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE | 0x1002), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_gettid, 0, 1), BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE | 0x1003), - BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_openat, 0, 1), - BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE | 0x1004), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_getppid, 0, 1), - BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE | 0x1005), + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE | 0x1004), BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), }; @@ -1815,26 +1797,15 @@ EXPECT_NE(self->mypid, syscall(__NR_getpid)); } -TEST_F(TRACE_syscall, ptrace_syscall_errno) -{ - /* Swap SECCOMP_RET_TRACE tracer for PTRACE_SYSCALL tracer. */ - teardown_trace_fixture(_metadata, self->tracer); - self->tracer = setup_trace_fixture(_metadata, tracer_ptrace, NULL, - true); - - /* Tracer should skip the open syscall, resulting in ESRCH. */ - EXPECT_SYSCALL_RETURN(-ESRCH, syscall(__NR_openat)); -} - -TEST_F(TRACE_syscall, ptrace_syscall_faked) +TEST_F(TRACE_syscall, ptrace_syscall_dropped) { /* Swap SECCOMP_RET_TRACE tracer for PTRACE_SYSCALL tracer. */ teardown_trace_fixture(_metadata, self->tracer); self->tracer = setup_trace_fixture(_metadata, tracer_ptrace, NULL, true); - /* Tracer should skip the gettid syscall, resulting fake pid. */ - EXPECT_SYSCALL_RETURN(45000, syscall(__NR_gettid)); + /* Tracer should skip the open syscall, resulting in EPERM. */ + EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_openat)); } TEST_F(TRACE_syscall, syscall_allowed) @@ -1867,21 +1838,7 @@ EXPECT_NE(self->mypid, syscall(__NR_getpid)); } -TEST_F(TRACE_syscall, syscall_errno) -{ - long ret; - - ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); - ASSERT_EQ(0, ret); - - ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &self->prog, 0, 0); - ASSERT_EQ(0, ret); - - /* openat has been skipped and an errno return. */ - EXPECT_SYSCALL_RETURN(-ESRCH, syscall(__NR_openat)); -} - -TEST_F(TRACE_syscall, syscall_faked) +TEST_F(TRACE_syscall, syscall_dropped) { long ret; @@ -1892,7 +1849,8 @@ ASSERT_EQ(0, ret); /* gettid has been skipped and an altered return value stored. */ - EXPECT_SYSCALL_RETURN(45000, syscall(__NR_gettid)); + EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_gettid)); + EXPECT_NE(self->mytid, syscall(__NR_gettid)); } TEST_F(TRACE_syscall, skip_after_RET_TRACE) diff -u linux-gcp-4.15.0/zfs/META linux-gcp-4.15.0/zfs/META --- linux-gcp-4.15.0/zfs/META +++ linux-gcp-4.15.0/zfs/META @@ -2,7 +2,7 @@ Name: zfs Branch: 1.0 Version: 0.7.5 -Release: 1ubuntu16.5 +Release: 1ubuntu16.4 Release-Tags: relext License: CDDL Author: OpenZFS on Linux diff -u linux-gcp-4.15.0/zfs/include/sys/trace_dmu.h linux-gcp-4.15.0/zfs/include/sys/trace_dmu.h --- linux-gcp-4.15.0/zfs/include/sys/trace_dmu.h +++ linux-gcp-4.15.0/zfs/include/sys/trace_dmu.h @@ -50,7 +50,7 @@ __field(uint64_t, tx_lastsnap_txg) __field(uint64_t, tx_lasttried_txg) __field(boolean_t, tx_anyobj) - __field(boolean_t, tx_waited) + __field(boolean_t, tx_dirty_delayed) __field(hrtime_t, tx_start) __field(boolean_t, tx_wait_dirty) __field(int, tx_err) @@ -62,7 +62,7 @@ __entry->tx_lastsnap_txg = tx->tx_lastsnap_txg; __entry->tx_lasttried_txg = tx->tx_lasttried_txg; __entry->tx_anyobj = tx->tx_anyobj; - __entry->tx_waited = tx->tx_waited; + __entry->tx_dirty_delayed = tx->tx_dirty_delayed; __entry->tx_start = tx->tx_start; __entry->tx_wait_dirty = tx->tx_wait_dirty; __entry->tx_err = tx->tx_err; @@ -74,7 +74,7 @@ "} dirty %llu min_tx_time %llu", __entry->tx_txg, __entry->tx_lastsnap_txg, __entry->tx_lasttried_txg, __entry->tx_anyobj, - __entry->tx_waited, __entry->tx_start, + __entry->tx_dirty_delayed, __entry->tx_start, __entry->tx_wait_dirty, __entry->tx_err, __entry->dirty, __entry->min_tx_time) );