From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9bDB-00ARiB-Rv for kexec@lists.infradead.org; Fri, 30 Jul 2021 22:42:39 +0000 Received: by mail-pj1-x1033.google.com with SMTP id ca5so17237218pjb.5 for ; Fri, 30 Jul 2021 15:42:35 -0700 (PDT) Date: Fri, 30 Jul 2021 22:42:30 +0000 From: Sean Christopherson Subject: Re: [PATCH 11/12] x86/sev: Handle CLFLUSH MMIO events Message-ID: References: <20210721142015.1401-1-joro@8bytes.org> <20210721142015.1401-12-joro@8bytes.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210721142015.1401-12-joro@8bytes.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Joerg Roedel Cc: x86@kernel.org, Eric Biederman , kexec@lists.infradead.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Martin Radev , Arvind Sankar , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org On Wed, Jul 21, 2021, Joerg Roedel wrote: > From: Joerg Roedel > > Handle CLFLUSH instruction to MMIO memory in the #VC handler. The ^ |- emulated > instruction is ignored by the handler, as the Hypervisor is > responsible for cache management of emulated MMIO memory. > > Signed-off-by: Joerg Roedel > --- > arch/x86/kernel/sev-shared.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c > index a7a0793c4f98..682fa202444f 100644 > --- a/arch/x86/kernel/sev-shared.c > +++ b/arch/x86/kernel/sev-shared.c > @@ -632,6 +632,15 @@ static enum es_result vc_handle_mmio_twobyte_ops(struct ghcb *ghcb, > long *reg_data; > > switch (insn->opcode.bytes[1]) { > + /* CLFLUSH */ > + case 0xae: > + /* > + * Ignore CLFLUSHes - those go to emulated MMIO anyway and the > + * hypervisor is responsible for cache management. This wording can be misread as "the hypervisor is responsible for _all_ cache management". Maybe just: /* * Ignore CLFLUSHes - the hyperivsor is responsible for cache * management of emulated MMIO. */ Side topic, out of curisoity, what's mapping/accessing emulated MMIO as non-UC? > + */ > + ret = ES_OK; > + break; > + > /* MMIO Read w/ zero-extension */ > case 0xb6: > bytes = 1; > -- > 2.31.1 > _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec