Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp854830pxk; Wed, 9 Sep 2020 23:33:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD/rQIWNDCIsTjy9Gm/M1hXfFAVy8bHWjAIQCfQDxhLoY9zBEZWfJQv5EbrX8G+3NtIwXt X-Received: by 2002:a17:906:1f43:: with SMTP id d3mr6796861ejk.295.1599719636471; Wed, 09 Sep 2020 23:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599719636; cv=none; d=google.com; s=arc-20160816; b=1AMj05apTG/Tyz16dBMec/d96I/YbiXKcf9UkOvUhoX3y3AatbWDKKKF6+6gwNZstG hwm2LBecwCRwjRk1Qgnw/joLEm08LGAHdgFHNOngoOIPLblhp4xIE/lQ9l0Z1ym+Ufdw +WiVaIPIfFvkGvsHOWTD6c0PUci5Y0GpG+TZVcSNxQsBINbHc5NjqReEuClLopuSy3de PBj6i9T6A4ybU7B8DJqQK0xETnUD4KEp2NFgEVQUYjCTEQqshTvbbV8w/0VJf4jORPJM qY719Y4pr5xijjNTbkN7neAaY00cOqxFjWgkATFT2IVtXoYEGtoV/JU0fbDKBJuV82ZI nhPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=dv7GWftNx2nhY02/J93HOwF97EV9QjZZAjL+30D0FKI=; b=Y/iYN6vCLtk8P2ewUe+c8fIBrPCrT/aQJJ/uq3KSUSvM/x1mcrCR2q6lU26gc/Wix+ FBCOuf6RvClp0BA2JtOTbowhSvDuZy7tKWkEs6S6idcyNLN71DvEIG5iA5ijGGAvap+v XNUVdfR/UCmOtGnTt+QFaXZkq+zVqBp23WqrmHHKz1jTZWOKfLYRfUtlSiyNbY370ClU qxrmKeQdpAOSpFbrQQwTzORCGDNtKjTlO/CaLn2nzgnRkZzXJHluJ6qe1ZHrP49NDtgO 5cSFIQmg9dYNBx4mHmfmRTUVM8cKYRuTxBvxJin5BnEgQWOq5lzRjhplXploK7974Rf1 NY7w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si2938425ejy.112.2020.09.09.23.33.31; Wed, 09 Sep 2020 23:33:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727087AbgIJGak (ORCPT + 99 others); Thu, 10 Sep 2020 02:30:40 -0400 Received: from mga18.intel.com ([134.134.136.126]:17717 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbgIJGaj (ORCPT ); Thu, 10 Sep 2020 02:30:39 -0400 IronPort-SDR: 2IfyOgCIjaY2IxGhSlaisomYhAGWDbZjscqYNcrVr6BaAZjLR0s9+h0i36P6pe9EMB91TbCkrn uRi+n/NvvppQ== X-IronPort-AV: E=McAfee;i="6000,8403,9739"; a="146197074" X-IronPort-AV: E=Sophos;i="5.76,412,1592895600"; d="scan'208";a="146197074" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 23:30:38 -0700 IronPort-SDR: 2SHvKZI52W59UxXnsyvreedC99fKtuEdJuAxlKNpWlJrk1m+lUcI8uM0z7CuYb3m9q1Nk6u5j/ IlxShIQtMKTg== X-IronPort-AV: E=Sophos;i="5.76,412,1592895600"; d="scan'208";a="480766765" Received: from shuo-intel.sh.intel.com (HELO localhost) ([10.239.154.30]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 23:30:34 -0700 Date: Thu, 10 Sep 2020 14:30:32 +0800 From: Shuo A Liu To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Sean Christopherson , Yu Wang , Reinette Chatre , Yakui Zhao , Zhi Wang , Dave Hansen , Dan Williams , Fengwei Yin , Zhenyu Wang Subject: Re: [PATCH v3 02/17] x86/acrn: Introduce acrn_{setup, remove}_intr_handler() Message-ID: <20200910063032.GJ13723@shuo-intel.sh.intel.com> References: <20200909090836.46762-1-shuo.a.liu@intel.com> <20200909090836.46762-3-shuo.a.liu@intel.com> <20200909093609.GA607744@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200909093609.GA607744@kroah.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On Wed 9.Sep'20 at 11:36:09 +0200, Greg Kroah-Hartman wrote: >On Wed, Sep 09, 2020 at 05:08:21PM +0800, shuo.a.liu@intel.com wrote: >> From: Shuo Liu >> >> The ACRN Hypervisor builds an I/O request when a trapped I/O access >> happens in User VM. Then, ACRN Hypervisor issues an upcall by sending >> a notification interrupt to the Service VM. HSM in the Service VM needs >> to hook the notification interrupt to handle I/O requests. >> >> Notification interrupts from ACRN Hypervisor are already supported and >> a, currently uninitialized, callback called. >> >> Export two APIs for HSM to setup/remove its callback. >> >> Originally-by: Yakui Zhao >> Signed-off-by: Shuo Liu >> Reviewed-by: Zhi Wang >> Reviewed-by: Reinette Chatre >> Cc: Dave Hansen >> Cc: Sean Christopherson >> Cc: Dan Williams >> Cc: Fengwei Yin >> Cc: Zhi Wang >> Cc: Zhenyu Wang >> Cc: Yu Wang >> Cc: Reinette Chatre >> Cc: Greg Kroah-Hartman >> --- >> arch/x86/include/asm/acrn.h | 8 ++++++++ >> arch/x86/kernel/cpu/acrn.c | 19 +++++++++++++++++++ >> 2 files changed, 27 insertions(+) >> create mode 100644 arch/x86/include/asm/acrn.h >> >> diff --git a/arch/x86/include/asm/acrn.h b/arch/x86/include/asm/acrn.h >> new file mode 100644 >> index 000000000000..ff259b69cde7 >> --- /dev/null >> +++ b/arch/x86/include/asm/acrn.h >> @@ -0,0 +1,8 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +#ifndef _ASM_X86_ACRN_H >> +#define _ASM_X86_ACRN_H >> + >> +void acrn_setup_intr_handler(void (*handler)(void)); >> +void acrn_remove_intr_handler(void); >> + >> +#endif /* _ASM_X86_ACRN_H */ >> diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c >> index 0b2c03943ac6..bd1d7e759a0f 100644 >> --- a/arch/x86/kernel/cpu/acrn.c >> +++ b/arch/x86/kernel/cpu/acrn.c >> @@ -9,7 +9,11 @@ >> * >> */ >> >> +#define pr_fmt(fmt) "acrn: " fmt >> + >> #include >> + >> +#include >> #include >> #include >> #include >> @@ -55,6 +59,21 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_acrn_hv_callback) >> set_irq_regs(old_regs); >> } >> >> +void acrn_setup_intr_handler(void (*handler)(void)) >> +{ >> + if (acrn_intr_handler) >> + pr_warn("Overwrite the acrn_intr_handler.\n"); > >What can someone do with this warning? If it's really an "error", why >not prevent this from happening? It cannot happen if there are not new user of it. The current user is HSM hsm_init()/hsm_exit() in the later patches of this series. I can remove the warn. > >Don't scare users with things they can do nothing about. OK. Got it. Thanks. Thanks shuo