Re: [PATCH v3 3/3] mm/memory.c: Add memory read privilege before filling PTE entry

2020-05-18 Thread maobibo
On 05/19/2020 04:57 AM, Andrew Morton wrote: > On Mon, 18 May 2020 13:08:49 +0800 Bibo Mao wrote: > >> On mips platform, hw PTE entry valid bit is set in pte_mkyoung >> function, it is used to set physical page with readable privilege. > > pte_mkyoung() seems to be a strange place to set the

Re: [PATCH v4 2/4] mm/memory.c: Update local TLB if PTE entry exists

2020-05-20 Thread maobibo
On 05/20/2020 09:26 AM, Andrew Morton wrote: > On Tue, 19 May 2020 18:03:28 +0800 Bibo Mao wrote: > >> If two threads concurrently fault at the same address, the thread that >> won the race updates the PTE and its local TLB. For now, the other >> thread gives up, simply does nothing, and

Re: [PATCH v4 3/4] mm/memory.c: Add memory read privilege on page fault handling

2020-05-20 Thread maobibo
On 05/20/2020 09:30 AM, Andrew Morton wrote: > On Tue, 19 May 2020 18:03:29 +0800 Bibo Mao wrote: > >> Here add pte_sw_mkyoung function to make page readable on MIPS >> platform during page fault handling. This patch improves page >> fault latency about 10% on my MIPS machine with lmbench >>

Re: [PATCH v3 3/3] mm/memory.c: Add memory read privilege before filling PTE entry

2020-05-27 Thread maobibo
On 05/28/2020 04:55 AM, Hugh Dickins wrote: > On Tue, 19 May 2020, maobibo wrote: >> On 05/19/2020 04:57 AM, Andrew Morton wrote: >>> On Mon, 18 May 2020 13:08:49 +0800 Bibo Mao wrote: >>> >>>> On mips platform, hw PTE entry valid bit is set in pte_m

Re: [PATCH v6 3/4] mm/memory.c: Add memory read privilege on page fault handling

2020-05-26 Thread maobibo
On 05/26/2020 05:44 AM, Andrew Morton wrote: > On Mon, 25 May 2020 10:52:39 +0800 Bibo Mao wrote: > >> Here add pte_sw_mkyoung function to make page readable on MIPS >> platform during page fault handling. This patch improves page >> fault latency about 10% on my MIPS machine with lmbench >>

Re: [PATCH v6 1/4] MIPS: Do not flush tlb page when updating PTE entry

2020-05-26 Thread maobibo
On 05/26/2020 05:42 AM, Andrew Morton wrote: > On Mon, 25 May 2020 10:52:37 +0800 Bibo Mao wrote: > >> It is not necessary to flush tlb page on all CPUs if suitable PTE >> entry exists already during page fault handling, just updating >> TLB is fine. >> >> Here redefine

Re: [PATCH v6 1/4] MIPS: Do not flush tlb page when updating PTE entry

2020-05-26 Thread maobibo
On 05/25/2020 04:31 PM, Sergei Shtylyov wrote: > On 25.05.2020 11:12, Sergei Shtylyov wrote: > >>> It is not necessary to flush tlb page on all CPUs if suitable PTE >>> entry exists already during page fault handling, just updating >>> TLB is fine. >>> >>> Here redefine

Re: [PATCH v7 2/4] mm/memory.c: Update local TLB if PTE entry exists

2020-05-28 Thread maobibo
On 05/29/2020 03:23 AM, Andrew Morton wrote: > On Wed, 27 May 2020 10:25:18 +0800 Bibo Mao wrote: > >> If two threads concurrently fault at the same page, the thread that >> won the race updates the PTE and its local TLB. For now, the other >> thread gives up, simply does nothing, and

Re: [PATCH 1/2] MIPS: set page access bit with pgprot on some MIPS platform

