[PATCH 2/2] target/i386: Use X86ASIdx_MEM in kvm_init()

Xiaoyao Li posted 2 patches 1 month ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Marcelo Tosatti <mtosatti@redhat.com>
[PATCH 2/2] target/i386: Use X86ASIdx_MEM in kvm_init()
Posted by Xiaoyao Li 1 month ago
When the patch introduces 'enum X86ADIdx'[0] got merged, it somehow
missed the change to replace as id 0 with X86ASIdx_MEM in kvm_init().

Change the leftover in kvm_init() to make the usage consistent.

[0] https://lore.kernel.org/qemu-devel/20250730095253.1833411-3-xiaoyao.li@intel.com/

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 accel/kvm/kvm-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 58802f7c3cc1..3030c47d55b1 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2800,7 +2800,7 @@ static int kvm_init(AccelState *as, MachineState *ms)
     s->memory_listener.listener.coalesced_io_del = kvm_uncoalesce_mmio_region;
 
     kvm_memory_listener_register(s, &s->memory_listener,
-                                 &address_space_memory, 0, "kvm-memory");
+                                 &address_space_memory, X86ASIdx_MEM, "kvm-memory");
     memory_listener_register(&kvm_io_listener,
                              &address_space_io);
 
-- 
2.43.0
Re: [PATCH 2/2] target/i386: Use X86ASIdx_MEM in kvm_init()
Posted by Philippe Mathieu-Daudé 4 weeks, 1 day ago
On 14/10/25 11:42, Xiaoyao Li wrote:
> When the patch introduces 'enum X86ADIdx'[0] got merged, it somehow
> missed the change to replace as id 0 with X86ASIdx_MEM in kvm_init().
> 
> Change the leftover in kvm_init() to make the usage consistent.
> 
> [0] https://lore.kernel.org/qemu-devel/20250730095253.1833411-3-xiaoyao.li@intel.com/
> 
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
>   accel/kvm/kvm-all.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 58802f7c3cc1..3030c47d55b1 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -2800,7 +2800,7 @@ static int kvm_init(AccelState *as, MachineState *ms)
>       s->memory_listener.listener.coalesced_io_del = kvm_uncoalesce_mmio_region;
>   
>       kvm_memory_listener_register(s, &s->memory_listener,
> -                                 &address_space_memory, 0, "kvm-memory");
> +                                 &address_space_memory, X86ASIdx_MEM, "kvm-memory");

NAck: this is a generic code use by multiple architectures.
Re: [PATCH 2/2] target/i386: Use X86ASIdx_MEM in kvm_init()
Posted by Paolo Bonzini 4 weeks, 1 day ago
On 10/16/25 10:43, Philippe Mathieu-Daudé wrote:
> On 14/10/25 11:42, Xiaoyao Li wrote:
>> When the patch introduces 'enum X86ADIdx'[0] got merged, it somehow
>> missed the change to replace as id 0 with X86ASIdx_MEM in kvm_init().

It wasn't missed, it broke CI. ;)

Paolo

>> Change the leftover in kvm_init() to make the usage consistent.
>>
>> [0] https://lore.kernel.org/qemu-devel/20250730095253.1833411-3- 
>> xiaoyao.li@intel.com/
>>
>> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
>> ---
>>   accel/kvm/kvm-all.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
>> index 58802f7c3cc1..3030c47d55b1 100644
>> --- a/accel/kvm/kvm-all.c
>> +++ b/accel/kvm/kvm-all.c
>> @@ -2800,7 +2800,7 @@ static int kvm_init(AccelState *as, MachineState 
>> *ms)
>>       s->memory_listener.listener.coalesced_io_del = 
>> kvm_uncoalesce_mmio_region;
>>       kvm_memory_listener_register(s, &s->memory_listener,
>> -                                 &address_space_memory, 0, "kvm- 
>> memory");
>> +                                 &address_space_memory, X86ASIdx_MEM, 
>> "kvm-memory");
> 
> NAck: this is a generic code use by multiple architectures.
> 
> 


Re: [PATCH 2/2] target/i386: Use X86ASIdx_MEM in kvm_init()
Posted by Xiaoyao Li 4 weeks, 1 day ago
On 10/16/2025 5:23 PM, Paolo Bonzini wrote:
> On 10/16/25 10:43, Philippe Mathieu-Daudé wrote:
>> On 14/10/25 11:42, Xiaoyao Li wrote:
>>> When the patch introduces 'enum X86ADIdx'[0] got merged, it somehow
>>> missed the change to replace as id 0 with X86ASIdx_MEM in kvm_init().
> 
> It wasn't missed, it broke CI. ;)

I see.

I missed the fact that Philippe pointed out:

   this is a generic code use by multiple architectures.

Sorry for the wrong patch.

> Paolo
> 
>>> Change the leftover in kvm_init() to make the usage consistent.
>>>
>>> [0] https://lore.kernel.org/qemu-devel/20250730095253.1833411-3- 
>>> xiaoyao.li@intel.com/
>>>
>>> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
>>> ---
>>>   accel/kvm/kvm-all.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
>>> index 58802f7c3cc1..3030c47d55b1 100644
>>> --- a/accel/kvm/kvm-all.c
>>> +++ b/accel/kvm/kvm-all.c
>>> @@ -2800,7 +2800,7 @@ static int kvm_init(AccelState *as, 
>>> MachineState *ms)
>>>       s->memory_listener.listener.coalesced_io_del = 
>>> kvm_uncoalesce_mmio_region;
>>>       kvm_memory_listener_register(s, &s->memory_listener,
>>> -                                 &address_space_memory, 0, "kvm- 
>>> memory");
>>> +                                 &address_space_memory, 
>>> X86ASIdx_MEM, "kvm-memory");
>>
>> NAck: this is a generic code use by multiple architectures.
>>
>>
>