IRC channel logs


back to list of logs

***Out`Of`Control is now known as GNU[BDC]
***GNU[BDC] is now known as Viper
***Viper is now known as GNU[BDC]
<almuhs>damo22 youpi: I've got to find APIC table and lapic address. But, when I try to find the apic entries, all are shown as apic_id = 0
<almuhs>check this:
<almuhs>maybe apic table not fill in a single page?
***Server sets mode: +nt
<almuhs>this is the video
<youpi>almuhs: I'm not surprised that the first CPU has APIC ID 0
<almuhs>other question is that my VM has 4 cores
<almuhs>but gnumach only detects one of this
<almuhs>youpi: I've printed ncpu and nioapic values, and both has the value 1
<almuhs>but my VM is 4 cores
<almuhs>I've just printed the end address of apic table
<almuhs>apic table start is in f9494000 and the end is in f949364d
<damo22>how did you start qemu
<almuhs>with this script
<damo22>not sure if coreduo has smp4
<almuhs>anyways, if qemu takes coreduo, It might shows 2 cpus
<almuhs>but, in qemu monitor, "info cpus" shows 4 cpus
<damo22>The following CPUs models are compatible with most AMD and Intel x86
<damo22>hosts, but their usage is discouraged, as they expose a very limited
<damo22>featureset, which prevents guests having optimal performance.
<almuhs>I've just removed this line, but the problem is the same
<almuhs>gnumach only find 1 cpu
<damo22>-M q35,accel=kvm
<damo22>it might not have the correct tables otherwise
<almuhs>what is this?: <damo22> -M q35,accel=kvm
<damo22>append that to your qemu command
<almuhs>kvm is enabled
<damo22>im not sure if that flag works as expected
<almuhs>what is q35?
<damo22>q35 is the chipset
<damo22>it changes the machine layout
<youpi>qemu's cpu emulation is completely independent from the numer of smp CPU
<youpi>you need to pass -smp 2 to have two CPUs
<youpi>whatever the kind of CPU you as to simulation
<almuhs>I have -smp 4
<damo22>ok but the acpi tables might not get generated unless its the right "machine"
<youpi>I have never had to do anything beyond -smp <n> to get smp support
<almuhs>in the MinSMP the 4 cpus are find correctly
<damo22>ok then
<almuhs>youpi: then, how you set the number of cpus in qemu?
<damo22>-smp N
<almuhs>It's the same than me
<damo22>maybe theres something wrong with your parser
<damo22>does it stop when it finds one entry?
<almuhs>but I suspect that maybe the table doesn't fills in a single page
<almuhs>or It is wrongly mapped
<almuhs>this is the code
<almuhs>this was the original code:
<damo22> what is "acpi_rsdt_n"
<almuhs>the number of entries in rsdt table
<damo22>i thought the madt table has different entries for the cpus not the rsdt
<almuhs>yes, the madt parser is below
<almuhs>in acpi_apic_setup()
<almuhs>this line is only where the apic table is found (inside rsdt table)
<damo22>ok so it "found apic in address"
<almuhs>because I found the main address of MADT table
<almuhs>aka APIC table
<almuhs>the pointer to MADT table is inside of RSDT table
<damo22>i think "end" is not the end of the madt table
<damo22>uint32_t end = (uint32_t) apic + apic->header.length;
<damo22>is that the total length?
<almuhs>check the while loop
<almuhs> while((uint32_t)apic_entry < end){
<almuhs>so, this end might be the end of madt table
<damo22>if((lapic_entry->flags & 0x1) && ncpu < NCPUS){ <--- did you set NCPUS?
<almuhs>oops... this can be the error
<almuhs>NCPUS is set to 1 yet
<damo22>just take out the &&
<almuhs>where is this line?
<damo22>you dont need a check for that
<almuhs>I've removed It. I go to check It
<damo22>you will only have 1 ioapic
<damo22>thats pretty normal
<almuhs>yes, It very common
<almuhs>but we might consider that could be more than one
<almuhs>something goes wrong
<almuhs>the code is here:
<almuhs>but the lapic and ioapics are found correctly
<almuhs>oh... I know the reason. The cpu_to_lapic array has defined its size using NCPUS
<almuhs>so, in the print loop, this exceed this range
<almuhs>yes, this is the reason
<almuhs>by now, I have defined the size of cpu_to_lapic array in 255
<almuhs>damo22: now It works
<almuhs>now I have to clean the code to remove useless prints
<damo22> <--- this configures most of the ioapic
<damo22>but needs to be integrated with the madt overrides for the irqs
<almuhs>do you need access to madt?
<almuhs>then I will move apic pointer output of acpi_setup
<almuhs>as a global
<damo22>maybe call it madt not apic
<almuhs>apic_madt ?
<almuhs>damo22: now you can find the pointer here
<almuhs>by default is defined to zero, like NULL value
<almuhs>damo22: the booting process recording
<almuhs>but, if I saw It well, the APIC is found after harddisk starts
<almuhs>then, will can you to configure IOAPIC without problems?
<almuhs>ok, all pushed to github
<damo22>i think i will need to configure the ioapic in gnumach
<damo22>because i need to swap pic for apic
<damo22>but it should be done after SMP work
<almuhs>yes, but you told that the configuration must be before load harddisk drivers
<almuhs>**must be done
<damo22>i think we can leave the ioapic work for later
<almuhs>and, currently the apic parser call is done just after harddisk drivers loading
<almuhs>I'm asking about might be better to move the acpi_setup() call to a previous line
<damo22>we can move it around later as required, also disks will be done in userspace with rump
<almuhs>then, the current call is not a problem, is not?
<damo22>should be fine
<almuhs>tomorrow I will have to work in naming
<almuhs>acpi_setup() is not a good name for a apic parser
<damo22>try to use GNU coding style
<damo22>or it may be hard to merge later
<almuhs>maybe I can use a e-style plugin in GNU mode
<damo22>i gtg
<almuhs>ok, bye
<almuhs>I go to sleep
<almuhs>4:00 AM in spain
***wleslie_ is now known as wleslie
***pie_[bnc] is now known as pie_
<almuhs>hi. Tonight we got to find all lapic and ioapic from gnumach. But, before send the patch, I want to improve the code
<almuhs>by example, I want to rename this function, to a more appropriate name
<almuhs>what name do you suggest to this function?
<almuhs>this function start the search of MADT table, and generates two structures with the APIC ID of each cpu and ioapic existent in the machine