2020-06-05 Thread maobibo
On 06/05/2020 05:39 PM, Jiaxun Yang wrote: > On Fri, 5 Jun 2020 17:11:05 +0800 > Bibo Mao wrote: > >> On MIPS system which has rixi hardware bit, page access bit is not >> set in pgrot. For memory reading, there will be one page fault to >> allocate physical page; however valid bit is not

Re: [PATCH 2/3] mm/huge_memory.c: update tlb entry if pmd is changed

2020-06-25 Thread maobibo
On 06/25/2020 08:30 AM, Mike Kravetz wrote: > On 6/24/20 2:26 AM, Bibo Mao wrote: >> When set_pmd_at is called in function do_huge_pmd_anonymous_page, >> new tlb entry can be added by software on MIPS platform. >> >> Here add update_mmu_cache_pmd when pmd entry is set, and >>

Re: mm/memory.c: Add update local tlb for smp race

2020-05-16 Thread maobibo
On 05/15/2020 09:50 PM, David Hildenbrand wrote: > On 14.05.20 08:50, Bibo Mao wrote: >> If there are two threads hitting page fault at the address, one >> thread updates pte entry and local tlb, the other thread can update >> local tlb also, rather than give up and let page fault happening >>

Re: [PATCH 2/3] mm/memory.c: Update local TLB if PTE entry exists

2020-05-16 Thread maobibo
On 05/16/2020 04:40 AM, Andrew Morton wrote: > On Fri, 15 May 2020 12:10:08 +0800 Bibo Mao wrote: > >> If there are two threads hitting page fault at the same page, >> one thread updates PTE entry and local TLB, the other can >> update local tlb also, rather than give up and do page fault >>

Re: [PATCH] MIPS: update tlb even if pte entry has no change

2020-05-14 Thread maobibo
On 05/14/2020 05:33 PM, Mike Rapoport wrote: > On Thu, May 14, 2020 at 10:17:57AM +0800, Bibo Mao wrote: >> From: bibo mao >> >> If there are two threads reading the same memory and tlb miss happens, >> one thread fills pte entry, the other reads new pte value during page fault >> handling.

Re: [PATCH] MIPS: update tlb even if pte entry has no change

2020-05-14 Thread maobibo
On 05/14/2020 05:37 PM, Sergei Shtylyov wrote: > On 14.05.2020 12:35, Sergei Shtylyov wrote: > >>> From: bibo mao >>> >>> If there are two threads reading the same memory and tlb miss happens, >>> one thread fills pte entry, the other reads new pte value during page fault >>> handling. PTE

Re: mm/memory.c: Add update local tlb for smp race

2020-05-17 Thread maobibo
On 05/16/2020 05:34 PM, maobibo wrote: > > > On 05/15/2020 09:50 PM, David Hildenbrand wrote: >> On 14.05.20 08:50, Bibo Mao wrote: >>> If there are two threads hitting page fault at the address, one >>> thread updates pte entry and local tlb, the other thr

Re: [PATCH 1/3] mm: set page fault address for update_mmu_cache_pmd

2020-06-30 Thread maobibo
On 06/30/2020 06:09 PM, Kirill A. Shutemov wrote: > On Wed, Jun 24, 2020 at 05:26:30PM +0800, Bibo Mao wrote: >> update_mmu_cache_pmd is used to update tlb for the pmd entry by >> software. On MIPS system, the tlb entry indexed by page fault >> address maybe exists already, only that tlb entry

Re: [PATCH 1/3] mm: set page fault address for update_mmu_cache_pmd

2020-06-30 Thread maobibo
On 06/30/2020 06:42 PM, maobibo wrote: > > > On 06/30/2020 06:09 PM, Kirill A. Shutemov wrote: >> On Wed, Jun 24, 2020 at 05:26:30PM +0800, Bibo Mao wrote: >>> update_mmu_cache_pmd is used to update tlb for the pmd entry by >>> software. On MIPS system, th

Re: [PATCH] MIPS: Do not flush tlb when setting pmd entry

2020-06-19 Thread maobibo
On 06/17/2020 07:14 PM, Thomas Bogendoerfer wrote: > On Tue, Jun 16, 2020 at 06:34:21PM +0800, maobibo wrote: >> >> >> On 06/15/2020 06:14 PM, Thomas Bogendoerfer wrote: >>> On Wed, Jun 03, 2020 at 05:42:13PM +0800, Bibo Mao wrote: >>>> Function set_pmd

Re: [PATCH v5 2/4] mm/memory.c: Update local TLB if PTE entry exists

2020-05-22 Thread maobibo
On 05/22/2020 03:22 AM, Andrew Morton wrote: > On Thu, 21 May 2020 11:30:35 +0800 Bibo Mao wrote: > >> If two threads concurrently fault at the same address, the thread that >> won the race updates the PTE and its local TLB. For now, the other >> thread gives up, simply does nothing, and

Re: [GIT PULL] MIPS changes for v5.8-rc1

2020-06-03 Thread maobibo
On 06/04/2020 05:00 AM, Linus Torvalds wrote: > On Tue, Jun 2, 2020 at 5:55 AM Thomas Bogendoerfer > wrote: >> >> Bibo Mao (4): >> mm/memory.c: Add memory read privilege on page fault handling > > Hmm. That's a horribly named commit, but can you clarify why this > didn't just use the

Re: [PATCH v8] mm: Proactive compaction

2020-06-22 Thread maobibo
On 06/23/2020 10:26 AM, Nathan Chancellor wrote: > On Tue, Jun 16, 2020 at 01:45:27PM -0700, Nitin Gupta wrote: >> For some applications, we need to allocate almost all memory as >> hugepages. However, on a running system, higher-order allocations can >> fail if the memory is fragmented. Linux

Re: [PATCH] MIPS: Do not flush tlb when setting pmd entry

2020-06-23 Thread maobibo
On 06/22/2020 11:48 PM, Thomas Bogendoerfer wrote: > On Sat, Jun 20, 2020 at 11:47:35AM +0800, maobibo wrote: >> >> >> On 06/17/2020 07:14 PM, Thomas Bogendoerfer wrote: >>> On Tue, Jun 16, 2020 at 06:34:21PM +0800, maobibo wrote: >>>> >>>>

Re: [PATCH] MIPS: Do not flush tlb when setting pmd entry

2020-06-16 Thread maobibo
On 06/15/2020 06:14 PM, Thomas Bogendoerfer wrote: > On Wed, Jun 03, 2020 at 05:42:13PM +0800, Bibo Mao wrote: >> Function set_pmd_at is to set pmd entry, if tlb entry need to >> be flushed, there exists pmdp_huge_clear_flush alike function >> before set_pmd_at is called. So it is not necessary

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

2024-02-22 Thread maobibo
On 2024/2/22 下午5:34, WANG Xuerui wrote: On 2/17/24 11:15, maobibo wrote: On 2024/2/15 下午6:25, WANG Xuerui wrote: On 2/15/24 18:11, WANG Xuerui wrote: Sorry for the late reply (and Happy Chinese New Year), and thanks for providing microbenchmark numbers! But it seems the more comprehensive

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

2024-02-18 Thread maobibo
On 2024/2/19 上午10:41, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:19 AM Bibo Mao wrote: 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

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

2024-02-18 Thread maobibo
Huacai, Thanks for your reviewing, I reply inline. On 2024/2/19 上午10:39, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:19 AM Bibo Mao wrote: This patch refines ipi handling on LoongArch platform, there are three changes with this patch. 1. Add generic get_percpu_irq() api, replace

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

2024-02-18 Thread maobibo
On 2024/2/19 上午10:42, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:19 AM Bibo Mao wrote: The patch adds paravirt interface for guest kernel, function pv_guest_initi() firstly checks whether system runs on VM mode. If kernel runs on VM mode, it will call function

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

2024-02-18 Thread maobibo
On 2024/2/19 上午10:45, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:20 AM Bibo Mao wrote: On LoongArch system, ipi hw uses iocsr registers, there is one iocsr register access on ipi sending, and two iocsr access on ipi receiving which is ipi interrupt handler. On VM mode all

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

