Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3869213ioa; Tue, 26 Apr 2022 11:20:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKvDGcbukTkE4V568ltKYOgrMxl6/ZBWusR5uwTmxmO+97pOsyZkYw5J60xuIKrE21dxrx X-Received: by 2002:a17:90b:352:b0:1c6:77e:a4f7 with SMTP id fh18-20020a17090b035200b001c6077ea4f7mr38718230pjb.77.1650997205139; Tue, 26 Apr 2022 11:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650997205; cv=none; d=google.com; s=arc-20160816; b=PAZizTMaRIDbH9PpPOhDJXVOhzWGFWuwHcuO8Nh1voCqftTdVqORnbl9L+N8JN8xha 2CbN0S2/RcBco64JHfCxJiEkIEzWGki+xXKNa0nan4c62ErrGy5P1y1A8LJ3lGSaRGUW hGG+gGZhpoqvajrZQv62IMwUbvcoJFPkRRF1U66Ccn3LRUA6bN/XNpFcVZr0/mbuI8ae qQGpFi2eb+zL8kKuqUMsxruSi2+6Q4LnA7+tLandinojQJvf4CDvhX9DPEjzgG5No30J 65qJHndBxBOmLtH1ZxbN1tP6quEYeqwYsDQlY00yXM2/mfieq17+DCAnfvIHAU8duOj+ /G3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WDgzj5odytfvHWYC79oVcVHBLZLoY6i/6Y3HutpD6F4=; b=twZw1ikSzDsvm6mtVwgMwdlZxieQ/i5BeN1VYbHSL1i8r44fKiM9Rq4ohc/p21CF7g IOfwWI2WxO+rpI0E8RewkjJ3keZ4mR/BGUiHvVASTWwR7cPcaGxPrZa3fUFGzV0y55P5 wadyb9mTXtPiNwH7LHEnM5QaeE7I0jH2efq4G//VRnDd2uwF+Rg9+5qtq8Run0vfLAWK vspKa5/sxsTbq0BOs1M+YS5ooSVunG2krFx/LS2Yk4U4fkvuIJv5OivTQAO8OdUAn8AQ w4JT3sb0jofDgPMXYyubM+/vfJo5kCCOGgxPM0TwVtNJnofvNVbxKxv56gblGjCqg1nk HFaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RNjGzXao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x129-20020a636387000000b003ab0dab94bcsi9578931pgb.126.2022.04.26.11.19.48; Tue, 26 Apr 2022 11:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RNjGzXao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347398AbiDZJUA (ORCPT + 99 others); Tue, 26 Apr 2022 05:20:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345693AbiDZI4p (ORCPT ); Tue, 26 Apr 2022 04:56:45 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0930BDC591 for ; Tue, 26 Apr 2022 01:41:18 -0700 (PDT) Received: from zn.tnic (p5de8eeb4.dip0.t-ipconnect.de [93.232.238.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 947631EC04A6; Tue, 26 Apr 2022 10:41:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1650962472; 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:in-reply-to:in-reply-to: references:references; bh=WDgzj5odytfvHWYC79oVcVHBLZLoY6i/6Y3HutpD6F4=; b=RNjGzXao8IjCAZdnyz+sxuWaGQkZ/vd2mBMQcXkorVlHxF8aZwOhjFv4yzyb07IC1cWtdD ULYpgmsRwGJlrKq9s0lT+lGWYaOvYXAN7z6VNXS1lWrwLuV/e11t2Bk/YoGWr2WZKy1VVj Dqp/f/bCRwbcGI72KlCyWMGc2WUv3AY= Date: Tue, 26 Apr 2022 10:41:09 +0200 From: Borislav Petkov To: Juergen Gross Cc: Oleksandr , Christoph Hellwig , Boris Ostrovsky , Stefano Stabellini , xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Julien Grall , Oleksandr Tyshchenko , "Michael S. Tsirkin" , Tom Lendacky Subject: Re: [PATCH V1 3/6] xen/virtio: Add option to restrict memory access under Xen Message-ID: References: <1650646263-22047-1-git-send-email-olekstysh@gmail.com> <1650646263-22047-4-git-send-email-olekstysh@gmail.com> <6c5042fe-dafc-eb4f-c1fa-03b0faf252de@gmail.com> <147f68f6-7d67-1884-bd14-5040639b3396@suse.com> <67c7460a-3001-35a6-8e5b-f367270b257a@gmail.com> <7d89848a-3a1c-415d-957a-564ffdd3712d@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7d89848a-3a1c-415d-957a-564ffdd3712d@suse.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 26, 2022 at 07:16:16AM +0200, Juergen Gross wrote: > Christoph suggested (rather firmly) this would be the way to go. Yeah, I saw it but I don't think it is the right way to go. What happens the next time a guest needs to query the platform underneath? Misuse these interfaces again? Because people will see the Xen use and say, hey, look, I will use this for my funky HV too. Even worse: what happens if Xen decides to implement SEV/TDX? Then you're in for a world of fun. Now, if we want to *extend* the interfaces to have something as generic as, say, platform_has() and that should be the way for generic kernel code running in the guest to query the platform capabilities, then sure, by all means. > This is needed on guest side at a rather hypervisor independent place. > > So a capability of some sort seems appropriate. > > Another suggestion of mine was to have a callback (or flag) in > struct x86_hyper_runtime for that purpose. This becomes an issue if the HV is not x86 - then you need a different method of querying it, which then underneath will call the arch-specific interface. I don't know how much of querying guests need to do and how they've been doing that so far. Depending on the requirements, we probably should think about a clean design from the get-go instead of homegrown things. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette