lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhR5DFQv0kVYDduoRv6bAL24N23ZA+1ggs=CAh6=iEcA2husg@mail.gmail.com>
Date: Thu, 25 Sep 2025 12:13:49 -0500
From: Sagi Shahar <sagis@...gle.com>
To: Binbin Wu <binbin.wu@...ux.intel.com>
Cc: linux-kselftest@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>, 
	Shuah Khan <shuah@...nel.org>, Sean Christopherson <seanjc@...gle.com>, 
	Ackerley Tng <ackerleytng@...gle.com>, Ryan Afranji <afranji@...gle.com>, 
	Andrew Jones <ajones@...tanamicro.com>, Isaku Yamahata <isaku.yamahata@...el.com>, 
	Erdem Aktas <erdemaktas@...gle.com>, Rick Edgecombe <rick.p.edgecombe@...el.com>, 
	Roger Wang <runanwang@...gle.com>, Oliver Upton <oliver.upton@...ux.dev>, 
	"Pratik R. Sampat" <pratikrajesh.sampat@....com>, Reinette Chatre <reinette.chatre@...el.com>, 
	Ira Weiny <ira.weiny@...el.com>, Chao Gao <chao.gao@...el.com>, 
	Chenyi Qiang <chenyi.qiang@...el.com>, linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH v10 10/21] KVM: selftests: Set up TDX boot parameters region

On Mon, Sep 8, 2025 at 3:07 AM Binbin Wu <binbin.wu@...ux.intel.com> wrote:
>
>
>
> On 9/4/2025 2:54 PM, Sagi Shahar wrote:
> [...]
> > +
> > +void vm_tdx_load_common_boot_parameters(struct kvm_vm *vm)
> > +{
> > +     struct td_boot_parameters *params =
> > +             addr_gpa2hva(vm, TD_BOOT_PARAMETERS_GPA);
> > +     uint32_t cr4;
> > +
> > +     TEST_ASSERT_EQ(vm->mode, VM_MODE_PXXV48_4K);
> > +
> > +     cr4 = kvm_get_default_cr4();
> > +
> > +     /* TDX spec 11.6.2: CR4 bit MCE is fixed to 1 */
> > +     cr4 |= X86_CR4_MCE;
> > +
> > +     /* Set this because UEFI also sets this up, to handle XMM exceptions */
>
> I don't get it.
> Could you elaborate it a bit?
>

I'm not entirely sure where this code came from but it looks like this
is unnecessary, at least for now. Dropping this in the next version.

> > +     cr4 |= X86_CR4_OSXMMEXCPT;
> > +
> > +     /* TDX spec 11.6.2: CR4 bit VMXE and SMXE are fixed to 0 */
> > +     cr4 &= ~(X86_CR4_VMXE | X86_CR4_SMXE);
> > +
> > +     /* Set parameters! */
> > +     params->cr0 = kvm_get_default_cr0();
> > +     params->cr3 = vm->pgd;
> > +     params->cr4 = cr4;
> > +     params->idtr.base = vm->arch.idt;
> > +     params->idtr.limit = kvm_get_default_idt_limit();
> > +     params->gdtr.base = vm->arch.gdt;
> > +     params->gdtr.limit = kvm_get_default_gdt_limit();
> > +
> > +     TEST_ASSERT(params->cr0 != 0, "cr0 should not be 0");
> > +     TEST_ASSERT(params->cr3 != 0, "cr3 should not be 0");
> > +     TEST_ASSERT(params->cr4 != 0, "cr4 should not be 0");
> > +     TEST_ASSERT(params->gdtr.base != 0, "gdt base address should not be 0");
> > +     TEST_ASSERT(params->idtr.base != 0, "idt base address should not be 0");
> > +}
> > +
> [...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