dimm: Correct type of MemoryHotplugState->base
PATCH 1/1 dimm: Correct type of MemoryHotplugState->base
The 'base' field of MemoryHotplugState is ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.
However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to memory_region_add_subgregion for example).
So, correct its type to 'hwaddr'.
--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/mem/pc-dimm.h +1 -1
@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;
Signature · 1 line
2.5.0
Quoted 19 lines · On Thu, 21 Jan 2016 12:37:51 +1100 David Gibson <[email protected]>…
The 'base' field of MemoryHotplugState is
ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to
memory_region_add_subgregionfor example).So, correct its type to 'hwaddr'.
Signed-off-by David Gibson <[email protected]>--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/hw/mem/pc-dimm.h +0
-0
include/hw/mem/pc-dimm.h typedef struct PCDIMMDeviceClass { · line 83
Quoted 8 lines
include/hw/mem/pc-dimm.h +1
-1@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;
I agree with this fix but that's not the only place where ram_addr_t needs to be replaced with hwaddr.
For example type of MachineState.[max]ram_size fields needs to be changed as well. Because QEMU builds without CONFIG_XEN_BACKEND on 32-bit hosts are broken since ram_addr_t is 32-bits there while some targets assume and use it as 64-bit one.
Quoted 29 lines · Igor Mammedov
Quoted 26 lines · On Thu, 21 Jan 2016 12:37:51 +1100 David Gibson <[email protected]>…
The 'base' field of MemoryHotplugState is
ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to
memory_region_add_subgregionfor example).So, correct its type to 'hwaddr'.
Signed-off-by David Gibson <[email protected]>--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/hw/mem/pc-dimm.h +1
-1@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;
Quoted 8 lines
Quoted 1 line
I agree with this fix but that's not the only place where
ram_addr_tneeds to be replaced with hwaddr.
For example type of MachineState.[max]ram_size fields needs to be changed as well. Because QEMU builds withoutCONFIG_XEN_BACKENDon 32-bit hosts are broken sinceram_addr_tis 32-bits there while some targets assume and use it as 64-bit one.
But on a 32-bit system without CONFIG_XEN_BACKEND you cannot allocate more than 4G anyway, so the choice of ram_addr_t is understandable in that case.
On the other hand, on a 32-bit system without CONFIG_XEN_BACKEND you definitely can place 128M of hot plugged memory between say 4096MB and 4224MB.
Paolo
Igor Mammedov
Reviewed-byQuoted 39 lines · On Fri, 22 Jan 2016 15:21:05 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 29 lines · Igor Mammedov
Quoted 26 lines · On Thu, 21 Jan 2016 12:37:51 +1100 David Gibson <[email protected]>…
The 'base' field of MemoryHotplugState is
ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to
memory_region_add_subgregionfor example).So, correct its type to 'hwaddr'.
Signed-off-by David Gibson <[email protected]>--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/hw/mem/pc-dimm.h +1
-1@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;Quoted 8 lines
Quoted 1 line
I agree with this fix but that's not the only place where
ram_addr_tneeds to be replaced with hwaddr.
For example type of MachineState.[max]ram_size fields needs to be changed as well. Because QEMU builds withoutCONFIG_XEN_BACKENDon 32-bit hosts are broken sinceram_addr_tis 32-bits there while some targets assume and use it as 64-bit one.
Quoted 3 lines
But on a 32-bit system without
CONFIG_XEN_BACKENDyou cannot allocate more than 4G anyway, so the choice ofram_addr_tis understandable in that case.
QEMU build will probably fail with above config but if it succeeds then maxmem will be silently truncated.
Quoted 4 lines
On the other hand, on a 32-bit system without
CONFIG_XEN_BACKENDyou definitely can place 128M of hot plugged memory between say 4096MB and 4224MB.
True.
Anyway for this patch
Quoted 3 lines
Paolo
Quoted 49 lines · Igor Mammedov
Quoted 39 lines · On Fri, 22 Jan 2016 15:21:05 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 29 lines · Igor Mammedov
Quoted 26 lines · On Thu, 21 Jan 2016 12:37:51 +1100 David Gibson <[email protected]>…
The 'base' field of MemoryHotplugState is
ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to
memory_region_add_subgregionfor example).So, correct its type to 'hwaddr'.
Signed-off-by David Gibson <[email protected]>--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/hw/mem/pc-dimm.h +1
-1@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;Quoted 8 lines
Quoted 1 line
I agree with this fix but that's not the only place where
ram_addr_tneeds to be replaced with hwaddr.
For example type of MachineState.[max]ram_size fields needs to be changed as well. Because QEMU builds withoutCONFIG_XEN_BACKENDon 32-bit hosts are broken sinceram_addr_tis 32-bits there while some targets assume and use it as 64-bit one.Quoted 3 lines
But on a 32-bit system without
CONFIG_XEN_BACKENDyou cannot allocate more than 4G anyway, so the choice ofram_addr_tis understandable in that case.QEMU build will probably fail with above config but if it succeeds then maxmem will be silently truncated.
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
On the other hand, on a 32-bit system without
CONFIG_XEN_BACKENDyou definitely can place 128M of hot plugged memory between say 4096MB and 4224MB.True.
Anyway for this patch
Reviewed-by Igor Mammedov <[email protected]>
Who needs to take this patch? I'm not sure if I need to do anything further to push it forwards.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Eduardo Habkost
Acked-byQuoted 53 lines · David Gibson
Quoted 52 lines · Igor Mammedov
Quoted 39 lines · On Fri, 22 Jan 2016 15:21:05 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 29 lines · Igor Mammedov
Quoted 26 lines · On Thu, 21 Jan 2016 12:37:51 +1100 David Gibson <[email protected]>…
The 'base' field of MemoryHotplugState is
ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to
memory_region_add_subgregionfor example).So, correct its type to 'hwaddr'.
Signed-off-by David Gibson <[email protected]>--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/hw/mem/pc-dimm.h +1
-1@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;Quoted 8 lines
Quoted 1 line
I agree with this fix but that's not the only place where
ram_addr_tneeds to be replaced with hwaddr.
For example type of MachineState.[max]ram_size fields needs to be changed as well. Because QEMU builds withoutCONFIG_XEN_BACKENDon 32-bit hosts are broken sinceram_addr_tis 32-bits there while some targets assume and use it as 64-bit one.Quoted 3 lines
But on a 32-bit system without
CONFIG_XEN_BACKENDyou cannot allocate more than 4G anyway, so the choice ofram_addr_tis understandable in that case.QEMU build will probably fail with above config but if it succeeds then maxmem will be silently truncated.
Quoted 4 lines
On the other hand, on a 32-bit system without
CONFIG_XEN_BACKENDyou definitely can place 128M of hot plugged memory between say 4096MB and 4224MB.
Quoted 7 lines
Quoted 4 lines
True.
Anyway for this patch
Reviewed-by Igor Mammedov <[email protected]>Who needs to take this patch? I'm not sure if I need to do anything further to push it forwards.
Most pc-dimm changes were merged either by me or Michael. I can merge it if I get an Acked-by from Michael.
Otherwise, Michael has my Acked-by if he wants to merge it through his tree.
Signature · 1 line
Eduardo
Quoted 62 lines · Eduardo Habkost
Quoted 53 lines · David Gibson
Quoted 52 lines · Igor Mammedov
Quoted 39 lines · On Fri, 22 Jan 2016 15:21:05 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 29 lines · Igor Mammedov
Quoted 26 lines · On Thu, 21 Jan 2016 12:37:51 +1100 David Gibson <[email protected]>…
The 'base' field of MemoryHotplugState is
ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to
memory_region_add_subgregionfor example).So, correct its type to 'hwaddr'.
Signed-off-by David Gibson <[email protected]>--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/hw/mem/pc-dimm.h +1
-1@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;Quoted 8 lines
Quoted 1 line
I agree with this fix but that's not the only place where
ram_addr_tneeds to be replaced with hwaddr.
For example type of MachineState.[max]ram_size fields needs to be changed as well. Because QEMU builds withoutCONFIG_XEN_BACKENDon 32-bit hosts are broken sinceram_addr_tis 32-bits there while some targets assume and use it as 64-bit one.Quoted 3 lines
But on a 32-bit system without
CONFIG_XEN_BACKENDyou cannot allocate more than 4G anyway, so the choice ofram_addr_tis understandable in that case.QEMU build will probably fail with above config but if it succeeds then maxmem will be silently truncated.
Quoted 4 lines
On the other hand, on a 32-bit system without
CONFIG_XEN_BACKENDyou definitely can place 128M of hot plugged memory between say 4096MB and 4224MB.Quoted 7 lines
Quoted 4 lines
True.
Anyway for this patch
Reviewed-by Igor Mammedov <[email protected]>Who needs to take this patch? I'm not sure if I need to do anything further to push it forwards.
Quoted 7 lines
Most pc-dimm changes were merged either by me or Michael. I can merge it if I get an Acked-by from Michael.
Otherwise, Michael has my Acked-by if he wants to merge it through his tree.
Acked-by Eduardo Habkost <[email protected]>
Ah, I didn't realise Michael worked in this area. Adding him to CC..
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 66 lines · David Gibson
Quoted 65 lines · Eduardo Habkost
Quoted 53 lines · David Gibson
Quoted 52 lines · Igor Mammedov
Quoted 39 lines · On Fri, 22 Jan 2016 15:21:05 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 29 lines · Igor Mammedov
Quoted 26 lines · On Thu, 21 Jan 2016 12:37:51 +1100 David Gibson <[email protected]>…
The 'base' field of MemoryHotplugState is
ram_addr_t, which indicates that it exists in the abstract address space of RAM regions.However, the actual usage of this field indicates that it is a concrete physical address (it's passed as an offset to
memory_region_add_subgregionfor example).So, correct its type to 'hwaddr'.
Signed-off-by David Gibson <[email protected]>--- include/hw/mem/pc-dimm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/hw/mem/pc-dimm.h +1
-1@@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass {* @mr: hotplug memory address space container */ typedef struct MemoryHotplugState { -ram_addr_t base; +hwaddr base;MemoryRegion mr; }MemoryHotplugState ;Quoted 8 lines
Quoted 1 line
I agree with this fix but that's not the only place where
ram_addr_tneeds to be replaced with hwaddr.
For example type of MachineState.[max]ram_size fields needs to be changed as well. Because QEMU builds withoutCONFIG_XEN_BACKENDon 32-bit hosts are broken sinceram_addr_tis 32-bits there while some targets assume and use it as 64-bit one.Quoted 3 lines
But on a 32-bit system without
CONFIG_XEN_BACKENDyou cannot allocate more than 4G anyway, so the choice ofram_addr_tis understandable in that case.QEMU build will probably fail with above config but if it succeeds then maxmem will be silently truncated.
Quoted 4 lines
On the other hand, on a 32-bit system without
CONFIG_XEN_BACKENDyou definitely can place 128M of hot plugged memory between say 4096MB and 4224MB.Quoted 7 lines
Quoted 4 lines
True.
Anyway for this patch
Reviewed-by Igor Mammedov <[email protected]>Who needs to take this patch? I'm not sure if I need to do anything further to push it forwards.
Most pc-dimm changes were merged either by me or Michael. I can merge it if I get an Acked-by from Michael.
Quoted 6 lines
Quoted 4 lines
Otherwise, Michael has my Acked-by if he wants to merge it through his tree.
Acked-by Eduardo Habkost <[email protected]>Ah, I didn't realise Michael worked in this area. Adding him to CC..
Ooops, I thought Michael was already on CC. He is the PC and PCI maintainer, but he has been merging machine.c and other generic hw/ patches recently.
I sent another message to qemu-devel today, asking people where could be the default destination for hw/core and other generic hw/ code that has no maintainer in MAINTAINERS.
Signature · 1 line
Eduardo