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,URIBL_BLOCKED, 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 ECF2FC4363D for ; Wed, 23 Sep 2020 02:43:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 865642087D for ; Wed, 23 Sep 2020 02:43:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AuEiNKhL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbgIWCn5 (ORCPT ); Tue, 22 Sep 2020 22:43:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25971 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727287AbgIWCn4 (ORCPT ); Tue, 22 Sep 2020 22:43:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600829035; 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=L5Iph86XmuhHCGapZ7ui2au4oqLldEp1TWYtO710rHU=; b=AuEiNKhL32mIuP7Xj28ttIrADaF0cOAEYbXTAC4LyK57duVTwMnH9ff53vApiXyKVomW4R 2e44tvMeSyrBsAOLjxIkUv1uGYU+wAEeLyZQlURcGRsrERxf2yKv8i3TqwuvfsqV3jUwzQ C8rz2312K/gKwDF8I+kb+ren5jxuzA8= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-183-dumeZ1ljNIiJCzFkh7izCw-1; Tue, 22 Sep 2020 22:43:53 -0400 X-MC-Unique: dumeZ1ljNIiJCzFkh7izCw-1 Received: by mail-wr1-f69.google.com with SMTP id j7so8253263wro.14 for ; Tue, 22 Sep 2020 19:43:53 -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=L5Iph86XmuhHCGapZ7ui2au4oqLldEp1TWYtO710rHU=; b=SObLcrBjAAiJfHQ3HA05EDvMGD1Q2h5mguPPjtBB2LRzqDWhWYnRcpfaY7tTnHuM+c CjRqWRVne9atLzTbix5wu8Vkc5L4QCfq9lWfutF2vYpjgTEjejDEyUqkKX2xNEzIPcfm LHPlulXD3O75qZIBeuL2lNHHJHVGbg9llps3bt6Bg4PAOsm2rt6fJWgHjra2eDU1DvmS EK+ZZwMX5yNXvZwI+6M63T23r33IznoUKvKTxH1Y7kyHZ/yOVA4ygg5+O8c7Z282eH0l fHTHWR4ZoKTyldsXRNwUU4sRsKZlaI8hcwqnXQYnK9jfnHF5UMJ9ySLa+k6kT+UZHFec Fl5w== X-Gm-Message-State: AOAM531K2vApmEzpPWVP6CW+PxELEwwF1XDeuYyf9ZHL0FCbD8uBZB3p P9DPZMOogWZU7XS8JKqaKrYw/J8/Ci+oM6TBChaXL3UScGP60MY45/D1/avxCin1Uwmre0QWtRz rGPeZYnC1kqllS7QAaqOFPM50 X-Received: by 2002:adf:f986:: with SMTP id f6mr8040332wrr.270.1600829032470; Tue, 22 Sep 2020 19:43:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxujNV1OhkUe3ta9YvVqeawpCFmGsJIC6lIUnrWxeIHRF2Kv6kHIxIuUPBV+nuf//TFgzpi9A== X-Received: by 2002:adf:f986:: with SMTP id f6mr8040312wrr.270.1600829032236; Tue, 22 Sep 2020 19:43:52 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:2eaa:3549:74e8:ad2b? ([2001:b07:6468:f312:2eaa:3549:74e8:ad2b]) by smtp.gmail.com with ESMTPSA id s11sm27588526wrt.43.2020.09.22.19.43.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Sep 2020 19:43:51 -0700 (PDT) Subject: Re: [PATCH v6 04/12] KVM: SVM: Modify intercept_exceptions to generic intercepts To: Babu Moger , Sean Christopherson Cc: "vkuznets@redhat.com" , "jmattson@google.com" , "wanpengli@tencent.com" , "kvm@vger.kernel.org" , "joro@8bytes.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "tglx@linutronix.de" References: <159985237526.11252.1516487214307300610.stgit@bmoger-ubuntu> <159985250037.11252.1361972528657052410.stgit@bmoger-ubuntu> <1654dd89-2f15-62b6-d3a7-53f3ec422dd0@redhat.com> <20200914150627.GB6855@sjchrist-ice> <408c7b65-11a5-29af-9b9f-ca8ccfcc0126@amd.com> From: Paolo Bonzini Message-ID: <4fea8c91-8991-2449-b8b7-180cdc8786ca@redhat.com> Date: Wed, 23 Sep 2020 04:43:50 +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: <408c7b65-11a5-29af-9b9f-ca8ccfcc0126@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 22/09/20 21:11, Babu Moger wrote: > > >> -----Original Message----- >> From: Paolo Bonzini >> Sent: Tuesday, September 22, 2020 8:39 AM >> To: Sean Christopherson >> Cc: Moger, Babu ; vkuznets@redhat.com; >> jmattson@google.com; wanpengli@tencent.com; kvm@vger.kernel.org; >> joro@8bytes.org; x86@kernel.org; linux-kernel@vger.kernel.org; >> mingo@redhat.com; bp@alien8.de; hpa@zytor.com; tglx@linutronix.de >> Subject: Re: [PATCH v6 04/12] KVM: SVM: Modify intercept_exceptions to >> generic intercepts >> >> On 14/09/20 17:06, Sean Christopherson wrote: >>>> I think these should take a vector instead, and add 64 in the functions. >>> >>> And "s/int bit/u32 vector" + BUILD_BUG_ON(vector > 32)? >> >> Not sure if we can assume it to be constant, but WARN_ON_ONCE is good >> enough as far as performance is concerned. The same int->u32 + >> WARN_ON_ONCE should be done in patch 1. > > Paolo, Ok sure. Will change "int bit" to "u32 vector". I will send a new > patch to address this. This needs to be addressed in all these functions, > vmcb_set_intercept, vmcb_clr_intercept, vmcb_is_intercept, > set_exception_intercept, clr_exception_intercept, svm_set_intercept, > svm_clr_intercept, svm_is_intercept. > > Also will add WARN_ON_ONCE(vector > 32); on set_exception_intercept, > clr_exception_intercept. Does that sound good? I can do the fixes myself, no worries. It should get to kvm/next this week. Paolo