Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3989440pxv; Mon, 19 Jul 2021 13:47:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8BkOWo+oPmTC+K1Sw2hUOdC1nFxwaV3S3QAcUoS6hkIlHOQxNESuwtTQ2BBe0ifwcARK5 X-Received: by 2002:a05:6402:10d9:: with SMTP id p25mr10969600edu.51.1626727663179; Mon, 19 Jul 2021 13:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626727663; cv=none; d=google.com; s=arc-20160816; b=Awi3USHXSZ7GJz0+QvaqyCtGEYBH5hzzVgIShBPrV71W88ic1aruhYOJhguQzAmVFt XVTYypRtEchlx+C5MjWLfdItVdXMBYuYohRLqvIeH9xn2NCaI7vFCpa0xF2MWafjFl4e mUHdApxXBe34OFoaoDwfpQvkK59hx3PGneYKcqYDIi8TGKwWwnM5zcZ7YW/krcqg2Xva 4lVmLbBPWFt+uFRESnLpL3di+ju6VMTiJG4A/t1cV4tnEm1LnV3V5SGJT0Vk+cTWptd4 MwnnlYTsCBseDqfUdLEV1bABnHGDG/IlyqALLAu3gnGCMBB6zZnGzcCW5jouJ01GqrCG qt5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wDda5dbFXyknFG+xoYFL2uxWIVC+IEB+7xC2zqUFwSc=; b=fEiPs97huIcvR0EcVItAOqc2k0lMn6kZv+OU6qEkNdQKsMlWDTwqrFO4x3pcgLcndc 5bylmw+pPm5gnHCx/RbqBESPRRuaQEAVQMZr7wrXijRsL0Ja8XlrJXLGayy2sRetEejy OjzMB8zbX1QsoYbhGnd9ArsS9oKSgaj0JCeCEfk9SR4OZi4mRpeP+cPGlAJpVnECWLLe hQfwy7CkV6xTWGIW/JxyCwAZHkRV5iAn+2gloa86BAorZyJW4KcVsIpYIFiql5fXxpj4 I92ngQUI9L0t59nJFWAWkATYB5dDCNT3MtfpUUExuCUvd7V8Gf5l62ZQcnusyVN4hyB4 rYTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="C2kt/tLj"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si24158416edv.199.2021.07.19.13.47.20; Mon, 19 Jul 2021 13:47:43 -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=@google.com header.s=20161025 header.b="C2kt/tLj"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358755AbhGSTbM (ORCPT + 99 others); Mon, 19 Jul 2021 15:31:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385398AbhGSS7G (ORCPT ); Mon, 19 Jul 2021 14:59:06 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC785C0613E8 for ; Mon, 19 Jul 2021 12:30:11 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id u13so32084157lfs.11 for ; Mon, 19 Jul 2021 12:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wDda5dbFXyknFG+xoYFL2uxWIVC+IEB+7xC2zqUFwSc=; b=C2kt/tLjq50F2/8YiWA2vApdMGBU1c/5g8q0V7XaPGvDRnYu01eyxREz3eqyUTFPjo +RkvlkvZfYICjMHAI8gTK9GAf+/flWsUK+v7GAxtmc+xq9D5SUVbZ+DUZ9CiQxzMeanC YwYKYS3yuZmuX9KNoLodu1DiX6u9M1TDj8A4sNlA8pqZqXdGe8vk+eCXrW99r7bbq4xn aezOsvO51i/RTsOu+xwDKXdMBUxnzitKNY74AjA/4ymoyUgfBT077E45qJa7F/qXUBWW ztnTsieI6KT6/2V/OeLJPzcwydkdGfXsTY7HAJUxHWTKjw57wll20Q46XtDXCQNoAQ7m jF2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wDda5dbFXyknFG+xoYFL2uxWIVC+IEB+7xC2zqUFwSc=; b=WYfdVY7kEVYAm8KG1Tydk/mnhbnr9pymePM+0MqN/8Y0Of3x+c8LznpFCfsRIZ7Ha3 9El9ZEnkf16sYT2SH45JjMgarGJqSfwCUxUB/U+upNeSJpbgnuP8OnHUCPJj6pW6h9mj h/mrftB3kEOC98QN5XO2p9In+JOIMr5OiZfWUaznAXkdAnkNIWornMaKEBIRYCByW1R5 DVScSfpd2JejXN5Zbz44RYqRgOnnCsWJ2OKmckMtwX7u+S8r0v4Yxbj7Pdaz+kAHVEC2 lNVafIiUDLQeA4q484xZPutiAyGz9voreqaBF7OCFyg1VMFIFkM28jcEi788qUS+32wY kxOQ== X-Gm-Message-State: AOAM532A91lCbiDziGYPHrynsOS2YA1SxqPHC1k/fo9iEhLjlRwsL+0q 3E1qyoMaYowrdZfdjop69KyTk0DBrnic9ecGefN6IA== X-Received: by 2002:ac2:46d0:: with SMTP id p16mr19415538lfo.23.1626723483858; Mon, 19 Jul 2021 12:38:03 -0700 (PDT) MIME-Version: 1.0 References: <20210608154805.216869-1-jean-philippe@linaro.org> In-Reply-To: From: Oliver Upton Date: Mon, 19 Jul 2021 12:37:52 -0700 Message-ID: Subject: Re: [RFC PATCH 0/5] KVM: arm64: Pass PSCI to userspace To: Jean-Philippe Brucker Cc: Alexandru Elisei , salil.mehta@huawei.com, lorenzo.pieralisi@arm.com, kvm@vger.kernel.org, corbet@lwn.net, maz@kernel.org, linux-kernel@vger.kernel.org, jonathan.cameron@huawei.com, catalin.marinas@arm.com, pbonzini@redhat.com, will@kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 11:02 AM Jean-Philippe Brucker wrote: > We forward the whole PSCI function range, so it's either KVM or userspace. > If KVM manages PSCI and the guest calls an unimplemented function, that > returns directly to the guest without going to userspace. > > The concern is valid for any other range, though. If userspace enables the > HVC cap it receives function calls that at some point KVM might need to > handle itself. So we need some negotiation between user and KVM about the > specific HVC ranges that userspace can and will handle. Are we going to use KVM_CAPs for every interesting HVC range that userspace may want to trap? I wonder if a more generic interface for hypercall filtering would have merit to handle the aforementioned cases, and whatever else a VMM will want to intercept down the line. For example, x86 has the concept of 'MSR filtering', wherein userspace can specify a set of registers that it wants to intercept. Doing something similar for HVCs would avoid the need for a kernel change each time a VMM wishes to intercept a new hypercall. -- Thanks, Oliver