[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-s390
Subject: Re: [PULL 1/4] KVM: s390: randomize sca address
From: Christian Borntraeger <borntraeger () de ! ibm ! com>
Date: 2014-03-25 14:04:22
Message-ID: 53318CE6.6040605 () de ! ibm ! com
[Download RAW message or body]
On 25/03/14 14:53, Paolo Bonzini wrote:
> Il 25/03/2014 14:35, Christian Borntraeger ha scritto:
>> We allocate a page for the 2k sca, so lets use the space to improve
>> hit rate of some internal cpu caches. No need to change the freeing
>> of the page, as this will shift away the page offset bits anyway.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
>> ---
>> arch/s390/kvm/kvm-s390.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index 7337c57..a02979f 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -215,6 +215,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
>> {
>> int rc;
>> char debug_name[16];
>> + static unsigned long sca_offset;
>>
>> rc = -EINVAL;
>> #ifdef CONFIG_KVM_S390_UCONTROL
>> @@ -236,6 +237,10 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
>> kvm->arch.sca = (struct sca_block *) get_zeroed_page(GFP_KERNEL);
>> if (!kvm->arch.sca)
>> goto out_err;
>> + spin_lock(&kvm_lock);
>> + sca_offset = (sca_offset + 16) & 0x7f0;
>> + kvm->arch.sca = (struct sca_block *) ((char *) kvm->arch.sca + sca_offset);
>> + spin_unlock(&kvm_lock);
>>
>> sprintf(debug_name, "kvm-%u", current->pid);
>>
>>
>
> Does this have to remain the same across migration?
Nope, the sca address is just an internal _host_ detail and does not belong/influence
the guest.
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic