Skip to content

Commit

Permalink
Merge tag 'x86_cleanups_for_6.5' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/tip/tip

Pull x86 cleanups from Dave Hansen:
 "As usual, these are all over the map. The biggest cluster is work from
  Arnd to eliminate -Wmissing-prototype warnings:

   - Address -Wmissing-prototype warnings

   - Remove repeated 'the' in comments

   - Remove unused current_untag_mask()

   - Document urgent tip branch timing

   - Clean up MSR kernel-doc notation

   - Clean up paravirt_ops doc

   - Update Srivatsa S. Bhat's maintained areas

   - Remove unused extern declaration acpi_copy_wakeup_routine()"

* tag 'x86_cleanups_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
  x86/acpi: Remove unused extern declaration acpi_copy_wakeup_routine()
  Documentation: virt: Clean up paravirt_ops doc
  x86/mm: Remove unused current_untag_mask()
  x86/mm: Remove repeated word in comments
  x86/lib/msr: Clean up kernel-doc notation
  x86/platform: Avoid missing-prototype warnings for OLPC
  x86/mm: Add early_memremap_pgprot_adjust() prototype
  x86/usercopy: Include arch_wb_cache_pmem() declaration
  x86/vdso: Include vdso/processor.h
  x86/mce: Add copy_mc_fragile_handle_tail() prototype
  x86/fbdev: Include asm/fb.h as needed
  x86/hibernate: Declare global functions in suspend.h
  x86/entry: Add do_SYSENTER_32() prototype
  x86/quirks: Include linux/pnp.h for arch_pnpbios_disabled()
  x86/mm: Include asm/numa.h for set_highmem_pages_init()
  x86: Avoid missing-prototype warnings for doublefault code
  x86/fpu: Include asm/fpu/regset.h
  x86: Add dummy prototype for mk_early_pgtbl_32()
  x86/pci: Mark local functions as 'static'
  x86/ftrace: Move prepare_ftrace_return prototype to header
  ...
  • Loading branch information
torvalds committed Jun 26, 2023
2 parents 5dfe7a7 + b360cbd commit 1930048
Show file tree
Hide file tree
Showing 28 changed files with 78 additions and 54 deletions.
6 changes: 6 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ E: tomas@nocrew.org
W: http://tomas.nocrew.org/
D: dsp56k device driver

N: Srivatsa S. Bhat
E: srivatsa@csail.mit.edu
D: Maintainer of Generic Paravirt-Ops subsystem
D: Maintainer of VMware hypervisor interface
D: Maintainer of VMware virtual PTP clock driver (ptp_vmw)

N: Ross Biro
E: ross.biro@gmail.com
D: Original author of the Linux networking code
Expand Down
3 changes: 3 additions & 0 deletions Documentation/process/maintainer-tip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,9 @@ allowing themselves a breath. Please respect that.
The release candidate -rc1 is the starting point for new patches to be
applied which are targeted for the next merge window.

So called _urgent_ branches will be merged into mainline during the
stabilization phase of each release.


Git
^^^
Expand Down
16 changes: 8 additions & 8 deletions Documentation/virt/paravirt_ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ Paravirt_ops
============

Linux provides support for different hypervisor virtualization technologies.
Historically different binary kernels would be required in order to support
different hypervisors, this restriction was removed with pv_ops.
Historically, different binary kernels would be required in order to support
different hypervisors; this restriction was removed with pv_ops.
Linux pv_ops is a virtualization API which enables support for different
hypervisors. It allows each hypervisor to override critical operations and
allows a single kernel binary to run on all supported execution environments
including native machine -- without any hypervisors.

pv_ops provides a set of function pointers which represent operations
corresponding to low level critical instructions and high level
functionalities in various areas. pv-ops allows for optimizations at run
time by enabling binary patching of the low-ops critical operations
corresponding to low-level critical instructions and high-level
functionalities in various areas. pv_ops allows for optimizations at run
time by enabling binary patching of the low-level critical operations
at boot time.

pv_ops operations are classified into three categories:

- simple indirect call
These operations correspond to high level functionality where it is
These operations correspond to high-level functionality where it is
known that the overhead of indirect call isn't very important.

- indirect call which allows optimization with binary patch
Usually these operations correspond to low level critical instructions. They
Usually these operations correspond to low-level critical instructions. They
are called frequently and are performance critical. The overhead is
very important.

- a set of macros for hand written assembly code
Hand written assembly codes (.S files) also need paravirtualization
because they include sensitive instructions or some of code paths in
because they include sensitive instructions or some code paths in
them are very performance critical.
6 changes: 3 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -15974,7 +15974,7 @@ F: include/uapi/linux/ppdev.h

PARAVIRT_OPS INTERFACE
M: Juergen Gross <jgross@suse.com>
M: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
R: Ajay Kaher <akaher@vmware.com>
R: Alexey Makhalov <amakhalov@vmware.com>
R: VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
L: virtualization@lists.linux-foundation.org
Expand Down Expand Up @@ -22546,7 +22546,7 @@ S: Supported
F: drivers/misc/vmw_balloon.c

VMWARE HYPERVISOR INTERFACE
M: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
M: Ajay Kaher <akaher@vmware.com>
M: Alexey Makhalov <amakhalov@vmware.com>
R: VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
L: virtualization@lists.linux-foundation.org
Expand All @@ -22573,8 +22573,8 @@ F: drivers/scsi/vmw_pvscsi.c
F: drivers/scsi/vmw_pvscsi.h

VMWARE VIRTUAL PTP CLOCK DRIVER
M: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
M: Deep Shah <sdeep@vmware.com>
R: Ajay Kaher <akaher@vmware.com>
R: Alexey Makhalov <amakhalov@vmware.com>
R: VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
L: netdev@vger.kernel.org
Expand Down
1 change: 1 addition & 0 deletions arch/x86/entry/vdso/vgetcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/kernel.h>
#include <linux/getcpu.h>
#include <asm/segment.h>
#include <vdso/processor.h>

notrace long
__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/include/asm/doublefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _ASM_X86_DOUBLEFAULT_H
#define _ASM_X86_DOUBLEFAULT_H

#include <linux/linkage.h>

#ifdef CONFIG_X86_32
extern void doublefault_init_cpu_tss(void);
#else
Expand All @@ -10,4 +12,6 @@ static inline void doublefault_init_cpu_tss(void)
}
#endif

asmlinkage void __noreturn doublefault_shim(void);

#endif /* _ASM_X86_DOUBLEFAULT_H */
3 changes: 3 additions & 0 deletions arch/x86/include/asm/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ struct dyn_arch_ftrace {

#ifndef __ASSEMBLY__

void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
unsigned long frame_pointer);

#if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE)
extern void set_ftrace_ops_ro(void);
#else
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/include/asm/mce.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,7 @@ static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
#endif

static inline void mce_hygon_feature_init(struct cpuinfo_x86 *c) { return mce_amd_feature_init(c); }

unsigned long copy_mc_fragile_handle_tail(char *to, char *from, unsigned len);

#endif /* _ASM_X86_MCE_H */
6 changes: 4 additions & 2 deletions arch/x86/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ static inline int syscall_get_arch(struct task_struct *task)
}

void do_syscall_64(struct pt_regs *regs, int nr);
void do_int80_syscall_32(struct pt_regs *regs);
long do_fast_syscall_32(struct pt_regs *regs);

#endif /* CONFIG_X86_32 */

void do_int80_syscall_32(struct pt_regs *regs);
long do_fast_syscall_32(struct pt_regs *regs);
long do_SYSENTER_32(struct pt_regs *regs);

#endif /* _ASM_X86_SYSCALL_H */
11 changes: 2 additions & 9 deletions arch/x86/include/asm/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <asm/processor-flags.h>
#include <asm/pgtable.h>

