diff --git a/add-virtcca-support.patch b/add-virtcca-support.patch index 007d437d8f71221645aca102725fade1ca3cd72c..b9e4c8ce11c82b59b62471f6af5a31a383ef5a36 100644 --- a/add-virtcca-support.patch +++ b/add-virtcca-support.patch @@ -643,7 +643,7 @@ index df3b1e5..1d64508 100644 def load_compute_driver(virtapi, compute_driver=None): """Load a compute driver module. diff --git a/nova/virt/hardware.py b/nova/virt/hardware.py -index feeef57..79de856 100644 +index feeef57..c70f781 100644 --- a/nova/virt/hardware.py +++ b/nova/virt/hardware.py @@ -38,6 +38,22 @@ MEMPAGES_SMALL = -1 @@ -761,7 +761,7 @@ index feeef57..79de856 100644 def _get_numa_pagesize_constraint( flavor: 'objects.Flavor', -@@ -2411,3 +2505,384 @@ def check_hw_rescue_props(image_meta): +@@ -2411,3 +2505,381 @@ def check_hw_rescue_props(image_meta): """ hw_rescue_props = ['hw_rescue_device', 'hw_rescue_bus'] return any(key in image_meta.properties for key in hw_rescue_props) @@ -783,10 +783,10 @@ index feeef57..79de856 100644 + '%(host_secure_cell)s', {'cell': instance_cell, 'host_secure_cell': host_secure_cell}) + + origin_secure_mem = instance_cell.memory ++ unsecure_cell_memory = 0 + -+ instance_cell.memory = 0 + if instance_cell.pagesize == None and cell_index == 0: -+ instance_cell.memory = get_swiotlb_buffer_constraint(flavor, VIRTCCA_SWIOTLB_BUFFER_DEFAULT) ++ unsecure_cell_memory = get_swiotlb_buffer_constraint(flavor, VIRTCCA_SWIOTLB_BUFFER_DEFAULT) + + if ( + 'pagesize' in instance_cell and @@ -823,13 +823,13 @@ index feeef57..79de856 100644 + # we want to allow overcommit in this case as we're not using + # hugepages + if not host_cell.can_fit_pagesize(pagesize, -+ instance_cell.memory * units.Ki, ++ unsecure_cell_memory * units.Ki, + use_free=False): + LOG.debug('Not enough available memory to schedule instance ' + 'with pagesize %(pagesize)d. Required: ' + '%(required)s, available: %(available)s, total: ' + '%(total)s.', -+ {'required': instance_cell.memory, ++ {'required': unsecure_cell_memory, + 'available': host_cell.avail_memory, + 'total': host_cell.memory, + 'pagesize': pagesize}) @@ -841,10 +841,10 @@ index feeef57..79de856 100644 + # itself on any NUMA cell, i.e. with 'ram_allocation_ratio = 2.0' + # on a host with 1GB RAM, we should allow two 1GB instances but not + # one 2GB instance. -+ if instance_cell.memory > host_cell.memory: ++ if unsecure_cell_memory > host_cell.memory: + LOG.debug('Not enough host cell memory to fit instance cell. ' + 'Required: %(required)d, actual: %(actual)d', -+ {'required': instance_cell.memory, ++ {'required': unsecure_cell_memory, + 'actual': host_cell.memory}) + return None + @@ -896,12 +896,12 @@ index feeef57..79de856 100644 + 'num_cpu_reserved': cpuset_reserved}) + return None + -+ if instance_cell.memory > host_cell.avail_memory: ++ if unsecure_cell_memory > host_cell.avail_memory: + LOG.debug('Not enough available memory to schedule instance. ' + 'Oversubscription is not possible with pinned ' + 'instances. Required: %(required)s, available: ' + '%(available)s, total: %(total)s. ', -+ {'required': instance_cell.memory, ++ {'required': unsecure_cell_memory, + 'available': host_cell.avail_memory, + 'total': host_cell.memory}) + return None @@ -931,7 +931,7 @@ index feeef57..79de856 100644 + {'usage': cpu_usage, 'limit': cpu_limit}) + return None + -+ ram_usage = host_cell.memory_usage + instance_cell.memory ++ ram_usage = host_cell.memory_usage + unsecure_cell_memory + ram_limit = host_cell.memory * limits.ram_allocation_ratio + if ram_usage > ram_limit: + LOG.debug('Host cell has limitations on usable memory. There is ' @@ -948,7 +948,6 @@ index feeef57..79de856 100644 + {'required': origin_secure_mem, + 'available': host_secure_cell.avail_memory, + 'total': host_secure_cell.memory}) -+ instance_cell.memory = origin_secure_mem + return None + + orc_numa_name = f"{VIRTCCA_SECURE_NUMA_1G_PAGE_PREFIX}{host_secure_cell.id}" @@ -957,10 +956,8 @@ index feeef57..79de856 100644 + numa_entry_1g = numa_entry_1g -1 + + if numa_entry_1g > secure_numa_page.get(orc_numa_name, 0): -+ instance_cell.memory = origin_secure_mem + return None + -+ instance_cell.memory = origin_secure_mem + instance_cell.id = host_cell.id + return instance_cell + diff --git a/openstack-nova.spec b/openstack-nova.spec index ab8bbd8c2b7f7ade63c2b18d0175f14dc742c41a..d6a7f3e012849808ce4f27f5217f5c68f0badb0f 100644 --- a/openstack-nova.spec +++ b/openstack-nova.spec @@ -17,7 +17,7 @@ Name: openstack-nova # Liberty semver reset # https://review.openstack.org/#/q/I6a35fa0dda798fad93b804d00a46af80f08d475c,n,z Version: 23.2.2 -Release: 4 +Release: 5 Summary: OpenStack Compute (nova) License: ASL 2.0 @@ -728,6 +728,9 @@ exit 0 %endif %changelog +* Tue Jun 10 2025 Panhengchang - 23.2.2-5 +- Fix fix unintended modification of input parameter in virtcca + * Thu Jun 5 2025 liuhao - 23.2.2-4 - Add virtcca support