[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V1 3/6] xen/virtio: Add option to restrict memory access under Xen
 
- To: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Oleksandr <olekstysh@xxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>
 
- From: Juergen Gross <jgross@xxxxxxxx>
 
- Date: Mon, 25 Apr 2022 09:53:23 +0200
 
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>
 
- Delivery-date: Mon, 25 Apr 2022 07:53:29 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On 24.04.22 20:08, Boris Ostrovsky wrote:
 
On 4/24/22 12:53 PM, Oleksandr wrote:
 
On 23.04.22 19:40, Christoph Hellwig wrote:
 
 
+
+#ifdef CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS
+int arch_has_restricted_virtio_memory_access(void)
+{
+    return (xen_has_restricted_virtio_memory_access() ||
+            cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT));
+}
 
So instead of hardcoding Xen here, this seems like a candidate for
another cc_platform_has flag.
 
 
I have a limited knowledge of x86 and Xen on x86.
 Would the Xen specific bits fit into Confidential Computing Platform checks? I 
will let Juergen/Boris comment on this.
 
 
This is unrelated to confidential so I don't think we can add another CC_ flag.
Would arch/x86/kernel/cpu/hypervisor.c be a better home for this?
 
 
Or a callback in struct struct x86_hyper_runtime maybe?
Juergen
 Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc 
Description: OpenPGP public key 
Attachment:
OpenPGP_signature 
Description: OpenPGP digital signature 
 
    
     |