Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp184048pxk; Wed, 9 Sep 2020 02:37:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2Akr/ssKdhrGjYSoabA6Kf2J5dBF2R+eR7BKeImL5sC0+lIr1nMft7J5EpS41adEP1E3W X-Received: by 2002:a17:906:3ad0:: with SMTP id z16mr2867197ejd.193.1599644247728; Wed, 09 Sep 2020 02:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599644247; cv=none; d=google.com; s=arc-20160816; b=ay76K3UMerk7fR4h3RU4hNw9FjT2NT/JIJKh3TAVyrKoJxuqlRwu8wgJWJdF7laj/Y /zp0elZSB9P/R7WHO6XLOuGJ/SNjswHy6qkJxr3+tA6Dg5LCLDmmZSta7SbsX8Im1D33 5HhOxQWwcUvnSpVOlTplWcs0eJbVdhxLtN4rY7pgOJ3/4L+hJ3hUoEJPECxfJc1SdlNF bXdPCfYYuIHNORo7+I6hPC7tzodAq+GMNko/QEi8XvJM53pO+V40bwwPQezoiTVXdZKl ST5PQmFO8lx9QX6smIk63nCeSxAftxirF50+/99de0exEkoJrpw0db3ZLWfvhEl6E7JR gEpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=SpjO+h0SlY2KImQOM/wSRix1pMyh7urcbWGxZklDu/k=; b=s0rZVkofCIQBP4P2GpPhp7yIB00nT+jykN2yXzzsGgCafJcQvlT4CS9PZR+Be4D0Bj 2w8ITfsyvuGP6CX+jKoHXXaPdgajIKa5VgjLUpnTeAFCBQKrrxnQI+asDClBlf4Hc2Kb oZnPcm1c0bSMZ76QOxNbGmkwiMZjGM869QbpYyn37Mg0fHF9sW0+u/1hdgbXZUXQ76Nc rcXeeP/NoDxDFTlzDSK06zg9PN15bTDVuWVbpUovJWpiEbLmazc+fvL1CeprwBz3DLvI ISkdXiIZl2/mwgPQSyFS+SRGMBhGAmaxCpUCsYo1kPhqmrkcUhjNxW8II/YwH7QeA0CV lgqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FN3smRmo; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu3si1033757ejb.617.2020.09.09.02.37.05; Wed, 09 Sep 2020 02:37:27 -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=@kernel.org header.s=default header.b=FN3smRmo; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730174AbgIIJgG (ORCPT + 99 others); Wed, 9 Sep 2020 05:36:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730136AbgIIJgA (ORCPT ); Wed, 9 Sep 2020 05:36:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7EAD62087C; Wed, 9 Sep 2020 09:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599644159; bh=WhCbCOYAgVBM6ESgc/BWT45n0KWObYl8AhVF0LbOeRU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FN3smRmor9Z1cEEK3TX/DIf7Jl/x7cExqmZOic2iQnUbIrI0hsCU00CqsGBJWuRmZ 3XwgvBHoMCJf7aHNRVQ4/NwXAulPMLL1aeXx1WgLiTejGOVc3dBTVjuydHlnB9FeFU otjBmtLoOVgU+vP5aLGuqGj53acpQwMDaUfEq/NU= Date: Wed, 9 Sep 2020 11:36:09 +0200 From: Greg Kroah-Hartman To: shuo.a.liu@intel.com 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: <20200909093609.GA607744@kroah.com> References: <20200909090836.46762-1-shuo.a.liu@intel.com> <20200909090836.46762-3-shuo.a.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200909090836.46762-3-shuo.a.liu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Don't scare users with things they can do nothing about. thanks, greg k-h