Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1496228ybh; Fri, 13 Mar 2020 02:14:08 -0700 (PDT) X-Google-Smtp-Source: ADFU+vszukO2B6UQhQyC+Bo/dx0VZk0XxkUzMsqCrbNICke6TCe0bbC0Jke0Dj0zaTzllWbrkvrl X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr9725860otc.337.1584090847913; Fri, 13 Mar 2020 02:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584090847; cv=none; d=google.com; s=arc-20160816; b=eeWL3rge/Ph6CZ4GJTPTcMeGrOb2j5ObrNU3mUE2V667oPMhiySAzk7sw+DA2tQoPN HR2Zbw9Zo5b1+UuwP+ADYLhOvcZNIEdJb3FXfCZtl5IU7em8ctfUQARUyLauyFZeF0DU PTgijqi1brQUCCPyI5QaLeijWh2DM+Nx3BYzx0AXh0tz8LoCgm0PBVdBZoW2bWU6SXlm FhRQqbUEUPzlAiUPRFpdb+QFBXEdICvkwC8ZJHDgCidJscMjyPrAkYWdPBuZVb0qIvzC +Vs/rzbc2p8EOC/LlAEYyxR2IBghQ0u7eSLGxo2Id3g9hNS/dl21wc/QR8R70cPlFSHX wcnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ECrWC7u/aI1ryiL9w5jyBirclWFA7SwyWnDvR8q6Ec0=; b=YwyNjl/saQZZZGjzufyRdVor7sNdGQ9/5u7ULGQSWKicGL5GqC4HGfkEFBepSErdkK LXiSf/E/elW2jvVj1pKGD8Y7YPk5K9uUqk6fy2yjldHBoIc2f76ii1EAvqAl7lVFk5mc 151AR5SMSHXNfguLlZyXZQ0soCCWPGaHNvEvWrO1RRAc+SaPWZleUGpaONdHxiSQh2Lh UzGifrSoP7W/N5rYWleEHEK+nQEcAczt337ogh5sxIYe1cW1oNHwjEPuAOpM9kNhP1Tb FePY0WN/aGEE48Dik2Xl40nRb8iCRsPFcKo3BoWRhXfW8o5vLHPJSBem9TQElW/bGAf1 /Ong== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y25si5463745otj.304.2020.03.13.02.13.56; Fri, 13 Mar 2020 02:14:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726545AbgCMJMZ (ORCPT + 99 others); Fri, 13 Mar 2020 05:12:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:45946 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgCMJMZ (ORCPT ); Fri, 13 Mar 2020 05:12:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 63F64AD39; Fri, 13 Mar 2020 09:12:23 +0000 (UTC) Date: Fri, 13 Mar 2020 10:12:21 +0100 From: Joerg Roedel 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 Subject: Re: [PATCH 38/62] x86/sev-es: Handle instruction fetches from user-space 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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