diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-07 13:46:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-07 13:46:09 -0400 |
commit | 9cf9d28e9bf991af21fc4bbf33281b66843b094b (patch) | |
tree | f7036272a25b2084439c7293f13bd20a15c1362a /arch | |
parent | ff1649ff780fb7c0bfbf42d05ffc9b56336b9aa3 (diff) | |
parent | 53cb780adbe69df90c8dc23e992ce40455e687c3 (diff) |
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: Read buffer overflow
[S390] kernel: Storing machine flags early in lowcore
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/early.c | 3 | ||||
-rw-r--r-- | arch/s390/kvm/sigp.c | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index 8d15314381e0..cae14c499511 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -208,6 +208,9 @@ static noinline __init void detect_machine_type(void) | |||
208 | machine_flags |= MACHINE_FLAG_KVM; | 208 | machine_flags |= MACHINE_FLAG_KVM; |
209 | else | 209 | else |
210 | machine_flags |= MACHINE_FLAG_VM; | 210 | machine_flags |= MACHINE_FLAG_VM; |
211 | |||
212 | /* Store machine flags for setting up lowcore early */ | ||
213 | S390_lowcore.machine_flags = machine_flags; | ||
211 | } | 214 | } |
212 | 215 | ||
213 | static __init void early_pgm_check_handler(void) | 216 | static __init void early_pgm_check_handler(void) |
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index 36678835034d..0ef81d6776e9 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c | |||
@@ -169,7 +169,7 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
169 | unsigned long *reg) | 169 | unsigned long *reg) |
170 | { | 170 | { |
171 | struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; | 171 | struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; |
172 | struct kvm_s390_local_interrupt *li; | 172 | struct kvm_s390_local_interrupt *li = NULL; |
173 | struct kvm_s390_interrupt_info *inti; | 173 | struct kvm_s390_interrupt_info *inti; |
174 | int rc; | 174 | int rc; |
175 | u8 tmp; | 175 | u8 tmp; |
@@ -189,9 +189,10 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
189 | return 2; /* busy */ | 189 | return 2; /* busy */ |
190 | 190 | ||
191 | spin_lock(&fi->lock); | 191 | spin_lock(&fi->lock); |
192 | li = fi->local_int[cpu_addr]; | 192 | if (cpu_addr < KVM_MAX_VCPUS) |
193 | li = fi->local_int[cpu_addr]; | ||
193 | 194 | ||
194 | if ((cpu_addr >= KVM_MAX_VCPUS) || (li == NULL)) { | 195 | if (li == NULL) { |
195 | rc = 1; /* incorrect state */ | 196 | rc = 1; /* incorrect state */ |
196 | *reg &= SIGP_STAT_INCORRECT_STATE; | 197 | *reg &= SIGP_STAT_INCORRECT_STATE; |
197 | kfree(inti); | 198 | kfree(inti); |