DECLARE_PER_CPU(u64, tlbstate_untag_mask);

void __flush_tlb_all(void);

#define TLB_FLUSH_ALL -1UL
Expand Down Expand Up @@ -54,15 +56,6 @@ static inline void cr4_clear_bits(unsigned long mask)
local_irq_restore(flags);
}

#ifdef CONFIG_ADDRESS_MASKING
DECLARE_PER_CPU(u64, tlbstate_untag_mask);

static inline u64 current_untag_mask(void)
{
return this_cpu_read(tlbstate_untag_mask);
}
#endif

#ifndef MODULE
/*
* 6 because 6 should be plenty and struct tlb_state will fit in two cache
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/acpi/sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ extern int wakeup_pmode_return;

extern u8 wake_sleep_flags;

extern unsigned long acpi_copy_wakeup_routine(unsigned long);
extern void wakeup_long64(void);

extern void do_suspend_lowlevel(void);
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/doublefault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <asm/processor.h>
#include <asm/desc.h>
#include <asm/traps.h>
#include <asm/doublefault.h>

#define ptr_ok(x) ((x) > PAGE_OFFSET && (x) < PAGE_OFFSET + MAXMEM)

Expand Down
3 changes: 0 additions & 3 deletions arch/x86/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,6 @@ static void *addr_from_call(void *ptr)
return ptr + CALL_INSN_SIZE + call.disp;
}

void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
unsigned long frame_pointer);

/*
* If the ops->trampoline was not allocated, then it probably
* has a static trampoline func, or is the ftrace caller itself.
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/head32.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ asmlinkage __visible void __init __noreturn i386_start_kernel(void)
* to the first kernel PMD. Note the upper half of each PMD or PTE are
* always zero at this stage.
*/
void __init mk_early_pgtbl_32(void);
void __init mk_early_pgtbl_32(void)
{
#ifdef __pa
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/platform-quirks.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/pnp.h>

#include <asm/setup.h>
#include <asm/bios_ebda.h>
Expand Down
32 changes: 19 additions & 13 deletions arch/x86/lib/msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ void msrs_free(struct msr *msrs)
EXPORT_SYMBOL(msrs_free);

/**
* Read an MSR with error handling
*
* msr_read - Read an MSR with error handling
* @msr: MSR to read
* @m: value to read into
*
* It returns read data only on success, otherwise it doesn't change the output
* argument @m.
*
* Return: %0 for success, otherwise an error code
*/
static int msr_read(u32 msr, struct msr *m)
{
Expand All @@ -49,10 +49,12 @@ static int msr_read(u32 msr, struct msr *m)
}

/**
* Write an MSR with error handling
* msr_write - Write an MSR with error handling
*
* @msr: MSR to write
* @m: value to write
*
* Return: %0 for success, otherwise an error code
*/
static int msr_write(u32 msr, struct msr *m)
{
Expand Down Expand Up @@ -88,25 +90,29 @@ static inline int __flip_bit(u32 msr, u8 bit, bool set)
}

/**
* Set @bit in a MSR @msr.
* msr_set_bit - Set @bit in a MSR @msr.
* @msr: MSR to write
* @bit: bit number to set
*
* Retval:
* < 0: An error was encountered.
* = 0: Bit was already set.
* > 0: Hardware accepted the MSR write.
* Return:
* * < 0: An error was encountered.
* * = 0: Bit was already set.
* * > 0: Hardware accepted the MSR write.
*/
int msr_set_bit(u32 msr, u8 bit)
{
return __flip_bit(msr, bit, true);
}

/**
* Clear @bit in a MSR @msr.
* msr_clear_bit - Clear @bit in a MSR @msr.
* @msr: MSR to write
* @bit: bit number to clear
*
* Retval:
* < 0: An error was encountered.
* = 0: Bit was already cleared.
* > 0: Hardware accepted the MSR write.
* Return:
* * < 0: An error was encountered.
* * = 0: Bit was already cleared.
* * > 0: Hardware accepted the MSR write.
*/
int msr_clear_bit(u32 msr, u8 bit)
{
Expand Down
1 change: 1 addition & 0 deletions arch/x86/lib/usercopy_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/export.h>
#include <linux/uaccess.h>
#include <linux/highmem.h>
#include <linux/libnvdimm.h>

/*
* Zero Userspace
Expand Down
1 change: 1 addition & 0 deletions arch/x86/math-emu/fpu_entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <asm/traps.h>
#include <asm/user.h>
#include <asm/fpu/api.h>
#include <asm/fpu/regset.h>

#include "fpu_system.h"
#include "fpu_emu.h"
Expand Down
1 change: 1 addition & 0 deletions arch/x86/mm/highmem_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <linux/export.h>
#include <linux/swap.h> /* for totalram_pages */
#include <linux/memblock.h>
#include <asm/numa.h>

void __init set_highmem_pages_init(void)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/mm/pat/set_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ within_inclusive(unsigned long addr, unsigned long start, unsigned long end)
* points to #2, but almost all physical-to-virtual translations point to #1.
*
* This is so that we can have both a directmap of all physical memory *and*
* take full advantage of the the limited (s32) immediate addressing range (2G)
* take full advantage of the limited (s32) immediate addressing range (2G)
* of x86_64.
*
* See Documentation/arch/x86/x86_64/mm.rst for more detail.
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/pci/ce4100.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void ehci_reg_read(struct sim_dev_reg *reg, u32 *value)
*value |= 0x100;
}

void sata_revid_init(struct sim_dev_reg *reg)
static void sata_revid_init(struct sim_dev_reg *reg)
{
reg->sim_reg.value = 0x01060100;
reg->sim_reg.mask = 0;
Expand Down Expand Up @@ -172,7 +172,7 @@ static inline void extract_bytes(u32 *value, int reg, int len)
*value &= mask;
}

int bridge_read(unsigned int devfn, int reg, int len, u32 *value)
static int bridge_read(unsigned int devfn, int reg, int len, u32 *value)
{
u32 av_bridge_base, av_bridge_limit;
int retval = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/platform/olpc/olpc_dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static int __init olpc_dt_compatible_match(phandle node, const char *compat)
return 0;
}

void __init olpc_dt_fixup(void)
static void __init olpc_dt_fixup(void)
{
phandle node;
u32 board_rev;
Expand Down
1 change: 1 addition & 0 deletions arch/x86/video/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/vgaarb.h>
#include <asm/fb.h>

int fb_is_primary_device(struct fb_info *info)
{
Expand Down
5 changes: 5 additions & 0 deletions include/linux/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ void *devm_memremap(struct device *dev, resource_size_t offset,
size_t size, unsigned long flags);
void devm_memunmap(struct device *dev, void *addr);

/* architectures can override this */
pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
unsigned long size, pgprot_t prot);


#ifdef CONFIG_PCI
/*
* The PCI specifications (Rev 3.0, 3.2.5 "Transaction Ordering and
Expand Down
2 changes: 2 additions & 0 deletions include/linux/olpc-ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ extern int olpc_ec_sci_query(u16 *sci_value);

extern bool olpc_ec_wakeup_available(void);

asmlinkage int xo1_do_sleep(u8 sleep_state);

#else

static inline int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
Expand Down
4 changes: 4 additions & 0 deletions include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ extern struct pbe *restore_pblist;
int pfn_is_nosave(unsigned long pfn);

int hibernate_quiet_exec(int (*func)(void *data), void *data);
int hibernate_resume_nonboot_cpu_disable(void);
int arch_hibernation_header_save(void *addr, unsigned int max_size);
int arch_hibernation_header_restore(void *addr);

#else /* CONFIG_HIBERNATION */
static inline void register_nosave_region(unsigned long b, unsigned long e) {}
static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
Expand Down
Loading

0 comments on commit 1930048

Please sign in to comment.