[BUG] kernel crash with CONFIG_SPARSEMEM on my ia32 box

2007-08-30 Thread bibo,mao
function memory_present(). That means only E820_ram space has mem_map space allocated. so system crashed in function set_highmem_pages_init(), if pfn points to E820_reserve space, pfn_to_page(pfn) will point to unallocated page area. thanks bibo,mao Here is crashing log

Re: [BUG] kernel crash with CONFIG_SPARSEMEM on my ia32 box

2007-08-30 Thread bibo,mao
I tried 2.6.21 version, it also crashed similarly. thanks bibo,mao Andrew Morton wrote: On Fri, 31 Aug 2007 09:49:53 +0800 "bibo,mao" <[EMAIL PROTECTED]> wrote: > Hi, Let's cc linux-mm. >I have one machine with 4G memory and 1G pci memory hole > betwee

[Patch] ia64 enable singlestep on system call

2007-01-31 Thread bibo,mao
his. Any comments is welcome. Signed-off-by: bibo, mao <[EMAIL PROTECTED]> thanks bibo,mao arch/ia64/kernel/ptrace.c | 12 ++-- include/asm-ia64/thread_info.h |4 +++- 2 files changed, 9 insertions(+), 7 deletions(-)

Re: [PATCH] EFI x86: pass firmware call parameters on the stack

2007-01-31 Thread bibo,mao
hat is different from x86_64 linux convention. How about adding EFIAPI prefix before efi runtime service function, this prefix has different definition in different architecture. thanks bibo,mao --- 2.6.20-rc6/include/linux/efi.h.bak 2007-02-01 10:49:13.0 +0800 +++ 2.6.20-rc6/include/l

Re: [PATCH] EFI x86: pass firmware call parameters on the stack

2007-02-01 Thread bibo,mao
Frederic Riss wrote: 2007/2/1, bibo,mao <[EMAIL PROTECTED]>: currently x86_64 kernel does not support efi, efi convention comply to MS convention. On ia32 parameter is passed on stack, on x86_64 parameter is passed by registers but that is different from x86_64 linux convention. Is an

Re: [PATCH] x86_64: change early_ioremap to static

2007-06-01 Thread bibo,mao
hi yinghai, early_ioremap is useful for early firmware access such as efi memory map table which does not reside at low memory address. efi patch patch will use this function, initial efi patch has posted. thanks bibo,mao Yinghai Lu wrote: [PATCH] x86_64: change early_ioremap to static only

[PATCH 1/5] LoongArch: KVM: Add hypercall instruction emulation support

2024-01-02 Thread Bibo Mao
On LoongArch system, hypercall instruction is supported when system runs on VM mode. This patch adds dummy function with hypercall instruction emulation, rather than inject EXCCODE_INE invalid instruction exception. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch

[PATCH 0/5] LoongArch: Add pv ipi support on LoongArch VM

2024-01-02 Thread Bibo Mao
) 42.4 56665.3 13364.4 Shell Scripts (8 concurrent) 6.0 7412.1 12353.4 System Call Overhead 15000.06962239.6 4641.5 System Benchmarks Index Score7205.8 Bibo Mao (5): LoongArch: KVM: Add hypercall

[PATCH 4/5] LoongArch: Add paravirt interface for guest kernel

2024-01-02 Thread Bibo Mao
-off-by: Bibo Mao --- arch/loongarch/Kconfig| 8 arch/loongarch/include/asm/kvm_para.h | 7 arch/loongarch/include/asm/paravirt.h | 27 .../include/asm/paravirt_api_clock.h | 1 + arch/loongarch/kernel/Makefile

[PATCH 2/5] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-01-02 Thread Bibo Mao
System will trap into hypervisor when executing cpucfg instruction. And now hardware only uses the area 0 - 20 for actual usage, here one specified area 0x1000 -- 0x10ff is used for KVM hypervisor, and the area can be extended for other hypervisors in future. Signed-off-by: Bibo Mao

[PATCH 5/5] LoongArch: Add pv ipi support on LoongArch system

2024-01-02 Thread Bibo Mao
: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/kvm_para.h | 124 + arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kernel/irq.c| 2 +- arch/loongarch/kernel/paravirt.c | 103

[PATCH 3/5] LoongArch/smp: Refine ipi ops on LoongArch platform

2024-01-02 Thread Bibo Mao
pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include/asm/smp.h | 31 +++ arch/loongarch/kernel/irq.c | 22 +-- arch/loongarch/kernel/perf_event.c

[PATCH v2 1/6] LoongArch: KVM: Add hypercall instruction emulation support

2024-01-07 Thread Bibo Mao
On LoongArch system, hypercall instruction is supported when system runs on VM mode. This patch adds dummy function with hypercall instruction emulation, rather than inject EXCCODE_INE invalid instruction exception. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch

[PATCH v2 2/6] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-01-07 Thread Bibo Mao
System will trap into hypervisor when executing cpucfg instruction. And now hardware only uses the area 0 - 20 for actual usage, here one specified area 0x1000 -- 0x10ff is used for KVM hypervisor, and the area can be extended for other hypervisors in future. Signed-off-by: Bibo Mao

[PATCH v2 0/6] LoongArch: Add pv ipi support on LoongArch VM

2024-01-07 Thread Bibo Mao
routing uses hw cpuid 2. Refine changelog description 3. Add hypercall statistic support for vcpu 4. Set percpu pv ipi message buffer aligned with cacheline 5. Refine pv ipi send logic, do not send ipi message with if there is pending ipi message. --- Bibo Mao (6): LoongArch: KVM: Add

[PATCH v2 3/6] LoongArch: SMP: Refine ipi ops on LoongArch platform

2024-01-07 Thread Bibo Mao
pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include/asm/smp.h | 31 +++ arch/loongarch/kernel/irq.c | 22 +-- arch/loongarch/kernel/perf_event.c

[PATCH v2 4/6] LoongArch: Add paravirt interface for guest kernel

2024-01-07 Thread Bibo Mao
KVM hypervisor, and there is only KVM hypervisor supported on LoongArch now. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 9 arch/loongarch/include/asm/kvm_para.h | 7 arch/loongarch/include/asm/paravirt.h | 27 .../include/asm

[PATCH v2 6/6] LoongArch: Add pv ipi support on LoongArch system

2024-01-07 Thread Bibo Mao
hypervisor greatly. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/kvm_host.h | 1 + arch/loongarch/include/asm/kvm_para.h | 124 + arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kernel/irq.c

[PATCH v2 5/6] LoongArch: KVM: Add physical cpuid map support

2024-01-07 Thread Bibo Mao
smallest cpuid from extioi, and the max cpuid size is defines as 256. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 26 arch/loongarch/include/asm/kvm_vcpu.h | 1 + arch/loongarch/kvm/vcpu.c | 61 ++- arch/loongarch/kvm/vm.c

[PATCH v3 0/6] LoongArch: Add pv ipi support on LoongArch VM

2024-01-22 Thread Bibo Mao
changelog description 3. Add hypercall statistic support for vcpu 4. Set percpu pv ipi message buffer aligned with cacheline 5. Refine pv ipi send logic, do not send ipi message with if there is pending ipi message. --- Bibo Mao (6): LoongArch/smp: Refine ipi ops on LoongArch platform

[PATCH v3 3/6] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-01-22 Thread Bibo Mao
System will trap into hypervisor when executing cpucfg instruction. And now hardware only uses the area 0 - 20 for actual usage, here one specified area 0x1000 -- 0x10ff is used for KVM hypervisor, and the area can be extended for other hypervisors in future. Signed-off-by: Bibo Mao

[PATCH v3 4/6] LoongArch: Add paravirt interface for guest kernel

2024-01-22 Thread Bibo Mao
KVM hypervisor, since there is only KVM hypervisor supported on LoongArch now. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 9 arch/loongarch/include/asm/kvm_para.h | 7 arch/loongarch/include/asm/paravirt.h | 27 .../include

[PATCH v3 6/6] LoongArch: Add pv ipi support on LoongArch system

2024-01-22 Thread Bibo Mao
hypervisor greatly. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/kvm_host.h | 1 + arch/loongarch/include/asm/kvm_para.h | 124 + arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kernel/irq.c

[PATCH v3 2/6] LoongArch: KVM: Add hypercall instruction emulation support

2024-01-22 Thread Bibo Mao
On LoongArch system, hypercall instruction is supported when system runs on VM mode. This patch adds dummy function with hypercall instruction emulation, rather than inject EXCCODE_INE invalid instruction exception. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch

[PATCH v3 5/6] LoongArch: KVM: Add physical cpuid map support

2024-01-22 Thread Bibo Mao
smallest cpuid from extioi, and the max cpuid size is defines as 256. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 26 arch/loongarch/include/asm/kvm_vcpu.h | 1 + arch/loongarch/kvm/vcpu.c | 93 ++- arch/loongarch/kvm/vm.c

[PATCH v3 1/6] LoongArch/smp: Refine ipi ops on LoongArch platform

2024-01-22 Thread Bibo Mao
pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include/asm/smp.h | 31 +++ arch/loongarch/kernel/irq.c | 22 +-- arch/loongarch/kernel/perf_event.c

