Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3240842ybf; Tue, 3 Mar 2020 02:15:05 -0800 (PST) X-Google-Smtp-Source: ADFU+vt8z4e9DBbVn1p3XIze4/Fju5ALIJvujiS42d0lu/ih5mizZg8O2lv910v1hOhf/okd/G8d X-Received: by 2002:a05:6808:1d3:: with SMTP id x19mr1988586oic.77.1583230505676; Tue, 03 Mar 2020 02:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583230505; cv=none; d=google.com; s=arc-20160816; b=iUn2fZMIx/g6boGZZuzcgxnj7ifs5pJpPBnQinVe1YKZViLi80RblyZSzC5jIfCqa2 Bap0y/UffoUjUqqrPYeXE7tR8IxH2JPntKl2lpVpdf+O3qm8wzUKNNtnILZglUlU1el6 alH6vNdeOcbwjsPDQc35Frs76+rref74uVzmbg6k0a6DeQXv7i3I76kVneVhr0vfpjiv 1J8jdls5OYcR3SKwSa68a+myApc3ON3PUJEYw0fnugZfCH1J3+EEt2iyBwFSVYHzrvei YHQyi6zRqnCTkf+QmiJGugx26+zkgY6L9bjW1KUcNFQ97mBOgDUcLImBoX3j+ah5AR6N FLEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Zvzf1CSZ/TEF990OeJK7NBEzQ+DyFrhGwywL/pR36+4=; b=H+W0uYB25PYoLyCeh8qmL5iSbfsFc1ZCMGMrMCIjO2d08FtMsNzu1L0CYBatstSwo6 R/su2hHxa1g9OFz0ZllxwqcTJdmPmG/NZD30RSew36zbVG8rGW77MaefZpv0dyT0mZ0Z kon2ce0Fd63W6p0bUBQv4gc+Povvea2+6Y+c+kry0eLIqAhGRxixptnUwYneEj1e426S 7+vb5lkbupBn3dHXE2Rl278xn0oam8YynYNyO9NoM1hkPbj/ITfjZDV3PPanctizljaw d7MeSxjS2fgv25a3Gk0/+bFVNi1VOCjU6UenbH4GDWx0RBUnr2Uk3JpZNZtV37PZb7pO iEKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FZkiPaPD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si1634880oto.204.2020.03.03.02.14.54; Tue, 03 Mar 2020 02:15:05 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FZkiPaPD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbgCCKO2 (ORCPT + 99 others); Tue, 3 Mar 2020 05:14:28 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59722 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728487AbgCCKO1 (ORCPT ); Tue, 3 Mar 2020 05:14:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583230466; 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=Zvzf1CSZ/TEF990OeJK7NBEzQ+DyFrhGwywL/pR36+4=; b=FZkiPaPDDmXhm9Q3x7dsRlOPk9kPgbaf6CotVurEa4/9iuxY7rsusuEAqoG5oV74V20DMH o7lrfxx4PoPY4Wyjg+qjB0NXJeUmv+h5OdrBVF4mAavJU8r9zVg717Q8RcC5FaHgvlsE6Z aZq0eosjTX6wjR52nlOE1dBhH0IhY+g= 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-458-1zcg2TdXNSS6VN_ZR6j15A-1; Tue, 03 Mar 2020 05:14:25 -0500 X-MC-Unique: 1zcg2TdXNSS6VN_ZR6j15A-1 Received: by mail-wr1-f69.google.com with SMTP id p11so1003366wrn.10 for ; Tue, 03 Mar 2020 02:14:25 -0800 (PST) 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=Zvzf1CSZ/TEF990OeJK7NBEzQ+DyFrhGwywL/pR36+4=; b=ESMbQhSZDNnhqFaiRW03qWptFX2rj3aLlG4Fbc8IUOn/ActUPOl6KouZ7gpls2s3h0 1xtUDVHLjI9gOofYjjdFgSwEAGuTMSR7Q7TzlOqeS3cqBdIHPyyteXQ0+VSEILpEvXVG tr4CA1GfYgd2nMAuUuh7xTjeKjuBYhSmBlemLH2iZ6bQag3p34Go/P6kkVIncFbH0+c1 GBTbt8JIKABaJl2XP2/xXh1fb4KnjiXvLei/Fsa8JLOjCfaDjqgE+H3Q6p3ay3Qq1TFn FKli24QLlYoAmwArVN5m7cc+7P15bGsDTZZ+boC7bpQ6vuwwGf9+fdIUj0g3pjEJSwIx M0kA== X-Gm-Message-State: ANhLgQ0gtt7Ml04AMkn85Ygb4yNznQvJ9upnftpD8lJR7btZ36bONKmS LE/6lCzfa47+URqqp2P77wkJHCI3+wW66BdCxZPcVSlLr0xM4W3JMLTLtQa4j8P+AnKgk1o4FeW bI/4S9Yr1xOqijX7xbnfJ/xV4 X-Received: by 2002:adf:ec50:: with SMTP id w16mr4917950wrn.9.1583230464305; Tue, 03 Mar 2020 02:14:24 -0800 (PST) X-Received: by 2002:adf:ec50:: with SMTP id w16mr4917933wrn.9.1583230464031; Tue, 03 Mar 2020 02:14:24 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:9def:34a0:b68d:9993? ([2001:b07:6468:f312:9def:34a0:b68d:9993]) by smtp.gmail.com with ESMTPSA id 19sm3171981wma.3.2020.03.03.02.14.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Mar 2020 02:14:23 -0800 (PST) Subject: Re: [PATCH 3/6] KVM: x86: Add dedicated emulator helper for grabbing CPUID.maxphyaddr To: Jan Kiszka , Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li References: <20200302195736.24777-1-sean.j.christopherson@intel.com> <20200302195736.24777-4-sean.j.christopherson@intel.com> <617748ab-0edd-2ccc-e86b-b86b0adf9d3b@siemens.com> From: Paolo Bonzini Message-ID: <4ddde497-9c71-d64c-df20-3b4439664336@redhat.com> Date: Tue, 3 Mar 2020 11:14:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <617748ab-0edd-2ccc-e86b-b86b0adf9d3b@siemens.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/03/20 10:48, Jan Kiszka wrote: >> >> I don't think this is a particularly useful change.? Yes, it's not >> intuitive but is it more than a matter of documentation (and possibly >> moving the check_cr_write snippet into a separate function)? > > Besides the non obvious return value of the current function, this > approach also avoids leaving cpuid traces for querying maxphyaddr, which > is also not very intuitive IMHO. There are already other cases where we leave CPUID traces. We can just stop tracing if check_limit (which should be renamed to from_guest) is true; there are other internal cases which call ctxt->ops->get_cpuid, such as vendor_intel, and those should also use check_limit==true and check the return value of ctxt->ops->get_cpuid. Paolo