mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 16:55:08 +07:00
33def8498f
Use a more generic form for __section that requires quotes to avoid complications with clang and gcc differences. Remove the quote operator # from compiler_attributes.h __section macro. Convert all unquoted __section(foo) uses to quoted __section("foo"). Also convert __attribute__((section("foo"))) uses to __section("foo") even if the __attribute__ has multiple list entry forms. Conversion done using the script at: https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/2-convert_section.pl Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Nick Desaulniers <ndesaulniers@gooogle.com> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
56 lines
1.2 KiB
C
56 lines
1.2 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <linux/acpi.h>
|
|
|
|
#include <xen/hvc-console.h>
|
|
|
|
#include <asm/io_apic.h>
|
|
#include <asm/hypervisor.h>
|
|
#include <asm/e820/api.h>
|
|
|
|
#include <xen/xen.h>
|
|
#include <asm/xen/interface.h>
|
|
#include <asm/xen/hypercall.h>
|
|
|
|
#include <xen/interface/memory.h>
|
|
|
|
#include "xen-ops.h"
|
|
|
|
/*
|
|
* PVH variables.
|
|
*
|
|
* The variable xen_pvh needs to live in the data segment since it is used
|
|
* after startup_{32|64} is invoked, which will clear the .bss segment.
|
|
*/
|
|
bool xen_pvh __section(".data") = 0;
|
|
|
|
void __init xen_pvh_init(struct boot_params *boot_params)
|
|
{
|
|
u32 msr;
|
|
u64 pfn;
|
|
|
|
xen_pvh = 1;
|
|
xen_domain_type = XEN_HVM_DOMAIN;
|
|
xen_start_flags = pvh_start_info.flags;
|
|
|
|
msr = cpuid_ebx(xen_cpuid_base() + 2);
|
|
pfn = __pa(hypercall_page);
|
|
wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
|
|
|
|
xen_efi_init(boot_params);
|
|
}
|
|
|
|
void __init mem_map_via_hcall(struct boot_params *boot_params_p)
|
|
{
|
|
struct xen_memory_map memmap;
|
|
int rc;
|
|
|
|
memmap.nr_entries = ARRAY_SIZE(boot_params_p->e820_table);
|
|
set_xen_guest_handle(memmap.buffer, boot_params_p->e820_table);
|
|
rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap);
|
|
if (rc) {
|
|
xen_raw_printk("XENMEM_memory_map failed (%d)\n", rc);
|
|
BUG();
|
|
}
|
|
boot_params_p->e820_entries = memmap.nr_entries;
|
|
}
|