Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3373343pxb; Mon, 17 Jan 2022 18:56:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIg+CSpOEIUI+guEAxQyOEJi+FNBONYcW5ylVuVoDm3JD8o3lFFHfzvuVRlvSaQqw/38OZ X-Received: by 2002:a63:7d43:: with SMTP id m3mr18850166pgn.301.1642474604370; Mon, 17 Jan 2022 18:56:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642474604; cv=none; d=google.com; s=arc-20160816; b=l4SPejy17334jqlcTet5cBz+JNDUzX7c76cUOLNoW9neBFSJsuV5IbjJOWEOwKSjsx zS6DkN3OGgdAQkBIyYktWUESYAzhZxLQ1nfUIuJL98rCRHNM2khMjBFEA9EBLyHGNBVO FmBJ28HJYUiW8nx2nwB0GpPj6DLHWaz5ynAmW9oBl+Eapb62NAtq/wroZpeMz71J9g+p LV1uFDLStz0fSkYZKA/DXLPSq8ILulWveJT78pzacnPkwQD/eF/VO+OoKyJf7r4xnfUf neXJnBv/bplu/AR5QMLbeH5smO9yXQwrQmNbAJeB38msvqBbBp+9e+YWF0df1tJBpp9V pxKA== 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=tMYLEKtwmKZnMDQqe7i5oMHWWonGj1KvrD1gDeyu4sQ=; b=NPbhjCnCrsCRuCw+qHILTQQje2Au3+O5xkoWjadwQnuLEOh4Mz/NqD7MLFt10hOA1n igVVGVuYbcynq13qS0BS69Fdq9CCkBZHJDvoXg+FOLRmXWL6Iv0Og+y/CoHyFcEY61YW hcGywP1i7vFzuzJOyk8Lv9YNmU2yMTX4KLSDqDZf/ceJ+6I2tu1ZSMlnfgVR9IR3F4d2 GQvTqRcGQXRRsa0usnQ2nz2cl5qPXy9PxNKirLqoix5DBZx36r1cchtKR7KUuKDgnbwA vX5PxlkStoxdD6fontctOoBT2BUYpU+i+gf41WxP0hIcZr2v9wbgAqi9wjm7IjxCS7A1 SNzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=DD48inKH; 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 c33si15384585pgc.243.2022.01.17.18.56.31; Mon, 17 Jan 2022 18:56:44 -0800 (PST) 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=DD48inKH; 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 S238370AbiAQScy (ORCPT + 99 others); Mon, 17 Jan 2022 13:32:54 -0500 Received: from mail.skyhub.de ([5.9.137.197]:46840 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236207AbiAQScx (ORCPT ); Mon, 17 Jan 2022 13:32:53 -0500 Received: from zn.tnic (dslb-088-067-202-008.088.067.pools.vodafone-ip.de [88.67.202.8]) (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 9D6B11EC0531; Mon, 17 Jan 2022 19:32:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1642444368; 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=tMYLEKtwmKZnMDQqe7i5oMHWWonGj1KvrD1gDeyu4sQ=; b=DD48inKHSf6nNdN24Lltg/F/tclIN08m5nZO3lL4pVJWodmJrKBqdWSw6Ec/RnW5EhOkax jYMyYxxv03sWTWvT5knpRylIUrwLaz9cTCtF8B7E6HopMStP5E1aTXIMiPzhg6d0tbpq50 Nr0oLbTkjaxMRU+V0KxX+A+ujD0cSpA= Date: Mon, 17 Jan 2022 19:32:51 +0100 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , tglx@linutronix.de, mingo@redhat.com, dave.hansen@intel.com, luto@kernel.org, peterz@infradead.org, sathyanarayanan.kuppuswamy@linux.intel.com, aarcange@redhat.com, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, jgross@suse.com, jmattson@google.com, joro@8bytes.org, jpoimboe@redhat.com, knsathya@kernel.org, pbonzini@redhat.com, sdeep@vmware.com, seanjc@google.com, tony.luck@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/26] x86/tdx: Support TDX guest port I/O at decompression time Message-ID: References: <20211214150304.62613-1-kirill.shutemov@linux.intel.com> <20211214150304.62613-11-kirill.shutemov@linux.intel.com> <20220115010155.ss2hnyotw4a3nljf@black.fi.intel.com> <20220117143920.3umnnlx7dl27cm5z@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220117143920.3umnnlx7dl27cm5z@box.shutemov.name> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 05:39:20PM +0300, Kirill A. Shutemov wrote: > arch/x86/boot and arch/x86/boot/compressed are separate linking domains. > boot/ uses own implementation while boot/compressed uses implementation > from . Decopliing boot/compressed from requires hack. > See #define _ACPI_IO_H_ below. I am painfully aware. And the need to share code with kernel proper has grown quite the nasties in the meantime. So, we talked about what to do here recently and the suggestion was to librarize common functionality so that 1. it can be shared between the two. 2. changes in the kernel proper headers do not break the boot stubs. So, instead of yet another duplication, I think what we should do is start growing a shared/ header namespace, i.e., arch/x86/include/asm/shared/ for example, and put there common, well, shared, functionality between boot stubs and kernel proper. Stuff which is basic and generic enough so that it can be shared by both. That would be a prepatch. Then, ontop, I'm wondering if it would be cleaner to have in/out function pointers in the boot stub which are assigned by default to those __in/__out generic shared handlers and then early_tdx_detect() would assign to them tdx_io_{in,out} when it detects it is running as a TDX guest. Hmmm...? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette