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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 EF95AC47426 for ; Thu, 24 Sep 2020 06:52:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA8FB2395A for ; Thu, 24 Sep 2020 06:52:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Px5jN3yU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727316AbgIXGwV (ORCPT ); Thu, 24 Sep 2020 02:52:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34839 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727232AbgIXGwC (ORCPT ); Thu, 24 Sep 2020 02:52:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OnQ7RnpQyCWKyHzqHkBwFITRaelVc+b99566RYUlUuU=; b=Px5jN3yUPLFgaCEZFODUlf2YVFDFEdsApCj4qCQR2ghCNC69dBxb/yQxFs4REUtPlAWuX9 79YXjGPXnNVXuIPk6q1poSEzV0500OkqpFqRi0HxepvMLBU/4uTcU7VXzJup9540pOA4Im EWZ+pktwDL3kpIhUT1AYM2u4uz2E8jU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-Om7ZnQ2wNm6yTWTU1ofa6g-1; Thu, 24 Sep 2020 02:51:59 -0400 X-MC-Unique: Om7ZnQ2wNm6yTWTU1ofa6g-1 Received: by mail-wr1-f72.google.com with SMTP id d13so823147wrr.23 for ; Wed, 23 Sep 2020 23:51:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OnQ7RnpQyCWKyHzqHkBwFITRaelVc+b99566RYUlUuU=; b=DZPJvASc6Kv8rR9/F4MqUNt2yTift4wG3Q8jdJTwwDAzt9lPDsTH7f2XkM73u1xOpi l4jcN8LzRKxIILi6IldzWUZzkH7HSF7zkkmIbXGEtz8kPXKPVhSwa3QPl2r50LGSj1xJ 2hEbrks0l2A6pcuGb/Unka2/URyzSoaPwlovSbSdiA67ZnXJlAmC80KkGSGyj0g/PdoP KvJLnvy19+V1vwwtT7q4g0SaMEv3rW9eNpJmLEs1xCn+FJ70gdREcFObToIBcU2BYJEg zzqwvX73LbeIUsEjj4ghoRNvYTDWL0af+OuKuhl/LRQDO/DvmdpTKjmYgAy+PSRzTXWL SLjg== X-Gm-Message-State: AOAM5314I6mAdwjF+87TOh6OeD4p8+L859Q1laq0UqyN8+wEv4Im3qnU M8gQOGSk9OpWX70jFzmBUux8kHhhIZBvsxzJZn403MtT68Gdh0cFyYa9SvMgRWFCLsVGrB0KzJz Tu7nHR5BdR9CKwWToyVKo669F X-Received: by 2002:a7b:c095:: with SMTP id r21mr3254607wmh.133.1600930318652; Wed, 23 Sep 2020 23:51:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIeIX5AT7dBIOdJC7LRZQn1fAtdurXZZQW16RpkfOrEWOzAPYZlFOar52I36l0bKFZs60P9g== X-Received: by 2002:a7b:c095:: with SMTP id r21mr3254593wmh.133.1600930318446; Wed, 23 Sep 2020 23:51:58 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:d80e:a78:c27b:93ed? ([2001:b07:6468:f312:d80e:a78:c27b:93ed]) by smtp.gmail.com with ESMTPSA id n4sm2287101wrp.61.2020.09.23.23.51.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Sep 2020 23:51:57 -0700 (PDT) Subject: Re: [PATCH] KVM: SVM: Add a dedicated INVD intercept routine To: Tom Lendacky , Sean Christopherson Cc: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Brijesh Singh , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" References: <16f36f9a51608758211c54564cd17c8b909372f1.1600892859.git.thomas.lendacky@amd.com> <20200923203241.GB15101@linux.intel.com> <12be5ce2-2caf-ce8a-01f1-9254ca698849@amd.com> From: Paolo Bonzini Message-ID: Date: Thu, 24 Sep 2020 08:51:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <12be5ce2-2caf-ce8a-01f1-9254ca698849@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/09/20 22:40, Tom Lendacky wrote: >>> +static int invd_interception(struct vcpu_svm *svm) >>> +{ >>> + /* >>> + * Can't do emulation on an SEV guest and INVD is emulated >>> + * as a NOP, so just skip the instruction. >>> + */ >>> + return (sev_guest(svm->vcpu.kvm)) >>> + ? kvm_skip_emulated_instruction(&svm->vcpu) >>> + : kvm_emulate_instruction(&svm->vcpu, 0); >> >> Is there any reason not to do kvm_skip_emulated_instruction() for both SEV >> and legacy? VMX has the same odd kvm_emulate_instruction() call, but AFAICT >> that's completely unecessary, i.e. VMX can also convert to a straight skip. > > You could, I just figured I'd leave the legacy behavior just in case. Not > that I can think of a reason that behavior would ever change. Yeah, let's do skip for both SVM and VMX. Paolo