Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fixes' into next

Merge our fixes branch from this cycle. In particular this brings in a
papr_scm.c change which a subsequent patch has a dependency on.

+57 -29
+7 -2
arch/powerpc/kernel/vdso/gettimeofday.S
··· 22 22 .macro cvdso_call funct call_time=0 23 23 .cfi_startproc 24 24 PPC_STLU r1, -PPC_MIN_STKFRM(r1) 25 + .cfi_adjust_cfa_offset PPC_MIN_STKFRM 25 26 mflr r0 26 - .cfi_register lr, r0 27 27 PPC_STLU r1, -PPC_MIN_STKFRM(r1) 28 + .cfi_adjust_cfa_offset PPC_MIN_STKFRM 28 29 PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) 30 + .cfi_rel_offset lr, PPC_MIN_STKFRM + PPC_LR_STKOFF 29 31 #ifdef __powerpc64__ 30 32 PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1) 33 + .cfi_rel_offset r2, PPC_MIN_STKFRM + STK_GOT 31 34 #endif 32 35 get_datapage r5 33 36 .ifeq \call_time ··· 42 39 PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) 43 40 #ifdef __powerpc64__ 44 41 PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1) 42 + .cfi_restore r2 45 43 #endif 46 44 .ifeq \call_time 47 45 cmpwi r3, 0 48 46 .endif 49 47 mtlr r0 50 - .cfi_restore lr 51 48 addi r1, r1, 2 * PPC_MIN_STKFRM 49 + .cfi_restore lr 50 + .cfi_def_cfa_offset 0 52 51 crclr so 53 52 .ifeq \call_time 54 53 beqlr+
+21 -5
arch/powerpc/kvm/book3s_32_sr.S
··· 122 122 123 123 /* 0x0 - 0xb */ 124 124 125 - /* 'current->mm' needs to be in r4 */ 126 - tophys(r4, r2) 127 - lwz r4, MM(r4) 128 - tophys(r4, r4) 129 - /* This only clobbers r0, r3, r4 and r5 */ 125 + /* switch_mmu_context() needs paging, let's enable it */ 126 + mfmsr r9 127 + ori r11, r9, MSR_DR 128 + mtmsr r11 129 + sync 130 + 131 + /* switch_mmu_context() clobbers r12, rescue it */ 132 + SAVE_GPR(12, r1) 133 + 134 + /* Calling switch_mmu_context(<inv>, current->mm, <inv>); */ 135 + lwz r4, MM(r2) 130 136 bl switch_mmu_context 137 + 138 + /* restore r12 */ 139 + REST_GPR(12, r1) 140 + 141 + /* Disable paging again */ 142 + mfmsr r9 143 + li r6, MSR_DR 144 + andc r9, r9, r6 145 + mtmsr r9 146 + sync 131 147 132 148 .endm
+2 -5
arch/powerpc/platforms/pseries/papr_scm.c
··· 462 462 { 463 463 struct papr_scm_perf_stat *stat; 464 464 struct papr_scm_perf_stats *stats; 465 - char *statid; 466 465 int index, rc, count; 467 466 u32 available_events; 468 467 ··· 492 493 493 494 for (index = 0, stat = stats->scm_statistic, count = 0; 494 495 index < available_events; index++, ++stat) { 495 - statid = kzalloc(strlen(stat->stat_id) + 1, GFP_KERNEL); 496 - if (!statid) { 496 + p->nvdimm_events_map[count] = kmemdup_nul(stat->stat_id, 8, GFP_KERNEL); 497 + if (!p->nvdimm_events_map[count]) { 497 498 rc = -ENOMEM; 498 499 goto out_nvdimm_events_map; 499 500 } 500 501 501 - strcpy(statid, stat->stat_id); 502 - p->nvdimm_events_map[count] = statid; 503 502 count++; 504 503 } 505 504 p->nvdimm_events_map[count] = NULL;
+14 -5
arch/powerpc/platforms/pseries/vas-sysfs.c
··· 27 27 28 28 /* 29 29 * This function is used to get the notification from the drmgr when 30 - * QoS credits are changed. Though receiving the target total QoS 31 - * credits here, get the official QoS capabilities from the hypervisor. 30 + * QoS credits are changed. 32 31 */ 33 - static ssize_t update_total_credits_trigger(struct vas_cop_feat_caps *caps, 32 + static ssize_t update_total_credits_store(struct vas_cop_feat_caps *caps, 34 33 const char *buf, size_t count) 35 34 { 36 35 int err; 37 36 u16 creds; 38 37 39 38 err = kstrtou16(buf, 0, &creds); 39 + /* 40 + * The user space interface from the management console 41 + * notifies OS with the new QoS credits and then the 42 + * hypervisor. So OS has to use this new credits value 43 + * and reconfigure VAS windows (close or reopen depends 44 + * on the credits available) instead of depending on VAS 45 + * QoS capabilities from the hypervisor. 46 + */ 40 47 if (!err) 41 - err = vas_reconfig_capabilties(caps->win_type); 48 + err = vas_reconfig_capabilties(caps->win_type, creds); 42 49 43 50 if (err) 44 51 return -EINVAL; 52 + 53 + pr_info("Set QoS total credits %u\n", creds); 45 54 46 55 return count; 47 56 } ··· 101 92 VAS_ATTR_RO(nr_used_credits); 102 93 103 94 static struct vas_sysfs_entry update_total_credits_attribute = 104 - __ATTR(update_total_credits, 0200, NULL, update_total_credits_trigger); 95 + __ATTR(update_total_credits, 0200, NULL, update_total_credits_store); 105 96 106 97 static struct attribute *vas_def_capab_attrs[] = { 107 98 &nr_total_credits_attribute.attr,
+12 -11
arch/powerpc/platforms/pseries/vas.c
··· 779 779 * changes. Reconfig window configurations based on the credits 780 780 * availability from this new capabilities. 781 781 */ 782 - int vas_reconfig_capabilties(u8 type) 782 + int vas_reconfig_capabilties(u8 type, int new_nr_creds) 783 783 { 784 784 struct vas_cop_feat_caps *caps; 785 - int old_nr_creds, new_nr_creds; 785 + int old_nr_creds; 786 786 struct vas_caps *vcaps; 787 787 int rc = 0, nr_active_wins; 788 788 ··· 795 795 caps = &vcaps->caps; 796 796 797 797 mutex_lock(&vas_pseries_mutex); 798 - rc = h_query_vas_capabilities(H_QUERY_VAS_CAPABILITIES, vcaps->feat, 799 - (u64)virt_to_phys(&hv_cop_caps)); 800 - if (rc) 801 - goto out; 802 - 803 - new_nr_creds = be16_to_cpu(hv_cop_caps.target_lpar_creds); 804 798 805 799 old_nr_creds = atomic_read(&caps->nr_total_credits); 806 800 ··· 826 832 false); 827 833 } 828 834 829 - out: 830 835 mutex_unlock(&vas_pseries_mutex); 831 836 return rc; 832 837 } ··· 843 850 struct of_reconfig_data *rd = data; 844 851 struct device_node *dn = rd->dn; 845 852 const __be32 *intserv = NULL; 846 - int len, rc = 0; 853 + int new_nr_creds, len, rc = 0; 847 854 848 855 if ((action == OF_RECONFIG_ATTACH_NODE) || 849 856 (action == OF_RECONFIG_DETACH_NODE)) ··· 855 862 if (!intserv) 856 863 return NOTIFY_OK; 857 864 858 - rc = vas_reconfig_capabilties(VAS_GZIP_DEF_FEAT_TYPE); 865 + rc = h_query_vas_capabilities(H_QUERY_VAS_CAPABILITIES, 866 + vascaps[VAS_GZIP_DEF_FEAT_TYPE].feat, 867 + (u64)virt_to_phys(&hv_cop_caps)); 868 + if (!rc) { 869 + new_nr_creds = be16_to_cpu(hv_cop_caps.target_lpar_creds); 870 + rc = vas_reconfig_capabilties(VAS_GZIP_DEF_FEAT_TYPE, 871 + new_nr_creds); 872 + } 873 + 859 874 if (rc) 860 875 pr_err("Failed reconfig VAS capabilities with DLPAR\n"); 861 876
+1 -1
arch/powerpc/platforms/pseries/vas.h
··· 135 135 }; 136 136 137 137 int sysfs_add_vas_caps(struct vas_cop_feat_caps *caps); 138 - int vas_reconfig_capabilties(u8 type); 138 + int vas_reconfig_capabilties(u8 type, int new_nr_creds); 139 139 int __init sysfs_pseries_vas_init(struct vas_all_caps *vas_caps); 140 140 141 141 #ifdef CONFIG_PPC_VAS