[PATCH v4 1/6] LoongArch/smp: Refine ipi ops on LoongArch platform

2024-01-31 Thread Bibo Mao
structure smp_ops on LoongArch platform so that pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include/asm/smp.h | 31 +++ arch/loongarch/kernel/irq.c | 22

[PATCH v4 3/6] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-01-31 Thread Bibo Mao
VM will trap into hypervisor when executing cpucfg instruction. And hardware only uses the area 0 - 20 for actual usage now, here one specified area 0x4000 -- 0x40ff is used for KVM hypervisor, and the area can be extended to use for other hypervisors in future. Signed-off-by: Bibo Mao

[PATCH v4 2/6] LoongArch: KVM: Add hypercall instruction emulation support

2024-01-31 Thread Bibo Mao
On LoongArch system, hypercall instruction is supported when system runs on VM mode. This patch adds dummy function with hypercall instruction emulation, rather than inject EXCCODE_INE invalid instruction exception. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch

[PATCH v4 0/6] LoongArch: Add pv ipi support on LoongArch VM

2024-01-31 Thread Bibo Mao
pending ipi message. --- Bibo Mao (6): LoongArch/smp: Refine ipi ops on LoongArch platform LoongArch: KVM: Add hypercall instruction emulation support LoongArch: KVM: Add cpucfg area for kvm hypervisor LoongArch: Add paravirt interface for guest kernel LoongArch: KVM: Add vcpu search

[PATCH v4 4/6] LoongArch: Add paravirt interface for guest kernel

2024-01-31 Thread Bibo Mao
is KVM hypervisor, since there is only KVM hypervisor supported on LoongArch now. This patch only adds paravirt interface for guest kernel, however there is not effective pv functions added here. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 9 arch/loongarch

[PATCH v4 5/6] LoongArch: KVM: Add vcpu search support from physical cpuid

2024-01-31 Thread Bibo Mao
different size declaration about physical cpuid, KVM uses the smallest cpuid from extioi irqchip, and the max cpuid size is defines as 256. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 26 arch/loongarch/include/asm/kvm_vcpu.h | 1 + arch/loongarch/kvm/vcpu.c

[PATCH v4 6/6] LoongArch: Add pv ipi support on LoongArch system

2024-01-31 Thread Bibo Mao
trap times into hypervisor greatly. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/kvm_host.h | 1 + arch/loongarch/include/asm/kvm_para.h | 124 + arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch

[PATCH v5 1/6] LoongArch/smp: Refine some ipi functions on LoongArch platform

2024-02-21 Thread Bibo Mao
encoding, the ipi hw will convert it into bitmap in ipi message buffer. 3. Add structure smp_ops on LoongArch platform so that pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include

[PATCH v5 0/6] LoongArch: Add pv ipi support on LoongArch VM

2024-02-21 Thread Bibo Mao
cpu pv ipi message buffer aligned with cacheline 5. Refine pv ipi send logic, do not send ipi message with if there is pending ipi message. --- Bibo Mao (6): LoongArch/smp: Refine some ipi functions on LoongArch platform LoongArch: KVM: Add hypercall instruction emulation support LoongArch

[PATCH v5 3/6] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-02-21 Thread Bibo Mao
PV features, and the area can be extended for other hypervisors in future. This area will never be used for real HW, it is only used by software. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/inst.h | 1 + arch/loongarch/include/asm/loongarch.h | 10 ++ arch/loongarch/kvm/exit.c

[PATCH v5 2/6] LoongArch: KVM: Add hypercall instruction emulation support

2024-02-21 Thread Bibo Mao
value KVM_HCALL_INVALID_CODE, rather than inject EXCCODE_INE invalid instruction exception. So VM can continue to executing the next code. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch/loongarch/include/asm/kvm_para.h | 26 ++ arch

[PATCH v5 4/6] LoongArch: Add paravirt interface for guest kernel

2024-02-21 Thread Bibo Mao
is KVM hypervisor, since there is only KVM hypervisor supported on LoongArch now. There is not effective with pv_ipi_init() now, it is dummy function. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 9 arch/loongarch/include/asm/kvm_para.h | 7

[PATCH v5 5/6] LoongArch: KVM: Add vcpu search support from physical cpuid

2024-02-21 Thread Bibo Mao
as 256 by KVM which comes from extioi irqchip. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 26 arch/loongarch/include/asm/kvm_vcpu.h | 1 + arch/loongarch/kvm/vcpu.c | 93 ++- arch/loongarch/kvm/vm.c | 11 4

[PATCH v5 6/6] LoongArch: Add pv ipi support on LoongArch system

