Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1149135pxx; Fri, 30 Oct 2020 03:25:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjCeceso75tS74gr4HN8t2mHUyKJFQhenN4BcdbmFs25oy0d0EDGh5rTMMtiAtBug5LoPF X-Received: by 2002:a17:906:95c5:: with SMTP id n5mr1761636ejy.111.1604053550955; Fri, 30 Oct 2020 03:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604053550; cv=none; d=google.com; s=arc-20160816; b=gLJsiJosdNbwvDo4Lh5+v+p5pqvrrGi7pxcffngRo018TdsJ06TuUWStyb9J5k48z9 8CnafwpFjv7k9/a2aCHuv6kfRofYXq80MuXg5PGphSlbQ9vrLsMos7ZgS96EFWn5lBIR BscHxPnUOZEAABnxFCdnuVtwJ8vlq/xSymFMTq7uuJX+81734IL3yKou7AxCI6xb6PBY /jpwBQH9MX/nH0R9eugU5AX62anjMQhUnD7Xi1ht2r9NdCCSCARePzcPISmEdfwH0gsr BgkQGtf8ZvMOQaiKxDH6m8XnJxNmpsrQM8tJAwFTIa37qJClDWdZgfrRJ4oKvi4pCdsQ Tpvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xKtrsF7rKr66FumLjY3753xOwWWLzkjNEBS8dgaUpPU=; b=bpKPEpP3wsZh7LnE5Uk5hmcdzo4u8rktVq0uErHPy2bSdSwZOtEVRPPTHZB7yxkZYl B/eR2npIN6pbCnkXCnQ1VtdrCY3xsLZNLDDJbCpzp5Jyp99Vhx+JOhMRmSNRXfeseY6d o0N2e+bzzOKsLjtLIK+RJhaHLuycj6yhoqTrNY6YcwUMJkRDfI/lb9ZtZU2IdGmsd+NP MSi9+Jg0ORsX2cZzbLhV34O9kuCFs3zteon5fNkSUxKEvOEEnqr2IRI1PdgBTJjZqigC 8ibs0aCst6wi8EYsVKXTYSWjIL9+mYFfpGvfSvMz8DxgwmIpSlSKeU+7pMZrjZnA6wmu 0kRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mc7si3840640ejb.354.2020.10.30.03.25.28; Fri, 30 Oct 2020 03:25:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726302AbgJ3KXR (ORCPT + 99 others); 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