lkml.org 
[lkml]   [2021]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v2-fix-v2 2/2] x86/tdx: Handle in-kernel MMIO
From
Date
User-space
> access triggers SIGBUS.

Actually it looks like it's implemented below now, so that sentence
could be dropped.


> +
> + if (user_mode(regs)) {
> + ret = insn_fetch_from_user(regs, buffer);
> + if (!ret)
> + return -EFAULT;
> + if (!insn_decode_from_regs(&insn, regs, buffer, ret))
> + return -EFAULT;
> + } else {
> + ret = copy_from_kernel_nofault(buffer, (void *)regs->ip,
> + MAX_INSN_SIZE);
> + if (ret)
> + return -EFAULT;
> + insn_init(&insn, buffer, MAX_INSN_SIZE, 1);
> + insn_get_length(&insn);
> + }
> +

\
 
 \ /
  Last update: 2021-06-02 23:03    [W:1.933 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site