diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-11-26 08:40:20 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-11-26 08:40:20 -0800 |
| commit | 85fbf15bc9ac458f014fe70b38fa5773ee6aca9d (patch) | |
| tree | 4fe817597e007ea0647ac4d9af84979cfba2f700 /arch/x86/kernel/kdebugfs.c | |
| parent | fd2615908dfd0586ea40692a99c44e34b7e869bc (diff) | |
| parent | b3c72fc9a78e74161f9d05ef7191706060628f8c (diff) | |
| download | linux-85fbf15bc9ac458f014fe70b38fa5773ee6aca9d.tar.gz linux-85fbf15bc9ac458f014fe70b38fa5773ee6aca9d.tar.bz2 linux-85fbf15bc9ac458f014fe70b38fa5773ee6aca9d.zip | |
Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 boot updates from Ingo Molnar:
"The main changes were:
- Extend the boot protocol to allow future extensions without hitting
the setup_header size limit.
- Add quirk to devicetree systems to disable the RTC unless it's
listed as a supported device.
- Fix ld.lld linker pedantry"
* 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/boot: Introduce setup_indirect
x86/boot: Introduce kernel_info.setup_type_max
x86/boot: Introduce kernel_info
x86/init: Allow DT configured systems to disable RTC at boot time
x86/realmode: Explicitly set entry point via ENTRY in linker script
Diffstat (limited to 'arch/x86/kernel/kdebugfs.c')
| -rw-r--r-- | arch/x86/kernel/kdebugfs.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index edaa30b20841..64b6da95af98 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c @@ -44,7 +44,12 @@ static ssize_t setup_data_read(struct file *file, char __user *user_buf, if (count > node->len - pos) count = node->len - pos; - pa = node->paddr + sizeof(struct setup_data) + pos; + pa = node->paddr + pos; + + /* Is it direct data or invalid indirect one? */ + if (!(node->type & SETUP_INDIRECT) || node->type == SETUP_INDIRECT) + pa += sizeof(struct setup_data); + p = memremap(pa, count, MEMREMAP_WB); if (!p) return -ENOMEM; @@ -108,9 +113,17 @@ static int __init create_setup_data_nodes(struct dentry *parent) goto err_dir; } - node->paddr = pa_data; - node->type = data->type; - node->len = data->len; + if (data->type == SETUP_INDIRECT && + ((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) { + node->paddr = ((struct setup_indirect *)data->data)->addr; + node->type = ((struct setup_indirect *)data->data)->type; + node->len = ((struct setup_indirect *)data->data)->len; + } else { + node->paddr = pa_data; + node->type = data->type; + node->len = data->len; + } + create_setup_data_node(d, no, node); pa_data = data->next; |
