Commit Graph
41 Commits
Author SHA1 Message Date
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
Wei Liu f9c9b12775 tools: fix "make distclean"
The original rule to target "distclean" in tools/Rules.mk was in effect
"make clean". It should be "make distclean".

However not all Makefiles in subdirectories have distclean target
defined. So this patch also adds a bunch of distclean targets to various
Makefiles. They only depend on clean target and don't have any actions
in most cases.

With the patch applied, following command outputs 0 results:

  find tools -name 'Makefile*' -exec grep -L 'distclean' {} \+ \
     | grep -v ocaml | grep -v libfsimage

Ocaml and libfsimage are known to have distclean defined in a dedicated
rules file.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-27 16:34:45 +00:00
Andrew Cooper 944cea4588 firmware/tcgbios: Prevent integer truncation in the return value
rc inside the function is uint32_t.  None of the callers check the return
value.

Coverity ID: 1055442

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
2013-11-26 10:58:35 +00:00
Roger Pau Monne 8dc8415c2c rombios: remove sdtint.h dependency
Hardcode uint8_t, uint16_t and uint32_t typedefs, so we no longer need
stdint.h

Resolves problem reported by Wang Zhihao on 64bit Ubuntu systems.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-05-01 14:20:37 +01:00
Ian Campbell 26021e6729 tools: hvmloader: split scratch and hypercall addressing from ROMBIOS low heap.
Although happen to live at the same physical address their lifespans
do not overlap. The scratch and hypercall spaces are used only within
hvmloader and the same area is reused as a heap within ROMBIOS. But
each is free to make its own decisions about where to place things.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:39:22 +01:00
Ian Campbell ac7802b593 tools: hvmloader: split e820 support into its own code module.
Pass the table address as a paramter to the build function and cause
it to return the number of entries. Pass both base and offset as
parameters to the dump function.

This adds a duplicated e820.h header to ROMBIOS. Since the e820 data
structure is well defined by existing BIOS implementations I think
this is OK and simplifies the cross talk between hvmloader and
ROMBIOS.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:36:17 +01:00
Ian Campbell ddff13d94c tools: hvmloader: move ROMBIOS configuration into tools/firmware/rombios/
Currently rombios and hvmloader are rather intertwined. Separate the
ROMBIOS configuration options out into a ROMBIOS provided file so that
the dependency can become strictly from hvmloader to rombios.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:34:30 +01:00
Ian Campbell 3531dea6fd tools: consistently use $(CFLAGS_xeninclude) instead of open coding.
Renamed from the slightly ambiguous CFLAGS_include.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-21 18:04:59 +00:00
Keir Fraser 547cb1849c build: Make XEN_ROOT an absolute path.
Otherwise make can search the path relative to certain standard paths
such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in
Config.mk suffers from this).

Signed-off-by: Keir Fraser <keir@xen.org>
2011-03-17 10:36:25 +00:00
Keir Fraser d188e4cc7e rombios: __STRING() is Linux-specific
Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 11:12:43 +00:00
Keir Fraser 83833d973b rombios: Indirect through 32-bit jump table from within the 32-bit bios.
This gets rid of shenanigans with relocating the jump table around the
place.

Also clean up bios_info table while we are updating it.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-23 14:32:41 +00:00
Keir Fraser b08c16ec2f hvm bios: add PMM (a memory manager during POST)
The PMM (POST Memory Manager) offers malloc/free functionality
for PCI option ROMs during POST (Power On Self Test).

This patch adds a PMM functionality to the guest BIOS.

