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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
[S390] kvm: extension capability for new address space layout
[S390] kvm: fix address mode switching

+17 -10
+2
arch/s390/include/asm/pgtable.h
··· 658 658 * struct gmap_struct - guest address space 659 659 * @mm: pointer to the parent mm_struct 660 660 * @table: pointer to the page directory 661 + * @asce: address space control element for gmap page table 661 662 * @crst_list: list of all crst tables used in the guest address space 662 663 */ 663 664 struct gmap { 664 665 struct list_head list; 665 666 struct mm_struct *mm; 666 667 unsigned long *table; 668 + unsigned long asce; 667 669 struct list_head crst_list; 668 670 }; 669 671
+3
arch/s390/kernel/asm-offsets.c
··· 10 10 #include <linux/sched.h> 11 11 #include <asm/vdso.h> 12 12 #include <asm/sigp.h> 13 + #include <asm/pgtable.h> 13 14 14 15 /* 15 16 * Make sure that the compiler is new enough. We want a compiler that ··· 127 126 DEFINE(__LC_KERNEL_STACK, offsetof(struct _lowcore, kernel_stack)); 128 127 DEFINE(__LC_ASYNC_STACK, offsetof(struct _lowcore, async_stack)); 129 128 DEFINE(__LC_PANIC_STACK, offsetof(struct _lowcore, panic_stack)); 129 + DEFINE(__LC_USER_ASCE, offsetof(struct _lowcore, user_asce)); 130 130 DEFINE(__LC_INT_CLOCK, offsetof(struct _lowcore, int_clock)); 131 131 DEFINE(__LC_MCCK_CLOCK, offsetof(struct _lowcore, mcck_clock)); 132 132 DEFINE(__LC_MACHINE_FLAGS, offsetof(struct _lowcore, machine_flags)); ··· 153 151 DEFINE(__LC_VDSO_PER_CPU, offsetof(struct _lowcore, vdso_per_cpu_data)); 154 152 DEFINE(__LC_GMAP, offsetof(struct _lowcore, gmap)); 155 153 DEFINE(__LC_CMF_HPP, offsetof(struct _lowcore, cmf_hpp)); 154 + DEFINE(__GMAP_ASCE, offsetof(struct gmap, asce)); 156 155 #endif /* CONFIG_32BIT */ 157 156 return 0; 158 157 }
+6
arch/s390/kernel/entry64.S
··· 1076 1076 lg %r14,__LC_THREAD_INFO # pointer thread_info struct 1077 1077 tm __TI_flags+7(%r14),_TIF_EXIT_SIE 1078 1078 jnz sie_exit 1079 + lg %r14,__LC_GMAP # get gmap pointer 1080 + ltgr %r14,%r14 1081 + jz sie_gmap 1082 + lctlg %c1,%c1,__GMAP_ASCE(%r14) # load primary asce 1083 + sie_gmap: 1079 1084 lg %r14,__SF_EMPTY(%r15) # get control block pointer 1080 1085 SPP __SF_EMPTY(%r15) # set guest id 1081 1086 sie 0(%r14) ··· 1088 1083 SPP __LC_CMF_HPP # set host id 1089 1084 lg %r14,__LC_THREAD_INFO # pointer thread_info struct 1090 1085 sie_exit: 1086 + lctlg %c1,%c1,__LC_USER_ASCE # load primary asce 1091 1087 ni __TI_flags+6(%r14),255-(_TIF_SIE>>8) 1092 1088 lg %r14,__SF_EMPTY+8(%r15) # load guest register save area 1093 1089 stmg %r0,%r13,0(%r14) # save guest gprs 0-13
+3 -2
arch/s390/kvm/kvm-s390.c
··· 123 123 124 124 switch (ext) { 125 125 case KVM_CAP_S390_PSW: 126 + case KVM_CAP_S390_GMAP: 126 127 r = 1; 127 128 break; 128 129 default: ··· 264 263 vcpu->arch.guest_fpregs.fpc &= FPC_VALID_MASK; 265 264 restore_fp_regs(&vcpu->arch.guest_fpregs); 266 265 restore_access_regs(vcpu->arch.guest_acrs); 266 + gmap_enable(vcpu->arch.gmap); 267 267 } 268 268 269 269 void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) 270 270 { 271 + gmap_disable(vcpu->arch.gmap); 271 272 save_fp_regs(&vcpu->arch.guest_fpregs); 272 273 save_access_regs(vcpu->arch.guest_acrs); 273 274 restore_fp_regs(&vcpu->arch.host_fpregs); ··· 464 461 local_irq_disable(); 465 462 kvm_guest_enter(); 466 463 local_irq_enable(); 467 - gmap_enable(vcpu->arch.gmap); 468 464 VCPU_EVENT(vcpu, 6, "entering sie flags %x", 469 465 atomic_read(&vcpu->arch.sie_block->cpuflags)); 470 466 if (sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs)) { ··· 472 470 } 473 471 VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", 474 472 vcpu->arch.sie_block->icptcode); 475 - gmap_disable(vcpu->arch.gmap); 476 473 local_irq_disable(); 477 474 kvm_guest_exit(); 478 475 local_irq_enable();
+2 -8
arch/s390/mm/pgtable.c
··· 160 160 table = (unsigned long *) page_to_phys(page); 161 161 crst_table_init(table, _REGION1_ENTRY_EMPTY); 162 162 gmap->table = table; 163 + gmap->asce = _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH | 164 + _ASCE_USER_BITS | __pa(table); 163 165 list_add(&gmap->list, &mm->context.gmap_list); 164 166 return gmap; 165 167 ··· 242 240 */ 243 241 void gmap_enable(struct gmap *gmap) 244 242 { 245 - /* Load primary space page table origin. */ 246 - S390_lowcore.user_asce = _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH | 247 - _ASCE_USER_BITS | __pa(gmap->table); 248 - asm volatile("lctlg 1,1,%0\n" : : "m" (S390_lowcore.user_asce) ); 249 243 S390_lowcore.gmap = (unsigned long) gmap; 250 244 } 251 245 EXPORT_SYMBOL_GPL(gmap_enable); ··· 252 254 */ 253 255 void gmap_disable(struct gmap *gmap) 254 256 { 255 - /* Load primary space page table origin. */ 256 - S390_lowcore.user_asce = 257 - gmap->mm->context.asce_bits | __pa(gmap->mm->pgd); 258 - asm volatile("lctlg 1,1,%0\n" : : "m" (S390_lowcore.user_asce) ); 259 257 S390_lowcore.gmap = 0UL; 260 258 } 261 259 EXPORT_SYMBOL_GPL(gmap_disable);
+1
include/linux/kvm.h
··· 553 553 #define KVM_CAP_SPAPR_TCE 63 554 554 #define KVM_CAP_PPC_SMT 64 555 555 #define KVM_CAP_PPC_RMA 65 556 + #define KVM_CAP_S390_GMAP 71 556 557 557 558 #ifdef KVM_CAP_IRQ_ROUTING 558 559