Skip to content

Commit

Permalink
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/tip

Pull x86 platform updates from Ingo Molnar:
 "UV platform updates (with a 'hubless' variant) and Jailhouse updates
  for better UART support"

* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/jailhouse: Only enable platform UARTs if available
  x86/jailhouse: Improve setup data version comparison
  x86/platform/uv: Account for UV Hubless in is_uvX_hub Ops
  x86/platform/uv: Check EFI Boot to set reboot type
  x86/platform/uv: Decode UVsystab Info
  x86/platform/uv: Add UV Hubbed/Hubless Proc FS Files
  x86/platform/uv: Setup UV functions for Hubless UV Systems
  x86/platform/uv: Add return code to UV BIOS Init function
  x86/platform/uv: Return UV Hubless System Type
  x86/platform/uv: Save OEM_ID from ACPI MADT probe
  • Loading branch information
torvalds committed Nov 26, 2019
2 parents 1c134b1 + 7a56b81 commit da42761
Show file tree
Hide file tree
Showing 7 changed files with 323 additions and 110 deletions.
2 changes: 1 addition & 1 deletion arch/x86/include/asm/uv/bios.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect);
extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *);
extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus);

extern void uv_bios_init(void);
extern int uv_bios_init(void);

extern unsigned long sn_rtc_cycles_per_second;
extern int uv_type;
Expand Down
16 changes: 14 additions & 2 deletions arch/x86/include/asm/uv/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ struct mm_struct;
#ifdef CONFIG_X86_UV
#include <linux/efi.h>

#define UV_PROC_NODE "sgi_uv"

static inline int uv(int uvtype)
{
/* uv(0) is "any" */
if (uvtype >= 0 && uvtype <= 30)
return 1 << uvtype;
return 1;
}

extern unsigned long uv_systab_phys;

extern enum uv_system_type get_uv_system_type(void);
Expand All @@ -20,7 +30,8 @@ static inline bool is_early_uv_system(void)
return uv_systab_phys && uv_systab_phys != EFI_INVALID_TABLE_ADDR;
}
extern int is_uv_system(void);
extern int is_uv_hubless(void);
extern int is_uv_hubbed(int uvtype);
extern int is_uv_hubless(int uvtype);
extern void uv_cpu_init(void);
extern void uv_nmi_init(void);
extern void uv_system_init(void);
Expand All @@ -32,7 +43,8 @@ extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; }
static inline bool is_early_uv_system(void) { return 0; }
static inline int is_uv_system(void) { return 0; }
static inline int is_uv_hubless(void) { return 0; }
static inline int is_uv_hubbed(int uv) { return 0; }
static inline int is_uv_hubless(int uv) { return 0; }
static inline void uv_cpu_init(void) { }
static inline void uv_system_init(void) { }
static inline const struct cpumask *
Expand Down
61 changes: 20 additions & 41 deletions arch/x86/include/asm/uv/uv_hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/topology.h>
#include <asm/types.h>
#include <asm/percpu.h>
#include <asm/uv/uv.h>
#include <asm/uv/uv_mmrs.h>
#include <asm/uv/bios.h>
#include <asm/irq_vectors.h>
Expand Down Expand Up @@ -243,83 +244,61 @@ static inline int uv_hub_info_check(int version)
#define UV4_HUB_REVISION_BASE 7
#define UV4A_HUB_REVISION_BASE 8 /* UV4 (fixed) rev 2 */

#ifdef UV1_HUB_IS_SUPPORTED
/* WARNING: UVx_HUB_IS_SUPPORTED defines are deprecated and will be removed */
static inline int is_uv1_hub(void)
{
return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE;
}
#ifdef UV1_HUB_IS_SUPPORTED
return is_uv_hubbed(uv(1));
#else
static inline int is_uv1_hub(void)
{
return 0;
}
#endif
}

#ifdef UV2_HUB_IS_SUPPORTED
static inline int is_uv2_hub(void)
{
return ((uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) &&
(uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE));
}
#ifdef UV2_HUB_IS_SUPPORTED
return is_uv_hubbed(uv(2));
#else
static inline int is_uv2_hub(void)
{
return 0;
}
#endif
}

#ifdef UV3_HUB_IS_SUPPORTED
static inline int is_uv3_hub(void)
{
return ((uv_hub_info->hub_revision >= UV3_HUB_REVISION_BASE) &&
(uv_hub_info->hub_revision < UV4_HUB_REVISION_BASE));
}
#ifdef UV3_HUB_IS_SUPPORTED
return is_uv_hubbed(uv(3));
#else
static inline int is_uv3_hub(void)
{
return 0;
}
#endif
}

/* First test "is UV4A", then "is UV4" */
#ifdef UV4A_HUB_IS_SUPPORTED
static inline int is_uv4a_hub(void)
{
return (uv_hub_info->hub_revision >= UV4A_HUB_REVISION_BASE);
}
#else
static inline int is_uv4a_hub(void)
{
#ifdef UV4A_HUB_IS_SUPPORTED
if (is_uv_hubbed(uv(4)))
return (uv_hub_info->hub_revision == UV4A_HUB_REVISION_BASE);
#endif
return 0;
}
#endif

#ifdef UV4_HUB_IS_SUPPORTED
static inline int is_uv4_hub(void)
{
return uv_hub_info->hub_revision >= UV4_HUB_REVISION_BASE;
}
#ifdef UV4_HUB_IS_SUPPORTED
return is_uv_hubbed(uv(4));
#else
static inline int is_uv4_hub(void)
{
return 0;
}
#endif
}

static inline int is_uvx_hub(void)
{
if (uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE)
return uv_hub_info->hub_revision;

return 0;
return (is_uv_hubbed(-2) >= uv(2));
}

static inline int is_uv_hub(void)
{
#ifdef UV1_HUB_IS_SUPPORTED
return uv_hub_info->hub_revision;
#endif
return is_uvx_hub();
return is_uv1_hub() || is_uvx_hub();
}

union uvh_apicid {
Expand Down
25 changes: 16 additions & 9 deletions arch/x86/include/uapi/asm/bootparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,22 @@ struct boot_e820_entry {
* setup data structure.
*/
struct jailhouse_setup_data {
__u16 version;
__u16 compatible_version;
__u16 pm_timer_address;
__u16 num_cpus;
__u64 pci_mmconfig_base;
__u32 tsc_khz;
__u32 apic_khz;
__u8 standard_ioapic;
__u8 cpu_ids[255];
struct {
__u16 version;
__u16 compatible_version;
} __attribute__((packed)) hdr;
struct {
__u16 pm_timer_address;
__u16 num_cpus;
__u64 pci_mmconfig_base;
__u32 tsc_khz;
__u32 apic_khz;
__u8 standard_ioapic;
__u8 cpu_ids[255];
} __attribute__((packed)) v1;
struct {
__u32 flags;
} __attribute__((packed)) v2;
} __attribute__((packed));

/* The so-called "zeropage" */
Expand Down
Loading

0 comments on commit da42761

Please sign in to comment.