For example, the option ROM on LSI Logic SAS card uses PMM and
failed to initialize the device without PMM.  Thus, the HVM can't
boot up directly from the passthroughed SCSI disk.
gPXE also uses PMM (I don't know what happens without PMM).

With this patch, we succeeded in SAS boot of HVM.

For further information about PMM:
http://www.phoenix.com/en/OEM-ODM/Customer+Services/White+Papers-Specs/PC+Industry+Specifications.htm
http://www.phoenix.com/NR/rdonlyres/873A00CF-33AC-4775-B77E-08E7B9754993/0/specspmm101.pdf

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-01-23 12:50:14 +00:00
Keir Fraser 85952ca7ce rombios: Simplify 32-bit gateway interface definitions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-22 17:41:13 +00:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Keir Fraser 0a72f4c6f8 firmware: Fix build dependencies.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-31 11:51:14 +01:00
Keir Fraser 24c47cc182 firmware: Fix CFLAGS -I directives.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-30 10:55:06 +01:00
Keir Fraser b5ee8eb3d6 rombios: Obtain S3 wake vector from >1MB.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 16:03:58 +01: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 656217ee9c hvmloader: Build with -Werror.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-09 13:52:52 +01:00
Keir Fraser 0080a146fc x86 firmware: Consolidate firmware common build rules.
Also avoid overriding global optimisation default (-O1, -O2, etc.)

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-02 10:42:27 +01:00
Keir Fraser 6ab58a7ed9 tools build: Fix build after subdir rules cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-03-25 10:17:22 +00:00
Keir Fraser c3e57fa148 tools/firmware: Use generic subdirs rules.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-03-25 09:51:03 +00:00
Keir Fraser 53f48ca221 Fix some build system error handling.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2007-12-20 13:16:21 +00:00
Keir Fraser 3192c29b6a Fix non-portable grep usage. Solaris doesn't have -q option.
Signed-off-by: John Levon <john.levon@sun.com>
2007-11-13 19:26:55 +00:00
Keir Fraser e451db15ef hvm: Clean up firmware compilation warnings.
Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
2007-10-26 09:58:43 +01:00
Keir Fraser d62f502aaa hvm: TCGBIOS fixes
Fix IPL measurement of El Torito CD boot and some eventlog formats.

The TCG BIOS extensions are described here:
https://www.trustedcomputinggroup.org/specs/PCClient/TCG_PCClientImplementationforBIOS_1-20_1-00.pdf

- fix cdrom (El Torito) boot (8.2.5.6 El Torito, p63)
   tcpa_ipl() is modified to support various boot devices.
   move some measurement code into cdrom_boot() function.
- fix EV_IPL (0Dh) event (10.4.1 Event Types, p76)
   eventfield size should be zero
- fix EV_SEPARATOR event (3.2.2 Integrity Collection and Reporting,
   p32)
   change eventfield to -1 (0xFFFFFFFF)  from  "---------------"
- add "Returned INT 19h" event (8.2.3 Logging of Boot Events, p59)
   actually, tcgbios does not call int19h, but we extend this
   tentatively

Signed-off-by: Seiji Munetoh <seiji.munetoh@gmail.com>
2007-10-17 10:00:27 +01:00
Keir Fraser ebe41ed23d hvm: Improve tcgbios code for finding ACPI RSDP.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-09-26 09:14:33 +01:00
Keir Fraser f3f2e4ef69 firmware: fix romimage generation for *bsd
- portability fix in Makefile: mkhex is not bash specific
 - GNU od separates column with one blank, BSD od uses eight blanks.
   Change sed to deal with this.
 - Add a fourth sed to fix a build error on NetBSD

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-09-26 09:10:41 +01:00
kfraser@localhost.localdomain ea511d357e tools: Clean up usage of const type qualifier.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-12 11:26:51 +01:00
kfraser@localhost.localdomain 14b75336fa hvm rombios: Do not screw around with the PIT in the BIOS 32-bit
extensions. mdelay() can more easily be implemented by polling the
DRAM refresh bit in port 0x61. And this does not mess with state that
a guest may be relying on.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-24 12:14:57 +01:00
Keir Fraser f7ffac81ac hvmloader: Fix ROMBIOS highmem relocation. Only SHF_ALLOC sections
should be relocated. SHT_NOBITS must be handled properly (space
explicitly allocated and zeroed).
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-19 21:06:29 +01:00
Keir Fraser e5baa1aa0c hvmloader: Simplify e820_malloc() interface and improve
implementation. Strip unnecessary sections from the highmem bios
extension elf image.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-19 19:22:12 +01:00
kfraser@localhost.localdomain e18371883e TCGBIOS fixes and cleanups.
- Add a missing break into the switch statement
- Simplify the code that switches from protected mode into real mode
  by letting it spill eax; this also fixes the case where the stack is
  above 0xffff.
- reformat the source for 80 columns
- remove some comments that were relevant when the TCG extensions were
  direct part of the real-mode Bochs BIOS

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-03-15 10:36:10 +00:00
kfraser@localhost.localdomain a917e6d478 Disable GCC stack protector for ROMBIOS.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2007-02-15 14:17:00 +00:00
kfraser@localhost.localdomain 09a4bf86cf [TPM] Set tcpa calls in the rombios and other fixes.
This patch places some tcpa calls into the rombios that had previously
not applied anymore or were not set.
Force the reads from MMIO memory locations that the compiler otherwise
optimizes away (-O2) if there was an immediate write to the same
memory location before.
Use #define'd constants wherever possible.
Fix all remaining compiler warnings.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-02-06 23:01:35 +00:00
kaf24@localhost.localdomain 6696b4ae89 Fix firmware compile on Solaris.
Use $(LD) not ld. Include right headers for x86 ELF bits.

Signed-off-by: John Levon <john.levon@sun.com>
2007-01-28 18:45:04 +00:00
kaf24@localhost.localdomain 23791a54c2 [HVM] Fix some BIOS build warnings.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-01-26 16:56:26 +00:00
kaf24@localhost.localdomain 539c6224a5 [TCGBIOS] Fix some makefile issues.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-01-26 16:46:00 +00:00
kaf24@localhost.localdomain d8a689313b Remove the test functions from HVM highmem 32-bit BIOS.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-01-26 16:39:38 +00:00
kaf24@localhost.localdomain 2d52e184e5 [HVM] Add TCG BIOS extensions to the high memory area along with
some often-used libc utility functions. The TCG extensions are
described here:

https://www.trustedcomputinggroup.org/specs/PCClient/TCG_PCClientImplementationforBIOS_1-20_1-00.pdf

I have tried to keep the patching with rombios.c to a minimum, but
some amount of code needs to be inserted at various locations.

The code is currently deactivated, but can be activated by setting
BX_TCGBIOS to '1'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-01-26 16:38:32 +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