Re: Per-cpu IDT patch
s ymgch <[email protected]> Mon, 6 Jul 2020 13:54:58 +0900
| Newsgroups | gmane.os.netbsd.ports.x86-64,gmane.os.netbsd.ports.i386 |
|---|---|
| Message-ID | <CAPnD6HoUb--bYAZYRbOD57Bqp1Eyjoc+Fn=FnYr5bF_hKUdgSA@mail.gmail.com> |
On Sat, Jul 4, 2020 at 6:32 PM Manuel Bouyer <[email protected]> wrote: > > On Fri, Jul 03, 2020 at 02:11:43PM +0900, s ymgch wrote: > > Hi all, > > > > I tried to make an IDT per-cpu. The patch is here: > > http://www.netbsd.org/~yamaguchi/pcpu-idt.patch > > > > The summary of modifications is as follows. > > - Add an IDT pointer and idt_allocmap into struct cpu_info > > - Change prototype of cpu_init_idt() > > - void => struct cpu_info* > > - for loading an IDT address in struct cpu_info* > > - Copy a part of IDT entries from cpu 0 at attaching a CPU > > - for the same entries, for example, exceptions, db, etc. > > > > This function can be enabled by PCPU_IDT option that is newly provided. > > > > Does this patch look good? > > Please let me know if you have any comments about this. > > I guess idt_vec_init_cpu_md() is not used by XENPV at all ? > If so I guess you can remove #ifndef XENPV here > If is it used I think it can not work without setting the idt back to read-only > anyway. The function is used even by XENPV to initialize iv_idt for cpu0. I guess the reason why it can be working without the setting in init_x86_64() is that the same setting is done in set_idtgate(). I'm going to remove #ifndef XENPV by another commit if XEN3_DOM0 and XEN3_DOMU kernel can work without it. > > Othervise I don't see problems at first glance. I tested an amd64 domU in > PV, PVH and PVHVM mode. Thank you very much for your test. Best regards, -- yamaguchi