diff mbox

[04/04] qemu-kvm: other archs should maintain memory mapping also.

Message ID 706158FABBBA044BAD4FE898A02E4BC236A2BC03@pdsmsx503.ccr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang, Xiantao April 28, 2009, 9:29 a.m. UTC
From d184d9b0a91ca674961000ed3d35b7fc25d29e03 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <xiantao.zhang@intel.com>
Date: Tue, 28 Apr 2009 16:59:36 +0800
Subject: [PATCH] qemu-kvm: other archs should maintain memory mapping also.
 
Currently, use TARGET_I386 to comment out the mapping machanism
for other archs, but mapping machanism should be useful for other archs
to maintain guest's memory mapping.
 
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
---
 qemu-kvm.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

Comments

Avi Kivity April 28, 2009, 9:39 a.m. UTC | #1
Zhang, Xiantao wrote:
> From d184d9b0a91ca674961000ed3d35b7fc25d29e03 Mon Sep 17 00:00:00 2001
> From: Xiantao Zhang <xiantao.zhang@intel.com>
> Date: Tue, 28 Apr 2009 16:59:36 +0800
> Subject: [PATCH] qemu-kvm: other archs should maintain memory mapping also.
>  
> Currently, use TARGET_I386 to comment out the mapping machanism
> for other archs, but mapping machanism should be useful for other archs
> to maintain guest's memory mapping.
>  
>   

Hollis, does this work for you?

If now, you can add a new define KVM_WANT_MAPPING or something, and 
define it for I386 and IA64.

> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
> ---
>  qemu-kvm.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
>  
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index 68a9218..4f71192 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -846,6 +846,7 @@ static int must_use_aliases_target(target_phys_addr_t addr)
>          return true;
>      return false;
>  }
> +#endif
>  
>  static struct mapping {
>      target_phys_addr_t phys;
> @@ -885,7 +886,6 @@ static void drop_mapping(target_phys_addr_t start_addr)
>      if (p)
>          *p = mappings[--nr_mappings];
>  }
> -#endif
>  
>  void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
>                                        unsigned long size,
> @@ -893,9 +893,7 @@ void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
>  {
>      int r = 0;
>      unsigned long area_flags;
> -#ifdef TARGET_I386
>      struct mapping *p;
> -#endif
>  
>      if (start_addr + size > phys_ram_size) {
>          phys_ram_size = start_addr + size;
> @@ -955,13 +953,11 @@ void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
>          exit(1);
>      }
>  
> -#ifdef TARGET_I386
>      drop_mapping(start_addr);
>      p = &mappings[nr_mappings++];
>      p->phys = start_addr;
>      p->ram = phys_offset;
>      p->len = size;
> -#endif
>  
>      return;
>  }
>
Jes Sorensen April 29, 2009, 2:59 p.m. UTC | #2
>>>>> "Avi" == Avi Kivity <avi@redhat.com> writes:

Avi> Zhang, Xiantao wrote:
>> From d184d9b0a91ca674961000ed3d35b7fc25d29e03 Mon Sep 17 00:00:00
>> 2001 From: Xiantao Zhang <xiantao.zhang@intel.com> Date: Tue, 28
>> Apr 2009 16:59:36 +0800 Subject: [PATCH] qemu-kvm: other archs
>> should maintain memory mapping also.  Currently, use TARGET_I386 to
>> comment out the mapping machanism for other archs, but mapping
>> machanism should be useful for other archs to maintain guest's
>> memory mapping.
>> 

Avi> Hollis, does this work for you?

Avi> If now, you can add a new define KVM_WANT_MAPPING or something,
Avi> and define it for I386 and IA64.

I have gone ahead and implemented this - however I also redid the
must_use_alias code in the process, removing a ton of gross
TARGET_I386 #ifdefs.

The must_use_alias patch needs to be applied first as it introduces
target-<arch>/qemu-kvm-arch.h which is needed for the KVM_WANT_MAPPING
patch.

Look for follow up mails to this one in a couple of minutes.

Cheers,
Jes
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhang, Xiantao May 11, 2009, 10:15 a.m. UTC | #3
Any conclusion on this thread ? 
Xiantao

