64 位 linux 上 32 位进程的地址空间 [英] 32-bit process’s address space on 64-bit linux

查看:37
本文介绍了64 位 linux 上 32 位进程的地址空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个回答中,作者指出:使用 64 位 x86_64 内核,32 位进程可以使用整个 4GB 地址空间,除了由内核管理的 4GB 地址空间末尾的几个页面 (8KB).

这个内核管理内存的用途是什么?难道不应该在内核空间,防止用户意外损坏?

What is the purpose of this kernel-managed memory? Shouldn’t it be in the kernel space, to prevent accidental corruption by the user?

推荐答案

引用内核源代码:内核指针具有冗余信息,因此我们可以使用一种方案,其中我们可以返回错误代码或 [...] 具有相同返回值的指针."

值 -1..-4095(在 32 位模式下映射到 0xfffff000–0xffffffff)是为内核级 errno 值保留的.从 0xffffe000-0xffffefff 中的其他 4KB 为 vsyscall vdso 魔术页面保留,但由于 vdso 页面在许多卫星后可重新定位,因此该区域仍然可能无人值守,也就是说,[stack]/proc/*/maps 中的条目始终以 0xffffdff 结束,无论 [vdso] 是映射到 0xffffe000 还是其他位置.

The values -1..-4095 (mapping to 0xfffff000–0xffffffff in 32-bit mode) are reserved for kernel-level errno values. The other 4KB from 0xffffe000–0xffffefff are held free for the vsyscall vdso magic page, but since the vdso page is relocatable since many moons, this area remains potentially unpopulated, that is to say, the [stack] entry in /proc/*/maps ends at 0xffffdfff always regardless of whether [vdso] is mapped at 0xffffe000 or elsewhere.

这篇关于64 位 linux 上 32 位进程的地址空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