mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-19 22:11:22 +00:00

When a PTE is updated in the page table, the _PAGE_NEWPAGE bit will always be set. And the corresponding page will always be mapped or unmapped depending on whether the PTE is present or not. The check on the _PAGE_NEWPROT bit is not really reachable. Abandoning it will allow us to simplify the code and remove the unreachable code. Reviewed-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Link: https://patch.msgid.link/20241011102354.1682626-2-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
|
|
* Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
|
|
* Copyright (C) 2005 Jeff Dike (jdike@karaya.com)
|
|
*/
|
|
|
|
#ifndef __STUB_DATA_H
|
|
#define __STUB_DATA_H
|
|
|
|
#include <linux/compiler_types.h>
|
|
#include <as-layout.h>
|
|
#include <sysdep/tls.h>
|
|
|
|
struct stub_init_data {
|
|
unsigned long stub_start;
|
|
|
|
int stub_code_fd;
|
|
unsigned long stub_code_offset;
|
|
int stub_data_fd;
|
|
unsigned long stub_data_offset;
|
|
|
|
unsigned long segv_handler;
|
|
};
|
|
|
|
#define STUB_NEXT_SYSCALL(s) \
|
|
((struct stub_syscall *) (((unsigned long) s) + (s)->cmd_len))
|
|
|
|
enum stub_syscall_type {
|
|
STUB_SYSCALL_UNSET = 0,
|
|
STUB_SYSCALL_MMAP,
|
|
STUB_SYSCALL_MUNMAP,
|
|
};
|
|
|
|
struct stub_syscall {
|
|
struct {
|
|
unsigned long addr;
|
|
unsigned long length;
|
|
unsigned long offset;
|
|
int fd;
|
|
int prot;
|
|
} mem;
|
|
|
|
enum stub_syscall_type syscall;
|
|
};
|
|
|
|
struct stub_data {
|
|
unsigned long offset;
|
|
long err, child_err;
|
|
|
|
int syscall_data_len;
|
|
/* 128 leaves enough room for additional fields in the struct */
|
|
struct stub_syscall syscall_data[(UM_KERN_PAGE_SIZE - 128) / sizeof(struct stub_syscall)] __aligned(16);
|
|
|
|
/* Stack for our signal handlers and for calling into . */
|
|
unsigned char sigstack[UM_KERN_PAGE_SIZE] __aligned(UM_KERN_PAGE_SIZE);
|
|
};
|
|
|
|
#endif
|