From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AFA81CEAC9 for ; Tue, 14 Jan 2025 17:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736876021; cv=none; b=ogt9yKkx4nfUmH/EilRkajznv6kPgRNyAZFAG9L4C8egyP1enLKzPDRa3SSyww8+Mz7eBx5bD35DPHZghrWJFtE5Y15XV5iwvOWORFhWfx0qnHQaXli9Y6iAOrc8z9WT92+OtfyEFMPul+mTys1MEDyS0tCbO7K2IpdwMdFqYt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736876021; c=relaxed/simple; bh=u70UZQQ6rrjlX6HwoBxIlEBWzFfCa1RmDu5GKrBIlwU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eebqyPTTDxmkOPiXprr+BYNyGbzRoLgfww5aWTvi1DAnNEC/YyINB7i6rELHnAHLxS9rGC5Zt8QJiKQZ+wn86cc3pA0uoCxr6fKM4ji+i5vifI0gPwTE6W1UAVgObDHgUl4D04oMA+VjpxMv1mHRSk0a9z8LzYW2O/H44I5oOpw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=UrgA7cLW; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="UrgA7cLW" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-7b7041273ddso476101485a.3 for ; Tue, 14 Jan 2025 09:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1736876018; x=1737480818; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AE0+MZyBKWqlPeBgME+af5vIGaihr4hRouPkFE36rIs=; b=UrgA7cLW7vFsXaJYpsRTu0EoPSArvAR9KVt/4JQZSmUT+H8zo1wmhT78r27J0twEzW 9nfITuYYUa1Zeg+OvSmNB6Ok9ObmdozY71krxfVx64bRjc3L+NopKu+x8efap5esbC8i fCd7f93aXxAO1nwPFLw8lXgKbmlu9RNUGz8I9ABBpRJLPtiXlVZITKDVkO4JvtDLLOMg PYCuN0DP4YeHgqVwG0mjBnSIKIc/ug35trSDiV/YMq9+5C5Uucs+h0GrGsc7Vz4MEeRq dlsF5YuKZZ9wpp0ebAS/PCfundHlCYHosdOomDAmb7AUWpfnB2QpV5eQEYltTWpirEMw Y7xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736876018; x=1737480818; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AE0+MZyBKWqlPeBgME+af5vIGaihr4hRouPkFE36rIs=; b=AEhknMUm5k9cThtvMnsK6YUKOcCk+JoPHrIMycBHJkPPYomwdvMejCRD90ElamSjTg lYeO22skRSfJc7wpiwHR4ujqrt7JX+e5XE26OM+RUXigQwhXs5Dpdc+xzWhZS629pFoU I1GLL/KBcz18Gkg6aDAV4lS6wvBdczOs4wrO2HYoFwZDi5G1fcZOBA5nsgGiwcpOj/4D oHBLOFAtz4GnImvlOlhoNovToi+GwK7KcJ8Y7P5HGtgHFvw+1B3C4no7F31FM2Ln2Gtj 8GkgnUzE7hSZAxHvKkRQ4Ef0WYtEsyc2GX+MiV0gxC0mlRTVOOc6hD+ZGbjysegOPUc8 Z4sA== X-Forwarded-Encrypted: i=1; AJvYcCX85RFe1u4iKwVfli8FI7m12EfyKTpW2hieAbtqf42AMRUG5nAS4hSDHW3lLp5UdQv6SOsMq3EIsjmbYaE=@vger.kernel.org X-Gm-Message-State: AOJu0YxmM9rJ8N7E3NfDceJZmlSdAmotuh3jN6nr04Dj2+VCEAaLI6Jm 6945ZJMwhfDygCpnOLN5w4qUFj2X0I14A3ne8/IkUzlFDer/Eaw67y0xJDzvchI= X-Gm-Gg: ASbGncuOiKdJZP0rsTAU2Xv24WBdnandqNzHdTrNRXXGoGXmTO+FkSj/wCKHjjyRppy MIwxmMfQnZO2apCJ4FEfbwHK2iV84NdxSq4o+PKrQbtUg6gbukT1yRQY921HbIQWC05h3Z6RQ8N NM2VXaivPQFV3Y8UALeFFDH8VI4yx37FMhMzjZ3DJKtQiy8WzcXr8Wj1/rfpYhujMa4abeOjUS+ F41M0I2s2aWIKUVlZqcDJECfGlzbgccjKDoVeBzKl4WHFdi8RsrMJkly+ESxg3QLTgNJS1cncMt XWUnrjeywBbRDh6269UccMmEYTF3gw== X-Google-Smtp-Source: AGHT+IFRhteXjfiktcSVEFWKeer5Q7R8iGRjkKhk3nK9D37c1uhceHVW0TcXnbzSolSoDFgCOgCQYw== X-Received: by 2002:a05:620a:2b9c:b0:7b6:67a6:5adb with SMTP id af79cd13be357-7bcd973d017mr4021472985a.21.1736876018296; Tue, 14 Jan 2025 09:33:38 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-128-5.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.128.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7bce350304bsm627970085a.71.2025.01.14.09.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 09:33:37 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1tXknI-00000002OrX-426c; Tue, 14 Jan 2025 13:33:36 -0400 Date: Tue, 14 Jan 2025 13:33:36 -0400 From: Jason Gunthorpe To: Stefano Garzarella Cc: Tom Lendacky , Jarkko Sakkinen , James Bottomley , linux-coco@lists.linux.dev, Borislav Petkov , Dave Hansen , Peter Huewe , "H. Peter Anvin" , linux-integrity@vger.kernel.org, x86@kernel.org, Joerg Roedel , Jarkko Sakkinen , linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Claudio Carvalho , Dov Murik Subject: Re: [PATCH 3/3] x86/sev: add a SVSM vTPM platform device Message-ID: <20250114173336.GL26854@ziepe.ca> References: <50a2e1d29b065498146f459035e447851a518d1a.camel@HansenPartnership.com> <20241210150413.GI1888283@ziepe.ca> <20241211150048.GJ1888283@ziepe.ca> <6rwo7tkdst227kb4pwvr54w4mfz2zw3offux7mqfupi3rgwkaz@65yklvvqw6n4> <20250114130720.GJ26854@ziepe.ca> <2yyqhjkxl56uqv35smrq6mdddufcpoj7fgon4n6h6zwei4kryu@pkwhln6b57ga> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2yyqhjkxl56uqv35smrq6mdddufcpoj7fgon4n6h6zwei4kryu@pkwhln6b57ga> On Tue, Jan 14, 2025 at 05:51:33PM +0100, Stefano Garzarella wrote: > Otherwise we need an intermediate module in drivers/char/tpm. Here we > have 2 options: > 1. continue as James did by creating a platform_device. > 2. or we could avoid this by just exposing a registration API invoked by > sev to specify the send_recv() callback to use. I mean something like > renaming tpm_platform_probe() in tpm_platform_register(), and call it in > snp_init_platform_device(). You should not layer things on top of things. If you have a clearly defined driver write it in the natural logical way and export the symbols you need. Either export TPM stuff to arch code, or export arch code to TPM. Don't make crazy boutique shims to avoid simple exports. > > Meaning that you'd export some of your arch stuff for the tpm driver > > to live in its natural home > > @Tom do you think we can eventually expose sev API like > svsm_perform_call_protocol(), svsm_get_caa(), etc.? We have lots of ways to make restricted exports now, you can use them and export those symbols. There shouldn't be resistance to this. Jason