diff options
-rw-r--r-- | arch/s390/include/asm/setup.h | 3 | ||||
-rw-r--r-- | arch/s390/kernel/early.c | 9 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/cio.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 2 |
5 files changed, 13 insertions, 7 deletions
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index 52a779c337e8..76f530b65f00 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h | |||
@@ -71,9 +71,12 @@ extern unsigned int user_mode; | |||
71 | #define MACHINE_FLAG_KVM (1UL << 9) | 71 | #define MACHINE_FLAG_KVM (1UL << 9) |
72 | #define MACHINE_FLAG_HPAGE (1UL << 10) | 72 | #define MACHINE_FLAG_HPAGE (1UL << 10) |
73 | #define MACHINE_FLAG_PFMF (1UL << 11) | 73 | #define MACHINE_FLAG_PFMF (1UL << 11) |
74 | #define MACHINE_FLAG_LPAR (1UL << 12) | ||
74 | 75 | ||
75 | #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) | 76 | #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) |
76 | #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) | 77 | #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) |
78 | #define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR) | ||
79 | |||
77 | #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) | 80 | #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) |
78 | 81 | ||
79 | #ifndef __s390x__ | 82 | #ifndef __s390x__ |
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index e49e9e0c69fd..02e45861b55b 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -214,10 +214,13 @@ static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE); | |||
214 | 214 | ||
215 | static noinline __init void detect_machine_type(void) | 215 | static noinline __init void detect_machine_type(void) |
216 | { | 216 | { |
217 | /* No VM information? Looks like LPAR */ | 217 | /* Check current-configuration-level */ |
218 | if (stsi(&vmms, 3, 2, 2) == -ENOSYS) | 218 | if ((stsi(NULL, 0, 0, 0) >> 28) <= 2) { |
219 | S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR; | ||
219 | return; | 220 | return; |
220 | if (!vmms.count) | 221 | } |
222 | /* Get virtual-machine cpu information. */ | ||
223 | if (stsi(&vmms, 3, 2, 2) == -ENOSYS || !vmms.count) | ||
221 | return; | 224 | return; |
222 | 225 | ||
223 | /* Running under KVM? If not we assume z/VM */ | 226 | /* Running under KVM? If not we assume z/VM */ |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 8d8957b38ab3..d9fb98cde0fa 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -804,7 +804,7 @@ setup_arch(char **cmdline_p) | |||
804 | if (MACHINE_IS_VM) | 804 | if (MACHINE_IS_VM) |
805 | pr_info("Linux is running as a z/VM " | 805 | pr_info("Linux is running as a z/VM " |
806 | "guest operating system in 31-bit mode\n"); | 806 | "guest operating system in 31-bit mode\n"); |
807 | else | 807 | else if (MACHINE_IS_LPAR) |
808 | pr_info("Linux is running natively in 31-bit mode\n"); | 808 | pr_info("Linux is running natively in 31-bit mode\n"); |
809 | if (MACHINE_HAS_IEEE) | 809 | if (MACHINE_HAS_IEEE) |
810 | pr_info("The hardware system has IEEE compatible " | 810 | pr_info("The hardware system has IEEE compatible " |
@@ -818,7 +818,7 @@ setup_arch(char **cmdline_p) | |||
818 | "guest operating system in 64-bit mode\n"); | 818 | "guest operating system in 64-bit mode\n"); |
819 | else if (MACHINE_IS_KVM) | 819 | else if (MACHINE_IS_KVM) |
820 | pr_info("Linux is running under KVM in 64-bit mode\n"); | 820 | pr_info("Linux is running under KVM in 64-bit mode\n"); |
821 | else | 821 | else if (MACHINE_IS_LPAR) |
822 | pr_info("Linux is running natively in 64-bit mode\n"); | 822 | pr_info("Linux is running natively in 64-bit mode\n"); |
823 | #endif /* CONFIG_64BIT */ | 823 | #endif /* CONFIG_64BIT */ |
824 | 824 | ||
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 126f240715a4..f9d8c7936a09 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -661,7 +661,7 @@ void __irq_entry do_IRQ(struct pt_regs *regs) | |||
661 | * We don't do this for VM because a tpi drops the cpu | 661 | * We don't do this for VM because a tpi drops the cpu |
662 | * out of the sie which costs more cycles than it saves. | 662 | * out of the sie which costs more cycles than it saves. |
663 | */ | 663 | */ |
664 | } while (!MACHINE_IS_VM && tpi (NULL) != 0); | 664 | } while (MACHINE_IS_LPAR && tpi(NULL) != 0); |
665 | irq_exit(); | 665 | irq_exit(); |
666 | set_irq_regs(old_regs); | 666 | set_irq_regs(old_regs); |
667 | } | 667 | } |
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index 35dfc3cb2aae..232ef047ba34 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -534,7 +534,7 @@ static int qdio_inbound_q_moved(struct qdio_q *q) | |||
534 | 534 | ||
535 | if ((bufnr != q->last_move) || q->qdio_error) { | 535 | if ((bufnr != q->last_move) || q->qdio_error) { |
536 | q->last_move = bufnr; | 536 | q->last_move = bufnr; |
537 | if (!is_thinint_irq(q->irq_ptr) && !MACHINE_IS_VM) | 537 | if (!is_thinint_irq(q->irq_ptr) && MACHINE_IS_LPAR) |
538 | q->u.in.timestamp = get_usecs(); | 538 | q->u.in.timestamp = get_usecs(); |
539 | return 1; | 539 | return 1; |
540 | } else | 540 | } else |