Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135601
b: refs/heads/master
c: 92e6ecf
h: refs/heads/master
i:
  135599: a35522b
v: v3
  • Loading branch information
Christian Borntraeger authored and Martin Schwidefsky committed Mar 26, 2009
1 parent caae3b4 commit b2de0ac
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 702d9e584feb028ed7e2a6d2b103b8ea57622ff2
refs/heads/master: 92e6ecf392fac3082653ac9d84b1bdf53d0ea160
1 change: 1 addition & 0 deletions trunk/arch/s390/include/asm/sysinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct sysinfo_3_2_2 {
char reserved_1[24];

} vm[8];
char reserved_544[3552];
};

static inline int stsi(void *sysinfo, int fc, int sel1, int sel2)
Expand Down
22 changes: 13 additions & 9 deletions trunk/arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Heiko Carstens <heiko.carstens@de.ibm.com>
*/

#include <linux/compiler.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/string.h>
Expand All @@ -20,6 +21,7 @@
#include <asm/processor.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/sysinfo.h>
#include <asm/cpcmd.h>
#include <asm/sclp.h>
#include "entry.h"
Expand Down Expand Up @@ -173,19 +175,21 @@ static noinline __init void init_kernel_storage_key(void)
page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY);
}

static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);

static noinline __init void detect_machine_type(void)
{
struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data;

get_cpu_id(&S390_lowcore.cpu_data.cpu_id);

/* Running under z/VM ? */
if (cpuinfo->cpu_id.version == 0xff)
machine_flags |= MACHINE_FLAG_VM;
/* No VM information? Looks like LPAR */
if (stsi(&vmms, 3, 2, 2) == -ENOSYS)
return;
if (!vmms.count)
return;

/* Running under KVM ? */
if (cpuinfo->cpu_id.version == 0xfe)
/* Running under KVM? If not we assume z/VM */
if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3))
machine_flags |= MACHINE_FLAG_KVM;
else
machine_flags |= MACHINE_FLAG_VM;
}

static __init void early_pgm_check_handler(void)
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/s390/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ SECTIONS
EXIT_TEXT
}

/* early.c uses stsi, which requires page aligned data. */
. = ALIGN(PAGE_SIZE);
.init.data : {
INIT_DATA
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kvm/kvm-s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup,
(unsigned long) vcpu);
get_cpu_id(&vcpu->arch.cpu_id);
vcpu->arch.cpu_id.version = 0xfe;
vcpu->arch.cpu_id.version = 0xff;
return 0;
}

Expand Down

0 comments on commit b2de0ac

Please sign in to comment.