[PATCH 03/12] hvf: Increase number of possible memory slots

Alexander Graf posted 12 patches 2 years, 7 months ago
Only 4 patches received!
There is a newer version of this series
[PATCH 03/12] hvf: Increase number of possible memory slots
Posted by Alexander Graf 2 years, 7 months ago
For PVG we will need more than the current 32 possible memory slots.
Bump the limit to 512 instead.

Signed-off-by: Alexander Graf <graf@amazon.com>
---
 accel/hvf/hvf-accel-ops.c | 2 +-
 include/sysemu/hvf_int.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
index 9c3da03c94..bf0caaa852 100644
--- a/accel/hvf/hvf-accel-ops.c
+++ b/accel/hvf/hvf-accel-ops.c
@@ -88,7 +88,7 @@ struct mac_slot {
     uint64_t gva;
 };
 
-struct mac_slot mac_slots[32];
+struct mac_slot mac_slots[512];
 
 static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags)
 {
diff --git a/include/sysemu/hvf_int.h b/include/sysemu/hvf_int.h
index 6ab119e49f..c7623a2c09 100644
--- a/include/sysemu/hvf_int.h
+++ b/include/sysemu/hvf_int.h
@@ -40,7 +40,7 @@ typedef struct hvf_vcpu_caps {
 
 struct HVFState {
     AccelState parent;
-    hvf_slot slots[32];
+    hvf_slot slots[512];
     int num_slots;
 
     hvf_vcpu_caps *hvf_caps;
-- 
2.39.2 (Apple Git-143)




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Re: [PATCH 03/12] hvf: Increase number of possible memory slots
Posted by Philippe Mathieu-Daudé 2 years, 7 months ago
On 15/6/23 00:40, Alexander Graf wrote:
> For PVG we will need more than the current 32 possible memory slots.
> Bump the limit to 512 instead.
> 
> Signed-off-by: Alexander Graf <graf@amazon.com>
> ---
>   accel/hvf/hvf-accel-ops.c | 2 +-
>   include/sysemu/hvf_int.h  | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
> index 9c3da03c94..bf0caaa852 100644
> --- a/accel/hvf/hvf-accel-ops.c
> +++ b/accel/hvf/hvf-accel-ops.c
> @@ -88,7 +88,7 @@ struct mac_slot {
>       uint64_t gva;
>   };
>   
> -struct mac_slot mac_slots[32];
> +struct mac_slot mac_slots[512];
>   
>   static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags)
>   {
> diff --git a/include/sysemu/hvf_int.h b/include/sysemu/hvf_int.h
> index 6ab119e49f..c7623a2c09 100644
> --- a/include/sysemu/hvf_int.h
> +++ b/include/sysemu/hvf_int.h
> @@ -40,7 +40,7 @@ typedef struct hvf_vcpu_caps {
>   
>   struct HVFState {
>       AccelState parent;
> -    hvf_slot slots[32];
> +    hvf_slot slots[512];
>       int num_slots;
>   
>       hvf_vcpu_caps *hvf_caps;

Please add a definition in this header (using in ops.c).

In order to save memory and woods, what about keeping
32 on x86 and only raising to 512 on arm?
Re: [PATCH 03/12] hvf: Increase number of possible memory slots
Posted by Alexander Graf 2 years, 7 months ago
Hi Philippe,


On 16.06.23 12:28, Philippe Mathieu-Daudé wrote:

>
> On 15/6/23 00:40, Alexander Graf wrote:
>> For PVG we will need more than the current 32 possible memory slots.
>> Bump the limit to 512 instead.
>>
>> Signed-off-by: Alexander Graf <graf@amazon.com>
>> ---
>>   accel/hvf/hvf-accel-ops.c | 2 +-
>>   include/sysemu/hvf_int.h  | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
>> index 9c3da03c94..bf0caaa852 100644
>> --- a/accel/hvf/hvf-accel-ops.c
>> +++ b/accel/hvf/hvf-accel-ops.c
>> @@ -88,7 +88,7 @@ struct mac_slot {
>>       uint64_t gva;
>>   };
>>
>> -struct mac_slot mac_slots[32];
>> +struct mac_slot mac_slots[512];
>>
>>   static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags)
>>   {
>> diff --git a/include/sysemu/hvf_int.h b/include/sysemu/hvf_int.h
>> index 6ab119e49f..c7623a2c09 100644
>> --- a/include/sysemu/hvf_int.h
>> +++ b/include/sysemu/hvf_int.h
>> @@ -40,7 +40,7 @@ typedef struct hvf_vcpu_caps {
>>
>>   struct HVFState {
>>       AccelState parent;
>> -    hvf_slot slots[32];
>> +    hvf_slot slots[512];
>>       int num_slots;
>>
>>       hvf_vcpu_caps *hvf_caps;
>
> Please add a definition in this header (using in ops.c).


Happy to :)


>
> In order to save memory and woods, what about keeping
> 32 on x86 and only raising to 512 on arm?


I am hoping that someone takes the apple-gfx driver and enables it for 
x86 as well, so I'd rather keep them consistent.

Alex




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879