From 80629b0b0fd5ca868dc8eced28e6101e39ac2ef6 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Wed, 22 Jun 2011 16:24:07 +0200 Subject: [S390] kvm-s390: fix kconfig dependencies A user can create the Kconfig combination !VIRTUALIZATION, S390_GUEST which results in the following warnings: warning: (S390_GUEST) selects VIRTIO which has unmet direct dependencies (VIRTUALIZATION) warning: (S390_GUEST && VIRTIO_PCI && VIRTIO_BALLOON) selects VIRTIO_RING which has unmet direct dependencies (VIRTUALIZATION && VIRTIO) warning: (S390_GUEST) selects VIRTIO which has unmet direct dependencies (VIRTUALIZATION) warning: (S390_GUEST && VIRTIO_PCI && VIRTIO_BALLOON) selects VIRTIO_RING which has unmet direct dependencies (VIRTUALIZATION && VIRTIO) S390_GUEST has to select VIRTUALIZATION before selecting VIRTIO and friends. Reported-by: Jan Glauber Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/s390') diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 90d77bd078f5..c03fef7a9c22 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -579,6 +579,7 @@ config S390_GUEST def_bool y prompt "s390 guest support for KVM (EXPERIMENTAL)" depends on 64BIT && EXPERIMENTAL + select VIRTUALIZATION select VIRTIO select VIRTIO_RING select VIRTIO_CONSOLE -- cgit v1.2.3 From b530ce7a1af5a9355be518557d86b33c6d2cf088 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Wed, 22 Jun 2011 16:24:08 +0200 Subject: [S390] s390: enforce HW limits for the initial sampling rate On specific configurations with hwsampler opcontrol --start returns an error on "echo 1 >/dev/oprofile/enable". Turns out that the hw sampling interval is not checked against the hardware limits. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/oprofile/init.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/s390') diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 5995e9bc72d9..5e2ab03eaffd 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c @@ -151,6 +151,12 @@ static int oprofile_hwsampler_init(struct oprofile_operations *ops) if (oprofile_max_interval == 0) return -ENODEV; + /* The initial value should be sane */ + if (oprofile_hw_interval < oprofile_min_interval) + oprofile_hw_interval = oprofile_min_interval; + if (oprofile_hw_interval > oprofile_max_interval) + oprofile_hw_interval = oprofile_max_interval; + if (oprofile_timer_init(ops)) return -ENODEV; -- cgit v1.2.3 From 6815823431296082fa20c2f14007e194424660b8 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Wed, 22 Jun 2011 16:24:09 +0200 Subject: [S390] hwsampler: Set a sane default sampling rate The sampling interval for the hardware sampler is specified in cycles. (see SA23-2260-01 The Load-Program-Parameter and the CPU-Measurement Facilities) The current default value will therefore result in millions of samples. This patch changes the default sampling interval to 4M, which will result in ~1500 samples per second on a z196 reducing the overhead of sampling. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/oprofile/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/s390') diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 5e2ab03eaffd..0e358c2cffeb 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c @@ -25,7 +25,7 @@ extern void s390_backtrace(struct pt_regs * const regs, unsigned int depth); #include "hwsampler.h" -#define DEFAULT_INTERVAL 4096 +#define DEFAULT_INTERVAL 4127518 #define DEFAULT_SDBT_BLOCKS 1 #define DEFAULT_SDB_BLOCKS 511 -- cgit v1.2.3 From 859c965149ab5004b58b1fffd98190b6664cb717 Mon Sep 17 00:00:00 2001 From: Jan Glauber Date: Wed, 22 Jun 2011 16:24:10 +0200 Subject: [S390] allow setting of upper 32 bit in smp_ctl_set_bit The bit shift operation in smp_ctl_set_bit does not specify the type of the shifted bit so integer is used as default. Therefore it is not possible to set bits in the upper 32 bit of the control register if the kernel runs in 64 bit mode. Fix this by specifying the type as unsigned long. Signed-off-by: Jan Glauber Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/s390') diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 52420d2785b3..1d55c95f617c 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -262,7 +262,7 @@ void smp_ctl_set_bit(int cr, int bit) memset(&parms.orvals, 0, sizeof(parms.orvals)); memset(&parms.andvals, 0xff, sizeof(parms.andvals)); - parms.orvals[cr] = 1 << bit; + parms.orvals[cr] = 1UL << bit; on_each_cpu(smp_ctl_bit_callback, &parms, 1); } EXPORT_SYMBOL(smp_ctl_set_bit); @@ -276,7 +276,7 @@ void smp_ctl_clear_bit(int cr, int bit) memset(&parms.orvals, 0, sizeof(parms.orvals)); memset(&parms.andvals, 0xff, sizeof(parms.andvals)); - parms.andvals[cr] = ~(1L << bit); + parms.andvals[cr] = ~(1UL << bit); on_each_cpu(smp_ctl_bit_callback, &parms, 1); } EXPORT_SYMBOL(smp_ctl_clear_bit); -- cgit v1.2.3