[Xen-devel] [RFC PATCH] p2m-pt: avoid get the pte falgs repeatedly.

2016-11-17 Thread Liang Li
There are a lot of code try to get the pte flags repeatedly, why not save the result and reuse it in the following code? It can help to save some CPU cycles and make the code cleaner, no? I am not sure if this is the right direction, just change one place. Signed-off-by: Liang Li --- xen/arch

[Xen-devel] [PATCH] libxc: Expose the MPX cpuid flag to guest

2016-01-11 Thread Liang Li
If hardware support memory protect externsion, expose this feature to guest by default. Users don't have to use a 'cpuid= ' option in config file to turn it on. Signed-off-by: Liang Li --- tools/libxc/xc_cpufeature.h | 1 + tools/libxc/xc_cpuid_x86.c | 6 ++ 2 files change

[Xen-devel] [RESEND] xen-netback: remove duplicated function definition

2015-07-05 Thread Liang Li
There are two duplicated xenvif_zerocopy_callback() definitions. Remove one of them. Signed-off-by: Liang Li --- drivers/net/xen-netback/common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 8a495b3..c6cb85a

[Xen-devel] [PATCH] xen-netback: remove duplicated function definition

2015-07-03 Thread Liang Li
There are two duplicated xenvif_zerocopy_callback() definitions. Remove one of them. Signed-off-by: Liang Li --- drivers/net/xen-netback/common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 8a495b3..c6cb85a

[Xen-devel] [v3] nested EPT: fix the handling of nested EPT

2015-06-29 Thread Liang Li
If the host EPT entry is changed, the nested EPT should be updated. the current code does not do this, and it's wrong. I have tested this patch, the L2 guest can boot and run as normal. Signed-off-by: Liang Li Signed-off-by: Yang Zhang Reported-by: Tim Deegan Reviewed-by: Tim Deegan ---

[Xen-devel] [PATCH] xen-netfront: Remove the meaningless code

2015-06-26 Thread Liang Li
The function netif_set_real_num_tx_queues() will return -EINVAL if the second parameter < 1, so call this function with the second parameter set to 0 is meaningless. Signed-off-by: Liang Li --- drivers/net/xen-netfront.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/net/

[Xen-devel] [v2 RESEND] nested EPT: fix the handling of nested EPT

2015-06-26 Thread Liang Li
If the host EPT entry is changed, the nested EPT should be updated. the current code does not do this, and it's wrong. I have tested this patch, the L2 guest can boot and run as normal. Signed-off-by: Liang Li Signed-off-by: Yang Zhang Reported-by: Tim Deegan --- xen/arch/x86/mm/p2m-ept.

[Xen-devel] [v2] nested EPT: fix the handling of nested EPT

2015-06-26 Thread Liang Li
If the host EPT entry is changed, the nested EPT should be updated. the current code does not do this, and it's wrong. I have tested this patch, the L2 guest can boot and run as normal. Signed-off-by: Liang Li Signed-off-by: Yang Zhang Reported-by: Tim Deegan --- xen/arch/x86/mm/p2m-ept.

[Xen-devel] [RESEND] nested EPT: fix the handling of nested EPT.

2015-06-02 Thread Liang Li
If the host EPT entry is changed, the nested EPT should be updated. The current code does not do this, and it's wrong. Reported-by: Tim Deegan Signed-off-by: Liang Li Signed-off-by: Yang Zhang --- xen/arch/x86/mm/p2m-ept.c | 4 1 file changed, 4 insertions(+) diff --git a/xen/arc

[Xen-devel] [PATCH] nested EPT: fix the handling of nested EPT.

2015-06-01 Thread Liang Li
If the host EPT entry is changed, the nested EPT should be updated. The current code does not do this, and it's wrong. Reported-by: Tim Deegan Signed-off-by: Liang Li Signed-off-by: Yang Zhang --- xen/arch/x86/mm/p2m-ept.c | 4 1 file changed, 4 insertions(+) diff --git a/xen/arc

[Xen-devel] [v2] VMX: replace some plain numbers

