Changeset View
Standalone View
sys/dev/xen/grant_table/grant_table.c
Show First 20 Lines • Show All 527 Lines • ▼ Show 20 Lines | gnttab_map(unsigned int start_idx, unsigned int end_idx) | ||||
if (shared == NULL) { | if (shared == NULL) { | ||||
vm_offset_t area; | vm_offset_t area; | ||||
area = kva_alloc(PAGE_SIZE * max_nr_grant_frames()); | area = kva_alloc(PAGE_SIZE * max_nr_grant_frames()); | ||||
KASSERT(area, ("can't allocate VM space for grant table")); | KASSERT(area, ("can't allocate VM space for grant table")); | ||||
shared = (grant_entry_t *)area; | shared = (grant_entry_t *)area; | ||||
} | } | ||||
#if defined(__x86_64__) || defined(__arm__) || defined(__i386__) | |||||
mhorne: `__i386__` is preferred to `__x86__` within FreeBSD.
I don't see a need to add `__arm__` to… | |||||
Done Inline ActionsFormer: fixed. Latter: While my goal is getting aarch64 operational, it seems worthwhile to try an aarch32 build at some point. In particular since getting aarch64 operational is likely to fix 95% of the aarch32 issues, it seems likely to be worth a little bit of effort. The one challenge is I'm unsure where the shared bits would go. Right now it really looks like nearly all of the issues for aarch64 are also issues for armel/armhf/aarch32 and riscv. ehem_freebsd_m5p.com: Former: fixed.
Latter: While my goal is getting aarch64 operational, it seems worthwhile to… | |||||
for (i = start_idx; i <= end_idx; i++) { | for (i = start_idx; i <= end_idx; i++) { | ||||
pmap_kenter((vm_offset_t) shared + i * PAGE_SIZE, | pmap_kenter((vm_offset_t) shared + i * PAGE_SIZE, | ||||
resume_frames + i * PAGE_SIZE); | resume_frames + i * PAGE_SIZE); | ||||
} | } | ||||
#elif defined(__aarch64__) | |||||
pmap_kenter((vm_offset_t) shared + (start_idx << PAGE_SHIFT), | |||||
(end_idx - start_idx + 1) << PAGE_SHIFT, resume_frames, | |||||
VM_MEMATTR_DEFAULT); | |||||
Done Inline ActionsThis is not correct, you seem to assume start_idx will always be 0, but that's not the case, see gnttab_expand for example. You would need to use something like: pmap_kenter((vm_offset_t)shared + start_idx * PAGE_SIZE, (end_idx - start_idx + 1) << PAGE_SHIFT, resume_frames + start_idx * PAGE_SIZE, VM_MEMATTR_DEFAULT); Or alternatively maybe: #ifdef __aarch64__ #define pmap_kenter(l, p) pmap_kenter(l, PAGE_SIZE, p, VM_MEMATTR_DEFAULT); #endif royger: This is not correct, you seem to assume start_idx will always be 0, but that's not the case… | |||||
Done Inline ActionsGah! So close, but missed the effect on the one argument. Yeah, that might explain the latest failure I've seen. I'll be close to the former. ehem_freebsd_m5p.com: Gah! So close, but missed the effect on the one argument. Yeah, that might explain the latest… | |||||
#else | |||||
#error "Unsupported architecture" | |||||
#endif | |||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
gnttab_resume(device_t dev) | gnttab_resume(device_t dev) | ||||
{ | { | ||||
unsigned int max_nr_gframes, nr_gframes; | unsigned int max_nr_gframes, nr_gframes; | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |
__i386__ is preferred to __x86__ within FreeBSD.
I don't see a need to add __arm__ to this list until someone tries to support it fully.