All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Michael Roth <michael.roth@amd.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>
Cc: bp@kernel.org, bgardon@google.com, dave.hansen@linux.intel.com,
	dmatlack@google.com, hpa@zytor.com, jpoimboe@kernel.org,
	kvm@vger.kernel.org, leitao@debian.org,
	linux-kernel@vger.kernel.org, maz@kernel.org, mingo@redhat.com,
	mirsad.todorovac@alu.unizg.hr, pawan.kumar.gupta@linux.intel.com,
	pbonzini@redhat.com, peterz@infradead.org, seanjc@google.com,
	shahuang@redhat.com, tabba@google.com, tglx@linutronix.de,
	x86@kernel.org
Subject: Re: [BUG net-next] arch/x86/kernel/cpu/bugs.c:2935: "Unpatched return thunk in use. This should not happen!" [STACKTRACE]
Date: Wed, 3 Apr 2024 14:14:36 +0200	[thread overview]
Message-ID: <20240403121436.GDZg1ILCn0a4Ddif3g@fat_crate.local> (raw)
In-Reply-To: <20240402133856.dtzinbbudsu7rg7d@amd.com>

On Tue, Apr 02, 2024 at 08:38:56AM -0500, Michael Roth wrote:
> On Tue, Apr 02, 2024 at 12:15:49PM +0200, bp@kernel.org wrote:
> > From: Borislav Petkov <bp@alien8.de>
> > 
> > Sorry if this comes out weird - mail troubles currently.
> > 
> > On Thu, Mar 28, 2024 at 07:38:30AM -0500, Michael Roth wrote:
> > > I'm seeing it pretty consistently on kvm/next as well. Not sure if
> > > there's anything special about my config but starting a fairly basic
> > > SVM guest seems to be enough to trigger it for me on the first
> > > invocation of svm_vcpu_run().
> > 
> > Hmm, can you share your config and what exactly you're doing?
> > 
> > I can't reproduce with Mirsad's reproducer, probably because of .config
> > differences. I tried making all CONFIG*KVM* options =y but no
> > difference.
> 
> I've reproduced against tip/master from today and attached the host
> config I used.
> 
> I can reproduce with a normal SVM guest using the following cmdline,
> but I don't think there's anything particular special regarding what
> QEMU options you use. It seems to trigger on the very first entry into
> VMRUN path:
> 
>   /home/mroth/qemu-build-snp-v4-wip2/qemu-system-x86_64
>     -smp 32,maxcpus=255 -cpu EPYC-Milan-v2 -overcommit cpu-pm=off
>     -enable-kvm -m 4G,slots=5,maxmem=210G -vga std -nographic
>     -machine pc,memory-backend=ram1
>     -object memory-backend-memfd,id=ram1,size=4G,share=true,prealloc=false,reserve=false
>     -device virtio-scsi-pci,id=scsi0,disable-legacy=on,iommu_platform=true
>     -drive file=/home/mroth/ubuntu-18.04-seves2.qcow2,if=none,id=drive0,snapshot=on
>     -device scsi-hd,id=hd0,drive=drive0,bus=scsi0.0
>     -device virtio-net-pci,mac=52:54:00:6c:3c:01,netdev=netdev0,id=net0,disable-legacy=on,iommu_platform=true,romfile=
>     -netdev tap,script=/home/mroth/qemu-ifup,id=netdev0
>     -L /home/mroth/AMDSEV/snp-release-2024-02-22/usr/local/share/qemu
>     -msg timestamp=on
>     -drive if=pflash,format=raw,unit=0,file=/home/mroth/AMDSEV/snp-release-2024-02-22/usr/local/share/qemu/OVMF_CODE.fd,readonly=on
>     -drive if=pflash,format=raw,unit=1,file=/home/mroth/AMDSEV/snp-release-2024-02-22/usr/local/share/qemu/OVMF_VARS.fd
> 
> I can also trigger using one of the more basic KVM selftests:
> 
>   make INSTALL_HDR_PATH="$headers_dir" headers_install
>   make -C tools/testing/selftests TARGETS="kvm" EXTRA_CFLAGS="-DDEBUG -I$headers_dir"
>   sudo tools/testing/selftests/kvm/userspace_io_test

Ok, thanks, that helped.

Problem is:

7f4b5cde2409 ("kvm: Disable objtool frame pointer checking for vmenter.S")

it is disabling checking of the arch/x86/kvm/svm/vmenter.S by objtool
when CONFIG_FRAME_POINTER=y but that also leads to objtool *not*
generating .return_sites and the return thunk remains unpatched.

I think we need to say: ignore frame pointer checking but still generate
.return_sites.

Josh, ideas?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2024-04-03 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 19:47 [BUG net-next] arch/x86/kernel/cpu/bugs.c:2935: "Unpatched return thunk in use. This should not happen!" [STACKTRACE] Mirsad Todorovac
2024-03-18 20:21 ` Borislav Petkov
2024-03-20  1:28   ` Mirsad Todorovac
2024-03-26 10:16     ` Borislav Petkov
2024-03-26 19:15       ` Mirsad Todorovac
2024-03-28 12:38         ` Michael Roth
2024-04-02 10:15           ` bp
2024-04-02 13:38             ` Michael Roth
2024-04-03 12:14               ` Borislav Petkov [this message]
2024-04-03 12:48                 ` Sean Christopherson
2024-04-04 13:44                   ` Borislav Petkov
2024-04-17 15:52                     ` Paolo Bonzini
     [not found]               ` <f497a833-f945-4907-b916-1739324de014@alu.unizg.hr>
2024-04-04 13:41                 ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240403121436.GDZg1ILCn0a4Ddif3g@fat_crate.local \
    --to=bp@alien8.de \
    --cc=bgardon@google.com \
    --cc=bp@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=dmatlack@google.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=mirsad.todorovac@alu.unizg.hr \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=shahuang@redhat.com \
    --cc=tabba@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.