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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88E57C433F5 for ; Thu, 28 Apr 2022 17:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350660AbiD1SAt (ORCPT ); Thu, 28 Apr 2022 14:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345831AbiD1SAr (ORCPT ); Thu, 28 Apr 2022 14:00:47 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD44E546B2 for ; Thu, 28 Apr 2022 10:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651168652; x=1682704652; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=UANH5L4pvwVt63Zr5jntGtwe30JNjvf8yv0PHx1/Iy0=; b=nhy4Tg5LvCfXpkRo0j0whUhWPuYZ/OlfKCKfJnotG+7JFilE4RicJNhZ cSWsyaRWVlH3S7Gu4XwNEeIPBfj3E0t9VOj91vuIqysqaN3AwdVBnmNa1 NznKln6Me7lhM0Kt02t4AQonqW5CqFBVuoKhYRW9gKvDOOKDBftGg2SBA MXwUXlHwv/T8frCBxwQqAnwqBtmNnezvSXRoXYwQRXXr8okiXCzpkD5Cm b6GbqIsWDQNsyFJxXUp1tjgHbR9IoAfXbrZ41kd6K6YmQLcr94eHAQ0Fj wg9EiWpi0y1SEHOQQENgsSeB3LNP5nIqxnIbtdrgvYpF1iz81HTpQj4po A==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="326863649" X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="326863649" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 10:57:32 -0700 X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="661910702" Received: from rbopardi-mobl.amr.corp.intel.com (HELO [10.251.19.231]) ([10.251.19.231]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 10:57:30 -0700 Message-ID: <9f644128-da30-a85d-1a4e-ea7ff06aec67@linux.intel.com> Date: Thu, 28 Apr 2022 10:57:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.7.0 Subject: Re: [PATCH v4 2/3] x86/tdx: Add TDX Guest event notify interrupt support Content-Language: en-US To: Wander Lairson Costa Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , "Kirill A . Shutemov" , Tony Luck , Andi Kleen , Kai Huang , linux-kernel@vger.kernel.org References: <20220422233418.1203092-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220422233418.1203092-3-sathyanarayanan.kuppuswamy@linux.intel.com> From: Sathyanarayanan Kuppuswamy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/28/22 10:50 AM, Wander Lairson Costa wrote: > On Fri, Apr 22, 2022 at 04:34:17PM -0700, Kuppuswamy Sathyanarayanan wrote: > > [snip] > >> >> +/* >> + * tdx_hcall_set_notify_intr() - Setup Event Notify Interrupt Vector. >> + * >> + * @vector : Vector address to be used for notification. >> + * >> + * return 0 on success or failure error number. >> + */ >> +static long tdx_hcall_set_notify_intr(u8 vector) >> +{ >> + u64 ret; >> + >> + /* Minimum vector value allowed is 32 */ >> + if (vector < 32) >> + return -EINVAL; >> + >> + /* >> + * Register callback vector address with VMM. More details >> + * about the ABI can be found in TDX Guest-Host-Communication >> + * Interface (GHCI), sec titled >> + * "TDG.VP.VMCALL". >> + */ >> + ret = _tdx_hypercall(TDVMCALL_SETUP_NOTIFY_INTR, vector, 0, 0, 0); >> + >> + if (ret) >> + return ret; >> + >> + return 0; > > Just "return _tdx_hypercall(TDVMCALL_SETUP_NOTIFY_INTR, vector, 0, 0, 0);" does the job, doesn't it? > And we can remove the declaration of ret. Makes sense. I will remove it. > > [snip] > >> >> +#ifdef CONFIG_INTEL_TDX_GUEST > > Just for consistency, can we change to "#if IS_ENABLED(CONFIG_INTEL_TDX_GUEST)"? Ok. I will change it in next version. > >> +DECLARE_IDTENTRY_SYSVEC(TDX_GUEST_EVENT_NOTIFY_VECTOR, sysvec_tdx_event_notify); >> +#endif >> + > > [snip] > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer