Commit Graph
24 Commits
Author SHA1 Message Date
Andrew Cooper 754a29cacf tools/hvmloader: Move various helpers to being static inlines
The IO port, MSR, IO-APIC and LAPIC accessors compile typically to single or
pairs of instructions, which is less overhead than even the stack manipulation
to call the helpers.

Move the implementations from util.c to being static inlines in util.h

In addition, turn ioapic_base_address into a constant as it is never modified
from 0xfec00000 (substantially shrinks the IO-APIC logic), and make use of the
"A" constraint for WRMSR/RDMSR like we already do for RDTSC.

Bloat-o-meter reports a net:
  add/remove: 0/13 grow/shrink: 0/18 up/down: 0/-790 (-790)

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-05-09 18:19:49 +01:00
Jan Beulich 8ef5b6e11b hvmloader: don't hard-code IO-APIC parameters
The IO-APIC address has variable bits determined by the PCI-to-ISA
bridge (albeit for now we refrain from actually evaluating them, as
there's still implicit rather than explicit agreement on the IO-APIC
base address between qemu and the hypervisor), and the IO-APIC version
should be read from the IO-APIC.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-08-04 10:08:48 +02:00
Ian Campbell 443701ef0c Replace FSF street address with canonical URL
As recommended in http://www.gnu.org/licenses/gpl-howto.en.html.

This is the result of:
$ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl

Where fsf.pl is:
    #!/usr/bin/perl -w -pi.bak -0777
    my $repl = 'If not, see <http://www.gnu.org/licenses/>.';
    my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/;

    my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/;

    my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/;
    my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/;
    my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/;

    s|$inwt$br$mass|$repl|m;
    s|$inwt$br$franklin|$repl|m;
    s|$inwt$br$temple|$repl|m;

The only remaining mentions of these addresses are in COPYING files which I
haven't touched.

Some of the changed files are imports from elsewhere, however
filtering them out is tricky, I think it is tolerable to have these
files be modified here and then perhaps reverted on the next sync,
since it's only 1-2 lines and obvious what is going on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2015-07-29 11:14:07 +01:00
David Vrabel 82639998a5 Fix emacs local variable block to use correct C style variable.
The emacs variable to set the C style from a local variable block is
c-file-style, not c-set-style.

Signed-off-by: David Vrabel <david.vrabel@citrix.com
2013-02-21 16:12:46 +00:00
Keir Fraser d31b9a4e40 hvmloader: Formatting cleanups.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-25 14:09:41 +01:00
Ian Campbell 95fad62ad6 hvmloader: add missing emacs local variables.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-08 13:40:46 +01:00
Ian Campbell 940d37818b hvmloader: allow create_mp_tables() to allocate the table
Will be used by SeaBIOS.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:47:50 +01:00
Ian Campbell e31a6b1889 hvmloader: return MPFPS from create_mp_tables()
This is the hook which the mptables hang off, so it is useful to know.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-01 16:47:27 +01:00
Ian Campbell 575f9fbdfa tools: hvmloader: Refactor MP table setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:47:16 +01:00
Keir Fraser 4bce6df7bd hvmloader: mp table fix
The bug causes noapic PAE Windows 2k3 boot failure.

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
2009-12-30 12:49:10 +00:00
Keir Fraser 89c6cf58e8 x86 hvm: Allow delivery of legacy 8259 interrupts to VCPUs != 0.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-01 20:22:29 +01:00
Keir Fraser 54562e0cdf hvmloader: Simplify access to hvm_info_table.
Also require the table to be present.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 13:49:05 +00:00
Keir Fraser 7eb8d34c18 tools: Declare functions static where they should be, and provide
proper prototypes for others as required.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-15 13:19:26 +01:00
Keir Fraser bc0389d051 solaris: Fix Solaris tools build.
Signed-off-by: John Levon <john.levon@sun.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-11-02 10:16:37 +00:00
kaf24@localhost.localdomain dd59dfdfb1 This patch adds a 32bit gateway to the Bochs BIOS. The 32 bit code is
compiled with gcc and linked into the hvmloader as a byte-array.
Hvmloader allocates memory (rounded up to next 64kb) from the e820
table
below 4GB, copies and relocates the 32bit code in the allocated area
and
copies a jumptable (located in a section '.biosjumptable') pointing to
the 'exported' functions into the Bochs BIOS's memory area to link the
two code sections. The memory area has been reserved and can be
identified with the signature '___JMPT'.

