|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 05/14] x86/svm: move nestedsvm declarations used only by svm code to private header
On 2/24/23 22:12, Andrew Cooper wrote: On 24/02/2023 6:50 pm, Xenia Ragiadakou wrote:diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h new file mode 100644 index 0000000000..43245e13de --- /dev/null +++ b/xen/arch/x86/hvm/svm/nestedhvm.h @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * nestedsvm.h: Nested Virtualization + * + * Copyright (c) 2011, Advanced Micro Devices, Inc + */ + +#ifndef __X86_HVM_SVM_NESTEDHVM_PRIV_H__ +#define __X86_HVM_SVM_NESTEDHVM_PRIV_H__ + +#include <xen/mm.h> +#include <xen/types.h> + +#include <asm/hvm/vcpu.h> +#include <asm/hvm/hvm.h> +#include <asm/hvm/nestedhvm.h> +#include <asm/msr-index.h> + +/* SVM specific intblk types, cannot be an enum because gcc 4.5 complains */ +/* GIF cleared */ +#define hvm_intblk_svm_gif hvm_intblk_archI know you're just moving code, but I simply don't believe this comment. This additional delta seems to compile fine: diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c index dbb0022190a8..111b10673cf4 100644 --- a/xen/arch/x86/hvm/svm/intr.c +++ b/xen/arch/x86/hvm/svm/intr.c @@ -154,7 +154,7 @@ void svm_intr_assist(void) return;intblk = hvm_interrupt_blocked(v, intack); I think this change merits its own patch. + +#define vcpu_nestedsvm(v) (vcpu_nestedhvm(v).u.nsvm) + +/* True when l1 guest enabled SVM in EFER */ +#define nsvm_efer_svm_enabled(v) \ + (!!((v)->arch.hvm.guest_efer & EFER_SVME))This seems to be the only use of asm/msr-index.h, and it's a macro so the header is actually unused. I'd drop the include - its a very common header anyway. Feel free to drop it. There was not in the other header. I have a tendency to include headers for everything. ~Andrew -- Xenia
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |