Am Tue, 22 Aug 2017 16:17:08 -0700
schrieb Gustavo Lima Chaves <[email protected]>:

> * Jan Kiszka <[email protected]> [2017-08-22 23:04:35 +0000]:
> 
> > On 2017-08-22 13:15, Gustavo Lima Chaves wrote:  
> > > * Gustavo Lima Chaves <[email protected]> [2017-08-22
> > > 16:36:54 +0000]: 
> > >> * Henning Schild <[email protected]> [2017-08-22
> > >> 13:42:22 +0000]: 
> > >>> Am Mon, 21 Aug 2017 18:13:35 -0700
> > >>> schrieb Gustavo Lima Chaves <[email protected]>:
> > >>>  
> > >>>> Hi,
> > >>>>
> > >>>> is testing xAPIC mode just a matter of having
> > >>>>
> > >>>> diff --git a/configs/qemu-vm.c b/configs/qemu-vm.c
> > >>>> index e5a420a..6225be9 100644
> > >>>> --- a/configs/qemu-vm.c
> > >>>> +++ b/configs/qemu-vm.c
> > >>>> @@ -49,6 +49,7 @@ struct {
> > >>>>                         .pci_mmconfig_end_bus = 0xff,
> > >>>>                         .x86 = {
> > >>>>                                 .pm_timer_address = 0x608,
> > >>>> +                                .apic_mode =
> > >>>> JAILHOUSE_APIC_MODE_XAPIC, .vtd_interrupt_limit = 256,
> > >>>>                                 .iommu_units = {
> > >>>>                                         {
> > >>>>
> > >>>> ? If so, it gives me a segv right away, with
> > >>>>
> > >>>> Initializing Jailhouse hypervisor v0.7 (36-g0b1b884-dirty) on
> > >>>> CPU 3 Code location: 0xfffffffff0000060
> > >>>> Using xAPIC
> > >>>> Page pool usage after early setup: mem 44/1480, remap 65/131072
> > >>>> Initializing processors:
> > >>>>  CPU 3... (APIC ID 0) FAILED
> > >>>>
> > >>>> as output.
> > >>>>
> > >>>> Has anyone been testing that?  
> > >>>
> > >>> Just talked to Andreas, he booted his root Linux in xapic mode
> > >>> to inherit that for the non-root cell. Just add "nox2apic" to
> > >>> your host Linux parameters.  
> > >>
> > >> Interesting, because my issue was at jailhouse enable time, I
> > >> did not even enter the merit of which inmate payload was used.
> > >> But I'll check better what's happening, if the .apic_mode = 1
> > >> approach is really all that is needed.  
> > > 
> > > Gotta hate answering to emails before coffee. You said *base*
> > > kernel, sorry. Will re-test.  
> > 
> > Exactly: If the root Linux was brought up in xAPIC mode, Jailhouse
> > has to follow this. Same in case it was using x2APIC before. We
> > cannot switch the mode safely, so we follow what was configured
> > before (auto mode) or defined in the config (like in your case).  
> 
> Thanks. It indeed wors for, say, apic-demo.c inmate. But I see code
> paths there that are hardcoded (at least seem, please correct me) to
> using x2APIC access—int_init() is one of them. I thought it had
> infrastructure for everything APIC be twofold, not just
> apic_ops.read/write. I ask that because I'd like to be able to work on
> xAPIC in Zephyr as well (x2APIC mode being a separate patch), but the
> world crashed for me while trying.

Andreas found and fixed a bug in the zephyr apic timer code. That might
be causing your trouble. I am not sure about the status of getting that
patch upstream. As far as i remember it was an ordering issue between
setting the counter and the mode, where the counter would drop to 0
before the mode is set from one-shot to periodic.

Henning

> Speaking of that, I used to replicate Jailhouse's prink() (via vmcall
> number 8) just fine on Linux to debug things without a console, but
> I'm having a hard time doing that on Zephyr (now on 32-bits). Any
> clues?
> 
> Thanks a lot.
> 
> > 
> > Jan
> > 
> > -- 
> > You received this message because you are subscribed to the Google
> > Groups "Jailhouse" group. To unsubscribe from this group and stop
> > receiving emails from it, send an email to
> > [email protected]. For more options, visit
> > https://groups.google.com/d/optout.  
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to