2024-02-21 Thread Bibo Mao
into hypervisor greatly. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/kvm_host.h | 1 + arch/loongarch/include/asm/kvm_para.h | 123 + arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kernel/irq.c

[PATCH v6 2/7] LoongArch: KVM: Add hypercall instruction emulation support

2024-03-02 Thread Bibo Mao
value KVM_HCALL_INVALID_CODE, rather than inject EXCCODE_INE invalid instruction exception. So VM can continue to executing the next code. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch/loongarch/include/asm/kvm_para.h | 26 ++ arch

[PATCH v6 3/7] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-03-02 Thread Bibo Mao
PV features, and the area can be extended for other hypervisors in future. This area will never be used for real HW, it is only used by software. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/inst.h | 1 + arch/loongarch/include/asm/loongarch.h | 10 + arch/loongarch/kvm/exit.c

[PATCH v6 0/7] LoongArch: Add pv ipi support on LoongArch VM

2024-03-02 Thread Bibo Mao
age buffer aligned with cacheline 5. Refine pv ipi send logic, do not send ipi message with if there is pending ipi message. --- Bibo Mao (7): LoongArch/smp: Refine some ipi functions on LoongArch platform LoongArch: KVM: Add hypercall instruction emulation support LoongArch: KVM: Add cpucf

[PATCH v6 1/7] LoongArch/smp: Refine some ipi functions on LoongArch platform

2024-03-02 Thread Bibo Mao
encoding, the ipi hw will convert it into bitmap in ipi message buffer. 3. Add structure smp_ops on LoongArch platform so that pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include

[PATCH v6 4/7] LoongArch: KVM: Add vcpu search support from physical cpuid

2024-03-02 Thread Bibo Mao
as 256 by KVM which comes from extioi irqchip. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 26 arch/loongarch/include/asm/kvm_vcpu.h | 1 + arch/loongarch/kvm/vcpu.c | 93 ++- arch/loongarch/kvm/vm.c | 11 4

[PATCH v6 6/7] LoongArch: Add pv ipi support on guest kernel side

2024-03-02 Thread Bibo Mao
interrupt acknowledge. And IPI message is stored in DDR, no trap in get IPI message. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 9 ++ arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/paravirt.h | 27 .../include/asm

[PATCH v6 5/7] LoongArch: KVM: Add pv ipi support on kvm side

2024-03-02 Thread Bibo Mao
into hypervisor greatly. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 1 + arch/loongarch/include/asm/kvm_para.h | 130 + arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kvm/exit.c | 76 ++- arch/loongarch

[PATCH v6 7/7] Documentation: KVM: Add hypercall for LoongArch

2024-03-02 Thread Bibo Mao
Add documentation topic for using pv_virt when running as a guest on KVM hypervisor. Signed-off-by: Bibo Mao --- Documentation/virt/kvm/index.rst | 1 + .../virt/kvm/loongarch/hypercalls.rst | 79 +++ Documentation/virt/kvm/loongarch/index.rst| 10

[PATCH v7 2/7] LoongArch: KVM: Add hypercall instruction emulation support

2024-03-15 Thread Bibo Mao
value KVM_HCALL_INVALID_CODE, rather than inject EXCCODE_INE invalid instruction exception. So VM can continue to executing the next code. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch/loongarch/include/asm/kvm_para.h | 26 ++ arch

[PATCH v7 1/7] LoongArch/smp: Refine some ipi functions on LoongArch platform

2024-03-15 Thread Bibo Mao
encoding, the ipi hw will convert it into bitmap in ipi message buffer. 3. Add structure smp_ops on LoongArch platform so that pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include

[PATCH v7 0/7] LoongArch: Add pv ipi support on LoongArch VM

2024-03-15 Thread Bibo Mao
ending ipi message. --- Bibo Mao (7): LoongArch/smp: Refine some ipi functions on LoongArch platform LoongArch: KVM: Add hypercall instruction emulation support LoongArch: KVM: Add cpucfg area for kvm hypervisor LoongArch: KVM: Add vcpu search support from physical cpuid LoongArch: KVM: Add pv i

[PATCH v7 3/7] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-03-15 Thread Bibo Mao
PV features, and the area can be extended for other hypervisors in future. This area will never be used for real HW, it is only used by software. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/inst.h | 1 + arch/loongarch/include/asm/loongarch.h | 10 + arch/loongarch/kvm/exit.c

[PATCH v7 4/7] LoongArch: KVM: Add vcpu search support from physical cpuid

2024-03-15 Thread Bibo Mao
as 256 by KVM which comes from extioi irqchip. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 26 arch/loongarch/include/asm/kvm_vcpu.h | 1 + arch/loongarch/kvm/vcpu.c | 93 ++- arch/loongarch/kvm/vm.c | 11 4