In the Bochs BIOS only stub functions are provided. These load the
index
of a particular function in the jump table, switch to protected mode
and
call the function in the high memory area.  The stack is prepared such
that functions compiled by gcc can just pick the parameters from the
stack as usual - this means that the 16bit real-mode return address is
taken off the stack. The stub functions should have the same signature
as those in 32bit space. For ABI compatibility reasons parameters
inside
the Bochs BIOS stubs should all be 32bit wide.

This patch includes a test function that calls three gcc-compiled
functions in the high memory area and displays their success status.
Simple tests are done doing multiplication and addition of 32-bit
numbers and reading and modification of a static variable. These
functions test the interface and the relocation code. The test code is
removed in patch part 3.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-01-26 16:30:48 +00:00
kaf24@localhost.localdomain c21d85bf59 [HVM] Change VCPU->LAPIC_ID mapping so that VCPU0 has ID0.
This fixes booting of older x86/64 Linux kernels.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-31 12:26:42 +00:00
kaf24@localhost.localdomain 175eac1a6d [HVM] Route ISA IRQ 0 to IOAPIC GSI 2, just like 99% of native systems.
This is a built-in assumption of HPET 'legacy' IRQ routing, which is
why we have changed to this routing strategy now.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-26 19:49:11 +00:00
kfraser@localhost.localdomain db08b83ada [HVMLOADER][ACPI] Move SSDT initialisation to acpi/ dir.
This kills off a few hundred lines of unnecessary code.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-28 15:47:52 +00:00
kfraser@localhost.localdomain a41ba620b1 [HVM] Move IOAPIC ID back to 0x00. Shift LAPIC IDs to 0x01 upwards.
Actually the conflict between LAPIC ID 0x00 and IOAPIC ID 0x00
really doesn't matter even in a native system but we can avoid
any risk of a warning by shifting the LAPIC ID space by one.

Also the changeset fixes construction of the MADT (LAPIC info
was overwriting the IOAPIC info) so we can now boot with ACPI
MADT again.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-27 12:00:01 +00:00
kfraser@localhost.localdomain bbfa22f8c9 [HVM] Move PCI and PCI-ISA bridge setup to hvmloader.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-22 17:50:20 +00:00
kfraser@localhost.localdomain facdf41917 [HVM] Set VIOAPIC ID to a value that does not conflict with LAPIC IDs.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-22 11:52:46 +00:00
kfraser@localhost.localdomain d46c9ce0d7 [HVM] Reworked interrupt distribution logic.
TODO:
 1. Fix IO-APIC ID to not conflict with LAPIC IDS.
 2. Fix i8259 device model (seems to work already though!).
 3. Add INTSRC overrides in MPBIOS and ACPI tables so
    that PCI legacy IRQ routing always ends up at an
    IO-APIC input with level trigger. Restricting link
    routing to {5,6,10,11} and setting overrides for all
    four of those would work.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-21 19:22:25 +00:00
kfraser@localhost.localdomain 5eeca68ffd [HVMLOADER] HVM loader initialises hypercall shim and uses
it to interrogate Xen version information. Also add support
for HVM hypercall execution on 64-bit host.

Signed-off-by: Steven Smith <ssmith@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-04 20:30:12 +01:00
kaf24@firebug.cl.cam.ac.uk f5ea9f8ba8 [HVM][Firmware] Make the creation of MP tables more dynamic
Currently the ROMBIOS includes static MP tables for only four
configurations: 1-way, 2-way, 4-way, and 8-way.

This patch makes the creation of MP tables more dynamic by creating them
from within HVMLOADER based upon the VCPU number provided by the HVM
information table.

Note: Some of the information included used to create the MP tables is
still hard coded and based upon values used in the original ROMBIOS MP
tables.  Data such as the CPU family/model/stepping information should
probably be made to match the information provided to the guest when
executing a CPUID.

Signed-off-by: Travis Betak <travis.betak@amd.com>
2006-06-28 13:59:29 +01:00