Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp5046348pxb; Tue, 5 Oct 2021 16:26:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGTslJh5OgSbUstRIntkD3bpEIA/zgSVTsyOZ0fussBQrRWN2jA7UcPUgnlNYLOxLhgFgJ X-Received: by 2002:a50:d84c:: with SMTP id v12mr29041612edj.203.1633476396913; Tue, 05 Oct 2021 16:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633476396; cv=none; d=google.com; s=arc-20160816; b=C/yI2Dyvwif5Zn/vHM/zWPpKxLnf2/YTAbRaHcWAkH6TbseT5s0BKZcltvSlcri83H 0Qe9HbL43oLM/XLmhZW0frEvI3TBLetNvobaFs3taOQ7AUuYIBfJ4MlKHW60jeX6o2kN lboBb2V3Xh4n8MTAz7de0vsV10BoB2yD434tNzCmUUk5dOHPrWUwHMp+OTsTEWkwxoXF D5wNnEH1PPKg+O2uEK7UYJNClIBSP2e8OIR9+ayG0KIN9Jep6yjvjoO7On33hypfzvuZ qa9AvvSHFJ03fuZlwgnEm337kY4X4aO2VVuggBs6PENpOs6xUvR2iKXCD2wevTLLITP3 oD4Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qoig9YLaROF70cWSZJHtV07yNnPKNFQwM+8CJKZDvBc=; b=i24emFDLIQaQtyvACHaBbprBOfgpnzOlei/rVfvGZGmPsG2MUueO2UDXy40/rJsmsE I6l5coMbvXoPAsT+Csmakowv6aAVqntsiAYgcLBozvHtIzH52mIrIP7j0EPEUzP3sqAU k5wCUjidBLFusap2pFZZ+mc6D2/BR6FGDEmK9a0REOrCoX+U7sZJ7QDOPWvSQ3FrmUtY Nvm++8dTenRALrQXyjpi7VnJKqdK7Q1417yiyORryzH9n94KD6DmmTJS34ZKBX+eTPiK 4bhRZOWS6b4LU49o0lN2xwR/u5tKb/yLJ1n4TFSQgU6dtOpnPiLxJ5C4Q5WF11JWxqHp Qlbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JifMz1Qa; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si21680312eju.764.2021.10.05.16.26.12; Tue, 05 Oct 2021 16:26:36 -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=@redhat.com header.s=mimecast20190719 header.b=JifMz1Qa; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236923AbhJEXYH (ORCPT + 99 others); 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-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