2015-04-16 Thread Liang Li
... making the code better document itself. No functional change intended. Signed-off-by: Liang Li --- xen/arch/x86/hvm/vmx/vmx.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 6c4f78c..892a3bc 100644

[Xen-devel] [PATCH] VMX: replace some plain numbers

2015-04-16 Thread Liang Li
... making the code better document itself. No functional change intended. Signed-off-by: Liang Li --- xen/arch/x86/hvm/vmx/vmx.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 6c4f78c..5e90027 100644

[Xen-devel] [PATCH] xen-pt: Fix bug cause PCI devices re-attach failed

2015-04-13 Thread Liang Li
d prevent the device's related QemuOpts object from being released properly, and then trigger the bug when the device is re-attached. I sent a patch to fix a similar bug before, but the patch could not fix the issue completely. Signed-off-by: Liang Li --- hw/xen/xen_pt.c | 18 +++

[Xen-devel] [PATCH] x86/hvm: Fix the unknown nested vmexit reason 80000021 bug

2015-04-07 Thread Liang Li
, while bits 10:8 in the IDT-vectoring information field is 2, bit 3 in the interruptibility-state field should be cleared to avoid the next VM entry fail. Signed-off-by: Liang Li --- xen/arch/x86/hvm/vmx/vmx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86

[Xen-devel] [v2] Avoid needless EPT table ajustment and cache flush

2015-02-04 Thread Liang Li
mmu(d) becoming true, force the p2m_memory_type_changed and flush_all when the first device is assigned to guest to amend this issue. Signed-off-by: Liang Li Signed-off-by: Yang Zhang Acked-by: Kevin Tian --- xen/arch/x86/hvm/mtrr.c | 2 +- xen/drivers/passthrough/pci.c | 7 +++ 2

[Xen-devel] [PATCH] Avoid needless flush cache when guest change MTRR

2015-02-03 Thread Liang Li
assigned to guest to amend this issue. Signed-off-by: Liang Li Signed-off-by: Yang Zhang --- xen/arch/x86/hvm/mtrr.c | 2 +- xen/drivers/passthrough/pci.c | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c index

[Xen-devel] [RFC] Add the panic info when disable VT-d

2015-01-19 Thread Liang Li
Before the chang, if setting iommu=0 option in xen boot option, the painc info is "Couldn't enable IOMMU and iomm=required/force", this will confuse the users because the iommu has been disabled. Signed-off-by: Liang Li --- xen/arch/x86/apic.c | 5 + 1 file changed, 5 inse

[Xen-devel] [PATCH] xen-pt: Fix PCI devices re-attach failed

2014-12-24 Thread Liang Li
ror: libxl_qmp.c:287:qmp_handle_error_response: receive an error message from QMP server: Duplicate ID 'pci-pt-03_10.1' for device. The count of calling xen_pt_region_add and xen_pt_region_del are not the same will cause the XenPCIPassthroughState and it's related QemuOpts object not be released

[Xen-devel] [v4] libxc: Expose the 1GB pages cpuid flag to guest

2014-11-28 Thread Liang Li
nge is okay for shadow mode case. Signed-off-by: Liang Li Signed-off-by: Yang Zhang --- tools/libxc/xc_cpuid_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index a18b1ff..c97f91a 100644 --- a/tools/libxc/xc_cpuid_x86.c ++

[Xen-devel] [v3] libxc: Expose the 1GB pages cpuid flag to guest

2014-11-27 Thread Liang Li
If hardware support the 1GB pages, expose the feature to guest by default. Users don't have to use a 'cpuid= ' option in config fil e to turn it on. Signed-off-by: Liang Li Signed-off-by: Yang Zhang --- tools/libxc/xc_cpuid_x86.c | 3 +++ xen/arch/x86/hvm/hvm.c | 2 +- 2 f

[Xen-devel] [PATCH] libxc: Expose the pdpe1gb cpuid flag to guest

2014-11-16 Thread Liang Li
If hardware support the pdpe1gb flag, expose it to guest by default. Users don't have to use a 'cpuid= ' option in config file to turn it on. Signed-off-by: Liang Li --- tools/libxc/xc_cpuid_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/libxc/xc_cpuid_x86.