From 17f4566657df51c5e0cb40f30491e058d74d63c8 Mon Sep 17 00:00:00 2001 From: Claudio Imbrenda Date: Thu, 5 Jul 2018 12:39:30 +0200 Subject: s390x/storage attributes: fix CMMA_BLOCK_SIZE usage The macro CMMA_BLOCK_SIZE was defined but not used, and a hardcoded value was instead used in the code. This patch fixes the value of CMMA_BLOCK_SIZE and uses it in the appropriate place in the code, and fixes another case of hardcoded value in the KVM backend, replacing it with the more appropriate constant KVM_S390_CMMA_SIZE_MAX. Signed-off-by: Claudio Imbrenda Message-Id: <1530787170-3101-1-git-send-email-imbrenda@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-stattrib-kvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/s390x/s390-stattrib-kvm.c') diff --git a/hw/s390x/s390-stattrib-kvm.c b/hw/s390x/s390-stattrib-kvm.c index 480551c3db..c7e1f35524 100644 --- a/hw/s390x/s390-stattrib-kvm.c +++ b/hw/s390x/s390-stattrib-kvm.c @@ -105,7 +105,8 @@ static void kvm_s390_stattrib_synchronize(S390StAttribState *sa) KVMS390StAttribState *sas = KVM_S390_STATTRIB(sa); MachineState *machine = MACHINE(qdev_get_machine()); unsigned long max = machine->maxram_size / TARGET_PAGE_SIZE; - unsigned long cx, len = 1 << 19; + /* We do not need to reach the maximum buffer size allowed */ + unsigned long cx, len = KVM_S390_SKEYS_MAX / 2; int r; struct kvm_s390_cmma_log clog = { .flags = 0, -- cgit v1.2.3-55-g7522