From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F897C4363A for ; Fri, 30 Oct 2020 10:23:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0657220825 for ; Fri, 30 Oct 2020 10:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726310AbgJ3KXR (ORCPT ); Fri, 30 Oct 2020 06:23:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:42952 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgJ3KXR (ORCPT ); Fri, 30 Oct 2020 06:23:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E11A6AEE0; Fri, 30 Oct 2020 10:23:15 +0000 (UTC) Date: Fri, 30 Oct 2020 11:23:14 +0100 From: Joerg Roedel To: Erdem Aktas Cc: linux-kernel@vger.kernel.org, "Lendacky, Thomas" , linux-tip-commits@vger.kernel.org, Borislav Petkov , x86 Subject: Re: [tip: x86/seves] x86/kvm: Add KVM-specific VMMCALL handling under SEV-ES Message-ID: <20201030102314.GP22179@suse.de> References: <20200907131613.12703-64-joro@8bytes.org> <159972972598.20229.12880317872521101289.tip-bot2@tip-bot2> <20201028094952.GI22179@suse.de> 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 28, 2020 at 11:03:05AM -0700, Erdem Aktas wrote: > I might be missing something here but I think what you say is only > correct for the kvm_hypercall4 cases. All other functions use a > smaller number of registers. #VC blindly assumes that all those > registers are used in the vmcall and exposes them. Right, I think we should fix that in the guest and zero out the unused registers. VMMCALL can come from userspace after all, and the #VC handler does not look at the hypercall numbers. Further, on the host side KVM will unconditionally read out all 4 registers too, which requires us to set them valid in the GHCB. Regards, Joerg