Zhang, Xiantao wrote:
> From d184d9b0a91ca674961000ed3d35b7fc25d29e03 Mon Sep 17 00:00:00 2001
> From: Xiantao Zhang <xiantao.zhang@intel.com>
> Date: Tue, 28 Apr 2009 16:59:36 +0800
> Subject: [PATCH] qemu-kvm: other archs should maintain memory mapping
> also. 
> 
> Currently, use TARGET_I386 to comment out the mapping machanism
> for other archs, but mapping machanism should be useful for other
> archs 
> to maintain guest's memory mapping.
> 
> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
> ---
>  qemu-kvm.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
> 
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index 68a9218..4f71192 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -846,6 +846,7 @@ static int
>          must_use_aliases_target(target_phys_addr_t addr) return true;
>      return false;
>  }
> +#endif
> 
>  static struct mapping {
>      target_phys_addr_t phys;
> @@ -885,7 +886,6 @@ static void drop_mapping(target_phys_addr_t
>      start_addr) if (p)
>          *p = mappings[--nr_mappings];
>  }
> -#endif
> 
>  void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
>                                        unsigned long size,
> @@ -893,9 +893,7 @@ void
>  kvm_cpu_register_physical_memory(target_phys_addr_t start_addr, {
>      int r = 0;
>      unsigned long area_flags;
> -#ifdef TARGET_I386
>      struct mapping *p;
> -#endif
> 
>      if (start_addr + size > phys_ram_size) {
>          phys_ram_size = start_addr + size;
> @@ -955,13 +953,11 @@ void
>          kvm_cpu_register_physical_memory(target_phys_addr_t
>      start_addr, exit(1); }
> 
> -#ifdef TARGET_I386
>      drop_mapping(start_addr);
>      p = &mappings[nr_mappings++];
>      p->phys = start_addr;
>      p->ram = phys_offset;
>      p->len = size;
> -#endif
> 
>      return;
>  }

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jes Sorensen May 11, 2009, 11:18 a.m. UTC | #4
Zhang, Xiantao wrote:
> Any conclusion on this thread ? 
> Xiantao

Hi Xiantao,

Not that I am aware of, I suspect it's still pending in Avi's tree.

Cheers,
Jes


> Zhang, Xiantao wrote:
>> From d184d9b0a91ca674961000ed3d35b7fc25d29e03 Mon Sep 17 00:00:00 2001
>> From: Xiantao Zhang <xiantao.zhang@intel.com>
>> Date: Tue, 28 Apr 2009 16:59:36 +0800
>> Subject: [PATCH] qemu-kvm: other archs should maintain memory mapping
>> also. 
>>
>> Currently, use TARGET_I386 to comment out the mapping machanism
>> for other archs, but mapping machanism should be useful for other
>> archs 
>> to maintain guest's memory mapping.
>>
>> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
>> ---
>>  qemu-kvm.c |    6 +-----
>>  1 files changed, 1 insertions(+), 5 deletions(-)
>>
>> diff --git a/qemu-kvm.c b/qemu-kvm.c
>> index 68a9218..4f71192 100644
>> --- a/qemu-kvm.c
>> +++ b/qemu-kvm.c
>> @@ -846,6 +846,7 @@ static int
>>          must_use_aliases_target(target_phys_addr_t addr) return true;
>>      return false;
>>  }
>> +#endif
>>
>>  static struct mapping {
>>      target_phys_addr_t phys;
>> @@ -885,7 +886,6 @@ static void drop_mapping(target_phys_addr_t
>>      start_addr) if (p)
>>          *p = mappings[--nr_mappings];
>>  }
>> -#endif
>>
>>  void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
>>                                        unsigned long size,
>> @@ -893,9 +893,7 @@ void
>>  kvm_cpu_register_physical_memory(target_phys_addr_t start_addr, {
>>      int r = 0;
>>      unsigned long area_flags;
>> -#ifdef TARGET_I386
>>      struct mapping *p;
>> -#endif
>>
>>      if (start_addr + size > phys_ram_size) {
>>          phys_ram_size = start_addr + size;
>> @@ -955,13 +953,11 @@ void
>>          kvm_cpu_register_physical_memory(target_phys_addr_t
>>      start_addr, exit(1); }
>>
>> -#ifdef TARGET_I386
>>      drop_mapping(start_addr);
>>      p = &mappings[nr_mappings++];
>>      p->phys = start_addr;
>>      p->ram = phys_offset;
>>      p->len = size;
>> -#endif
>>
>>      return;
>>  }

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/qemu-kvm.c b/qemu-kvm.c
index 68a9218..4f71192 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -846,6 +846,7 @@  static int must_use_aliases_target(target_phys_addr_t addr)
         return true;
     return false;
 }
+#endif
 
 static struct mapping {
     target_phys_addr_t phys;
@@ -885,7 +886,6 @@  static void drop_mapping(target_phys_addr_t start_addr)
     if (p)
         *p = mappings[--nr_mappings];
 }
-#endif
 
 void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
                                       unsigned long size,
@@ -893,9 +893,7 @@  void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
 {
     int r = 0;
     unsigned long area_flags;
-#ifdef TARGET_I386
     struct mapping *p;
-#endif
 
     if (start_addr + size > phys_ram_size) {
         phys_ram_size = start_addr + size;
@@ -955,13 +953,11 @@  void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
         exit(1);
     }
 
-#ifdef TARGET_I386
     drop_mapping(start_addr);
     p = &mappings[nr_mappings++];
     p->phys = start_addr;
     p->ram = phys_offset;
     p->len = size;
-#endif
 
     return;
 }