Skip to content

Commit da42761

Browse files
committed
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/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
2 parents 1c134b1 + 7a56b81 commit da42761

File tree

7 files changed

+323
-110
lines changed

7 files changed

+323
-110
lines changed

arch/x86/include/asm/uv/bios.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect);
138138
extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *);
139139
extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus);
140140

141-
extern void uv_bios_init(void);
141+
extern int uv_bios_init(void);
142142

143143
extern unsigned long sn_rtc_cycles_per_second;
144144
extern int uv_type;

arch/x86/include/asm/uv/uv.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ struct mm_struct;
1212
#ifdef CONFIG_X86_UV
1313
#include <linux/efi.h>
1414

15+
#define UV_PROC_NODE "sgi_uv"
16+
17+
static inline int uv(int uvtype)
18+
{
19+
/* uv(0) is "any" */
20+
if (uvtype >= 0 && uvtype <= 30)
21+
return 1 << uvtype;
22+
return 1;
23+
}
24+
1525
extern unsigned long uv_systab_phys;
1626

1727
extern enum uv_system_type get_uv_system_type(void);
@@ -20,7 +30,8 @@ static inline bool is_early_uv_system(void)
2030
return uv_systab_phys && uv_systab_phys != EFI_INVALID_TABLE_ADDR;
2131
}
2232
extern int is_uv_system(void);
23-
extern int is_uv_hubless(void);
33+
extern int is_uv_hubbed(int uvtype);
34+
extern int is_uv_hubless(int uvtype);
2435
extern void uv_cpu_init(void);
2536
extern void uv_nmi_init(void);
2637
extern void uv_system_init(void);
@@ -32,7 +43,8 @@ extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
3243
static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; }
3344
static inline bool is_early_uv_system(void) { return 0; }
3445
static inline int is_uv_system(void) { return 0; }
35-
static inline int is_uv_hubless(void) { return 0; }
46+
static inline int is_uv_hubbed(int uv) { return 0; }
47+
static inline int is_uv_hubless(int uv) { return 0; }
3648
static inline void uv_cpu_init(void) { }
3749
static inline void uv_system_init(void) { }
3850
static inline const struct cpumask *

arch/x86/include/asm/uv/uv_hub.h

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/topology.h>
2020
#include <asm/types.h>
2121
#include <asm/percpu.h>
22+
#include <asm/uv/uv.h>
2223
#include <asm/uv/uv_mmrs.h>
2324
#include <asm/uv/bios.h>
2425
#include <asm/irq_vectors.h>
@@ -243,83 +244,61 @@ static inline int uv_hub_info_check(int version)
243244
#define UV4_HUB_REVISION_BASE 7
244245
#define UV4A_HUB_REVISION_BASE 8 /* UV4 (fixed) rev 2 */
245246

246-
#ifdef UV1_HUB_IS_SUPPORTED
247+
/* WARNING: UVx_HUB_IS_SUPPORTED defines are deprecated and will be removed */
247248
static inline int is_uv1_hub(void)
248249
{
249-
return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE;
250-
}
250+
#ifdef UV1_HUB_IS_SUPPORTED
251+
return is_uv_hubbed(uv(1));
251252
#else
252-
static inline int is_uv1_hub(void)
253-
{
254253
return 0;
255-
}
256254
#endif
255+
}
257256

258-
#ifdef UV2_HUB_IS_SUPPORTED
259257
static inline int is_uv2_hub(void)
260258
{
261-
return ((uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) &&
262-
(uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE));
263-
}
259+
#ifdef UV2_HUB_IS_SUPPORTED
260+
return is_uv_hubbed(uv(2));
264261
#else
265-
static inline int is_uv2_hub(void)
266-
{
267262
return 0;
268-
}
269263
#endif
264+
}
270265

271-
#ifdef UV3_HUB_IS_SUPPORTED
272266
static inline int is_uv3_hub(void)
273267
{
274-
return ((uv_hub_info->hub_revision >= UV3_HUB_REVISION_BASE) &&
275-
(uv_hub_info->hub_revision < UV4_HUB_REVISION_BASE));
276-
}
268+
#ifdef UV3_HUB_IS_SUPPORTED
269+
return is_uv_hubbed(uv(3));
277270
#else
278-
static inline int is_uv3_hub(void)
279-
{
280271
return 0;
281-
}
282272
#endif
273+
}
283274

284275
/* First test "is UV4A", then "is UV4" */
285-
#ifdef UV4A_HUB_IS_SUPPORTED
286-
static inline int is_uv4a_hub(void)
287-
{
288-
return (uv_hub_info->hub_revision >= UV4A_HUB_REVISION_BASE);
289-
}
290-
#else
291276
static inline int is_uv4a_hub(void)
292277
{
278+
#ifdef UV4A_HUB_IS_SUPPORTED
279+
if (is_uv_hubbed(uv(4)))
280+
return (uv_hub_info->hub_revision == UV4A_HUB_REVISION_BASE);
281+
#endif
293282
return 0;
294283
}
295-
#endif
296284

297-
#ifdef UV4_HUB_IS_SUPPORTED
298285
static inline int is_uv4_hub(void)
299286
{
300-
return uv_hub_info->hub_revision >= UV4_HUB_REVISION_BASE;
301-
}
287+
#ifdef UV4_HUB_IS_SUPPORTED
288+
return is_uv_hubbed(uv(4));
302289
#else
303-
static inline int is_uv4_hub(void)
304-
{
305290
return 0;
306-
}
307291
#endif
292+
}
308293

309294
static inline int is_uvx_hub(void)
310295
{
311-
if (uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE)
312-
return uv_hub_info->hub_revision;
313-
314-
return 0;
296+
return (is_uv_hubbed(-2) >= uv(2));
315297
}
316298

317299
static inline int is_uv_hub(void)
318300
{
319-
#ifdef UV1_HUB_IS_SUPPORTED
320-
return uv_hub_info->hub_revision;
321-
#endif
322-
return is_uvx_hub();
301+
return is_uv1_hub() || is_uvx_hub();
323302
}
324303

325304
union uvh_apicid {

arch/x86/include/uapi/asm/bootparam.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,22 @@ struct boot_e820_entry {
153153
* setup data structure.
154154
*/
155155
struct jailhouse_setup_data {
156-
__u16 version;
157-
__u16 compatible_version;
158-
__u16 pm_timer_address;
159-
__u16 num_cpus;
160-
__u64 pci_mmconfig_base;
161-
__u32 tsc_khz;
162-
__u32 apic_khz;
163-
__u8 standard_ioapic;
164-
__u8 cpu_ids[255];
156+
struct {
157+
__u16 version;
158+
__u16 compatible_version;
159+
} __attribute__((packed)) hdr;
160+
struct {
161+
__u16 pm_timer_address;
162+
__u16 num_cpus;
163+
__u64 pci_mmconfig_base;
164+
__u32 tsc_khz;
165+
__u32 apic_khz;
166+
__u8 standard_ioapic;
167+
__u8 cpu_ids[255];
168+
} __attribute__((packed)) v1;
169+
struct {
170+
__u32 flags;
171+
} __attribute__((packed)) v2;
165172
} __attribute__((packed));
166173

167174
/* The so-called "zeropage" */

0 commit comments

Comments
 (0)