[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 07/11] intel-hda: change msi property type

From: Cao jin
Subject: Re: [Qemu-devel] [PATCH v6 07/11] intel-hda: change msi property type
Date: Thu, 2 Jun 2016 16:42:39 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 06/01/2016 04:39 PM, Markus Armbruster wrote:
Cao jin <address@hidden> writes:

Not covered:

    static void intel_hda_update_irq(IntelHDAState *d)
-->    int msi = d->msi && msi_enabled(&d->pci);
        int level;

        if (d->int_sts & (1U << 31) && d->int_ctl & (1U << 31)) {
            level = 1;
        } else {
            level = 0;
        dprint(d, 2, "%s: level %d [%s]\n", __FUNCTION__,
               level, msi ? "msi" : "intx");
        if (msi) {
            if (level) {
                msi_notify(&d->pci, 0);
        } else {
            pci_set_irq(&d->pci, level);

This is wrong, because the meaning of the test changes from

     (user didn't specify msi=off) && (guest enabled MSI)


     (user didn't specify msi=on or msi=off) && (guest enabled MSI)

Thanks for pointing the error, seems I lost the fact that ON_OFF_AUTO_AUTO equals 0.

What about:

        int msi = msi_enabled(&d->pci);

If I understand it correctly, it can only be true when we added MSI
capability, and we do that only when msi=auto (default) or msi=on.

I think the modification is ok.

Yours Sincerely,

Cao jin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]