[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZrDKO7WBqAhmA-7J@example.org>
Date: Mon, 5 Aug 2024 14:48:59 +0200
From: Alexey Gladkov <legion@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, linux-coco@...ts.linux.dev,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Yuan Yao <yuan.yao@...el.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Yuntao Wang <ytcoode@...il.com>, Kai Huang <kai.huang@...el.com>,
Baoquan He <bhe@...hat.com>, Oleg Nesterov <oleg@...hat.com>,
cho@...rosoft.com, decui@...rosoft.com, John.Starks@...rosoft.com
Subject: Re: [PATCH v1 1/4] x86/tdx: Split MMIO read and write operations
On Tue, Jul 30, 2024 at 08:31:15PM +0200, Thomas Gleixner wrote:
> On Tue, Jul 30 2024 at 19:35, Alexey Gladkov wrote:
> > To implement MMIO in userspace, additional memory checks need to be
> > implemented. To avoid overly complicating the handle_mmio() function
> > and to separate checks from actions, it will be split into two separate
> > functions for handling read and write operations.
>
> It will be split? The patch splits it, no?
Yes. Sorry for my english. I will reword it.
> >
> > +static int handle_mmio_write(struct insn *insn, enum insn_mmio_type mmio, int size,
> > + struct pt_regs *regs, struct ve_info *ve)
>
> Please align the second line argument with the first argument in the
> first line.
>
> > +static int handle_mmio_read(struct insn *insn, enum insn_mmio_type mmio, int size,
> > + struct pt_regs *regs, struct ve_info *ve)
> > +{
> > + unsigned long *reg, val;
> > + int extend_size;
> > + u8 extend_val = 0;
>
> https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#variable-declarations
Ok. I will fix the coding style here and in other patches.
> > static int handle_mmio(struct pt_regs *regs, struct ve_info *ve)
> > {
> > - unsigned long *reg, val, vaddr;
> > + unsigned long vaddr;
> > char buffer[MAX_INSN_SIZE];
> > enum insn_mmio_type mmio;
> > struct insn insn = {};
> > - int size, extend_size;
> > - u8 extend_val = 0;
> > + int size;
>
> Ditto
>
> > /* Only in-kernel MMIO is supported */
> > if (WARN_ON_ONCE(user_mode(regs)))
> > @@ -428,12 +504,6 @@ static int handle_mmio(struct pt_regs *regs, struct ve_info *ve)
> > if (WARN_ON_ONCE(mmio == INSN_MMIO_DECODE_FAILED))
> > return -EINVAL;
>
> Thanks,
>
> tglx
>
--
Rgrds, legion
Powered by blists - more mailing lists