From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 38/62] x86/sev-es: Handle instruction fetches from user-space Date: Fri, 13 Mar 2020 10:12:21 +0100 Message-ID: <20200313091221.GA16378@suse.de> References: <20200211135256.24617-1-joro@8bytes.org> <20200211135256.24617-39-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: Joerg Roedel , X86 ML , "H. Peter Anvin" , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , LKML , kvm list , Linux Virtualization List-Id: virtualization@lists.linuxfoundation.org On Wed, Feb 12, 2020 at 01:42:48PM -0800, Andy Lutomirski wrote: > I realize that this is a somewhat arbitrary point in the series to > complain about this, but: the kernel already has infrastructure to > decode and fix up an instruction-based exception. See > fixup_umip_exception(). Please refactor code so that you can share > the same infrastructure rather than creating an entirely new thing. Okay, but 'infrastructure' is a bold word for the call path down fixup_umip_exception(). It uses the in-kernel instruction decoder, which I already use in my patch-set. But I agree that some code in this patch-set is duplicated and already present in the instruction decoder, and that fixup_umip_exception() has more robust instruction decoding. I factor the instruction decoding part out and make is usable for the #VC handler too and remove the code that is already present in the instruction decoder. Regards, Joerg