Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3434461pxu; Mon, 30 Nov 2020 03:09:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIedxfIVj86e8vmYtBGIwx1f31sIm02yW3+ZK0IIeOpDgPTBUVTnmYap7SyGyENWNStNZ7 X-Received: by 2002:a17:906:b14a:: with SMTP id bt10mr6293049ejb.458.1606734561288; Mon, 30 Nov 2020 03:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606734561; cv=none; d=google.com; s=arc-20160816; b=TXjML33Dz5BaQR/lxjC/oxDZ4ZCwZBNygmm46dc9zdm+hiJiN3oB26tYAKGqleo2Z2 TOuw+8wEq/cQfmcTwfD7v87r9LS0Q5v5/umy0G1xzMEENOWiobv0pUmfStIcIbvXtFMI 92WyJq3Fp/FQLDL/3wz/vcbjxdPA11QCKXyjDtoqHgtA7YrxzgbAHE5KtKkjfxI01axH MAzmMs+usV7jURjetLHjBPuAE4UcmS9J65I8vrrOeB4bQMwIakQ/OzW4F7qAPS0o6mBS 8c8xOsdbHtNUOSZhUfNnNiD642QyGAfelvFj4SB6ZHpFByeLiP+ZoyS49PDZkexnnbHB vJ+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ZM8hGmh0HYKlxLF1MQnAl60sUuzhNOm03zoIM5nbspw=; b=crav3Cps1expepHQDt06z0TuJHTWAnx7EoFLKTib3p2zNE9rKdxvGCUuYd3E+hGWd6 MVVvk46ffJj2dNKtJjlmTRQ31z4M40g/zc53p8XMQwfoVcZ6dJ8xXur14RgRUxh+w/wB +FcUncfwpicdVfMYD0O4ueE3V44SI9hrJTZ76aGij2EMDC3UO7JjJ4RpoAzVqIBJyQ3X RRitrweDx3KVbkZuVh+3G8OOgiSRd1v5t5Ifjxfv0260v4s7+1MFJKkl0pqxo065K5b3 VxNrkwoASRrDpQO6573vfc45f+fSisPH7HLf90UlrXthGmn6argMnBJXp/EYrl5dmeR1 soRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q2zjh7M4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si12191931ejz.473.2020.11.30.03.08.58; Mon, 30 Nov 2020 03:09:21 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q2zjh7M4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729032AbgK3LFD (ORCPT + 99 others); Mon, 30 Nov 2020 06:05:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:60068 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728681AbgK3LFC (ORCPT ); Mon, 30 Nov 2020 06:05:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606734216; 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=ZM8hGmh0HYKlxLF1MQnAl60sUuzhNOm03zoIM5nbspw=; b=Q2zjh7M4DM2jC2XKQ92cbJVqUI1SjUgT5w9CATvyyjQwEkEVjYvwa7KjkhV1K66O7h8QX4 M0PUrdw5OYj+c5I+cWmKwskecVPZPwQqbkdJmbNBjF2/23baJhKvm5EkSqfd7QscHopqKa EJWx9TTEJiPDgrFCZAIP/VvnBiovtbg= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-5sE5DlY4MN2XZBvqE28PTg-1; Mon, 30 Nov 2020 06:03:34 -0500 X-MC-Unique: 5sE5DlY4MN2XZBvqE28PTg-1 Received: by mail-ej1-f71.google.com with SMTP id g18so5597866eje.1 for ; Mon, 30 Nov 2020 03:03:34 -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=ZM8hGmh0HYKlxLF1MQnAl60sUuzhNOm03zoIM5nbspw=; b=ccKuvdJIapK9OjpURQZn5dk1pW1FOoOx/2+QcO/n08jzTkuTJmk72XQ/95sMiC6Vs1 jzoR0rgqxJzFkmNkxRh7Rct2OZNBfl6jAggmpjC+aYVP8a010eoTTjJA+p+0d704uNS8 DXZP0WD7oRTlUPur0WwTgfvm4MCvJWDeotPeBUMZQIRr3uRcUQkGGdVFYE+BILW/RHLT nx+xPDyd8Z2uQu2NKviXFCLKkY46gltq14KE/Z68yqDbm3CnQZkib+x3fXMzdHcU0UBx pHCPA0P65b3G8yJ/famJ9oCWlG02wUZQiXSV2SF1zEMpsA2UyQnkuHHw4+AW33FlkB4L JA5Q== X-Gm-Message-State: AOAM532N3NPj5waRNWIYLX/arIaHM2MoOwrXz7inZ2gkvVfvhBYCpOjG wdxFcEkWuvdgRYlMpuaaNuZxKD0FW7XLAJH/YFXzNX8D6flEgCDvE65ydzG37NlEDTwmuAT1vti HYyFRCW/MljHNBntIJHW+aaZg X-Received: by 2002:a17:906:4049:: with SMTP id y9mr9370138ejj.442.1606734212929; Mon, 30 Nov 2020 03:03:32 -0800 (PST) X-Received: by 2002:a17:906:4049:: with SMTP id y9mr9370101ejj.442.1606734212647; Mon, 30 Nov 2020 03:03:32 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id da9sm270504edb.13.2020.11.30.03.03.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 03:03:31 -0800 (PST) Subject: Re: [PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling To: David Woodhouse , Sean Christopherson , Joao Martins Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Ankur Arora , Boris Ostrovsky , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org References: <20190220201609.28290-1-joao.m.martins@oracle.com> <20190220201609.28290-2-joao.m.martins@oracle.com> <20190222013008.GG7224@linux.intel.com> <44b102eb-ea74-7f19-3f4a-41dfc298d372@redhat.com> <188a300f8314dd30a3a71857f63f144a3ce69950.camel@infradead.org> From: Paolo Bonzini Message-ID: <51b7771a-0b76-37e3-a80b-e372a7467aca@redhat.com> Date: Mon, 30 Nov 2020 12:03:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <188a300f8314dd30a3a71857f63f144a3ce69950.camel@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/11/20 11:39, David Woodhouse wrote: > ... except that's a bit icky because that trick of falling through to > the default case only works for *one* case statement. And more to the > point, the closest thing I can find to a 'kvm_hyperv_enabled()' flag is > what we do for setting the HV_X64_MSR_HYPERCALL_ENABLE flag... which is > based on whether the hv_guest_os_id is set, which in turn is done by > writing one of these MSRs You can use CPUID too (search for Hv#1 in leaf 0x40000000)? Paolo > I suppose we could disable them just by letting Xen take precedence, if > kvm->arch.xen_hvm_config.msr == HV_X64_MSR_GUEST_OS_ID. But that's > basically what Joao's patch already does. It doesn't disable the > *other* Hyper-V MSRs except for the one Xen 'conflicts' with, but I > don't think that matters.