Age | Commit message (Collapse) | Author |
|
* device/dev_name.c: Convert function prototypes from K&R to ANSI.
* device/subr.c: Convert function prototypes from K&R to ANSI.
Message-Id: <20211230112249.13682-2-etienne.brateau@gmail.com>
|
|
Greeting, I have changed some stuff in kern/thread.c which makes code
more readable for me. Maybe it will be usefull.
Message-Id: <20211230082643.8171-1-sys.arch.adam@gmail.com>
|
|
Notably trap/interrupt/syscall provide an exact SP value.
|
|
When we don't have a frame but PC points to a RET instruction (e.g. in the
userland system call assembly code), we can trivially unwind it.
|
|
User processes loaded in high memory are not visible to ddb through the
direct mapping. We can however read/write data through copy_from/to_phys.
|
|
We haven't seen the 2032 bug for a long time, f040677be3c0 ("kd: Do not
read the CMOS ram") probably fixed it at last.
|
|
Like Linux just did.
|
|
The segment code actually has vm_page entries for reserved pages, and
thus memmmap would reject mapping ACPI pages. Taking the information
from biosmem is much more precise, and indeed knows all hardware quirks
which can now be dropped from memmmap.
|
|
The memmmap method may reject some offsets (because it falls in non-device
ranges), so device_map_page has to notice this and report the error.
device_pager_data_request then has to notice as well and report.
|
|
For coherency with memory_object_create_proxy.
|
|
* vm/vm_map.c (vm_region_get_proxy):
- Return KERN_INVALID_ARGUMENT when the entry is a submap.
- Create a pager for the vm_object when the entry doesn't
have any yet, since it's an anonymous mapping.
Message-Id: <20211106081333.10366-3-jlledom@mailfence.com>
|
|
To get a proxy to the region a given address belongs to,
with protection and range limited to the region ones.
* include/mach/mach4.defs: vm_region_get_proxy RPC declaration
* vm/vm_map.c: vm_region_get_proxy implementation
Message-Id: <20211106081333.10366-2-jlledom@mailfence.com>
|
|
* vm/memory_object_proxy.c: Include kern/mach4.server.h.
(memory_object_create_proxy): Drop const qualifiers.
|
|
mach_port_t is for userland, kernel sees the translated ipc_port_t.
* include/mach/memory_object.h [MACH_KERNEL]: Include ipc/ipc_types.h
[MACH_KERNEL] (memory_object_t): Typedef to ipc_port_t instead of
mach_port_t.
(memory_object_array_t): Typedef to memory_object_t* instead of
mach_port_t*.
|
|
* device/dev_pager.c (device_pager_release): Drop unused function.
|
|
This is a no-op on i386.
* i386/include/mach/i386/vm_types.h (vm_size_array_t): New type.
* include/mach/mach4.defs (vm_size_array_t): New type.
(memory_object_create_proxy): Turn len parameter from vm_offset_array_t
to vm_size_array_t.
* vm/memory_object_proxy.c (memory_object_create_proxy): Turn len
parameter from const vm_offset_t * to const vm_size_t *.
|
|
xrstor and xrstors also take the xsave support bitmask.
We were otherwise not necessarily properly reloading all the FPU state,
thus leading to various subtle bugs, notably with glibc 2.33's
ifunc-optimized memcpy etc.
* i386/i386/fpu.h (xrstor, xrstors): Pass fp_xsave_support in EDX:EAX.
|
|
|
|
* x86_64/Makefrag.am (include_mach_i386dir): Rename to include_mach_x86_64dir, set to $(includedir)/mach/x86_64.
(include_mach_i386_HEADERS): Rename to include_mach_x86_64_HEADERS.
Reported-by: Andrea Monaco <andrea.monaco@autistici.org>
|
|
|
|
* linux/dev/drivers/block/ahci.c (ahci_probe_port): Avoid trying AHCI
identify when PxCMD.ATAPI is set.
|
|
* linux/dev/drivers/block/ahci.c (ahci_identify): Fix warning for the
identify timeout.
|
|
Remove the reference to the pager hash since they are used
both in the pager and the device hashes.
* device/dev_pager.c:
* Rename DEV_PAGER_HASH_COUNT to DEV_HASH_COUNT
* Rename dev_pager_hash to dev_hash
Message-Id: <20210828100252.18376-3-jlledom@mailfence.com>
|
|
* device/dev_pager.c:
* struct dev_pager: add offset field
* new struct dev_device_entry: includes device and offset
* new hash table dev_device_hashtable
* index [device + offset]
* new functions dev_device_hash[init,insert,delete,lookup]
* do the same as their counterparts for
dev_pager_hashtable
* dev_pager_setup(): record the offset
* device_map_page(): add the recorded offset on the fly
Message-Id: <20210828100252.18376-2-jlledom@mailfence.com>
|
|
Linux drivers are only limited by the DMA32 constraint, not by the directmap
constraint. But our segment order is currently set to
DMA < DMA32 < DIRECTMAP < HIGHMEM (since that is what we will have in 64bit
mode). In PAE mode this makes DMA32 limited to 800MiB. Ideally we'd have
DMA < DIRECTMAP < DMA32 < HIGHMEM but that'd make the memory code more
complex, and we are to remove the Linux drivers anyway. In the
meanwhile, In non-PAE mode we can just use HIGHMEM which is already
limited to 4GiB, that will do the work.
* linux/dev/glue/block.c (VM_PAGE_LINUX): New macro.
(device_read): Use VM_PAGE_LINUX instead of VM_PAGE_DMA32.
|
|
_kvtophys only works with direct-mappable memory, which is scarse,
better use kvtophys that can work with any kind of memory.
* linux/src/include/asm-i386/io.h: Include <intel/pmap.h>
(virt_to_phys): Use kvtophys instead of _kvtophys.
|
|
* linux/dev/glue/block.c (check_rw_block): Return 0 on no error.
|
|
vm_page_grab was systematically using the VM_PAGE_SEL_DIRECTMAP selector
to play safe with existing code.
This adds a flags parameter to let callers of vm_page_grab specify their
constraints.
Linux drivers need 32bit dmas, Xen drivers use kvtophys to clear some
data. Callers of kmem_pagealloc_physmem and vm_page_grab_phys_addr also use
kvtophys. Otherwise allocations can go to highmem.
This fixes the allocation jam in the directmap segment.
* vm/vm_page.h (VM_PAGE_DMA, VM_PAGE_DMA32, VM_PAGE_DIRECTMAP,
VM_PAGE_HIGHMEM): New macros.
(vm_page_grab): Add flags parameter.
* vm/vm_resident.c (vm_page_grab): Choose allocation selector according
to flags parameter.
(vm_page_convert, vm_page_alloc): Pass VM_PAGE_HIGHMEM to vm_page_grab.
(vm_page_grab_phys_addr): Pass VM_PAGE_DIRECTMAP to vm_page_grab.
* vm/vm_fault.c (vm_fault_page): Pass VM_PAGE_HIGHMEM to vm_page_grab.
* vm/vm_map.c (vm_map_copy_steal_pages): Pass VM_PAGE_HIGHMEM to vm_page_grab.
* kern/slab.c (kmem_pagealloc_physmem): Pass VM_PAGE_DIRECTMAP to vm_page_grab.
* i386/intel/pmap.c (pmap_page_table_page_alloc): Pass VM_PAGE_DIRECTMAP to
vm_page_grab.
* xen/block.c (device_read): Pass VM_PAGE_DIRECTMAP to vm_page_grab.
* linux/dev/glue/block.c (alloc_buffer): Pass VM_PAGE_DMA32 to vm_page_grab.
|
|
|
|
* vm/vm_page.c (db_show_vmstat): Add printing the segment size.
|
|
* vm/vm_page.c (db_show_vmstat): Drop displaying cache numbers a second
time.
|
|
It would be very tricky for the server to manage deallocation for
device_read, and does not seem useful anyway. device_reply.defs already
has it.
* include/device/device.defs (device_read): Add dealloc flag for the data
array.
|
|
* vm/vm_page.c (db_show_vmstat)
|
|
with an output similar to the userland vmstat command
* vm/vm_page.c (db_show_vmstat): New function.
* vm/vm_page.h (db_show_vmstat): New prototype.
* ddb/db_command.c (db_show_cmds): Add vmstat command.
|
|
* linux/dev/drivers/block/ahci.c (ahci_do_port_request): Reject sectors
beyond LBA48 or LBA28.
* linux/dev/glue/block.c (check_rw_block): New function.
(rdwr_partial, rdwr_full): Use check_rw_block to reject block number
overflows.
* linux/src/drivers/block/ide.c (do_rw_disk): Reject sectors beyond
LBA28 or CHS.
|
|
|
|
Otherwise userland can send spurious notifications.
|
|
This is required anyway, and allows the caller to pass on MAKE_SEND.
|
|
On success we'd have to clean the port right. Just consume it.
|
|
We want to prevent subproxies from requesting larger sizes than what a
proxy initially allowed.
|
|
|
|
|
|
glibc's mmap implementation assumes that gnumach will cap the prot for it,
so for now let's revert back to capping rather than rejecting.
That fixes mmap(SHARED|READ) for read-only objects.
|
|
This reverts commit af9f471b500bcd0c1023259c7577e074fe6d3ee5.
|
|
* If not making a copy, don't cap protection to the limit enforced
by the proxy, and only require read access. This fixes mapping
parts of read-only files MAP_ANON + PROT_READ|PROT_WRITE.
* Instead of silently capping protection, return KERN_PROTECTION_FAILURE
to the caller like the other vm_*() routines do.
|
|
We are still having issues with bogus dates. This adds prints at boot
and time set, to make sure what we actually read and write.
* i386/i386at/rtc.c: Include <kern/printf.h>
(readtodc): Warning about reaching CENTURY_START. Print the time read
from RTC.
(writetodc): Record in RTC remainder of division of year by 100 rather
than subtracting 1900. Print the time written to RTC.
|
|
This could conflict with read/writing the RTC.
* i386/i386at/kd.c (kd_xga_init): Do not read the CRAM. We were always
assuming VGA anyway.
|
|
We unmasked by hand kd's irq 1, but com0/1 also need unmasking. More
generally we should unmask irqs as appropriate.
* i386/i386at/model_dep.c (machine_init): Unmask irq 3 and 4.
|
|
Message-Id: <20210405115921.184572-3-damien@zamaudio.com>
|
|
Message-Id: <20210405115921.184572-2-damien@zamaudio.com>
|