From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 025E1C433EF for ; Tue, 5 Oct 2021 23:22:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D86C661211 for ; Tue, 5 Oct 2021 23:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236931AbhJEXYH (ORCPT ); Tue, 5 Oct 2021 19:24:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25185 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236855AbhJEXYG (ORCPT ); Tue, 5 Oct 2021 19:24:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633476135; 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=qoig9YLaROF70cWSZJHtV07yNnPKNFQwM+8CJKZDvBc=; b=JifMz1Qa0XklK/eKSOmP+bEc22fLF6n+JROC+4hEX3DJ/1hAQ/d4g+lHy/vfcexXed9gYj uA2INXXVe2Yeiw9qMxSRtERGgUAWpXWT0ZrMsYvsdxw/NEGaKeTSSP7jgEW5wlS65MlqrT h91uU0zl3vbdbSBHwTH0cNLuBNRlB6Q= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-KuX-0oTvP-WAQN1kttQ7dg-1; Tue, 05 Oct 2021 19:22:14 -0400 X-MC-Unique: KuX-0oTvP-WAQN1kttQ7dg-1 Received: by mail-qt1-f198.google.com with SMTP id o7-20020ac86d07000000b002a69537d614so605044qtt.21 for ; Tue, 05 Oct 2021 16:22:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=qoig9YLaROF70cWSZJHtV07yNnPKNFQwM+8CJKZDvBc=; b=IRF/cTub8v/mmYV+QrQN92YXJ2CIZi3ZEKeHmcK2+hYsMwBwMdXNz8lL7VUgxSsOu/ rDXLleWDhSdT24fUkcosII2n6+D1fBdq+n2A1irlFAsoSFbB7ICTynX1utCnMg4Ks2Kh 1yP7r+ymOLt/aqDsUvceyHBNJ4QwH393zjECAYERM8aacTsH1zHhUCkNc9KeCfzgUjUD xdQAkWnzQprRrDJeMUUFtxtz2TzNfM+vgAP/6HbnLoV1Ut9Jc2rXo4A8z+cqJ4dCg5zq rmLFm2xF9TnuNWI4YMXWvC8PiqpqLlDebSUVmX1/T4IJUtP6oHfEEK9CQBxdXA8gJ6uX MVQQ== X-Gm-Message-State: AOAM532US1GidEW6XIHxtwqf2505G+8YO9+PprIq8REzcyKs/1FYJdIP 7/wCqLOoIauhM7LE4gi6PXp99E5bRvPSqqx8NineBQrBC7sATXl02CVY7AVh4yojHsbNIm1UhSW eVG5QEI9MpNm97Nd3f+pZ0nK3 X-Received: by 2002:ac8:5905:: with SMTP id 5mr22906069qty.391.1633476133608; Tue, 05 Oct 2021 16:22:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfQ1xUNVnffIP0WLTcPBMp+wNs/p/fBsBlIq9JrbtKSVzJX1xXGa+vwn0y+lr1jAJnDdUo4A== X-Received: by 2002:ac8:5905:: with SMTP id 5mr22906033qty.391.1633476133396; Tue, 05 Oct 2021 16:22:13 -0700 (PDT) Received: from treble ([2600:1700:6e32:6c00::15]) by smtp.gmail.com with ESMTPSA id d129sm10413270qkf.136.2021.10.05.16.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 16:22:12 -0700 (PDT) Date: Tue, 5 Oct 2021 16:22:09 -0700 From: Josh Poimboeuf To: Kuppuswamy Sathyanarayanan Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 09/11] x86/tdx: Add MSR support for TDX guest Message-ID: <20211005232209.ozugpocq2cvx22li@treble> References: <20211005025205.1784480-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005025205.1784480-10-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211005025205.1784480-10-sathyanarayanan.kuppuswamy@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04, 2021 at 07:52:03PM -0700, Kuppuswamy Sathyanarayanan wrote: > From: "Kirill A. Shutemov" > > Use hypercall to emulate MSR read/write for TDX platform. > > TDVMCALL[Instruction.RDMSR] and TDVMCALL[Instruction.WRMSR] provide MSR > oprations. > > RDMSR and WRMSR specification details can be found in > Guest-Host-Communication Interface (GHCI) for Intel Trust Domain > Extensions (Intel TDX) specification, sec titled "TDG.VP. > VMCALL" and "TDG.VP.VMCALL". > > Signed-off-by: Kirill A. Shutemov > Reviewed-by: Andi Kleen > Reviewed-by: Tony Luck > Signed-off-by: Kuppuswamy Sathyanarayanan > --- > > Changes since v7: > * Removed tdx_is_context_switched_msr() support (since the list > is incomplete). This fails to build: arch/x86/kernel/tdx.c: In function ‘tdx_write_msr_safe’: arch/x86/kernel/tdx.c:135:22: error: implicit declaration of function ‘tdx_is_context_switched_msr’ [-Werror=implicit-function-declaration] 135 | WARN_ON_ONCE(tdx_is_context_switched_msr(msr)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/asm-generic/bug.h:104:32: note: in definition of macro ‘WARN_ON_ONCE’ 104 | int __ret_warn_on = !!(condition); \ | ^~~~~~~~~ -- Josh