Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3343533ioa; Tue, 26 Apr 2022 01:37:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys1rQ5aBcb6qlz0f2XLC6K7xPcdGSVSn+6xAUZZnjsKfdD84Hs+Od6rUb7CcZSuADLDMp5 X-Received: by 2002:a17:906:dc89:b0:6db:a789:7563 with SMTP id cs9-20020a170906dc8900b006dba7897563mr19934432ejc.471.1650962270691; Tue, 26 Apr 2022 01:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650962270; cv=none; d=google.com; s=arc-20160816; b=Qk7fP9KqeCU8a6g8OmcjOmb3lUGG3V9YHaHnZWgIYZQsYR3kutA1wM3Sfp6C7aoGQO Vy8uFJ9GxfofLmoQE6tBGswvAaZYOvD2DdXGY+DMg7crb60XfkNzvl9RpBbv/vkoYEqC 5nx8n/DjEv8U8IMIiL6ogSR5OFNHeNheP57KJu9JjtAfqheo9YMfWCf7cYY2JEzZcHPm Nc46WKVmJ5JYsoqnfyj8WyulvoE0AkfbpwXtM9KH4zDdxcq8d+WXBJ240Jngxg5JzlqC IwR1bxoYlRyrHIh0UMp4qxYmMjEjcOL6aKdeAlSebVgtxQFbBv/R+NBCXfp1nyD1UX1R 5XnA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VzCRn9yN2ByyCFR5QKv9+K8B8VcoQwcA3ZVz2Ifi7JQ=; b=dkjKShHIHXotnpq5T3SfuZyb60Q5D/2BjAmN3UhfVHOBtEc6sOpAriuIYBWDeJgtDW hbTYTPY7Z/x+HU9UUxGv2NSy17TH7D3WWkF/sDN9MYsyebJvA/KbcTajteTKkgAXKd08 BeWkUWgXYQ3vSjBsLAaaWzB8cvBbznzkmh1mOeXOuuGAE1ZbtzQ/epa+0Dv2SG9ASijk eKRqN8VGFolVWP1kbO30WBu47KEOx7e7mmW97+w6PQcMoIH28uj/gWnsWTKGihiz+Kb4 CnMcKnYfIkrx3eVRIfwbxzofa3IXwOKzntPogZszbiLKY+YU4clL+G/09u36wYlFEkOw 5CLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=fNnh8YiU; 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 e8-20020a056402190800b00423e13a04casi18565210edz.445.2022.04.26.01.37.24; Tue, 26 Apr 2022 01:37:49 -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=fNnh8YiU; 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 S233310AbiDYW0X (ORCPT + 99 others); Mon, 25 Apr 2022 18:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343507AbiDYV3P (ORCPT ); Mon, 25 Apr 2022 17:29:15 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D9F1220CE for ; Mon, 25 Apr 2022 14:26:08 -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 B81DA1EC04A6; Mon, 25 Apr 2022 23:26:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1650921961; 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=VzCRn9yN2ByyCFR5QKv9+K8B8VcoQwcA3ZVz2Ifi7JQ=; b=fNnh8YiUMApB0I9iM+V6r0nvmh8FA7oNdMa5U7S15/LCpqbI1/jM6tKwfyZ0aDGbo5ZAAv UISb+73NpqVJqWCi+Fa1hLJKqxhd+c42n4JjVcHL1lptzDXi9IsAxaLj9BDartlz8vh+99 YmQB5O8tl20QGO/Fbc7aZfQyJMnzDYU= Date: Mon, 25 Apr 2022 23:25:57 +0200 From: Borislav Petkov To: Oleksandr Cc: Juergen Gross , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <67c7460a-3001-35a6-8e5b-f367270b257a@gmail.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 Mon, Apr 25, 2022 at 11:38:36PM +0300, Oleksandr wrote: > diff --git a/include/linux/cc_platform.h b/include/linux/cc_platform.h > index efd8205..d06bc7a 100644 > --- a/include/linux/cc_platform.h > +++ b/include/linux/cc_platform.h > @@ -72,6 +72,19 @@ enum cc_attr { >          * Examples include TDX guest & SEV. >          */ >         CC_ATTR_GUEST_UNROLL_STRING_IO, > + > +       /** > +        * @CC_ATTR_GUEST_MEM_ACCESS_RESTRICTED: Restricted memory access to > +        *                                       Guest memory is active > +        * > +        * The platform/OS is running as a guest/virtual machine and uses > +        * the restricted access to its memory. This attribute is set if > either > +        * Guest memory encryption or restricted memory access using Xen > grant > +        * mappings is active. > +        * > +        * Examples include Xen guest and SEV. Wait, whaaat? The cc_platform* stuff is for *confidential computing* guests to check different platform aspects. From quickly skimming over this, this looks like a misuse to me. Why can't you query this from the hypervisor just like you do your other querying about what is supported, etc? Hypercalls, CPUID, whatever... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette