Skip to content

Commit 9d4c197

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: Drop "const" attribute from old memslot in commit_memory_region()
Drop the "const" attribute from @old in kvm_arch_commit_memory_region() to allow arch specific code to free arch specific resources in the old memslot without having to cast away the attribute. Freeing resources in kvm_arch_commit_memory_region() paves the way for simplifying kvm_free_memslot() by eliminating the last usage of its @dont param. Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent cf47f50 commit 9d4c197

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

arch/mips/kvm/mips.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
224224

225225
void kvm_arch_commit_memory_region(struct kvm *kvm,
226226
const struct kvm_userspace_memory_region *mem,
227-
const struct kvm_memory_slot *old,
227+
struct kvm_memory_slot *old,
228228
const struct kvm_memory_slot *new,
229229
enum kvm_mr_change change)
230230
{

arch/powerpc/kvm/powerpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
701701

702702
void kvm_arch_commit_memory_region(struct kvm *kvm,
703703
const struct kvm_userspace_memory_region *mem,
704-
const struct kvm_memory_slot *old,
704+
struct kvm_memory_slot *old,
705705
const struct kvm_memory_slot *new,
706706
enum kvm_mr_change change)
707707
{

arch/s390/kvm/kvm-s390.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4532,7 +4532,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
45324532

45334533
void kvm_arch_commit_memory_region(struct kvm *kvm,
45344534
const struct kvm_userspace_memory_region *mem,
4535-
const struct kvm_memory_slot *old,
4535+
struct kvm_memory_slot *old,
45364536
const struct kvm_memory_slot *new,
45374537
enum kvm_mr_change change)
45384538
{

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10024,7 +10024,7 @@ static void kvm_mmu_slot_apply_flags(struct kvm *kvm,
1002410024

1002510025
void kvm_arch_commit_memory_region(struct kvm *kvm,
1002610026
const struct kvm_userspace_memory_region *mem,
10027-
const struct kvm_memory_slot *old,
10027+
struct kvm_memory_slot *old,
1002810028
const struct kvm_memory_slot *new,
1002910029
enum kvm_mr_change change)
1003010030
{

include/linux/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
678678
enum kvm_mr_change change);
679679
void kvm_arch_commit_memory_region(struct kvm *kvm,
680680
const struct kvm_userspace_memory_region *mem,
681-
const struct kvm_memory_slot *old,
681+
struct kvm_memory_slot *old,
682682
const struct kvm_memory_slot *new,
683683
enum kvm_mr_change change);
684684
bool kvm_largepages_enabled(void);

virt/kvm/arm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2251,7 +2251,7 @@ int kvm_mmu_init(void)
22512251

22522252
void kvm_arch_commit_memory_region(struct kvm *kvm,
22532253
const struct kvm_userspace_memory_region *mem,
2254-
const struct kvm_memory_slot *old,
2254+
struct kvm_memory_slot *old,
22552255
const struct kvm_memory_slot *new,
22562256
enum kvm_mr_change change)
22572257
{

virt/kvm/kvm_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ static struct kvm_memslots *install_new_memslots(struct kvm *kvm,
985985

986986
static int kvm_set_memslot(struct kvm *kvm,
987987
const struct kvm_userspace_memory_region *mem,
988-
const struct kvm_memory_slot *old,
988+
struct kvm_memory_slot *old,
989989
struct kvm_memory_slot *new, int as_id,
990990
enum kvm_mr_change change)
991991
{

0 commit comments

Comments
 (0)