Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1204924pxy; Fri, 23 Apr 2021 02:51:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxKtqT597Ww/qnpx99OeOUeRlQ8tIQnFSLZwhZLPa8Q4CpblZfwm8y9A0zAJm9EyqMgeTm X-Received: by 2002:a17:90a:4811:: with SMTP id a17mr3399778pjh.74.1619171507344; Fri, 23 Apr 2021 02:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619171507; cv=none; d=google.com; s=arc-20160816; b=XDZKYi7m/PCAEVuqoKWvHVV8Rv750Wqy34Jfg2PG5PcpgjfgUi8hba1MLvEBgRXqGL E9blTB62GkaAsUlhqyHBWULacPR+I+kmsyQ9Dj9QERNrnzqPZ5R7dZMqcQIus/wMDvmR ZecvmKHcAt4zkJCE45xB973lmtDY62lylc74zx8aVyG+eQ2JEGg+/2ruQYS1kg3qOzSi uVRibv93mpKga2BNAhDEurMgVIVnQoXou51dqH5KvSq/MF9Pbh+gTeqgIEJpnEbiSFLc waowNXjFcg9gNTh11ZOPIht4IyFjxrPu4IanjE9UYe32HNB9qA35CqAbD0pLbgaaq6Ca EoAQ== 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=lttXllC96pjl9peZRGjvJaERkDX34Sq4PB6MZIKq8Dw=; b=khAJrNOXD9XZ2wGfiBPdQFbr5R7u1FH707c7ZyU3ah51z9Eqb+Cz3pUJcv3ywYOiRh 947+ijx6q/Zb0Xp5REbTwfwhp/u12kZRiBB61kli34qGB7ezKQbJYZ4Ze5n5DqZ0S/HI sWgrsJEdXJRc8pzDh4SybG/XLSb13E1WI88U4Cfl0f5c6BWCRt5nNMuSboENnGBd5a2U G0gDn5xt09mZu/PM0y+mRmNzNRFkeuCZqU5ltDHL1YFxdT6tfrnWUp8Zig1jllAV31t4 4qbnhAmN2kx+Dsafk2HO2KfFSj3Dc3Xo9p0vTVrK+AxFMp71lJWpLqbnSXwNjJtNSzPj 1/JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h8C7ozPi; 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 k14si5937475pfa.113.2021.04.23.02.51.34; Fri, 23 Apr 2021 02:51:47 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h8C7ozPi; 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 S241853AbhDWJut (ORCPT + 99 others); Fri, 23 Apr 2021 05:50:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40378 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241852AbhDWJus (ORCPT ); Fri, 23 Apr 2021 05:50:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619171412; 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=lttXllC96pjl9peZRGjvJaERkDX34Sq4PB6MZIKq8Dw=; b=h8C7ozPilbk0UFkf8ysHgKSjkQmKxARlYoRhujeoBgqZg8x5nbdYRY5oFif9re4j9pvOxN zWPX3v4Nw5R5wBbnkSvWB5nEiI8bXPfDuKHACsoB6oohYQoPxXrikA9wpvoAK56Pptz0w/ wySiPQM+nzKCzdXVkKNahtUUuFdzMK0= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-449-2aMAfHaYPFaCtZSADwr6eg-1; Fri, 23 Apr 2021 05:50:10 -0400 X-MC-Unique: 2aMAfHaYPFaCtZSADwr6eg-1 Received: by mail-ed1-f70.google.com with SMTP id w14-20020aa7da4e0000b02903834aeed684so16560582eds.13 for ; Fri, 23 Apr 2021 02:50:10 -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=lttXllC96pjl9peZRGjvJaERkDX34Sq4PB6MZIKq8Dw=; b=OiP0sw5gKhntIe+jBN6gdGnhZnDIPHMVyXpSwHIOjNPuuFaNQTJR011gKYv01J+mfv cgDe8D573Epf06ufMyx27XU0J/EfPOMD62nVXHfvxiU77R6nMDb2U0mMi9pturFjFM4A sV5RyE8OOoQ3Nnp9FSM/lrX9V7OTYVar2Q6i7FdwROcxr3k42VElEqZBBtXXBgqRrJxV DywgKplVNKS8HspGBWo3AiNXB/oFjpGBoHvNbYsWl9guv0cJnvLP5TRB/iQUNmRhxECB Dr4VIvKP5JtI3HAD4H1+zsk4AzyMyqqqufaS6fQ6L9faE0d8WbbahOoDsNl7jbgtfalS eCHw== X-Gm-Message-State: AOAM532jaJ+SAoRfYLza+WfivQ7sfq+XU0hsJOLRJzpWe3WPO1uSnKs9 +mcihFQaTzgjeK9prjiGP7IxfLj3KB1JjOxy09oIULanixBBKkueOmVhO7Q2uZ457inJbWGGw86 FxnTqpax0GViZ8y6AQckuVlQleytJ30FymHovCzKM2kovWqBtjHenKroYRRefIozByLhjUTcZMn r5 X-Received: by 2002:a05:6402:254f:: with SMTP id l15mr3443793edb.189.1619171409222; Fri, 23 Apr 2021 02:50:09 -0700 (PDT) X-Received: by 2002:a05:6402:254f:: with SMTP id l15mr3443755edb.189.1619171408919; Fri, 23 Apr 2021 02:50:08 -0700 (PDT) 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 x7sm4260299eds.67.2021.04.23.02.50.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Apr 2021 02:50:08 -0700 (PDT) Subject: Re: [PATCH] KVM: hyper-v: Add new exit reason HYPERV_OVERLAY To: Alexander Graf , Siddharth Chandrasekaran , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Cc: Evgeny Iakovlev , Liran Alon , Ioannis Aslanidis , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210423090333.21910-1-sidcha@amazon.de> <224d266e-aea3-3b4b-ec25-7bb120c4d98a@amazon.com> From: Paolo Bonzini Message-ID: <213887af-78b8-03ad-b3f9-c2194cb27b13@redhat.com> Date: Fri, 23 Apr 2021 11:50:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <224d266e-aea3-3b4b-ec25-7bb120c4d98a@amazon.com> 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 23/04/21 11:24, Alexander Graf wrote: > I can see how that may get interesting for other overlay pages later, > but this one in particular is just an MSR write, no? Is there any reason > we can't just use the user space MSR handling logic instead? > > What's missing then is a way to pull the hcall page contents from KVM. > But even there I'm not convinced that KVM should be the reference point > for its contents. Isn't user space in an as good position to assemble it? In theory userspace doesn't know how KVM wishes to implement the hypercall page, especially if Xen hypercalls are enabled as well. But userspace has two plausible ways to get the page contents: 1) add a ioctl to write the hypercall page contents to an arbitrary userspace address 2) after userspace updates the memslots to add the overlay page at the right place, use KVM_SET_MSR from userspace (which won't be filtered because it's host initiated) The second has the advantage of not needing any new code at all, but it's a bit more ugly. Paolo