profile
viewpoint
Eddie Dong dongyaozu Intel Eddie Dong, Intel Opensource Technology Center, is one of the early virtualization developers, from the time Xen/KVM was initiated.

dongyaozu/acrn-devicemodel 0

Project ACRN Device Model

dongyaozu/acrn-documentation 0

Project ACRN Documentation

dongyaozu/acrn-hypervisor 0

Project ACRN hypervisor

dongyaozu/acrn-kernel 0

Kernel tree for ACRN

dongyaozu/HammerDB 0

HammerDB Database Load Testing and Benchmarking Tool

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentprojectacrn/acrn-hypervisor

Keep XML and source code aligned

@jsun26intel can u ack?

donsheng

comment created time in a month

Pull request review commentprojectacrn/acrn-hypervisor

HV: correct hpa calculation for pre-launched VM

 static void prepare_prelaunched_vm_memmap(struct acrn_vm *vm, const struct acrn_ 					|| (entry->type == E820_TYPE_ACPI_NVS)) { 				ept_add_mr(vm, (uint64_t *)vm->arch_vm.nworld_eptp, base_hpa, entry->baseaddr, 					entry->length, EPT_RWX | EPT_WB);+				base_hpa += entry->length;+				remaining_hpa_size -= entry->length; 			}  			/* GPAs under 1MB are always backed by physical memory */ 			if ((entry->type != E820_TYPE_RAM) && (entry->baseaddr < (uint64_t)MEM_1M)) { 				ept_add_mr(vm, (uint64_t *)vm->arch_vm.nworld_eptp, base_hpa, entry->baseaddr, 					entry->length, EPT_RWX | EPT_UNCACHED);+				base_hpa += entry->length;+				remaining_hpa_size -= entry->length;

The action is same. Seems we can merge the 2 "if () {}". Can we?

jsun26intel

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

fork dongyaozu/HammerDB

HammerDB Database Load Testing and Benchmarking Tool

http://www.hammerdb.com

fork in 2 months

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentprojectacrn/acrn-hypervisor

Convert PCI UART paramter from a BDF string to a hex value

 def get_serial_console(config):     elif serial_type == "mmio" and pci_mmio:         print("CONFIG_SERIAL_PCI=y", file=config)         if serial_value:-            print('CONFIG_SERIAL_PCI_BDF="{}"'.format(serial_value), file=config)+            bus = int(serial_value.strip("'").split(':')[0], 16)+            dev = int(serial_value.strip("'").split(':')[1].split(".")[0], 16)+            fun = int(serial_value.strip("'").split('.')[1], 16)+            value = ((bus & 0xFF) << 8) | ((dev & 0x1F) << 3) | (fun & 0x7)+            print('CONFIG_SERIAL_PCI_BDF={}'.format(hex(value)), file=config)

Can you generate a comment line for the BDF in B:D:F format to be more readable too?

shuox

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentprojectacrn/acrn-hypervisor

Cleanup deprecated terms

 static void vpic_notify_intr(struct acrn_vpic *vpic) 	uint32_t pin;  	/*-	 * First check the slave.+	 * First check the Secondary. 	 */ 	i8259 = &vpic->i8259[1]; 	pin = vpic_get_highest_irrpin(i8259); 	if (!i8259->intr_raised && (pin < NR_VPIC_PINS_PER_CHIP)) { 		dev_dbg(DBG_LEVEL_PIC,-		"pic slave notify pin = %hhu (imr 0x%x irr 0x%x isr 0x%x)\n",+		"pic secondary notify pin = %hhu (imr 0x%x irr 0x%x isr 0x%x)\n", 		pin, i8259->mask, i8259->request, i8259->service);  		/*-		 * Cascade the request from the slave to the master.+		 * Cascade the request from the Secondary to the Primary.

secondary PIC to primary PIC

yonghuah

comment created time in 2 months

Pull request review commentprojectacrn/acrn-hypervisor

Cleanup deprecated terms

 static void vpic_notify_intr(struct acrn_vpic *vpic) 	uint32_t pin;  	/*-	 * First check the slave.+	 * First check the Secondary. 	 */ 	i8259 = &vpic->i8259[1]; 	pin = vpic_get_highest_irrpin(i8259); 	if (!i8259->intr_raised && (pin < NR_VPIC_PINS_PER_CHIP)) { 		dev_dbg(DBG_LEVEL_PIC,-		"pic slave notify pin = %hhu (imr 0x%x irr 0x%x isr 0x%x)\n",+		"pic secondary notify pin = %hhu (imr 0x%x irr 0x%x isr 0x%x)\n", 		pin, i8259->mask, i8259->request, i8259->service);  		/*-		 * Cascade the request from the slave to the master.+		 * Cascade the request from the Secondary to the Primary. 		 */ 		i8259->intr_raised = true; 		vpic_set_pinstate(vpic, 2U, 1U); 		vpic_set_pinstate(vpic, 2U, 0U); 	} else { 		dev_dbg(DBG_LEVEL_PIC,-		"pic slave no eligible interrupt (imr 0x%x irr 0x%x isr 0x%x)",+		"pic secondary no eligible interrupt (imr 0x%x irr 0x%x isr 0x%x)",

ditto

yonghuah

comment created time in 2 months

Pull request review commentprojectacrn/acrn-hypervisor

Cleanup deprecated terms

 static void vpic_notify_intr(struct acrn_vpic *vpic) 	uint32_t pin;  	/*-	 * First check the slave.+	 * First check the Secondary. 	 */ 	i8259 = &vpic->i8259[1]; 	pin = vpic_get_highest_irrpin(i8259); 	if (!i8259->intr_raised && (pin < NR_VPIC_PINS_PER_CHIP)) { 		dev_dbg(DBG_LEVEL_PIC,-		"pic slave notify pin = %hhu (imr 0x%x irr 0x%x isr 0x%x)\n",+		"pic secondary notify pin = %hhu (imr 0x%x irr 0x%x isr 0x%x)\n",

Secondary PIC

yonghuah

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentprojectacrn/acrn-hypervisor

Cleanup deprecated terms

 static void vpic_notify_intr(struct acrn_vpic *vpic) 	uint32_t pin;  	/*-	 * First check the slave.+	 * First check the Secondary.

secondary VPIC

yonghuah

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentprojectacrn/acrn-hypervisor

acrn-config: refinement for CAT/MBA

 #define BOARD_INFO_H  #define MAX_PCPU_NUM			4U-#define MAX_PLATFORM_CLOS_NUM		0U+#define HV_SUPPORTED_MAX_CLOS		0U

Can we add a comment for the MACRO HV_SUPPORTED_MAX_CLOS to explain what it mean?

donsheng

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentprojectacrn/acrn-hypervisor

acrn-config: refinement for CAT/MBA

I am ok with the patch. Terry can ack.

donsheng

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentprojectacrn/acrn-hypervisor

Cpu caps fixup

 bool is_apl_platform(void) { 	bool ret = false; -	if ((boot_cpu_data.displayfamily == 0x6U) && (boot_cpu_data.displaymodel == 0x92U)) {+	if ((boot_cpu_data.displayfamily == 0x6U) && (boot_cpu_data.displaymodel == 0x5c)) {

Any reason for this change? It is completely different. BTW 0x5c -->0x5CU ?

liujunming

comment created time in 2 months

Pull request review commentprojectacrn/acrn-hypervisor

acrn-config/HV: fix build issue while CDP_ENABLED=y

 const uint16_t hv_clos = 0U;  * clos value (valid_clos_num) that is common between the resources as  * each resource's clos max value to have consistent allocation.  */-uint16_t valid_clos_num = MAX_PLATFORM_CLOS_NUM;

If this is a simple rename, make it a separate patch and PR later with right explaination. Rename is less critical.

liuwei987

comment created time in 2 months

Pull request review commentprojectacrn/acrn-hypervisor

acrn-config/HV: fix build issue while CDP_ENABLED=y

 const uint16_t hv_clos = 0U;  * clos value (valid_clos_num) that is common between the resources as  * each resource's clos max value to have consistent allocation.  */-uint16_t valid_clos_num = MAX_PLATFORM_CLOS_NUM;

I have same question: Why we need this change? I didn't see the reasons.

liuwei987

comment created time in 2 months

pull request commentprojectacrn/acrn-hypervisor

Makefile: modify the realpath to abspath function

@terryzouhao your turn

liuwei987

comment created time in 3 months

Pull request review commentprojectacrn/acrn-hypervisor

hv: Fix issue in size used for memset in create_vm

 int32_t create_vm(uint16_t vm_id, uint64_t pcpu_bitmap, struct acrn_vm_config *v  	/* Allocate memory for virtual machine */ 	vm = &vm_array[vm_id];-	/* the vm_state lock field need to remain unchanged in vm data structure */-	(void)memset((void *)&vm->arch_vm, 0U, (sizeof(struct acrn_vm) - sizeof(spinlock_t)));+	/*+	 * the vm_state lock field need to remain unchanged in vm data structure+	 * Since arch_vm struct is page aligned, size used for memeset should consider+	 * subtracting 4K from the total size of acrn_vm.+	 * Using offset_of macro to avoid hardcoding 4k here.+	 */+	(void)memset((void *)&vm->arch_vm, 0U, (sizeof(struct acrn_vm) - offsetof(struct acrn_vm, arch_vm)));

Oh, the current definition of struct acrn_vm may waste ~1 page of memory. We need a cleaner solution.

sainath14

comment created time in 3 months

Pull request review commentprojectacrn/acrn-hypervisor

hv: Fix issue in size used for memset in create_vm

 int32_t create_vm(uint16_t vm_id, uint64_t pcpu_bitmap, struct acrn_vm_config *v  	/* Allocate memory for virtual machine */ 	vm = &vm_array[vm_id];-	/* the vm_state lock field need to remain unchanged in vm data structure */-	(void)memset((void *)&vm->arch_vm, 0U, (sizeof(struct acrn_vm) - sizeof(spinlock_t)));+	/*+	 * the vm_state lock field need to remain unchanged in vm data structure+	 * Since arch_vm struct is page aligned, size used for memeset should consider+	 * subtracting 4K from the total size of acrn_vm.+	 * Using offset_of macro to avoid hardcoding 4k here.+	 */+	(void)memset((void *)&vm->arch_vm, 0U, (sizeof(struct acrn_vm) - offsetof(struct acrn_vm, arch_vm)));

I see. What we want to reset is from arch_vm to the end of vm structure. Will " (size_t *) (vm+1) - (size_t) &vm->arch_vm" be easier to reader?

You decide.

sainath14

comment created time in 3 months

Pull request review commentprojectacrn/acrn-hypervisor

HV: move vm configuration check to pre-build time

 void prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config) void launch_vms(uint16_t pcpu_id) { 	uint16_t vm_id;+	uint64_t pre_vm_cpu_affinity = 0UL; 	struct acrn_vm_config *vm_config;  	for (vm_id = 0U; vm_id < CONFIG_MAX_VM_NUM; vm_id++) { 		vm_config = get_vm_config(vm_id);-		if ((vm_config->load_order == SOS_VM) || (vm_config->load_order == PRE_LAUNCHED_VM)) {-			if (vm_config->load_order == SOS_VM) {-				sos_vm_ptr = &vm_array[vm_id];+		if (vm_config->load_order == PRE_LAUNCHED_VM) {+			pre_vm_cpu_affinity |= vm_config->cpu_affinity;+			if (pcpu_id == get_configured_bsp_pcpu_id(vm_config)) {+				prepare_vm(vm_id, vm_config); 			}-+		} else if (vm_config->load_order == SOS_VM) {+			/* Deduct pcpus of PRE_LAUNCHED_VMs */+			vm_config->cpu_affinity = ALL_CPUS_MASK ^ pre_vm_cpu_affinity;+			if (vm_config->cpu_affinity == 0UL) {+			/* in case physical cores are not all up as expected */+				pr_err("no vCPUs for SOS VM (vm id: %d)", vm_id);+				break;+			}

This way, we can avoid the above code. "break" is somehow not liked...

jsun26intel

comment created time in 3 months

Pull request review commentprojectacrn/acrn-hypervisor

HV: move vm configuration check to pre-build time

 void prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config) void launch_vms(uint16_t pcpu_id) { 	uint16_t vm_id;+	uint64_t pre_vm_cpu_affinity = 0UL;

The way to calculate pre_vm_cpu_affinity has problems. This API is called multiple times (per PCPU).

I am thinking we can let the offline to configure the SOS affinity, not by our code. How do you think?

We then have some @pre to those VMs' affinity..

jsun26intel

comment created time in 3 months

Pull request review commentprojectacrn/acrn-hypervisor

HV: move vm configuration check to pre-build time

 void prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config) void launch_vms(uint16_t pcpu_id) { 	uint16_t vm_id;+	uint64_t pre_vm_cpu_affinity = 0UL; 	struct acrn_vm_config *vm_config;  	for (vm_id = 0U; vm_id < CONFIG_MAX_VM_NUM; vm_id++) { 		vm_config = get_vm_config(vm_id);-		if ((vm_config->load_order == SOS_VM) || (vm_config->load_order == PRE_LAUNCHED_VM)) {-			if (vm_config->load_order == SOS_VM) {-				sos_vm_ptr = &vm_array[vm_id];+		if (vm_config->load_order == PRE_LAUNCHED_VM) {+			pre_vm_cpu_affinity |= vm_config->cpu_affinity;+			if (pcpu_id == get_configured_bsp_pcpu_id(vm_config)) {+				prepare_vm(vm_id, vm_config); 			}-+		} else if (vm_config->load_order == SOS_VM) {+			/* Deduct pcpus of PRE_LAUNCHED_VMs */+			vm_config->cpu_affinity = ALL_CPUS_MASK ^ pre_vm_cpu_affinity;+			if (vm_config->cpu_affinity == 0UL) {+			/* in case physical cores are not all up as expected */+				pr_err("no vCPUs for SOS VM (vm id: %d)", vm_id);+				break;+			}
    for (vm_id = 0U; vm_id < CONFIG_MAX_VM_NUM; vm_id++) {
            vm_config = get_vm_config(vm_id);
            if ((vm_config->load_order == SOS_VM) || (vm_config->load_order == PRE_LAUNCHED_VM)) {
                    if (pcpu_id == get_configured_bsp_pcpu_id(vm_config)) {
                            prepare_vm(vm_id, vm_config);
                    }
            }
            if ((vm_config->load_order == SOS_VM && pcpu_id == BSP) {
                  sos_vm_ptr = &vm_array[vm_id];
           }
    }

??

jsun26intel

comment created time in 3 months

Pull request review commentprojectacrn/acrn-hypervisor

HV: move vm configuration check to pre-build time

 void prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config) void launch_vms(uint16_t pcpu_id) { 	uint16_t vm_id;+	uint64_t pre_vm_cpu_affinity = 0UL; 	struct acrn_vm_config *vm_config;  	for (vm_id = 0U; vm_id < CONFIG_MAX_VM_NUM; vm_id++) { 		vm_config = get_vm_config(vm_id); 		if ((vm_config->load_order == SOS_VM) || (vm_config->load_order == PRE_LAUNCHED_VM)) {

In this case, will "split this if ( .. == SOS_VM || .. == PRE_LAUNCHED_VM)" to "if (...SOS_VM) .... else {}" simplify the code?

jsun26intel

comment created time in 3 months

more