Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5174698pxj; Wed, 9 Jun 2021 10:51:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRBlUtbKnxUhSvVd07F817s0KKZ86DcqL/Z4ZhAIjlcLkwULzD7dWrmdSzrb8882ymmyuF X-Received: by 2002:a50:fd81:: with SMTP id o1mr597281edt.382.1623261073212; Wed, 09 Jun 2021 10:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623261073; cv=none; d=google.com; s=arc-20160816; b=CydIA7wh0ldRQ1ji3B+XH186T5VSFBhP2VJm5myUM9bpftSxOIQtieb3ogbgt+eI6m to28irxEosr0oh+kiftZIu2HXMHdGnfN0Ez9VDG8DkTDW05s3uRAU1F/WgyI0XAtItVD P0Dj3eYyNgkyZ3nglcmsLGSW2XbbouFf7zzCJGRTJbvJBjbD91IOsASEjjdNE20PUeZR V2vN6e3pSqXrzojTUWjpvWQ1gIsXBb3Z2+qy1km5U68lbzyRc+kGEIVF39ubZNUKUj8i Y9RXSxhsE7J70sfX5Pk8WoKlHctFTvVHdDDYS/HZQGmN2oe86/Kli/L3kAQPw8fnetNY mOZg== 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=oTvJUNqNPXJgrATOUO5AJ0EllSZ5xLN85/3fQaACIhM=; b=P6JvIpzPeSr3zkRgWm+7WShWphkJ11hW88e2xHwSQArW+YFt1hvIqviqeOuASuf9+E nHpF4SAeCzZQ/I3LIvHgXWzeEux6JPvve7XbDybpQ3QNJVaADljgvMkx+Q5lKOgRog/E jVMaKC15XzI7bCrTbKkQEOIBYKXbxFiFqX9VfyymICJOfILcXLwsJbU+0P5A3uc0gfcq KfuaoNQ5OJt7PCdYZo39gv35vy3imqm52godLwN+hqPkuuSg60PPR87l7d+3Ich8wkDS 0s+a7KMsW3nWs8o3Zn7lu0Gq6BvhD9no27P5fASoq4AIxtcrv8CDqsLT1f+zNAkncEcV NaZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ckclrrh8; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp35si388629ejc.731.2021.06.09.10.50.48; Wed, 09 Jun 2021 10:51:13 -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=@alien8.de header.s=dkim header.b=ckclrrh8; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237061AbhFIOev (ORCPT + 99 others); Wed, 9 Jun 2021 10:34:51 -0400 Received: from mail.skyhub.de ([5.9.137.197]:41828 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234734AbhFIOes (ORCPT ); Wed, 9 Jun 2021 10:34:48 -0400 Received: from zn.tnic (p200300ec2f0cf6002c8ea3a9506b9c3f.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:f600:2c8e:a3a9:506b:9c3f]) (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 8EC981EC0516; Wed, 9 Jun 2021 16:32:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1623249172; 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=oTvJUNqNPXJgrATOUO5AJ0EllSZ5xLN85/3fQaACIhM=; b=ckclrrh8R2rjSCsIJOO3Gmdo5IV8CSqDWXGxCyOiLEGdOp8yE4bUSK2hliXNS5hrCdi1Xy KAjGylpJid/k5gR66MMg90X8SOLKxELW44ANk8UQEiE0CpB7nVsCJ1hs+p36f/1TnNO2Bq gPxBZguTtaQXHrH610B7eRQWEh+oDW4= Date: Wed, 9 Jun 2021 16:32:46 +0200 From: Borislav Petkov To: "Kuppuswamy, Sathyanarayanan" Cc: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Dan Williams , Raj Ashok , Sean Christopherson , linux-kernel@vger.kernel.org, Tom Lendacky Subject: Re: [RFC v2-fix-v2 1/1] x86: Introduce generic protected guest abstraction Message-ID: References: <20210527042356.3983284-2-sathyanarayanan.kuppuswamy@linux.intel.com> <20210601211417.2177598-1-sathyanarayanan.kuppuswamy@linux.intel.com> <82f9e5a9-682a-70be-e5ea-938bb742265f@linux.intel.com> <9466ae0b-3a2a-5a43-a4c6-39e07ebe0fbc@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9466ae0b-3a2a-5a43-a4c6-39e07ebe0fbc@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 07:01:13AM -0700, Kuppuswamy, Sathyanarayanan wrote: > I am still not clear. What happens when a driver which includes > linux/protected-guest.h is compiled for non-x86 arch (s390 or arm64)? I was wondering what felt weird: why is prot{ected,}_guest_has() in a generic linux/ namespace header and not in an asm/ one? I think the proper way is for the other arches should be to provide their own prot_guest_has() implementation which generic code uses and the generic header would contain only the PR_GUEST_* defines. Take ioremap() as an example: arch/x86/include/asm/io.h arch/arm64/include/asm/io.h arch/s390/include/asm/io.h ... and pretty much every arch has that arch-specific io.h header which defines ioremap() and generic code includes include/linux/io.h which includes the respective asm/io.h header so that users can call the respective ioremap() implementation. prot_guest_has() sounds just the same to me. Better? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette