qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Susini <susinilorenzo1@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	"Laszlo Ersek" <lersek@redhat.com>,
	qemu-devel@nongnu.org, "Peter Xu" <peterx@redhat.com>
Subject: Re: KVM_MEM_READONLY slot flag not working properly
Date: Thu, 18 Mar 2021 18:40:22 +0100	[thread overview]
Message-ID: <CAHFRQs1TM_j4OYMQiqqf5fAAvFPkeaV+OF2FWm=r9jHPtkyB-Q@mail.gmail.com> (raw)
In-Reply-To: <a82e8771-913c-8dc4-03cf-c6148db1e15d@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

Well I'm sorry but I didn't know IDT was marked as read only by Linux. If
it is read only, how can you
register any new interrupt handler? I guess it's a way of securing stuff
against malicious attacks.
I was taking for granted that the IDT was written when registering a new
irq handler,
given that when an interrupt is raised, the new specified handler has to be
called
and its address should be retrieved in some way, that is by storing it in
the IDT.

I'm sorry, I'm a student and I'm trying to understand things,
Thank you,
Lorenzo

Il giorno gio 18 mar 2021 alle ore 18:04 Paolo Bonzini <pbonzini@redhat.com>
ha scritto:

> On 18/03/21 17:07, Laszlo Ersek wrote:
> > However, when I try to register a new interrupt handler (for instance for
> > the edu device, just to try it out), it works perfectly,
> > meaning that the IDT is not really read-only. Do you have any idea why?
> Any
> > suggestions on how to solve the problem?
> > Of course I've also checked KVM_CAP_READONLY_MEM, no problem with that.
>
> Sorry for asking a question that might be extremely stupid, but: did you
> check that the guest is writing to the IDT?  For example Linux never
> modifies the IDT when it runs, in fact it even makes it read only (check
> out idt_setup_apic_and_irq_gates in arch/x86/kernel/idt.c).
>
> Paolo
>
>

[-- Attachment #2: Type: text/html, Size: 1790 bytes --]

  reply	other threads:[~2021-03-18 17:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 11:28 KVM_MEM_READONLY slot flag not working properly Lorenzo Susini
2021-03-18 16:07 ` Laszlo Ersek
2021-03-18 17:04   ` Paolo Bonzini
2021-03-18 17:40     ` Lorenzo Susini [this message]
2021-03-18 17:54       ` Paolo Bonzini

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='CAHFRQs1TM_j4OYMQiqqf5fAAvFPkeaV+OF2FWm=r9jHPtkyB-Q@mail.gmail.com' \
    --to=susinilorenzo1@gmail.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vkuznets@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).