2024-02-16 Thread maobibo
On 2024/2/15 下午6:25, WANG Xuerui wrote: On 2/15/24 18:11, WANG Xuerui wrote: Sorry for the late reply (and Happy Chinese New Year), and thanks for providing microbenchmark numbers! But it seems the more comprehensive CoreMark results were omitted (that's also absent in v3)? While the Of

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

2024-02-19 Thread maobibo
On 2024/2/19 下午5:38, Huacai Chen wrote: On Mon, Feb 19, 2024 at 5:21 PM maobibo wrote: On 2024/2/19 下午4:48, Huacai Chen wrote: On Mon, Feb 19, 2024 at 12:11 PM maobibo wrote: On 2024/2/19 上午10:42, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:19 AM Bibo Mao wrote

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

2024-02-19 Thread maobibo
On 2024/2/19 下午5:02, Huacai Chen wrote: On Mon, Feb 19, 2024 at 3:37 PM maobibo wrote: On 2024/2/19 下午3:16, Huacai Chen wrote: On Mon, Feb 19, 2024 at 12:18 PM maobibo wrote: On 2024/2/19 上午10:45, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:20 AM Bibo Mao wrote

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

2024-02-19 Thread maobibo
On 2024/2/19 下午4:48, Huacai Chen wrote: On Mon, Feb 19, 2024 at 12:11 PM maobibo wrote: On 2024/2/19 上午10:42, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:19 AM Bibo Mao wrote: The patch adds paravirt interface for guest kernel, function pv_guest_initi() firstly checks

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

2024-02-18 Thread maobibo
On 2024/2/19 下午3:16, Huacai Chen wrote: On Mon, Feb 19, 2024 at 12:18 PM maobibo wrote: On 2024/2/19 上午10:45, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 1, 2024 at 11:20 AM Bibo Mao wrote: On LoongArch system, ipi hw uses iocsr registers, there is one iocsr register access on ipi

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

2024-01-03 Thread maobibo
On 2024/1/3 下午4:14, Juergen Gross wrote: On 03.01.24 09:00, maobibo wrote: On 2024/1/3 下午3:40, Jürgen Groß wrote: On 03.01.24 08:16, Bibo Mao wrote: The patch add paravirt interface for guest kernel, it checks whether system runs on VM mode. If it is, it will detect hypervisor type

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

2024-01-03 Thread maobibo
On 2024/1/3 下午3:40, Jürgen Groß wrote: On 03.01.24 08:16, Bibo Mao wrote: The patch add paravirt interface for guest kernel, it checks whether system runs on VM mode. If it is, it will detect hypervisor type. And returns true it is KVM hypervisor, else return false. Currently only KVM

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

2024-01-29 Thread maobibo
On 2024/1/29 下午8:38, Huacai Chen wrote: Hi, Bibo, On Mon, Jan 22, 2024 at 6:03 PM Bibo Mao wrote: This patch refines ipi handling on LoongArch platform, there are three changes with this patch. 1. Add generic get_percpu_irq api, replace some percpu irq function such as

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

2024-01-29 Thread maobibo
On 2024/1/29 下午9:10, Huacai Chen wrote: Hi, Bibo, On Mon, Jan 22, 2024 at 6:03 PM Bibo Mao wrote: On LoongArch system, ipi hw uses iocsr registers, there is one iocsr register access on ipi sender and two iocsr access on ipi receiver which is ipi interrupt handler. On VM mode all iocsr

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

2024-01-29 Thread maobibo
On 2024/1/29 下午9:11, Huacai Chen wrote: Hi, Bibo, Without this patch I can also create a SMP VM, so what problem does this patch want to solve? With ipi irqchip, physical cpuid is used for dest cpu rather than logical cpuid. And if ipi device is emulated in qemu side, there is

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

2024-02-26 Thread maobibo
On 2024/2/27 上午4:02, Jiaxun Yang wrote: 在2024年2月26日二月 上午8:04,maobibo写道: On 2024/2/26 下午2:12, Huacai Chen wrote: On Mon, Feb 26, 2024 at 10:04 AM maobibo wrote: On 2024/2/24 下午5:13, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 22, 2024 at 11:28 AM Bibo Mao wrote: Instruction cpucfg

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

2024-02-26 Thread maobibo
On 2024/2/27 下午1:23, Jiaxun Yang wrote: 在2024年2月27日二月 上午3:14,maobibo写道: On 2024/2/27 上午4:02, Jiaxun Yang wrote: 在2024年2月26日二月 上午8:04,maobibo写道: On 2024/2/26 下午2:12, Huacai Chen wrote: On Mon, Feb 26, 2024 at 10:04 AM maobibo wrote: On 2024/2/24 下午5:13, Huacai Chen wrote: Hi

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

2024-02-27 Thread maobibo
On 2024/2/27 下午5:05, Xi Ruoyao wrote: On Tue, 2024-02-27 at 15:09 +0800, maobibo wrote: It is difficult to find an area unused by HW for CSR method since the small CSR ID range. We may use IOCSR instead. In kernel/cpu-probe.c there are already some IOCSR reads. yes, IOCSR can be used

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

2024-02-27 Thread maobibo
On 2024/2/27 下午5:10, WANG Xuerui wrote: On 2/27/24 11:14, maobibo wrote: On 2024/2/27 上午4:02, Jiaxun Yang wrote: 在2024年2月26日二月 上午8:04,maobibo写道: On 2024/2/26 下午2:12, Huacai Chen wrote: On Mon, Feb 26, 2024 at 10:04 AM maobibo wrote: On 2024/2/24 下午5:13, Huacai Chen wrote: Hi

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

2024-02-26 Thread maobibo
On 2024/2/26 下午1:25, WANG Xuerui wrote: Hi, On 2/26/24 10:04, maobibo wrote: On 2024/2/24 下午5:13, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 22, 2024 at 11:28 AM Bibo Mao wrote: Instruction cpucfg can be used to get processor features. And there is trap exception when it is executed

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

2024-02-26 Thread maobibo
On 2024/2/26 下午2:12, Huacai Chen wrote: On Mon, Feb 26, 2024 at 10:04 AM maobibo wrote: On 2024/2/24 下午5:13, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 22, 2024 at 11:28 AM Bibo Mao wrote: Instruction cpucfg can be used to get processor features. And there is trap exception when

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

2024-03-01 Thread maobibo
On 2024/2/27 下午6:19, WANG Xuerui wrote: On 2/27/24 18:12, maobibo wrote: On 2024/2/27 下午5:10, WANG Xuerui wrote: On 2/27/24 11:14, maobibo wrote: On 2024/2/27 上午4:02, Jiaxun Yang wrote: 在2024年2月26日二月 上午8:04,maobibo写道: On 2024/2/26 下午2:12, Huacai Chen wrote: On Mon, Feb 26, 2024

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

2024-03-04 Thread maobibo
On 2024/3/2 下午5:41, WANG Xuerui wrote: On 3/2/24 16:47, Bibo Mao wrote: 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 |

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

2024-02-25 Thread maobibo
On 2024/2/24 下午5:13, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 22, 2024 at 11:28 AM Bibo Mao wrote: Instruction cpucfg can be used to get processor features. And there is trap exception when it is executed in VM mode, and also it is to provide cpu features to VM. On real hardware cpucfg

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

2024-02-25 Thread maobibo
On 2024/2/24 下午5:19, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 22, 2024 at 11:28 AM Bibo Mao wrote: On LoongArch system, ipi hw uses iocsr registers, there is one iocsr register access on ipi sending, and two iocsr access on ipi receiving which is ipi interrupt handler. On VM mode all

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

2024-02-25 Thread maobibo
On 2024/2/24 下午5:13, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 22, 2024 at 11:28 AM Bibo Mao wrote: Instruction cpucfg can be used to get processor features. And there is trap exception when it is executed in VM mode, and also it is to provide cpu features to VM. On real hardware cpucfg

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

2024-02-25 Thread maobibo
On 2024/2/24 下午5:15, Huacai Chen wrote: Hi, Bibo, On Thu, Feb 22, 2024 at 11:28 AM Bibo Mao wrote: Paravirt interface pv_ipi_init() is added here for guest kernel, it firstly checks whether system runs on VM mode. If kernel runs on VM mode, it will call function kvm_para_available() to

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

2024-03-05 Thread maobibo
On 2024/3/6 上午2:26, WANG Xuerui wrote: On 3/4/24 17:10, maobibo wrote: On 2024/3/2 下午5:41, WANG Xuerui wrote: On 3/2/24 16:47, Bibo Mao wrote: [snip] +Querying for existence +== + +To find out if we're running on KVM or not, cpucfg can be used with index

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

2024-04-01 Thread maobibo
On 2024/3/24 上午2:40, WANG Xuerui wrote: On 3/15/24 16:11, Bibo Mao wrote: [snip] +KVM hypercall ABI += + +Hypercall ABI on KVM is simple, only one scratch register a0 and at most +five generic registers used as input parameter. FP register and vector register +is not used

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

2024-04-01 Thread maobibo
On 2024/4/2 上午10:49, Xi Ruoyao wrote: On Tue, 2024-04-02 at 09:43 +0800, maobibo wrote: Sorry for the late reply, but I think it may be a bit non-constructive to repeatedly submit the same code without due explanation in our previous review threads. Let me try to recollect some

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

2024-04-01 Thread maobibo
On 2024/3/24 上午3:02, WANG Xuerui wrote: On 3/15/24 16:07, Bibo Mao wrote: Instruction cpucfg can be used to get processor features. And there is trap exception when it is executed in VM mode, and also it is to provide cpu features to VM. On real hardware cpucfg area 0 - 20 is used.  Here one

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

2024-04-01 Thread maobibo
On 2024/4/2 上午10:49, Xi Ruoyao wrote: On Tue, 2024-04-02 at 09:43 +0800, maobibo wrote: Sorry for the late reply, but I think it may be a bit non-constructive to repeatedly submit the same code without due explanation in our previous review threads. Let me try to recollect some

Re: [PATCH 1/4] KVM: delete .change_pte MMU notifier callback

2024-04-08 Thread maobibo
On 2024/4/5 下午7:58, Paolo Bonzini wrote: The .change_pte() MMU notifier callback was intended as an optimization. The original point of it was that KSM could tell KVM to flip its secondary PTE to a new location without having to first zap it. At the time there was also an .invalidate_page()

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

2024-04-30 Thread maobibo
On 2024/4/30 下午4:23, Huacai Chen wrote: Hi, Bibo, On Tue, Apr 30, 2024 at 9:45 AM Bibo Mao wrote: Percpu struct kvm_steal_time is added here, its size is 64 bytes and also defined as 64 bytes, so that the whole structure is in one physical page. When vcpu is onlined, function

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

2024-05-06 Thread maobibo
On 2024/5/6 上午9:45, Huacai Chen wrote: Hi, Bibo, I have done an off-list discussion with some KVM experts, and they think user-space have its right to know PV features, so cpucfg solution is acceptable. And I applied this series with some modifications at

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

2024-05-06 Thread maobibo
On 2024/5/6 上午9:49, Huacai Chen wrote: Hi, Bibo, On Sun, Apr 28, 2024 at 6:05 PM Bibo Mao wrote: Physical cpuid is used for interrupt routing for irqchips such as ipi/msi/extioi interrupt controller. And physical cpuid is stored at CSR register LOONGARCH_CSR_CPUID, it can not be changed

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

2024-05-05 Thread maobibo
Huacai, Many thanks for reviewing pv ipi patchset. And I reply inline. On 2024/5/6 上午9:49, Huacai Chen wrote: Hi, Bibo, On Sun, Apr 28, 2024 at 6:05 PM Bibo Mao wrote: Physical cpuid is used for interrupt routing for irqchips such as ipi/msi/extioi interrupt controller. And physical cpuid

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

2024-05-06 Thread maobibo
On 2024/5/6 上午9:53, Huacai Chen wrote: Hi, Bibo, On Sun, Apr 28, 2024 at 6:05 PM Bibo Mao wrote: PARAVIRT option and pv ipi is added on guest kernel side, function pv_ipi_init() is to add ipi sending and ipi receiving hooks. This function firstly checks whether system runs on VM mode. If

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

2024-05-06 Thread maobibo
On 2024/5/6 下午3:06, Huacai Chen wrote: Hi, Bibo, On Mon, May 6, 2024 at 2:36 PM maobibo wrote: On 2024/5/6 上午9:49, Huacai Chen wrote: Hi, Bibo, On Sun, Apr 28, 2024 at 6:05 PM Bibo Mao wrote: Physical cpuid is used for interrupt routing for irqchips such as ipi/msi/extioi interrupt

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

2024-05-05 Thread maobibo
On 2024/5/6 上午9:54, Huacai Chen wrote: Hi, Bibo, On Sun, Apr 28, 2024 at 6:05 PM Bibo Mao wrote: On LoongArch system, there is hypercall instruction special for virtualization. When system executes this instruction on host side, there is illegal instruction exception reported, however it

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

2024-05-06 Thread maobibo
On 2024/5/6 下午5:40, Huacai Chen wrote: On Mon, May 6, 2024 at 5:35 PM maobibo wrote: On 2024/5/6 下午4:59, Huacai Chen wrote: On Mon, May 6, 2024 at 4:18 PM maobibo wrote: On 2024/5/6 下午3:06, Huacai Chen wrote: Hi, Bibo, On Mon, May 6, 2024 at 2:36 PM maobibo wrote: On 2024/5

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

2024-05-06 Thread maobibo
On 2024/5/6 下午4:59, Huacai Chen wrote: On Mon, May 6, 2024 at 4:18 PM maobibo wrote: On 2024/5/6 下午3:06, Huacai Chen wrote: Hi, Bibo, On Mon, May 6, 2024 at 2:36 PM maobibo wrote: On 2024/5/6 上午9:49, Huacai Chen wrote: Hi, Bibo, On Sun, Apr 28, 2024 at 6:05 PM Bibo Mao wrote

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

2024-05-08 Thread maobibo
On 2024/5/8 下午1:00, Huacai Chen wrote: On Tue, May 7, 2024 at 11:06 AM maobibo wrote: On 2024/5/7 上午10:05, Huacai Chen wrote: On Tue, May 7, 2024 at 9:40 AM maobibo wrote: On 2024/5/6 下午10:17, Huacai Chen wrote: On Mon, May 6, 2024 at 6:05 PM maobibo wrote: On 2024/5/6 下午5:40

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

2024-05-06 Thread maobibo
On 2024/5/6 下午10:17, Huacai Chen wrote: On Mon, May 6, 2024 at 6:05 PM maobibo wrote: On 2024/5/6 下午5:40, Huacai Chen wrote: On Mon, May 6, 2024 at 5:35 PM maobibo wrote: On 2024/5/6 下午4:59, Huacai Chen wrote: On Mon, May 6, 2024 at 4:18 PM maobibo wrote: On 2024/5/6 下午3:06

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

2024-05-06 Thread maobibo
On 2024/5/7 上午10:05, Huacai Chen wrote: On Tue, May 7, 2024 at 9:40 AM maobibo wrote: On 2024/5/6 下午10:17, Huacai Chen wrote: On Mon, May 6, 2024 at 6:05 PM maobibo wrote: On 2024/5/6 下午5:40, Huacai Chen wrote: On Mon, May 6, 2024 at 5:35 PM maobibo wrote: On 2024/5/6 下午4:59