[PATCH v7 5/7] LoongArch: KVM: Add pv ipi support on kvm side

2024-03-15 Thread Bibo Mao
into hypervisor greatly. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 1 + arch/loongarch/include/asm/kvm_para.h | 129 + arch/loongarch/include/asm/kvm_vcpu.h | 10 ++ arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kvm/exit.c

[PATCH v7 6/7] LoongArch: Add pv ipi support on guest kernel side

2024-03-15 Thread Bibo Mao
interrupt acknowledge. And IPI message is stored in DDR, no trap in get IPI message. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 9 ++ arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/paravirt.h | 27 .../include/asm

[PATCH v7 7/7] Documentation: KVM: Add hypercall for LoongArch

2024-03-15 Thread Bibo Mao
Add documentation topic for using pv_virt when running as a guest on KVM hypervisor. Signed-off-by: Bibo Mao --- Documentation/virt/kvm/index.rst | 1 + .../virt/kvm/loongarch/hypercalls.rst | 82 +++ Documentation/virt/kvm/loongarch/index.rst| 10

[PATCH 0/2] LoongArch: Add steal time support

2024-03-26 Thread Bibo Mao
Para-virt feature steal time is added in both kvm and guest kernel side. It is silimar with other architectures, steal time structure comes from guest memory, also pseduo register is used to save/restore base address of steal time structure, so that vm migration is supported also. Bibo Mao (2

[PATCH 2/2] LoongArch: Add steal time support in guest side

2024-03-26 Thread Bibo Mao
hypervisor to enable steal time. When vcpu is offline, physical address is set as 0 and tells hypervisor to disable steal time. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/paravirt.h | 5 + arch/loongarch/kernel/paravirt.c | 130 ++ arch/loongarch/kernel/time.c

[PATCH 1/2] LoongArch: KVM: Add steal time support in kvm side

2024-03-26 Thread Bibo Mao
-maob...@loongson.cn/ Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 ++ arch/loongarch/include/asm/kvm_para.h | 10 +++ arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/include/uapi/asm/kvm.h | 4 + arch/loongarch/kvm/exit.c | 35

[PATCH 2/2] LoongArch: Add steal time support in guest side

2024-03-26 Thread Bibo Mao
hypervisor to enable steal time. When vcpu is offline, physical address is set as 0 and tells hypervisor to disable steal time. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/paravirt.h | 5 + arch/loongarch/kernel/paravirt.c | 130 ++ arch/loongarch/kernel/time.c

[PATCH 1/2] LoongArch: KVM: Add steal time support in kvm side

2024-03-26 Thread Bibo Mao
-maob...@loongson.cn/ Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 ++ arch/loongarch/include/asm/kvm_para.h | 10 +++ arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/include/uapi/asm/kvm.h | 4 + arch/loongarch/kvm/exit.c | 35

[PATCH v8 0/6] LoongArch: Add pv ipi support on LoongArch VM

2024-04-28 Thread Bibo Mao
2. Refine changelog description 3. Add hypercall statistic support for vcpu 4. Set percpu pv ipi message buffer aligned with cacheline 5. Refine pv ipi send logic, do not send ipi message with if there is pending ipi message. --- Bibo Mao (6): LoongArch/smp: Refine some ipi functions on LoongArc

[PATCH v8 1/6] LoongArch/smp: Refine some ipi functions on LoongArch platform

2024-04-28 Thread Bibo Mao
encoding, the ipi hw will convert it into bitmap in ipi message buffer. 3. Add structure smp_ops on LoongArch platform so that pv ipi can be used later. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/hardirq.h | 4 ++ arch/loongarch/include/asm/irq.h | 10 - arch/loongarch/include

[PATCH v8 2/6] LoongArch: KVM: Add hypercall instruction emulation support

2024-04-28 Thread Bibo Mao
value KVM_HCALL_INVALID_CODE, rather than inject EXCCODE_INE invalid instruction exception. So VM can continue to executing the next code. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch/loongarch/include/asm/kvm_para.h | 26 ++ arch

[PATCH v8 4/6] LoongArch: KVM: Add vcpu search support from physical cpuid

2024-04-28 Thread Bibo Mao
as 256 by KVM which comes from extioi irqchip. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 26 arch/loongarch/include/asm/kvm_vcpu.h | 1 + arch/loongarch/kvm/vcpu.c | 93 ++- arch/loongarch/kvm/vm.c | 11 4

[PATCH v8 3/6] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-04-28 Thread Bibo Mao
PV features, and the area can be extended for other hypervisors in future. This area will never be used for real HW, it is only used by software. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/inst.h | 1 + arch/loongarch/include/asm/loongarch.h | 10 + arch/loongarch/kvm/exit.c

[PATCH v8 5/6] LoongArch: KVM: Add pv ipi support on kvm side

2024-04-28 Thread Bibo Mao
into hypervisor greatly. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 1 + arch/loongarch/include/asm/kvm_para.h | 129 + arch/loongarch/include/asm/kvm_vcpu.h | 10 ++ arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kvm/exit.c

[PATCH v8 6/6] LoongArch: Add pv ipi support on guest kernel side

2024-04-28 Thread Bibo Mao
interrupt acknowledge. And IPI message is stored in DDR, no trap in get IPI message. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 9 ++ arch/loongarch/include/asm/hardirq.h | 1 + arch/loongarch/include/asm/paravirt.h | 27 .../include/asm

[PATCH v2 0/2] LoongArch: Add steal time support

2024-04-29 Thread Bibo Mao
. Add PARAVIRT_TIME_ACCOUNTING kconfig option in file arch/loongarch/Kconfig 2. Function name change such as replace pv_register_steal_time with pv_enable_steal_time etc --- Bibo Mao (2): LoongArch: KVM: Add steal time support in kvm side LoongArch: Add steal time support in guest side arch

[PATCH v2 2/2] LoongArch: Add steal time support in guest side

2024-04-29 Thread Bibo Mao
50 16 0 0 7583616 184816 723040 0 6300 6166 4 62 12 2 20 18 0 0 7583632 184480 722400 0 2814 1754 2 58 4 1 35 Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 11 +++ arch/loongarch/include/asm/paravirt.h | 5 + arch/loongarch/kernel

[PATCH v2 1/2] LoongArch: KVM: Add steal time support in kvm side

2024-04-29 Thread Bibo Mao
-maob...@loongson.cn/ Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 ++ arch/loongarch/include/asm/kvm_para.h | 10 +++ arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/include/uapi/asm/kvm.h | 4 + arch/loongarch/kvm/exit.c | 29

[PATCH v3 1/2] LoongArch: KVM: Add steal time support in kvm side

2024-05-20 Thread Bibo Mao
feature. One cpu attr ioctl command KVM_LOONGARCH_VCPU_PVTIME_CTRL is added to save and restore base address of steal time structure when VM is migrated. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 ++ arch/loongarch/include/asm/kvm_para.h | 10 ++ arch/loongarch/include

[PATCH v3 0/2] LoongArch: Add steal time support

2024-05-20 Thread Bibo Mao
... v2: 1. Add PARAVIRT_TIME_ACCOUNTING kconfig option in file arch/loongarch/Kconfig 2. Function name change such as replace pv_register_steal_time with pv_enable_steal_time etc --- Bibo Mao (2): LoongArch: KVM: Add steal time support in kvm side LoongArch: Add steal time support in guest

[PATCH v3 2/2] LoongArch: Add steal time support in guest side

2024-05-20 Thread Bibo Mao
50 16 0 0 7583616 184816 723040 0 6300 6166 4 62 12 2 20 18 0 0 7583632 184480 722400 0 2814 1754 2 58 4 1 35 Signed-off-by: Bibo Mao --- .../admin-guide/kernel-parameters.txt | 2 +- arch/loongarch/Kconfig| 11 ++ arch

[PATCH v4 0/2] LoongArch: Add steal time support

2024-05-24 Thread Bibo Mao
PARAVIRT_TIME_ACCOUNTING kconfig option in file arch/loongarch/Kconfig 2. Function name change such as replace pv_register_steal_time with pv_enable_steal_time etc --- Bibo Mao (2): LoongArch: KVM: Add steal time support in kvm side LoongArch: Add steal time support in guest side .../admin-guide

[PATCH v4 1/2] LoongArch: KVM: Add steal time support in kvm side

2024-05-24 Thread Bibo Mao
feature. One cpu attr ioctl command KVM_LOONGARCH_VCPU_PVTIME_CTRL is added to save and restore base address of steal time structure when VM is migrated. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 ++ arch/loongarch/include/asm/kvm_para.h | 10 ++ arch/loongarch/include

[PATCH v4 2/2] LoongArch: Add steal time support in guest side

2024-05-24 Thread Bibo Mao
16 0 0 7583616 184816 723040 0 6300 6166 4 62 12 2 20 18 0 0 7583632 184480 722400 0 2814 1754 2 58 4 1 35 Signed-off-by: Bibo Mao --- .../admin-guide/kernel-parameters.txt | 2 +- arch/loongarch/Kconfig| 11 ++ arch/loongarch

[PATCH] LoongArch: KVM: Implement function kvm_arch_para_features

2024-07-16 Thread Bibo Mao
Function kvm_arch_para_features() is to detect supported para features, it can be used by device driver to detect and enable para features, such as extioi irqchip driver to detect KVM_FEATURE_VIRT_EXTIOI. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_para.h | 10 ++ arch

[PATCH 1/2] LoongArch: KVM: Add paravirt qspinlock in kvm side

2024-07-23 Thread Bibo Mao
. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 4 arch/loongarch/include/asm/kvm_para.h | 1 + arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/kvm/exit.c | 24 +++- arch/loongarch/kvm/vcpu.c | 13

[PATCH 0/2] LoongArch: KVM: Add paravirt qspinlock support

2024-07-23 Thread Bibo Mao
nce impact Original 173.07 seconds With patch 171.73 seconds+1% 2. 2 VMs with 32 vCPUs and 2 numa node kernel compile time performance impact Original 2362.04 seconds With patch 354.17 seconds +566% B

[PATCH 2/2] LoongArch: KVM: Add paravirt qspinlock in guest side

2024-07-23 Thread Bibo Mao
. With kvm_wait() vCPU thread will exit to hypervisor and give up scheduleing on pCPU, and with function kvm_kick_cpu() one hypercall function is used to notify hypervisor to wakeup previously waited vCPU. Signed-off-by: Bibo Mao --- arch/loongarch/Kconfig| 14 +++ arch

[PATCH v3 1/2] LoongArch: KVM: Enable paravirt feature control from VMM

2024-07-25 Thread Bibo Mao
indicates that the virt EXTIOI can route interrupts to 256 vCPUs, rather than 4 vCPUs like with real HW. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 9 + arch/loongarch/include/asm/kvm_para.h | 1 + arch/loongarch/include/asm/loongarch.h | 13 --- arch

[PATCH v3 0/2] Add paravirt KVM_FEATURE_VIRT_EXTIOI feature

2024-07-25 Thread Bibo Mao
features. v1 ... v2: 1. Update changelog suggested by WangXuerui. 2. Fix typo issue in function kvm_loongarch_cpucfg_set_attr(), usr_features should be assigned directly, also suggested by WangXueRui. --- Bibo Mao (2): LoongArch: KVM: Enable paravirt feature control from VMM LoongArch: KVM

[PATCH v3 2/2] LoongArch: KVM: Implement function kvm_arch_para_features

2024-07-25 Thread Bibo Mao
Function kvm_arch_para_features() is to detect supported paravirt features, it can be used by device driver to detect and enable paravirt features, such as extioi irqchip driver can detect KVM_FEATURE_VIRT_EXTIOI and do some optimization. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm

[PATCH v4 2/3] LoongArch: KVM: Implement function kvm_para_has_feature

2024-07-30 Thread Bibo Mao
Function kvm_para_has_feature() is to detect supported paravirt features, it can be used by device driver to detect and enable paravirt features, such as extioi irqchip driver can detect KVM_FEATURE_VIRT_EXTIOI and do some optimization. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm

[PATCH v4 0/3] Add extioi virt extension support

2024-07-30 Thread Bibo Mao
by WangXueRui. --- Bibo Mao (3): LoongArch: KVM: Enable paravirt feature control from VMM LoongArch: KVM: Implement function kvm_para_has_feature irqchip/loongson-eiointc: Add extioi virt extension support .../arch/loongarch/irq-chip-model.rst | 64 ++ .../zh_CN/arch

[PATCH v4 1/3] LoongArch: KVM: Enable paravirt feature control from VMM

2024-07-30 Thread Bibo Mao
indicates that the virt EXTIOI can route interrupts to 256 vCPUs, rather than 4 vCPUs like with real HW. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 arch/loongarch/include/asm/kvm_para.h | 1 + arch/loongarch/include/asm/loongarch.h | 13 --- arch

[PATCH v4 3/3] irqchip/loongson-eiointc: Add extioi virt extension support

2024-07-30 Thread Bibo Mao
Interrupts can be routed to maximal four virtual CPUs with one external hardware interrupt. Add the extioi virt extension support so that Interrupts can be routed to 256 vcpus on hypervisor mode. Co-developed-by: Song Gao Signed-off-by: Song Gao Signed-off-by: Bibo Mao --- .../arch/loongarch

[PATCH] LoongArch: Revert qspinlock to test-and-set on VMs

2024-07-31 Thread Bibo Mao
Original 2362.04 seconds With patch 354.73 seconds+565% Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/Kbuild | 1 - arch/loongarch/include/asm/paravirt.h | 3 ++ arch/loongarch/include/asm/qspinlock.h | 41 ++ arch/loonga

[PATCH v2] LoongArch: Revert qspinlock to test-and-set simple lock on VM

2024-08-05 Thread Bibo Mao
Original 2362.04 seconds With patch 354.73 seconds+565% Signed-off-by: Bibo Mao --- v1 ... v2: 1. Define static key virt_spin_lock_key as false by default 2. Add prefix __init with function smp_prepare_boot_cpu(), since there is prefix __init with calle

[PATCH v5 0/3] Add extioi virt extension support

2024-08-05 Thread Bibo Mao
ctly, also suggested by WangXueRui. --- Bibo Mao (3): LoongArch: KVM: Enable paravirt feature control from VMM LoongArch: KVM: Implement function kvm_para_has_feature irqchip/loongson-eiointc: Add extioi virt extension support .../arch/loongarch/irq-chip-model.rst

[PATCH v5 2/3] LoongArch: KVM: Implement function kvm_para_has_feature

2024-08-05 Thread Bibo Mao
Function kvm_para_has_feature() is to detect supported paravirt features, it can be used by device driver to detect and enable paravirt features, such as extioi irqchip driver can detect KVM_FEATURE_VIRT_EXTIOI and do some optimization. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm

[PATCH v5 1/3] LoongArch: KVM: Enable paravirt feature control from VMM

2024-08-05 Thread Bibo Mao
indicates that the virt EXTIOI can route interrupts to 256 vCPUs, rather than 4 vCPUs like with real HW. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 arch/loongarch/include/asm/kvm_para.h | 1 + arch/loongarch/include/asm/loongarch.h | 13 --- arch

[PATCH v5 3/3] irqchip/loongson-eiointc: Add extioi virt extension support

2024-08-05 Thread Bibo Mao
Interrupts can be routed to maximal four virtual CPUs with one external hardware interrupt. Add the extioi virt extension support so that Interrupts can be routed to 256 vcpus on hypervisor mode. Co-developed-by: Song Gao Signed-off-by: Song Gao Signed-off-by: Bibo Mao --- .../arch/loongarch

[PATCH v6 0/3] Add extioi virt extension support

2024-08-11 Thread Bibo Mao
t features. v1 ... v2: 1. Update changelog suggested by WangXuerui. 2. Fix typo issue in function kvm_loongarch_cpucfg_set_attr(), usr_features should be assigned directly, also suggested by WangXueRui. --- Bibo Mao (3): LoongArch: KVM: Enable paravirt feature control from VMM Loon

[PATCH v6 1/3] LoongArch: KVM: Enable paravirt feature control from VMM

2024-08-11 Thread Bibo Mao
indicates that the virt EXTIOI can route interrupts to 256 vCPUs, rather than 4 vCPUs like with real HW. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm/kvm_host.h | 7 arch/loongarch/include/asm/kvm_para.h | 1 + arch/loongarch/include/asm/kvm_vcpu.h | 4 ++ arch

[PATCH v6 2/3] LoongArch: KVM: Implement function kvm_para_has_feature

2024-08-11 Thread Bibo Mao
Function kvm_para_has_feature() is to detect supported paravirt features, it can be used by device driver to detect and enable paravirt features, such as extioi irqchip driver can detect KVM_FEATURE_VIRT_EXTIOI and do some optimization. Signed-off-by: Bibo Mao --- arch/loongarch/include/asm

[PATCH v6 3/3] irqchip/loongson-eiointc: Add extioi virt extension support

2024-08-11 Thread Bibo Mao
. CPU bitmap is replaced with normal encoding and EIOINTC node type is removed, so there are 8 bits for cpu selection, at most 256 vCPUs are supported for interrupt routing. Co-developed-by: Song Gao Signed-off-by: Song Gao Signed-off-by: Bibo Mao --- .../arch/loongarch/irq-chip-model.rst

[PATCH] LoongArch: Fix AP booting issue in VM mode

2024-08-13 Thread Bibo Mao
: KVM: Add PV IPI support on guest side") Signed-off-by: Bibo Mao --- arch/loongarch/kernel/paravirt.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/loongarch/kernel/paravirt.c b/arch/loongarch/kernel/paravirt.c index 9c9b75b76f62..348920b25460 100644

[PATCH v7 0/3] Add extioi virt extension support

2024-08-22 Thread Bibo Mao
ggested by WangXueRui. --- Bibo Mao (3): LoongArch: KVM: Enable paravirt feature control from VMM LoongArch: KVM: Implement function kvm_para_has_feature irqchip/loongson-eiointc: Add extioi virt extension support .../arch/loongarch/irq-chip-model.rst | 64 +++ .../zh_CN/arch/loo

  1   2   >